annotate app/views/boards/show.rhtml @ 8:0c83d98252d9 yuya

* Add custom repo prefix and proper auth realm, remove auth cache (seems like an unwise feature), pass DB handle around, various other bits of tidying
author Chris Cannam
date Thu, 12 Aug 2010 15:31:37 +0100
parents 513646585e45
children 051f544170fe
rev   line source
Chris@0 1 <%= breadcrumb link_to(l(:label_board_plural), {:controller => 'boards', :action => 'index', :project_id => @project}) %>
Chris@0 2
Chris@0 3 <div class="contextual">
Chris@0 4 <%= link_to_if_authorized l(:label_message_new),
Chris@0 5 {:controller => 'messages', :action => 'new', :board_id => @board},
Chris@0 6 :class => 'icon icon-add',
Chris@0 7 :onclick => 'Element.show("add-message"); Form.Element.focus("message_subject"); return false;' %>
Chris@0 8 <%= watcher_tag(@board, User.current) %>
Chris@0 9 </div>
Chris@0 10
Chris@0 11 <div id="add-message" style="display:none;">
Chris@0 12 <% if authorize_for('messages', 'new') %>
Chris@0 13 <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2>
Chris@0 14 <% form_for :message, @message, :url => {:controller => 'messages', :action => 'new', :board_id => @board}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
Chris@0 15 <%= render :partial => 'messages/form', :locals => {:f => f} %>
Chris@0 16 <p><%= submit_tag l(:button_create) %>
Chris@0 17 <%= link_to_remote l(:label_preview),
Chris@0 18 { :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
Chris@0 19 :method => 'post',
Chris@0 20 :update => 'preview',
Chris@0 21 :with => "Form.serialize('message-form')",
Chris@0 22 :complete => "Element.scrollTo('preview')"
Chris@0 23 }, :accesskey => accesskey(:preview) %> |
Chris@0 24 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-message")' %></p>
Chris@0 25 <% end %>
Chris@0 26 <div id="preview" class="wiki"></div>
Chris@0 27 <% end %>
Chris@0 28 </div>
Chris@0 29
Chris@0 30 <h2><%=h @board.name %></h2>
Chris@0 31 <p class="subtitle"><%=h @board.description %></p>
Chris@0 32
Chris@0 33 <% if @topics.any? %>
Chris@0 34 <table class="list messages">
Chris@0 35 <thead><tr>
Chris@0 36 <th><%= l(:field_subject) %></th>
Chris@0 37 <th><%= l(:field_author) %></th>
Chris@0 38 <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
Chris@0 39 <%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
Chris@0 40 <%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
Chris@0 41 </tr></thead>
Chris@0 42 <tbody>
Chris@0 43 <% @topics.each do |topic| %>
Chris@0 44 <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
Chris@0 45 <td class="subject"><%= link_to h(topic.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => topic } %></td>
Chris@0 46 <td class="author" align="center"><%= topic.author %></td>
Chris@0 47 <td class="created_on" align="center"><%= format_time(topic.created_on) %></td>
Chris@0 48 <td class="replies" align="center"><%= topic.replies_count %></td>
Chris@0 49 <td class="last_message">
Chris@0 50 <% if topic.last_reply %>
Chris@0 51 <%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
Chris@0 52 <%= link_to_message topic.last_reply %>
Chris@0 53 <% end %>
Chris@0 54 </td>
Chris@0 55 </tr>
Chris@0 56 <% end %>
Chris@0 57 </tbody>
Chris@0 58 </table>
Chris@0 59 <p class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></p>
Chris@0 60 <% else %>
Chris@0 61 <p class="nodata"><%= l(:label_no_data) %></p>
Chris@0 62 <% end %>
Chris@0 63
Chris@0 64 <% other_formats_links do |f| %>
Chris@0 65 <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
Chris@0 66 <% end %>
Chris@0 67
Chris@0 68 <% html_title h(@board.name) %>
Chris@0 69
Chris@0 70 <% content_for :header_tags do %>
Chris@0 71 <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %>
Chris@0 72 <% end %>