nav for pages smaller and more maintainable

merge-requests/208/head
fatchan 5 years ago
parent 48e761be46
commit 339a743b1b
  1. 11
      views/mixins/boardnav.pug
  2. 17
      views/pages/banners.pug
  3. 19
      views/pages/board.pug
  4. 17
      views/pages/catalog.pug
  5. 50
      views/pages/home.pug
  6. 17
      views/pages/modlog.pug
  7. 17
      views/pages/modloglist.pug
  8. 17
      views/pages/thread.pug

@ -0,0 +1,11 @@
mixin boardnav(selected, showIndex, upLevel)
if showIndex
|
a(href=`${upLevel ? '../' : ''}index.html` class=(selected === 'index' ? 'bold' : '')) [Index]
|
a(href=`${upLevel ? '../' : ''}catalog.html` class=(selected === 'catalog' ? 'bold' : '')) [Catalog]
|
a(href=`${upLevel ? '../' : ''}banners.html` class=(selected === 'banners' ? 'bold' : '')) [Banners]
|
a(href=`${upLevel ? '../' : ''}logs.html` class=(selected === 'logs' ? 'bold' : '')) [Logs]

@ -1,5 +1,6 @@
extends ../layout.pug
include ../mixins/boardheader.pug
include ../mixins/boardnav.pug
block head
script(src='/js/theme.js')
@ -10,13 +11,7 @@ block content
br
include ../includes/stickynav.pug
nav.pages
a(href=`/${board._id}/index.html`) [Index]
|
a(href=`/${board._id}/catalog.html`) [Catalog]
|
a.bold(href=`/${board._id}/banners.html`) [Banners]
|
a(href=`/${board._id}/logs.html`) [Logs]
+boardnav('banners', true, false)
hr(size=1)
if board.banners.length > 0
section.catalog
@ -27,10 +22,4 @@ block content
include ../includes/stickynav.pug
hr(size=1)
nav.pages
a(href=`/${board._id}/index.html`) [Index]
|
a(href=`/${board._id}/catalog.html`) [Catalog]
|
a.bold(href=`/${board._id}/banners.html`) [Banners]
|
a(href=`/${board._id}/logs.html`) [Logs]
+boardnav('banners', true, false)

@ -1,5 +1,6 @@
extends ../layout.pug
include ../mixins/post.pug
include ../mixins/boardnav.pug
include ../mixins/boardheader.pug
block head
@ -14,13 +15,8 @@ block content
include ../includes/announcements.pug
include ../includes/stickynav.pug
nav.pages
include ../includes/pages.pug
|
a(href=`/${board._id}/catalog.html`) [Catalog]
|
a(href=`/${board._id}/banners.html`) [Banners]
|
a(href=`/${board._id}/logs.html`) [Logs]
include ../includes/boardpages.pug
+boardnav(null, false, false)
form(action='/forms/board/'+board._id+'/actions' method='POST' enctype='application/x-www-form-urlencoded')
hr(size=1)
if threads.length === 0
@ -33,11 +29,6 @@ block content
+post(post, true)
hr(size=1)
nav.pages
include ../includes/pages.pug
|
a(href=`/${board._id}/catalog.html`) [Catalog]
|
a(href=`/${board._id}/banners.html`) [Banners]
|
a(href=`/${board._id}/logs.html`) [Logs]
include ../includes/boardpages.pug
+boardnav(null, false, false)
include ../includes/actionfooter.pug

@ -1,5 +1,6 @@
extends ../layout.pug
include ../mixins/catalogtile.pug
include ../mixins/boardnav.pug
include ../mixins/boardheader.pug
block head
@ -11,13 +12,7 @@ block content
br
include ../includes/stickynav.pug
nav.pages
a(href=`/${board._id}/index.html`) [Index]
|
a.bold(href=`/${board._id}/catalog.html`) [Catalog]
|
a(href=`/${board._id}/banners.html`) [Banners]
|
a(href=`/${board._id}/logs.html`) [Logs]
+boardnav('catalog', true, false)
hr(size=1)
if threads.length === 0
p No posts.
@ -27,10 +22,4 @@ block content
+catalogtile(board, thread, i+1)
hr(size=1)
nav.pages
a(href=`/${board._id}/index.html`) [Index]
|
a.bold(href=`/${board._id}/catalog.html`) [Catalog]
|
a(href=`/${board._id}/banners.html`) [Banners]
|
a(href=`/${board._id}/logs.html`) [Logs]
+boardnav('catalog', true, false)

@ -22,24 +22,17 @@ block content
a(href='/create.html') create your own board
| .
if boards && boards.length > 0
.table-container.flex-center.mv-10.text-center
table.boardtable
include ../includes/boardtable.pug
each board in boards
tr
th Board
th Description
th.help(title='Posts in the last hour') PPH
th.help(title='Unique posters in the last 24h') Users
th Posts
each board in boards
tr
td
if board.settings.sfw
span.help(title='Safe for work') 💼
a(href=`/${board._id}/index.html`) /#{board._id}/ - #{board.settings.name}
td #{board.settings.description}
td #{board.pph}
td #{board.ips}
td #{board.sequence_value-1}
td
if board.settings.sfw
span.help(title='Safe for work') 💼
a(href=`/${board._id}/index.html`) /#{board._id}/ - #{board.settings.name}
td #{board.settings.description}
td #{board.pph}
td #{board.ips}
td #{board.sequence_value-1}
.table-container.flex-center.mv-10.text-center
table
tr.help(title='Total stats including unlisted boards')
@ -62,26 +55,3 @@ block content
| The source code for this site is available
a(href='https://github.com/fatchan/jschan/') here
| (and in the footer of each page) and is licensed under the Affero General Public License v3.
if webringBoards && webringBoards.length > 0
.table-container.flex-center.mv-10.text-center
p Webring boards:
div.scrolltable
table.boardtable.webringtable
tr
th Board
th Description
th.help(title='Posts in the last hour') PPH
th.help(title='Unique posters in the last 24h') Users
th.pr-20 Posts
each board in webringBoards
tr
td
if !board.nsfw
span.help(title='Safe for work') 💼
a(href=board.path) #{board.siteName} /#{board.uri}/ - #{board.title}
td #{board.subtitle || '-'}
td #{board.postsPerHour || '-'}
td #{board.uniqueUsers || '-'}
td.pr-20 #{board.totalPosts || '-'}
p
small: a(href='https://gitlab.com/alogware/LynxChanAddon-Webring') webring?

@ -1,5 +1,6 @@
extends ../layout.pug
include ../mixins/boardheader.pug
include ../mixins/boardnav.pug
block head
script(src='/js/theme.js')
@ -10,13 +11,7 @@ block content
br
include ../includes/stickynav.pug
nav.pages
a(href=`/${board._id}/index.html`) [Index]
|
a(href=`/${board._id}/catalog.html`) [Catalog]
|
a(href=`/${board._id}/banners.html`) [Banners]
|
a.bold(href=`/${board._id}/logs.html`) [Logs]
+boardnav('logs', true, true)
hr(size=1)
.table-container.flex-center.mv-10.text-center
table
@ -35,10 +30,4 @@ block content
td #{log.message || '-'}
hr(size=1)
nav.pages
a(href=`/${board._id}/index.html`) [Index]
|
a(href=`/${board._id}/catalog.html`) [Catalog]
|
a(href=`/${board._id}/banners.html`) [Banners]
|
a.bold(href=`/${board._id}/logs.html`) [Logs]
+boardnav('logs', true, true)

@ -1,5 +1,6 @@
extends ../layout.pug
include ../mixins/boardheader.pug
include ../mixins/boardnav.pug
block head
script(src='/js/theme.js')
@ -10,13 +11,7 @@ block content
br
include ../includes/stickynav.pug
nav.pages
a(href=`/${board._id}/index.html`) [Index]
|
a(href=`/${board._id}/catalog.html`) [Catalog]
|
a(href=`/${board._id}/banners.html`) [Banners]
|
a.bold(href=`/${board._id}/logs.html`) [Logs]
+boardnav('logs', true, false)
hr(size=1)
if dates.length === 0
p No Logs.
@ -38,10 +33,4 @@ block content
td #{count}
hr(size=1)
nav.pages
a(href=`/${board._id}/index.html`) [Index]
|
a(href=`/${board._id}/catalog.html`) [Catalog]
|
a(href=`/${board._id}/banners.html`) [Banners]
|
a.bold(href=`/${board._id}/logs.html`) [Logs]
+boardnav('logs', true, false)

@ -1,5 +1,6 @@
extends ../layout.pug
include ../mixins/post.pug
include ../mixins/boardnav.pug
include ../mixins/boardheader.pug
block head
@ -25,13 +26,7 @@ block content
include ../includes/announcements.pug
include ../includes/stickynav.pug
nav.pages
a(href=`/${board._id}/index.html`) [Index]
|
a(href=`/${board._id}/catalog.html`) [Catalog]
|
a(href=`/${board._id}/banners.html`) [Banners]
|
a(href=`/${board._id}/logs.html`) [Logs]
+boardnav(null, true, true)
form(action=`/forms/board/${board._id}/actions` method='POST' enctype='application/x-www-form-urlencoded')
hr(size=1)
section.thread
@ -40,11 +35,5 @@ block content
+post(post)
hr(size=1)
nav.pages
a(href=`/${board._id}/index.html`) [Index]
|
a(href=`/${board._id}/catalog.html`) [Catalog]
|
a(href=`/${board._id}/banners.html`) [Banners]
|
a(href=`/${board._id}/logs.html`) [Logs]
+boardnav(null, true, true)
include ../includes/actionfooter.pug

Loading…
Cancel
Save