diff options
-rw-r--r-- | app/controllers/admin_user_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/api_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/track_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/user_controller.rb | 16 | ||||
-rwxr-xr-x | app/helpers/link_to_helper.rb | 16 | ||||
-rw-r--r-- | app/models/track_mailer.rb | 2 | ||||
-rw-r--r-- | app/views/admin_user/show.rhtml | 2 | ||||
-rw-r--r-- | app/views/api/request_events.atom.builder | 2 | ||||
-rw-r--r-- | app/views/contact_mailer/to_admin_message.rhtml | 2 | ||||
-rw-r--r-- | app/views/user/_user_listing_single.rhtml | 4 | ||||
-rw-r--r-- | app/views/user/set_draft_profile_photo.rhtml | 2 |
11 files changed, 27 insertions, 27 deletions
diff --git a/app/controllers/admin_user_controller.rb b/app/controllers/admin_user_controller.rb index ed20ddcf4..52f7f330c 100644 --- a/app/controllers/admin_user_controller.rb +++ b/app/controllers/admin_user_controller.rb @@ -72,7 +72,7 @@ class AdminUserController < AdminController def login_as @admin_user = User.find(params[:id]) # check user does exist - post_redirect = PostRedirect.new( :uri => main_url(user_url(@admin_user)), :user_id => @admin_user.id, :circumstance => "login_as" ) + post_redirect = PostRedirect.new( :uri => main_url(user_path(@admin_user)), :user_id => @admin_user.id, :circumstance => "login_as" ) post_redirect.save! url = main_url(confirm_url(:email_token => post_redirect.email_token, :only_path => true)) diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 15fb4f5f9..0d6582773 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -228,7 +228,7 @@ class ApiController < ApplicationController :user_name => request.user_name, } if request.user - this_event[:user_url] = main_url(user_url(request.user)) + this_event[:user_url] = main_url(user_path(request.user)) end @event_data.push(this_event) diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index 15da7f327..5b22f3795 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -74,7 +74,7 @@ class TrackController < ApplicationController return atom_feed_internal if params[:feed] == 'feed' if self.track_set - redirect_to user_url(@track_user) + redirect_to user_path(@track_user) end end @@ -188,7 +188,7 @@ class TrackController < ApplicationController # track_thing.created_at = Time.now() # as created_at is used to limit the alerts to start with # track_thing.save! # flash[:notice] = "You are now tracking " + track_thing.params[:list_description] + " by email daily" - # redirect_to user_url(track_thing.tracking_user) + # redirect_to user_path(track_thing.tracking_user) else raise "new medium not handled " + new_medium end diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 4ee527bae..f0e3cd0d3 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -313,7 +313,7 @@ class UserController < ApplicationController post_redirect = PostRedirect.find_by_token(params[:pretoken]) do_post_redirect post_redirect else - redirect_to user_url(@user) + redirect_to user_path(@user) end end else @@ -388,7 +388,7 @@ class UserController < ApplicationController # Now clear the circumstance session[:user_circumstance] = nil flash[:notice] = _("You have now changed your email address used on {{site_name}}",:site_name=>site_name) - redirect_to user_url(@user) + redirect_to user_path(@user) end # Send a message to another user @@ -422,12 +422,12 @@ class UserController < ApplicationController ContactMailer.deliver_user_message( @user, @recipient_user, - main_url(user_url(@user)), + main_url(user_path(@user)), params[:contact][:subject], params[:contact][:message] ) flash[:notice] = _("Your message to {{recipient_user_name}} has been sent!",:recipient_user_name=>CGI.escapeHTML(@recipient_user.name)) - redirect_to user_url(@recipient_user) + redirect_to user_path(@recipient_user) return end else @@ -476,7 +476,7 @@ class UserController < ApplicationController @user.set_profile_photo(@profile_photo) @draft_profile_photo.destroy flash[:notice] = _("Thank you for updating your profile photo") - redirect_to user_url(@user) + redirect_to user_path(@user) return end @@ -492,7 +492,7 @@ class UserController < ApplicationController if !@user.get_about_me_for_html_display.empty? flash[:notice] = _("Thank you for updating your profile photo") - redirect_to user_url(@user) + redirect_to user_path(@user) else flash[:notice] = _("<p>Thanks for updating your profile photo.</p> <p><strong>Next...</strong> You can put some text about you and your research on your profile.</p>") @@ -520,7 +520,7 @@ class UserController < ApplicationController end flash[:notice] = _("You've now cleared your profile photo") - redirect_to user_url(@user) + redirect_to user_path(@user) end # before they've cropped it @@ -571,7 +571,7 @@ class UserController < ApplicationController @user.save! if @user.profile_photo flash[:notice] = _("You have now changed the text about you on your profile.") - redirect_to user_url(@user) + redirect_to user_path(@user) else flash[:notice] = _("<p>Thanks for changing the text about you on your profile.</p> <p><strong>Next...</strong> You can upload a profile photograph too.</p>") diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index 4f749d9d3..7bbab3b24 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -108,12 +108,12 @@ module LinkToHelper end # Users - def user_url(user) + def user_path(user) return show_user_url(:url_name => user.url_name, :only_path => true) end def user_link(user, cls=nil) - link_to h(user.name), user_url(user), :class => cls + link_to h(user.name), user_path(user), :class => cls end def user_link_for_request(request, cls=nil) @@ -125,7 +125,7 @@ module LinkToHelper user_name end else - link_to h(request.user.name), user_url(request.user), :class => cls + link_to h(request.user.name), user_path(request.user), :class => cls end end @@ -139,7 +139,7 @@ module LinkToHelper end def user_link_absolute(user) - link_to h(user.name), main_url(user_url(user)) + link_to h(user.name), main_url(user_path(user)) end def request_user_link_absolute(request) @@ -152,9 +152,9 @@ module LinkToHelper def user_or_you_link(user) if @user && user == @user - link_to h("you"), user_url(user) + link_to h("you"), user_path(user) else - link_to h(user.name), user_url(user) + link_to h(user.name), user_path(user) end end @@ -167,7 +167,7 @@ module LinkToHelper end def user_or_you_capital_link(user) - link_to user_or_you_capital(user), user_url(user) + link_to user_or_you_capital(user), user_path(user) end def user_admin_url(user) @@ -179,7 +179,7 @@ module LinkToHelper end def user_both_links(user) - link_to(h(user.name), main_url(user_url(user))) + " (" + link_to("admin", user_admin_url(user)) + ")" + link_to(h(user.name), main_url(user_path(user))) + " (" + link_to("admin", user_admin_url(user)) + ")" end # Tracks. feed can be 'track' or 'feed' diff --git a/app/models/track_mailer.rb b/app/models/track_mailer.rb index 7dfa87f52..fe01f1c52 100644 --- a/app/models/track_mailer.rb +++ b/app/models/track_mailer.rb @@ -7,7 +7,7 @@ class TrackMailer < ApplicationMailer def event_digest(user, email_about_things) post_redirect = PostRedirect.new( - :uri => main_url(user_url(user)) + "#email_subscriptions", + :uri => main_url(user_path(user)) + "#email_subscriptions", :user_id => user.id) post_redirect.save! unsubscribe_url = confirm_url(:email_token => post_redirect.email_token) diff --git a/app/views/admin_user/show.rhtml b/app/views/admin_user/show.rhtml index 4af79e45a..f6f2a0ae0 100644 --- a/app/views/admin_user/show.rhtml +++ b/app/views/admin_user/show.rhtml @@ -34,7 +34,7 @@ </div> <p> - <%= link_to 'Public page', main_url(user_url(@admin_user)) %> + <%= link_to 'Public page', main_url(user_path(@admin_user)) %> | <%= link_to 'Edit', '../edit/' + @admin_user.id.to_s %> | <%= link_to 'Log in as this user', '../login_as/' + @admin_user.id.to_s %> (also confirms their email) </p> diff --git a/app/views/api/request_events.atom.builder b/app/views/api/request_events.atom.builder index 44759ae7e..0fe6ac690 100644 --- a/app/views/api/request_events.atom.builder +++ b/app/views/api/request_events.atom.builder @@ -16,7 +16,7 @@ atom_feed("xmlns:alaveteli" => "http://www.alaveteli.org/API/v2/RequestEvents/At entry.author do |author| author.name(request.user_name) if !request.user.nil? - author.uri(main_url(user_url(request.user))) + author.uri(main_url(user_path(request.user))) end author.email(request.incoming_email) end diff --git a/app/views/contact_mailer/to_admin_message.rhtml b/app/views/contact_mailer/to_admin_message.rhtml index b41112c61..0ef744108 100644 --- a/app/views/contact_mailer/to_admin_message.rhtml +++ b/app/views/contact_mailer/to_admin_message.rhtml @@ -2,7 +2,7 @@ --------------------------------------------------------------------- <%= _('Message sent using {{site_name}} contact form, ', :site_name=>site_name)%> -<%=(@logged_in_user ? ("logged in as user " + main_url(user_url(@logged_in_user))) : "not logged in")%><% if !@last_request.nil? %> +<%=(@logged_in_user ? ("logged in as user " + main_url(user_path(@logged_in_user))) : "not logged in")%><% if !@last_request.nil? %> <%= _('Last request viewed: ')%><%= main_url(request_url(@last_request)) %> <% end %> <% if !@last_body.nil? %> diff --git a/app/views/user/_user_listing_single.rhtml b/app/views/user/_user_listing_single.rhtml index 53df3a7e8..ed1b95718 100644 --- a/app/views/user/_user_listing_single.rhtml +++ b/app/views/user/_user_listing_single.rhtml @@ -5,14 +5,14 @@ end %> <div class="user_listing"> <% if display_user.profile_photo %> <div class="user_photo_on_search"> - <a href="<%=user_url(display_user)%>"> + <a href="<%=user_path(display_user)%>"> <img src="<%= get_profile_photo_url(:url_name => display_user.url_name) %>" alt=""> </a> </div> <% end %> <span class="head <% if display_user.profile_photo %>no_icon<% end %>"> - <%= link_to highlight_words(display_user.name, @highlight_words), user_url(display_user) %> + <%= link_to highlight_words(display_user.name, @highlight_words), user_path(display_user) %> </span> <span class="bottomline"> diff --git a/app/views/user/set_draft_profile_photo.rhtml b/app/views/user/set_draft_profile_photo.rhtml index b3faba7fc..757498249 100644 --- a/app/views/user/set_draft_profile_photo.rhtml +++ b/app/views/user/set_draft_profile_photo.rhtml @@ -52,7 +52,7 @@ <% end %> <p> - <%= link_to _("Cancel, return to your profile page"), user_url(@user) %> + <%= link_to _("Cancel, return to your profile page"), user_path(@user) %> </p> </div> |