Skip to content

Commit

Permalink
Hide public profile link if not public
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed May 24, 2024
1 parent 2f6a872 commit 6b0b2f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/views/layouts/decidim/_user_menu.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<li role="presentation"><%= link_to t(".profile"), decidim.account_path, role: "menuitem" %></li>
<% if current_user.nickname.present? && !current_user.managed? %>
<% if current_user.nickname.present? && !current_user.managed? && current_user.public? %>
<li role="presentation"><%= link_to t(".public_profile"), decidim.profile_path(current_user.nickname), role: "menuitem" %></li>
<% end %>
<li role="presentation"><%= link_to t(".notifications"), decidim.notifications_path, role: "menuitem" %></li>
Expand Down
14 changes: 8 additions & 6 deletions app/views/layouts/decidim/header/_main_links_dropdown.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
<span class="text-secondary"><%= t("layouts.decidim.user_menu.profile") %></span>
<% end %>
</li>
<li>
<%= link_to decidim.profile_path(current_user.nickname), class: "dropdown__item" do %>
<%= icon "account-circle-line" %>
<span class="text-secondary"><%= t("layouts.decidim.user_menu.public_profile") %></span>
<% end %>
</li>
<% if current_user.public? %>
<li>
<%= link_to decidim.profile_path(current_user.nickname), class: "dropdown__item" do %>
<%= icon "account-circle-line" %>
<span class="text-secondary"><%= t("layouts.decidim.user_menu.public_profile") %></span>
<% end %>
</li>
<% end %>
<li>
<%= link_to decidim.notifications_path, class: "dropdown__item" do %>
<%= icon "notification-3-line" %>
Expand Down

0 comments on commit 6b0b2f9

Please sign in to comment.