Made messages more thread-like (replies, editing, etc.)
This commit is contained in:
5
app/views/messagereplies/_new.html.erb
Normal file
5
app/views/messagereplies/_new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<%= form_for [reply.get_message, reply] do |f| %>
|
||||
<%= render partial: "md_editor", locals: {name: "messagereply[text]", content: reply.text} %>
|
||||
<p><%= f.submit "Reply", class: "btn blue" %></p>
|
||||
<% end %>
|
||||
|
||||
17
app/views/messagereplies/_reply.html.erb
Normal file
17
app/views/messagereplies/_reply.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="item-group thread-reply with-avatar" id="reply-<%= reply.id %>">
|
||||
<div class="header">
|
||||
<%= link_to(reply.author.avatar(64), reply.author, title: reply.author.ign) %>
|
||||
<%= render partial: "users/username", locals: { user: reply.author } %>
|
||||
<%= link_to "#reply-#{reply.id}" do %>
|
||||
<%= ago reply.created_at %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to "edit", edit_message_messagereply_path(reply.message, reply), class: "editlink" if mod? || reply.author.is?(current_user) %>
|
||||
<div class="clear-right"></div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<div class="item content">
|
||||
<%= render_md(reply.text).html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
15
app/views/messagereplies/edit.html.erb
Normal file
15
app/views/messagereplies/edit.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<% title "Edit Message Reply: #{@reply.message.subject}" %>
|
||||
|
||||
<%
|
||||
position = @reply.message.replies.index(@reply)
|
||||
page = position / Kaminari.config.default_per_page + 1
|
||||
%>
|
||||
|
||||
<%= link_to "Messages", messages_path %> → <%= link_to @reply.message, message_path(@reply.message, page: page) + "#reply-#{@reply.id}" %> → Edit reply
|
||||
<h1>Edit reply</h1>
|
||||
<%= form_for [@reply.message, @reply] do |f| %>
|
||||
<%= render partial: "md_editor", locals: {name: "messagereply[text]", content: @reply.text} %>
|
||||
<p><%= f.submit "Reply", class: "btn blue left" %></p>
|
||||
<% end %>
|
||||
<p><%= button_to "Delete reply", [@reply.message, @reply], method: "delete", data: {confirm: "Delete reply forever?"}, class: "btn red right" %></p>
|
||||
<div class="clear"></div>
|
||||
Reference in New Issue
Block a user