Skip to content

Commit

Permalink
#29 - Page with user favorites.
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf committed Aug 7, 2022
1 parent 8f8747a commit 20d69f2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/views/controls/navbar.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<ul class="navbar-nav large-navbar-nav">
<template:navbarItem url="route:all" icon="file-alt" text="All pages" />
<template:navbarItem url="route:archive" icon="archive" text="Archive" />
<template:navbarItem url="route:favorites" icon="star" text="Your favorites" />
<template:navbarItem url="route:folderList" icon="folder" iconPrefix="fas" text="Folders" />
</ul>
<login:authorized any="wiki">
Expand Down
9 changes: 9 additions & 0 deletions src/views/controls/pageList.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@
Archived
</small>
</web:condition>
<utils:splitToArray output="var:favoritesArray" value="var:favorites" separator="," />
<if:arrayContains name="isFavorite" value="var:favoritesArray" item="ce:id" />
<web:out if:passed="isFavorite">
<small class="mr-1">
<fa5:icon name="star" />
Your favorite
</small>
</web:out>
</div>
</controls:pageLink>
</ui:forEach>
Expand Down
6 changes: 6 additions & 0 deletions src/views/index.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
<template:title value="Archive" />
<pages:archive />
</router:file>
<router:file path="favorites" name="favorites">
<template:title value="Your favorites" />
<controls:pageListGrouped>
<filter:in name="id" values="var:favorites" />
</controls:pageListGrouped>
</router:file>
<router:file path="settings" name="settings">
<template:title value="Settings" />
<pages:settings />
Expand Down

0 comments on commit 20d69f2

Please sign in to comment.