Remove if_user and similar methods

Rather than hiding features based on CSS, just avoid including them
in the output. Fixes #1862
This commit is contained in:
Andy Allan 2018-05-16 13:05:20 +08:00
parent 5da01b92c5
commit e1c62f1bf2
13 changed files with 73 additions and 202 deletions

View file

@ -11,8 +11,8 @@
<% if @display_name %>
<li><%= link_to t('.see_all_traces'), :controller => 'traces', :action => 'list', :display_name => nil, :tag => nil, :page => nil %></li>
<% end %>
<%= unless_user(@target_user, :li) do %>
<%= link_to t('.see_my_traces'), :action => 'mine', :tag => nil, :page => nil %>
<% if current_user && current_user != @target_user %>
<li><%= link_to t('.see_my_traces'), :action => 'mine', :tag => nil, :page => nil %></li>
<% end %>
<% end %>
</ul>

View file

@ -56,8 +56,10 @@
<% if current_user && (current_user==@trace.user || current_user.administrator? || current_user.moderator?)%>
<div class="buttons">
<%= if_user(@trace.user) do %>
<%= button_to t('.edit_track'), trace_edit_path(@trace) %>
<% if current_user == @trace.user %>
<div>
<%= button_to t('.edit_track'), trace_edit_path(@trace) %>
</div>
<% end %>
<%= button_to t('.delete_track'), { :controller => 'traces', :action => 'delete', :id => @trace.id }, :data => { :confirm => t('.confirm_delete') } %>
</div>