mirror of
https://github.com/andrigamerita/simpkey
synced 2025-02-17 20:30:49 +01:00
ファイル分け
This commit is contained in:
parent
2db780d982
commit
24006c3413
@ -1,62 +1,4 @@
|
|||||||
mixin avatar(user)
|
include _components
|
||||||
img.avatar(src=user.avatarUrl, alt="avatar for " + user.username style="width: 64px; height: 64px; border-radius: 50%")&attributes(attributes)
|
|
||||||
|
|
||||||
mixin note-header(note)
|
|
||||||
header&attributes(attributes)
|
|
||||||
span.name= getUserName(note.user)
|
|
||||||
span.acct(style="color: gray")= getAcct(note.user)
|
|
||||||
|
|
||||||
mixin sub-note(note)
|
|
||||||
.sub-note
|
|
||||||
+avatar(note.user)
|
|
||||||
+note-header(note)
|
|
||||||
p= note.text
|
|
||||||
|
|
||||||
mixin note(note)
|
|
||||||
if (note.reply)
|
|
||||||
+sub-note(note.reply)(style="opacity: 0.5")
|
|
||||||
if (note.renote && !note.text)
|
|
||||||
p: b 🔁 !{getUserName(note.user)} がRenote
|
|
||||||
+note(note.renote)
|
|
||||||
else
|
|
||||||
.note&attributes(attributes)
|
|
||||||
+avatar(note.user)
|
|
||||||
+note-header(note)
|
|
||||||
p
|
|
||||||
if (note.reply)
|
|
||||||
| ↩
|
|
||||||
!= note.text
|
|
||||||
if (note.renote)
|
|
||||||
p RN:
|
|
||||||
+sub-note(note.renote)
|
|
||||||
aside
|
|
||||||
span.visibility= getVisibility(note)
|
|
||||||
span.date= new Date(note.createdAt).toLocaleString()
|
|
||||||
.reactions
|
|
||||||
each val, key in note.reactions
|
|
||||||
span(class=(key === note.myReaction ? 'my reaction' : 'reaction'))=`${key} ${val}`
|
|
||||||
footer
|
|
||||||
|[
|
|
||||||
a(href="/reply?noteId=" + note.id) リプライ
|
|
||||||
|] [
|
|
||||||
a(href="/renote?noteId=" + note.id) リノート
|
|
||||||
|]
|
|
||||||
if !note.myReaction
|
|
||||||
| [
|
|
||||||
a(href="/react?noteId=" + note.id) リアクション
|
|
||||||
| ]
|
|
||||||
else
|
|
||||||
form(action="action/unreact", method="post" style="display: inline")
|
|
||||||
input(type="hidden", name="noteId", value=note.id)
|
|
||||||
button(type="submit") リアクション解除
|
|
||||||
|
|
||||||
mixin post-form(url, placeholder, buttonText)
|
|
||||||
form(action=url, method="post")
|
|
||||||
textarea(name="text", placeholder=placeholder style="max-width: 100%; min-width: 100%; height: 6em; margin-bottom: 8px")
|
|
||||||
button(type="submit")= buttonText
|
|
||||||
block
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
html
|
html
|
||||||
head
|
head
|
||||||
|
58
src/views/_components.pug
Normal file
58
src/views/_components.pug
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
mixin avatar(user)
|
||||||
|
img.avatar(src=user.avatarUrl, alt="avatar for " + user.username style="width: 64px; height: 64px; border-radius: 50%")&attributes(attributes)
|
||||||
|
|
||||||
|
mixin note-header(note)
|
||||||
|
header&attributes(attributes)
|
||||||
|
span.name= getUserName(note.user)
|
||||||
|
span.acct(style="color: gray")= getAcct(note.user)
|
||||||
|
|
||||||
|
mixin sub-note(note)
|
||||||
|
.sub-note
|
||||||
|
+avatar(note.user)
|
||||||
|
+note-header(note)
|
||||||
|
p= note.text
|
||||||
|
|
||||||
|
mixin note(note)
|
||||||
|
if (note.reply)
|
||||||
|
+sub-note(note.reply)(style="opacity: 0.5")
|
||||||
|
if (note.renote && !note.text)
|
||||||
|
p: b 🔁 !{getUserName(note.user)} がRenote
|
||||||
|
+note(note.renote)
|
||||||
|
else
|
||||||
|
.note&attributes(attributes)
|
||||||
|
+avatar(note.user)
|
||||||
|
+note-header(note)
|
||||||
|
p
|
||||||
|
if (note.reply)
|
||||||
|
| ↩
|
||||||
|
!= note.text
|
||||||
|
if (note.renote)
|
||||||
|
p RN:
|
||||||
|
+sub-note(note.renote)
|
||||||
|
aside
|
||||||
|
span.visibility= getVisibility(note)
|
||||||
|
span.date= new Date(note.createdAt).toLocaleString()
|
||||||
|
.reactions
|
||||||
|
each val, key in note.reactions
|
||||||
|
span(class=(key === note.myReaction ? 'my reaction' : 'reaction'))=`${key} ${val}`
|
||||||
|
footer
|
||||||
|
|[
|
||||||
|
a(href="/reply?noteId=" + note.id) リプライ
|
||||||
|
|] [
|
||||||
|
a(href="/renote?noteId=" + note.id) リノート
|
||||||
|
|]
|
||||||
|
if !note.myReaction
|
||||||
|
| [
|
||||||
|
a(href="/react?noteId=" + note.id) リアクション
|
||||||
|
| ]
|
||||||
|
else
|
||||||
|
form(action="action/unreact", method="post" style="display: inline")
|
||||||
|
input(type="hidden", name="noteId", value=note.id)
|
||||||
|
button(type="submit") リアクション解除
|
||||||
|
|
||||||
|
mixin post-form(url, placeholder, buttonText)
|
||||||
|
form(action=url, method="post")
|
||||||
|
textarea(name="text", placeholder=placeholder style="max-width: 100%; min-width: 100%; height: 6em; margin-bottom: 8px")
|
||||||
|
button(type="submit")= buttonText
|
||||||
|
block
|
Loading…
x
Reference in New Issue
Block a user