Refactor some diary entry routes to use resources
This commit is contained in:
parent
b7893df84e
commit
fbcd2bc10a
5 changed files with 12 additions and 10 deletions
|
@ -49,7 +49,7 @@
|
|||
</li>
|
||||
<% end %>
|
||||
<li class="compact-hide <%= current_page_class(traces_path) %>"><%= link_to t("layouts.gps_traces"), traces_path %></li>
|
||||
<li class="compact-hide <%= current_page_class(diary_path) %>"><%= link_to t("layouts.user_diaries"), diary_path %></li>
|
||||
<li class="compact-hide <%= current_page_class(diary_entries_path) %>"><%= link_to t("layouts.user_diaries"), diary_entries_path %></li>
|
||||
<li class="compact-hide <%= current_page_class(copyright_path) %>"><%= link_to t("layouts.copyright"), copyright_path %></li>
|
||||
<li class="compact-hide <%= current_page_class(help_path) %>"><%= link_to t("layouts.help"), help_path %></li>
|
||||
<li class="compact-hide <%= current_page_class(about_path) %>"><%= link_to t("layouts.about"), about_path %></li>
|
||||
|
@ -65,7 +65,7 @@
|
|||
</li>
|
||||
<% end %>
|
||||
<li class="<%= current_page_class(traces_path) %>"><%= link_to t("layouts.gps_traces"), traces_path %></li>
|
||||
<li class="<%= current_page_class(diary_path) %>"><%= link_to t("layouts.user_diaries"), diary_path %></li>
|
||||
<li class="<%= current_page_class(diary_entries_path) %>"><%= link_to t("layouts.user_diaries"), diary_entries_path %></li>
|
||||
<li class="<%= current_page_class(copyright_path) %>"><%= link_to t("layouts.copyright"), copyright_path %></li>
|
||||
<li class="<%= current_page_class(help_path) %>"><%= link_to t("layouts.help"), help_path %></li>
|
||||
<li class="<%= current_page_class(about_path) %>"><%= link_to t("layouts.about"), about_path %></li>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
<div class='section'>
|
||||
<h2><div class='icon community'></div><%= t ".community_driven_title" %></h2>
|
||||
<p><%= t ".community_driven_html", :diary_path => diary_path %></p>
|
||||
<p><%= t ".community_driven_html", :diary_path => diary_entries_path %></p>
|
||||
</div>
|
||||
|
||||
<div class='section' id='open-data'>
|
||||
|
|
|
@ -205,7 +205,7 @@
|
|||
<% else %>
|
||||
<ul class='secondary-actions clearfix'>
|
||||
<li><%= link_to t(".friends_changesets"), friend_changesets_path %></li>
|
||||
<li><%= link_to t(".friends_diaries"), friend_diaries_path %></li>
|
||||
<li><%= link_to t(".friends_diaries"), friends_diary_entries_path %></li>
|
||||
</ul>
|
||||
<div id="friends-container">
|
||||
<%= render :partial => "contact", :collection => friends, :locals => { :type => "friend" } %>
|
||||
|
@ -221,7 +221,7 @@
|
|||
<% else %>
|
||||
<ul class='secondary-actions clearfix'>
|
||||
<li><%= link_to t(".nearby_changesets"), nearby_changesets_path %></li>
|
||||
<li><%= link_to t(".nearby_diaries"), nearby_diaries_path %></li>
|
||||
<li><%= link_to t(".nearby_diaries"), nearby_diary_entries_path %></li>
|
||||
</ul>
|
||||
<div id="nearbyusers">
|
||||
<%= render :partial => "contact", :collection => nearby, :locals => { :type => "nearby mapper" } %>
|
||||
|
|
|
@ -216,9 +216,12 @@ OpenStreetMap::Application.routes.draw do
|
|||
post "/trace/:id/delete" => "traces#delete", :id => /\d+/
|
||||
|
||||
# diary pages
|
||||
resources :diary_entries, :path => "diary", :only => [:new, :create]
|
||||
get "/diary/friends" => "diary_entries#index", :friends => true, :as => "friend_diaries"
|
||||
get "/diary/nearby" => "diary_entries#index", :nearby => true, :as => "nearby_diaries"
|
||||
resources :diary_entries, :path => "diary", :only => [:new, :create, :index] do
|
||||
collection do
|
||||
get "friends" => "diary_entries#index", :friends => true
|
||||
get "nearby" => "diary_entries#index", :nearby => true
|
||||
end
|
||||
end
|
||||
get "/user/:display_name/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss }
|
||||
get "/diary/:language/rss" => "diary_entries#rss", :defaults => { :format => :rss }
|
||||
get "/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss }
|
||||
|
@ -226,7 +229,6 @@ OpenStreetMap::Application.routes.draw do
|
|||
get "/user/:display_name/diary/comments/" => "diary_entries#comments"
|
||||
get "/user/:display_name/diary" => "diary_entries#index"
|
||||
get "/diary/:language" => "diary_entries#index"
|
||||
get "/diary" => "diary_entries#index"
|
||||
scope "/user/:display_name" do
|
||||
resources :diary_entries, :path => "diary", :only => [:edit, :update, :show]
|
||||
end
|
||||
|
|
|
@ -8,7 +8,7 @@ class DiaryEntrySystemTest < ApplicationSystemTestCase
|
|||
|
||||
test "reply to diary entry should prefill the message subject" do
|
||||
sign_in_as(create(:user))
|
||||
visit diary_path
|
||||
visit diary_entries_path
|
||||
|
||||
click_on "Reply to this entry"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue