diff --git a/app/helpers/pseuds_helper.rb b/app/helpers/pseuds_helper.rb index cc3b1234193..997023d01a4 100644 --- a/app/helpers/pseuds_helper.rb +++ b/app/helpers/pseuds_helper.rb @@ -37,9 +37,15 @@ def print_pseud_list(user, pseuds, first: true) end end + def pseuds_for_sidebar(user, pseud) + pseuds = user.pseuds.abbreviated_list - [pseud] + pseuds = pseuds.sort + pseuds = [pseud] + pseuds if pseud && !pseud.new_record? + pseuds + end + # used in the sidebar - def print_pseud_selector(pseuds) - pseuds -= [@pseud] if @pseud && @pseud.new_record? - list = pseuds.sort.collect {|pseud| "
  • " + span_if_current(pseud.name, [pseud.user, pseud]) + "
  • "}.join("").html_safe + def pseud_selector(pseuds) + pseuds.collect { |pseud| "
  • #{span_if_current(pseud.name, [pseud.user, pseud])}
  • " }.join.html_safe end end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index c4f56e26113..b6a6b173a2b 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -15,17 +15,6 @@ def is_maintainer? current_user.is_a?(User) ? current_user.maintained_collections.present? : false end - def sidebar_pseud_link_text(user, pseud) - text = if current_page?(user) - ts('Pseuds') - elsif pseud.present? && !pseud.new_record? - pseud.name - else - user.login - end - (text + ' ↓').html_safe - end - # Prints user pseuds with links to anchors for each pseud on the page and the description as the title def print_pseuds(user) user.pseuds.collect(&:name).join(', ') diff --git a/app/views/users/_sidebar.html.erb b/app/views/users/_sidebar.html.erb index cbd8264ba54..429c8ebcc95 100644 --- a/app/views/users/_sidebar.html.erb +++ b/app/views/users/_sidebar.html.erb @@ -5,10 +5,9 @@
  • <%= span_if_current ts("Profile"), user_profile_path(@user) %>
  • <% if @user.pseuds.size > 1 %>
  • - <% pseud_link_text = current_page?(@user) ? ts("Pseuds") : (@pseud ? @pseud.name : @user.login) %> - "><%= pseud_link_text %> + "><%= ts("Pseuds") %>
  • diff --git a/features/other_a/pseuds.feature b/features/other_a/pseuds.feature index c8e40515e0d..b35f9414982 100644 --- a/features/other_a/pseuds.feature +++ b/features/other_a/pseuds.feature @@ -158,8 +158,8 @@ Scenario: Many pseuds And I should see "All Pseuds (4)" within "ul.expandable" When I go to my "Slartibartfast" pseud page - Then I should see "Slartibartfast" within "li.pseud > a" - And I should not see "Slartibartfast" within "ul.expandable" + Then I should see "Pseuds" within "li.pseud > a" + And I should see "Slartibartfast" within "ul.expandable" When I go to my pseuds page Then I should not see "Zaphod (Zaphod)" within "ul.pseud.index"