annotate app/views/wiki/annotate.html.erb @ 1080:5bd8c86cfa6a
issue_540
Makes the Publication model act as an activity; overloading the default ActivitiesController#index view in the Bibliography Plugin in order to differentiate Publications from the other event types.
* Known issues:
** route to /activities is not working (only to /activity);
** publication cache needs to be implemented in the model, not in the helper;
** when a publication is added to n projects, n events are created (all with the same content).
author |
luisf <luis.figueira@eecs.qmul.ac.uk> |
date |
Thu, 22 Nov 2012 16:51:23 +0000 |
parents |
cbb26bc654de |
children |
261b3d9a4903 |
rev |
line source |
Chris@0
|
1 <div class="contextual">
|
chris@37
|
2 <%= link_to(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit') %>
|
Chris@909
|
3 <%= link_to(l(:label_history),
|
Chris@909
|
4 {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
|
Chris@0
|
5 </div>
|
Chris@0
|
6
|
Chris@909
|
7 <%= wiki_page_breadcrumb(@page) %>
|
Chris@909
|
8
|
Chris@909
|
9 <h2><%=h @page.pretty_title %></h2>
|
Chris@0
|
10
|
Chris@0
|
11 <p>
|
Chris@909
|
12 <%= l(:label_version) %> <%= link_to h(@annotate.content.version),
|
Chris@909
|
13 :action => 'show', :project_id => @project,
|
Chris@909
|
14 :id => @page.title, :version => @annotate.content.version %>
|
Chris@909
|
15 <em>(<%= h(@annotate.content.author ?
|
Chris@909
|
16 @annotate.content.author.name : l(:label_user_anonymous))
|
Chris@909
|
17 %>, <%= format_time(@annotate.content.updated_on) %>)</em>
|
Chris@0
|
18 </p>
|
Chris@0
|
19
|
Chris@0
|
20 <% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
|
Chris@0
|
21
|
Chris@0
|
22 <table class="filecontent annotate">
|
Chris@0
|
23 <tbody>
|
Chris@0
|
24 <% line_num = 1 %>
|
Chris@0
|
25 <% @annotate.lines.each do |line| -%>
|
Chris@0
|
26 <tr class="bloc-<%= colors[line[0]] %>">
|
Chris@0
|
27 <th class="line-num"><%= line_num %></th>
|
Chris@909
|
28 <td class="revision"><%= link_to line[0], :controller => 'wiki',
|
Chris@909
|
29 :action => 'show', :project_id => @project,
|
Chris@909
|
30 :id => @page.title, :version => line[0] %></td>
|
Chris@0
|
31 <td class="author"><%= h(line[1]) %></td>
|
Chris@0
|
32 <td class="line-code"><pre><%=h line[2] %></pre></td>
|
Chris@0
|
33 </tr>
|
Chris@0
|
34 <% line_num += 1 %>
|
Chris@0
|
35 <% end -%>
|
Chris@0
|
36 </tbody>
|
Chris@0
|
37 </table>
|
Chris@0
|
38
|
Chris@0
|
39 <% content_for :header_tags do %>
|
Chris@0
|
40 <%= stylesheet_link_tag 'scm' %>
|
Chris@0
|
41 <% end %>
|