-
Notifications
You must be signed in to change notification settings - Fork 798
AO3-1173 We need a comment preview #5835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
69ab9b1
7e7d691
16d19e7
e1b9efa
db9f657
ed8d536
9fc1ade
3700d67
f1c857f
42dac9f
58ceb39
f0696e5
585d903
66dbf9c
839915d
0e5a37e
e445e3b
cd5612b
001a899
cffad9e
43ec3cb
ec69575
08e1473
793b2db
69fba89
edd82a7
6a277f6
a1e5b1a
765a2d1
4054a54
4cc19bd
0c352f8
120ea14
0735ce4
702cec6
bf9e71d
0f2e829
4c7a4f6
e6a8ed7
e09c845
c69e9df
0434ae0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| <h2 class="heading"><%= t(".page_heading") %></h2> | ||
| <p><%= t(".commenting_on_html", commentable_link: link_to_comment_ultimate_parent(@comment)) %></p> | ||
|
|
||
| <!--main content--> | ||
| <div id="previewpane"> | ||
| <ol class="thread"> | ||
| <% if @commentable.is_a?(Comment) %> | ||
| <li class="<%= cycle :odd, :even %> <%= css_classes_for_comment(@commentable) %>" id="comment_<%= @commentable.id %>" role="article"> | ||
| <% if @commentable.is_deleted %> | ||
| <p><%= t(".deleted_comment") %></p> | ||
| <% elsif !can_see_hidden_comment?(@commentable) %> | ||
| <p class="message"><%= t(".hidden_comment") %></p> | ||
| <% else %> | ||
| <h4 class="heading byline"> | ||
| <% if @commentable.by_anonymous_creator? %> | ||
| <%= t(".anonymous_creator") %> | ||
| <% else %> | ||
| <%= get_commenter_pseud_or_name(@commentable) %> | ||
| <% end %> | ||
| <span class="posted datetime"> | ||
| <%= time_in_zone(@commentable.created_at) %> | ||
| </span> | ||
| </h4> | ||
| <div class="icon"> | ||
| <% if @commentable.pseud %> | ||
| <% if @commentable.by_anonymous_creator? %> | ||
| <span class="anonymous icon"></span> | ||
| <% else %> | ||
| <%= icon_display(@commentable.pseud.user, @commentable.pseud) %> | ||
| <% end %> | ||
| <% else %> | ||
| <span class="visitor icon"></span> | ||
| <% end %> | ||
| </div> | ||
| <blockquote class="userstuff"> | ||
| <%= raw sanitize_field(@commentable, :comment_content) %> | ||
| </blockquote> | ||
| <% end %> | ||
| </li> | ||
| <li> | ||
| <ol class="thread"> | ||
| <li class="<%= cycle :odd, :even %> <%= css_classes_for_comment(@comment) %> preview" id="comment_preview" role="article"> | ||
| <h4 class="heading byline"> | ||
| <% if @comment.by_anonymous_creator? %> | ||
| <%= t(".anonymous_creator") %> | ||
| <% else %> | ||
| <%= get_commenter_pseud_or_name(@comment) %> | ||
| <% end %> | ||
| <span class="posted datetime"> | ||
| <%= time_in_zone(Time.current) %> | ||
| </span> | ||
| </h4> | ||
| <div class="icon"> | ||
| <% if @comment.pseud %> | ||
| <% if @comment.by_anonymous_creator? %> | ||
| <span class="anonymous icon"></span> | ||
| <% else %> | ||
| <%= icon_display(@comment.pseud.user, @comment.pseud) %> | ||
| <% end %> | ||
| <% else %> | ||
| <span class="visitor icon"></span> | ||
| <% end %> | ||
| </div> | ||
| <blockquote class="userstuff"> | ||
| <%= raw sanitize_field(@comment, :comment_content) %> | ||
| </blockquote> | ||
| </li> | ||
| </ol> | ||
| </li> | ||
| <% else %> | ||
| <li class="<%= cycle :odd, :even %> <%= css_classes_for_comment(@comment) %> preview" id="comment_preview" role="article"> | ||
| <h4 class="heading byline"> | ||
| <% if @comment.by_anonymous_creator? %> | ||
| <%= t(".anonymous_creator") %> | ||
| <% else %> | ||
| <%= get_commenter_pseud_or_name(@comment) %> | ||
| <% end %> | ||
| <span class="posted datetime"> | ||
| <%= time_in_zone(Time.current) %> | ||
| </span> | ||
| </h4> | ||
| <div class="icon"> | ||
| <% if @comment.pseud %> | ||
| <% if @comment.by_anonymous_creator? %> | ||
| <span class="anonymous icon"></span> | ||
| <% else %> | ||
| <%= icon_display(@comment.pseud.user, @comment.pseud) %> | ||
| <% end %> | ||
| <% else %> | ||
| <span class="visitor icon"></span> | ||
| <% end %> | ||
| </div> | ||
| <blockquote class="userstuff"> | ||
| <%= raw sanitize_field(@comment, :comment_content) %> | ||
| </blockquote> | ||
| </li> | ||
| <% end %> | ||
| </ol> | ||
| </div> | ||
| <!--/content--> | ||
|
|
||
| <!--inline edit form--> | ||
| <div id="edit_comment_on_preview"> | ||
| <h3 class="heading"><%= t(".edit_comment_heading") %></h3> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this heading is potentially confusing because technically you're not editing a comment if it wasn't created yet, and probably unnecessary because it should be obvious it's a comment drafting form, though i'm saying that as someone very used to ao3's interface and therefore very biased |
||
| <% cancel_target = @commentable.is_a?(Comment) ? @commentable.ultimate_parent : @commentable %> | ||
| <%= render partial: "comments/comment_form", | ||
| locals: { | ||
| comment: @comment, | ||
| commentable: @commentable, | ||
| button_name: t(".post_comment"), | ||
| cancel_redirect: true, | ||
| cancel_path: cancel_target.is_a?(Tag) ? tag_path(cancel_target) : polymorphic_path(cancel_target) | ||
| } %> | ||
| </div> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this link could be part of the h2 header, like on the /comments page