From 752e3cc682ffefe47af309b40f75e4a438462630 Mon Sep 17 00:00:00 2001 From: FM1337 Date: Thu, 22 Jun 2017 14:38:01 -0300 Subject: [PATCH] More changes --- mixins/Postable.pixy | 22 +++++++++++----------- mixins/PostableList.pixy | 15 +-------------- pages/posts/posts.pixy | 4 ++-- pages/profile/profile.pixy | 3 ++- pages/threads/threads.pixy | 6 +++--- 5 files changed, 19 insertions(+), 31 deletions(-) diff --git a/mixins/Postable.pixy b/mixins/Postable.pixy index 30255a72..214e4cea 100644 --- a/mixins/Postable.pixy +++ b/mixins/Postable.pixy @@ -1,43 +1,43 @@ -component Postable(post arn.Postable, viewUser *arn.User, highlightAuthorID string) +component Postable(post arn.Postable, highlightAuthorID string) .post.mountable(data-highlight=post.Author().ID == highlightAuthorID) .post-author Avatar(post.Author()) - + //- if post.recipient && post.recipient.ID !== post.author.ID //- a.user.post-recipient(href="/+" + post.recipient.nick, title=post.recipient.nick) //- img.user-image(src=post.recipient.avatar ? (post.recipient.avatar + "?s=100&r=x&d=mm") : "/images/elements/no-gravatar.svg", alt=post.recipient.nick) .post-content div(id="render-" + post.ID())!= aero.Markdown(post.Text()) - + //- if user && user.ID === post.authorId //- textarea.post-input.hidden(id="source-" + post.ID)= post.text //- a.post-save.hidden(id="save-" + post.ID, onclick=`$.saveEdit("${type.toLowerCase()}", "${post.ID}")`) //- i.fa.fa-save //- span Save - + .post-toolbar(id="toolbar-" + post.ID()) .spacer .post-likes(id="likes-" + post.ID(), title="Likes")= len(post.Likes()) - + //- if user != nil //- if user.ID !== post.authorId //- - var liked = post.likes && post.likes.indexOf(user.ID) !== -1 - + //- a.post-tool.post-like(id="like-" + post.ID, onclick=`$.like("${type.toLowerCase()}", "${post.ID}")`, title="Like", class=liked ? "hidden" : ") //- i.fa.fa-thumbs-up.fa-fw - + //- a.post-tool.post-unlike(id="unlike-" + post.ID, onclick=`$.unlike("${type.toLowerCase()}", "${post.ID}")`, title="Unlike", class=!liked ? "hidden" : ") //- i.fa.fa-thumbs-down.fa-fw - + //- if type === "Posts" || type === "Threads" //- if user.ID === post.authorId //- a.post-tool.post-edit(onclick=`$.edit("${post.ID}")`, title="Edit") //- i.fa.fa-pencil.fa-fw - + if post.Type() != "Thread" a.post-tool.post-permalink.ajax(href=post.Link(), title="Permalink") Icon("link") - + //- if type === "Messages" && user && (user.ID === post.authorId || user.ID === post.recipientId) //- a.post-tool.post-delete(onclick=`if(confirm("Do you really want to delete this ${typeSingular.toLowerCase()} from ${post.author.nick}?")) $.delete${typeSingular}("${post.ID}")`, title="Delete") - //- i.fa.fa-trash.fa-fw \ No newline at end of file + //- i.fa.fa-trash.fa-fw diff --git a/mixins/PostableList.pixy b/mixins/PostableList.pixy index 93855fcd..c2f956a9 100644 --- a/mixins/PostableList.pixy +++ b/mixins/PostableList.pixy @@ -2,17 +2,4 @@ component PostableList(postables []arn.Postable) .thread .posts each post in postables - .post - .post-author - Avatar(post.Author()) - - .post-content - p!= aero.Markdown(post.Text()) - - .post-toolbar - .spacer - .post-likes= len(post.Likes()) - a.post-tool.post-permalink.ajax(href=post.Link(), title="Permalink") - Icon("link") - - a.post-link.side-note.ajax(href=post.Link())= post.Title() + Postable(post, "") diff --git a/pages/posts/posts.pixy b/pages/posts/posts.pixy index 56b23d6d..6d02e8cc 100644 --- a/pages/posts/posts.pixy +++ b/pages/posts/posts.pixy @@ -1,5 +1,5 @@ component Post(post *arn.Post) - Postable(post.ToPostable(), nil, "") + Postable(post.ToPostable(), "") .side-note - a.ajax(href=post.Thread().Link())= post.Thread().Title \ No newline at end of file + a.ajax(href=post.Thread().Link())= post.Thread().Title diff --git a/pages/profile/profile.pixy b/pages/profile/profile.pixy index 5e5369ba..aa87fc5a 100644 --- a/pages/profile/profile.pixy +++ b/pages/profile/profile.pixy @@ -68,6 +68,7 @@ component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, else each thread in threads ThreadLink(thread) + .profile-category.mountable h3 a.ajax(href="/+" + viewUser.Nick + "/posts", title="View all posts") Posts if len(posts) == 0 @@ -78,7 +79,7 @@ component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, .post-author Avatar(post.Author()) .post-content - p!= aero.Markdown(post.Text) + .mountable!= aero.Markdown(post.Text) .post-toolbar.active .spacer .post-likes= len(post.Likes) diff --git a/pages/threads/threads.pixy b/pages/threads/threads.pixy index 83387f5b..9ad4433f 100644 --- a/pages/threads/threads.pixy +++ b/pages/threads/threads.pixy @@ -3,7 +3,7 @@ component Thread(thread *arn.Thread, posts []*arn.Post) .thread .posts - Postable(thread.ToPostable(), nil, thread.Author().ID) - + Postable(thread.ToPostable(), thread.Author().ID) + each post in posts - Postable(post.ToPostable(), nil, thread.Author().ID) \ No newline at end of file + Postable(post.ToPostable(), thread.Author().ID)