-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlog.pug
128 lines (119 loc) · 4.72 KB
/
log.pug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
doctype html
html(lang='en')
include ./mixins.pug
head
if log.name && log.name.length
title DICE LOGGER – #{log.name}
else
title DICE LOGGER – Log ##{log.id}
meta(name='viewport', content='width=device-width, initial-scale=1')
link(rel='stylesheet', href='/bulma.css')
link(rel='stylesheet', href='/fontawesome/css/fontawesome-all.min.css')
link(rel='stylesheet', href='/dice-logger.css')
body
section
.container
nav.navbar(role='navigation', aria-label='main navigation')
.navbar-brand
a.navbar-item(href='/').title.is-3.is-uppercase Dice Logger
.navbar-menu
.navbar-end
.navbar-item
form(method='POST', action='/')
.field
.control.has-text-centered
button.button.is-danger.is-5e
span.icon
i.fas.fa-plus
span New Log
if !edit
section.hero.is-danger.is-5e
.hero-body
.container
if log.name && log.name.length
h1.title #{log.name}
else
h1.title Log ##{log.id}
if edit
section.hero.is-light
.hero-body
.container
form(method='POST', action=`/${log.id}/edit/${log.key}/entries`)
.field
label.label Log Message
.control
input.input.is-large(type='text', name='message', value=message, maxlength=1024, autofocus=(!error || !error.length), placeholder='Enter a message to describe this roll for future reference. "My HP roll for level 5."')
.field
label.label Dice Roll
.control
input.input.is-monospace(type='text', name='roll', value=(roll || '1d20'), maxlength=8, class={'is-danger': error && error.length}, autofocus=(error && error.length))
if error && error.length
p.help.is-danger
| <strong>This roll is invalid.</strong>
| Look here for help on your dice roll options:
span.icon
i.far.fa-question-circle
a.has-color-primary(href='/faq#faq-roll-syntax', target='_blank', style='text-decoration: underline;') F.A.Q.
else
p.help
| Look here for help on your dice roll options:
span.icon
i.far.fa-question-circle
a.has-color-primary(href='/faq#faq-roll-syntax', target='_blank', style='text-decoration: underline;') F.A.Q.
.field
.control
button.button.is-danger.is-5e
span.icon
i.fas.fa-cube
span Roll!
section.section
.container
if !entries || !entries.length
article.message.is-black
.message-header
p Uh oh!
.message-body
p Nothing has been rolled for this log yet!
else
each entry in entries
+entry(entry, moment)
if entries.length < 100
.has-text-grey.has-text-centered Showing all #{entries.length} log entries.
else
.has-text-grey.has-text-centered Showing most recent 100 log entries.
if edit
section.hero.is-light
.hero-body
.container
.has-text-centered.is-size-7.has-text-grey
div.has-text-weight-bold
span.icon
i.fas.fa-exclamation-triangle
span Save the URL below so you can add rolls to this log later. Only this URL allows you to add to your log:
span.icon
i.fas.fa-exclamation-triangle
div
a(href=`/${log.id}/edit/${log.key}`)
span.icon
i.far.fa-edit
span #{baseUrl}/#{log.id}/edit/#{log.key}
br
div.has-text-weight-bold
span Share your rolls with the world (read-only):
div
a(href=`/${log.id}`)
span.icon
i.far.fa-share-square
span #{baseUrl}/#{log.id}
br
hr
form(method='POST')
.field
.control
input.input(type='text', name='name', value=log.name, maxlength=32, placeholder=(log.name || log.id))
.field
.control
button.button
span.icon
i.far.fa-save
span Rename Log