##// END OF EJS Templates
Enable syntax highlight on issues, messages and news (#1473, #1466)....
Jean-Philippe Lang -
r1548:af734b1b38e9
parent child
Show More
@@ -1,119 +1,120
1 1 <div class="contextual">
2 2 <%= show_and_goto_link(l(:button_update), 'update', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) if authorize_for('issues', 'edit') %>
3 3 <%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
4 4 <%= watcher_tag(@issue, User.current) %>
5 5 <%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-copy' %>
6 6 <%= link_to_if_authorized l(:button_move), {:controller => 'issues', :action => 'move', :id => @issue }, :class => 'icon icon-move' %>
7 7 <%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
8 8 </div>
9 9
10 10 <h2><%= @issue.tracker.name %> #<%= @issue.id %></h2>
11 11
12 12 <div class="issue <%= "status-#{@issue.status.position} priority-#{@issue.priority.position}" %>">
13 13 <h3><%=h @issue.subject %></h3>
14 14 <p class="author">
15 15 <%= authoring @issue.created_on, @issue.author %>.
16 16 <%= l(:label_updated_time, distance_of_time_in_words(Time.now, @issue.updated_on)) + '.' if @issue.created_on != @issue.updated_on %>
17 17 </p>
18 18
19 19 <table width="100%">
20 20 <tr>
21 21 <td style="width:15%"><b><%=l(:field_status)%> :</b></td><td style="width:35%"><%= @issue.status.name %></td>
22 22 <td style="width:15%"><b><%=l(:field_start_date)%> :</b></td><td style="width:35%"><%= format_date(@issue.start_date) %></td>
23 23 </tr>
24 24 <tr>
25 25 <td><b><%=l(:field_priority)%> :</b></td><td><%= @issue.priority.name %></td>
26 26 <td><b><%=l(:field_due_date)%> :</b></td><td><%= format_date(@issue.due_date) %></td>
27 27 </tr>
28 28 <tr>
29 29 <td><b><%=l(:field_assigned_to)%> :</b></td><td><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
30 30 <td><b><%=l(:field_done_ratio)%> :</b></td><td><%= progress_bar @issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%" %></td>
31 31 </tr>
32 32 <tr>
33 33 <td><b><%=l(:field_category)%> :</b></td><td><%=h @issue.category ? @issue.category.name : "-" %></td>
34 34 <% if User.current.allowed_to?(:view_time_entries, @project) %>
35 35 <td><b><%=l(:label_spent_time)%> :</b></td>
36 36 <td><%= @issue.spent_hours > 0 ? (link_to lwr(:label_f_hour, @issue.spent_hours), {:controller => 'timelog', :action => 'details', :project_id => @project, :issue_id => @issue}, :class => 'icon icon-time') : "-" %></td>
37 37 <% end %>
38 38 </tr>
39 39 <tr>
40 40 <td><b><%=l(:field_fixed_version)%> :</b></td><td><%= @issue.fixed_version ? link_to_version(@issue.fixed_version) : "-" %></td>
41 41 <% if @issue.estimated_hours %>
42 42 <td><b><%=l(:field_estimated_hours)%> :</b></td><td><%= lwr(:label_f_hour, @issue.estimated_hours) %></td>
43 43 <% end %>
44 44 </tr>
45 45 <tr>
46 46 <% n = 0
47 47 for custom_value in @custom_values %>
48 48 <td valign="top"><b><%= custom_value.custom_field.name %> :</b></td><td valign="top"><%= simple_format(h(show_value(custom_value))) %></td>
49 49 <% n = n + 1
50 50 if (n > 1)
51 51 n = 0 %>
52 52 </tr><tr>
53 53 <%end
54 54 end %>
55 55 </tr>
56 56 </table>
57 57 <hr />
58 58
59 59 <div class="contextual">
60 60 <%= link_to_remote(image_tag('comment.png'),
61 61 { :url => {:controller => 'issues', :action => 'reply', :id => @issue} },
62 62 :title => l(:button_reply)) if authorize_for('issues', 'edit') %>
63 63 </div>
64 64
65 65 <p><strong><%=l(:field_description)%></strong></p>
66 66 <div class="wiki">
67 67 <%= textilizable @issue, :description, :attachments => @issue.attachments %>
68 68 </div>
69 69
70 70 <% if @issue.attachments.any? %>
71 71 <%= link_to_attachments @issue.attachments, :delete_url => (authorize_for('issues', 'destroy_attachment') ? {:controller => 'issues', :action => 'destroy_attachment', :id => @issue} : nil) %>
72 72 <% end %>
73 73
74 74 <% if authorize_for('issue_relations', 'new') || @issue.relations.any? %>
75 75 <hr />
76 76 <div id="relations">
77 77 <%= render :partial => 'relations' %>
78 78 </div>
79 79 <% end %>
80 80
81 81 </div>
82 82
83 83 <% if @issue.changesets.any? && User.current.allowed_to?(:view_changesets, @project) %>
84 84 <div id="issue-changesets">
85 85 <h3><%=l(:label_associated_revisions)%></h3>
86 86 <%= render :partial => 'changesets', :locals => { :changesets => @issue.changesets} %>
87 87 </div>
88 88 <% end %>
89 89
90 90 <% if @journals.any? %>
91 91 <div id="history">
92 92 <h3><%=l(:label_history)%></h3>
93 93 <%= render :partial => 'history', :locals => { :journals => @journals } %>
94 94 </div>
95 95 <% end %>
96 96 <div style="clear: both;"></div>
97 97
98 98 <% if authorize_for('issues', 'edit') %>
99 99 <div id="update" style="display:none;">
100 100 <h3><%= l(:button_update) %></h3>
101 101 <%= render :partial => 'edit' %>
102 102 </div>
103 103 <% end %>
104 104
105 105 <p class="other-formats">
106 106 <%= l(:label_export_to) %>
107 107 <span><%= link_to 'Atom', {:format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
108 108 <span><%= link_to 'PDF', {:format => 'pdf'}, :class => 'pdf' %></span>
109 109 </p>
110 110
111 111 <% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
112 112
113 113 <% content_for :sidebar do %>
114 114 <%= render :partial => 'issues/sidebar' %>
115 115 <% end %>
116 116
117 117 <% content_for :header_tags do %>
118 118 <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@issue.project} - #{@issue.tracker} ##{@issue.id}: #{@issue.subject}") %>
119 <%= stylesheet_link_tag 'scm' %>
119 120 <% end %>
@@ -1,52 +1,56
1 1 <%= breadcrumb link_to(l(:label_board_plural), {:controller => 'boards', :action => 'index', :project_id => @project}),
2 2 link_to(h(@board.name), {:controller => 'boards', :action => 'show', :project_id => @project, :id => @board}) %>
3 3
4 4 <div class="contextual">
5 5 <%= link_to_if_authorized l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'icon icon-edit' %>
6 6 <%= link_to_if_authorized l(:button_delete), {:action => 'destroy', :id => @topic}, :method => :post, :confirm => l(:text_are_you_sure), :class => 'icon icon-del' %>
7 7 </div>
8 8
9 9 <h2><%=h @topic.subject %></h2>
10 10
11 11 <div class="message">
12 12 <p><span class="author"><%= authoring @topic.created_on, @topic.author %></span></p>
13 13 <div class="wiki">
14 14 <%= textilizable(@topic.content, :attachments => @topic.attachments) %>
15 15 </div>
16 16 <%= link_to_attachments @topic.attachments, :no_author => true %>
17 17 </div>
18 18 <br />
19 19
20 20 <% unless @replies.empty? %>
21 21 <h3 class="icon22 icon22-comment"><%= l(:label_reply_plural) %></h3>
22 22 <% @replies.each do |message| %>
23 23 <a name="<%= "message-#{message.id}" %>"></a>
24 24 <div class="contextual">
25 25 <%= link_to_if_authorized image_tag('edit.png'), {:action => 'edit', :id => message}, :title => l(:button_edit) %>
26 26 <%= link_to_if_authorized image_tag('delete.png'), {:action => 'destroy', :id => message}, :method => :post, :confirm => l(:text_are_you_sure), :title => l(:button_delete) %>
27 27 </div>
28 28 <div class="message reply">
29 29 <h4><%=h message.subject %> - <%= authoring message.created_on, message.author %></h4>
30 30 <div class="wiki"><%= textilizable message, :content, :attachments => message.attachments %></div>
31 31 <%= link_to_attachments message.attachments, :no_author => true %>
32 32 </div>
33 33 <% end %>
34 34 <% end %>
35 35
36 36 <% if !@topic.locked? && authorize_for('messages', 'reply') %>
37 37 <p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p>
38 38 <div id="reply" style="display:none;">
39 39 <% form_for :reply, @reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
40 40 <%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
41 41 <%= submit_tag l(:button_submit) %>
42 42 <%= link_to_remote l(:label_preview),
43 43 { :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
44 44 :method => 'post',
45 45 :update => 'preview',
46 46 :with => "Form.serialize('message-form')",
47 47 :complete => "Element.scrollTo('preview')"
48 48 }, :accesskey => accesskey(:preview) %>
49 49 <% end %>
50 50 <div id="preview" class="wiki"></div>
51 51 </div>
52 52 <% end %>
53
54 <% content_for :header_tags do %>
55 <%= stylesheet_link_tag 'scm' %>
56 <% end %>
@@ -1,57 +1,61
1 1 <div class="contextual">
2 2 <%= link_to_if_authorized l(:button_edit),
3 3 {:controller => 'news', :action => 'edit', :id => @news},
4 4 :class => 'icon icon-edit',
5 5 :accesskey => accesskey(:edit),
6 6 :onclick => 'Element.show("edit-news"); return false;' %>
7 7 <%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy', :id => @news}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
8 8 </div>
9 9
10 10 <h2><%=h @news.title %></h2>
11 11
12 12 <div id="edit-news" style="display:none;">
13 13 <% labelled_tabular_form_for :news, @news, :url => { :action => "edit", :id => @news },
14 14 :html => { :id => 'news-form' } do |f| %>
15 15 <%= render :partial => 'form', :locals => { :f => f } %>
16 16 <%= submit_tag l(:button_save) %>
17 17 <%= link_to_remote l(:label_preview),
18 18 { :url => { :controller => 'news', :action => 'preview' },
19 19 :method => 'post',
20 20 :update => 'preview',
21 21 :with => "Form.serialize('news-form')"
22 22 }, :accesskey => accesskey(:preview) %> |
23 23 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("edit-news")' %>
24 24 <% end %>
25 25 <div id="preview" class="wiki"></div>
26 26 </div>
27 27
28 28 <p><em><% unless @news.summary.blank? %><%=h @news.summary %><br /><% end %>
29 29 <span class="author"><%= authoring @news.created_on, @news.author %></span></em></p>
30 30 <div class="wiki">
31 31 <%= textilizable(@news.description) %>
32 32 </div>
33 33 <br />
34 34
35 35 <div id="comments" style="margin-bottom:16px;">
36 36 <h3 class="icon22 icon22-comment"><%= l(:label_comment_plural) %></h3>
37 37 <% @comments.each do |comment| %>
38 38 <% next if comment.new_record? %>
39 39 <div class="contextual">
40 40 <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment},
41 41 :confirm => l(:text_are_you_sure), :method => :post, :title => l(:button_delete) %>
42 42 </div>
43 43 <h4><%= authoring comment.created_on, comment.author %></h4>
44 44 <%= textilizable(comment.comments) %>
45 45 <% end if @comments.any? %>
46 46 </div>
47 47
48 48 <% if authorize_for 'news', 'add_comment' %>
49 49 <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
50 50 <% form_tag({:action => 'add_comment', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
51 51 <%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
52 52 <%= wikitoolbar_for 'comment_comments' %>
53 53 <p><%= submit_tag l(:button_add) %></p>
54 54 <% end %>
55 55 <% end %>
56 56
57 57 <% html_title @news.title -%>
58
59 <% content_for :header_tags do %>
60 <%= stylesheet_link_tag 'scm' %>
61 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now