summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-22 15:57:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-22 15:57:07 +0000
commit8eea999ca676063d94be5c8fc858d92f94af1fa0 (patch)
treeb92d1d67095d249f06be1774bad949518b328013 /app
parentad246e81ad522362916f9a37cc8cdb96d2a325eb (diff)
downloadredmine-8eea999ca676063d94be5c8fc858d92f94af1fa0.tar.gz
redmine-8eea999ca676063d94be5c8fc858d92f94af1fa0.zip
Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11072 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/views/boards/index.html.erb2
-rw-r--r--app/views/boards/show.html.erb18
2 files changed, 10 insertions, 10 deletions
diff --git a/app/views/boards/index.html.erb b/app/views/boards/index.html.erb
index 3caa08d3c..f859e822b 100644
--- a/app/views/boards/index.html.erb
+++ b/app/views/boards/index.html.erb
@@ -11,7 +11,7 @@
<% Board.board_tree(@boards) do |board, level| %>
<tr class="<%= cycle 'odd', 'even' %>">
<td style="padding-left: <%= level * 18 %>px;">
- <%= link_to h(board.name), {:action => 'show', :id => board}, :class => "board" %><br />
+ <%= link_to h(board.name), project_board_path(board.project, board), :class => "board" %><br />
<%=h board.description %>
</td>
<td class="topic-count"><%= board.topics_count %></td>
diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb
index 784c58a52..1a006a6ad 100644
--- a/app/views/boards/show.html.erb
+++ b/app/views/boards/show.html.erb
@@ -1,20 +1,20 @@
<%= board_breadcrumb(@board) %>
<div class="contextual">
-<%= link_to_if_authorized l(:label_message_new),
- {:controller => 'messages', :action => 'new', :board_id => @board},
- :class => 'icon icon-add',
- :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' %>
+<%= link_to l(:label_message_new),
+ new_board_message_path(@board),
+ :class => 'icon icon-add',
+ :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.allowed_to?(:add_messages, @board.project) %>
<%= watcher_tag(@board, User.current) %>
</div>
<div id="add-message" style="display:none;">
-<% if authorize_for('messages', 'new') %>
-<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2>
-<%= form_for @message, :url => {:controller => 'messages', :action => 'new', :board_id => @board}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
+<% if User.current.allowed_to?(:add_messages, @board.project) %>
+<h2><%= link_to h(@board.name), project_board_path(@project, @board) %> &#187; <%= l(:label_message_new) %></h2>
+<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>
<p><%= submit_tag l(:button_create) %>
- <%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %> |
+ <%= preview_link(preview_board_message_path(@board), 'message-form') %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' %></p>
<% end %>
<div id="preview" class="wiki"></div>
@@ -36,7 +36,7 @@
<tbody>
<% @topics.each do |topic| %>
<tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
- <td class="subject"><%= link_to h(topic.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => topic } %></td>
+ <td class="subject"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td class="author"><%= link_to_user(topic.author) %></td>
<td class="created_on"><%= format_time(topic.created_on) %></td>
<td class="reply-count"><%= topic.replies_count %></td>