diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin/timeline.rhtml | 14 | ||||
-rw-r--r-- | app/views/admin_request/edit_comment.rhtml | 17 | ||||
-rw-r--r-- | app/views/admin_request/show.rhtml | 5 |
3 files changed, 35 insertions, 1 deletions
diff --git a/app/views/admin/timeline.rhtml b/app/views/admin/timeline.rhtml index 3b77b5821..4c4aa4f36 100644 --- a/app/views/admin/timeline.rhtml +++ b/app/views/admin/timeline.rhtml @@ -46,6 +46,20 @@ <% else %> Missing outgoing message, internal error. <% end %> + <% elsif event.event_type == 'edit_comment' %> + <% comments = Comment.find(:all, event.params[:comment_id].to_i) %> + had annotation edited by administrator <strong><%=h event.params[:editor] %></strong>. + <% if comments.size > 0 %> + <% comment = comments[0] %> + <% for p in ['body'] + if event.params[p.to_sym] != event.params[('old_'+p).to_sym] + %> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <% + end + end + %> + <% else %> + Missing annotation, internal error. + <% end %> <% elsif event.event_type == 'destroy_incoming' %> had incoming message deleted by administrator <strong><%=h event.params[:editor] %></strong>. <% elsif event.event_type == 'response' %> diff --git a/app/views/admin_request/edit_comment.rhtml b/app/views/admin_request/edit_comment.rhtml new file mode 100644 index 000000000..d8d7de276 --- /dev/null +++ b/app/views/admin_request/edit_comment.rhtml @@ -0,0 +1,17 @@ +<h1>Edit annotation</h1> + +<%= error_messages_for 'comment' %> + +<% form_tag '../update_comment/' + @comment.id.to_s do %> + + <p><label for="comment_body">Body of annotation</label><br/> + <%= text_area 'comment', 'body', :rows => 10, :cols => 60 %></p> + + <p><%= submit_tag 'Save', :accesskey => 's' %></p> +<% end %> + +<p> +<%= link_to 'Show', '../show/' + @comment.info_request.id.to_s %> | +<%= link_to 'List all', '../list' %> +</p> + diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml index 29989933b..fb8eb2f79 100644 --- a/app/views/admin_request/show.rhtml +++ b/app/views/admin_request/show.rhtml @@ -122,7 +122,7 @@ <% for column in Comment.content_columns %> <th><%= column.human_name %></th> <% end %> - <!--<th>Actions</th>--> + <th>Actions</th> </tr> <% for comment in @info_request.comments.find(:all, :order => 'created_at') %> @@ -132,6 +132,9 @@ <% for column in Comment.content_columns.map { |c| c.name } %> <td><%=h comment.send(column) %></td> <% end %> + <td> + <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %> + </td> </tr> <% end %> </table> |