Fix icons in member rows

pull/5470/head
Oliver Günther 8 years ago
parent 5f1f2f3c3a
commit 441279e4a9
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 28
      app/cells/members/row_cell.rb
  2. 4
      app/views/groups/_memberships.html.erb
  3. 8
      app/views/users/_memberships.html.erb
  4. 5
      features/support/env.rb

@ -85,9 +85,8 @@ module Members
def edit_link
link_to_function(
'',
op_icon('icon icon-edit'),
edit_javascript,
class: 'icon icon-edit',
title: t(:button_edit)
)
end
@ -105,23 +104,22 @@ module Members
end
def delete_link
delete_class, delete_title = delete_link_class_and_title
link_to(
'',
{ controller: '/members', action: 'destroy', id: model, page: params[:page] },
method: :delete,
data: { confirm: delete_link_confirmation },
title: delete_title,
class: delete_class
) if model.deletable?
if model.deletable?
link_to(
op_icon('icon icon-delete'),
{ controller: '/members', action: 'destroy', id: model, page: params[:page] },
method: :delete,
data: { confirm: delete_link_confirmation },
title: delete_title
)
end
end
def delete_link_class_and_title
def delete_title
if model.disposable?
['icon icon-delete', I18n.t(:title_remove_and_delete_user)]
I18n.t(:title_remove_and_delete_user)
else
['icon icon-remove', I18n.t(:button_remove)]
I18n.t(:button_remove)
end
end

@ -86,7 +86,9 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %>
</td>
<td class="buttons">
<%= link_to_function l(:button_edit), "jQuery('#member-#{membership.id}-roles').hide(); jQuery('#member-#{membership.id}-roles-form').show();", class: 'icon icon-edit' %>
<%= link_to_function icon_wrapper('icon icon-edit', t(:button_edit)),
"jQuery('#member-#{membership.id}-roles').hide(); jQuery('#member-#{membership.id}-roles-form').show();" do %>
<% end %>
<%= link_to l(:button_remove), membership_of_group_path(@group, membership),
method: :delete,
remote: true,

@ -96,12 +96,12 @@ See doc/COPYRIGHT.rdoc for more details.
</td>
<%= call_hook(:view_users_memberships_table_row, user: @user, membership: membership, roles: roles, projects: projects )%>
<td class="buttons">
<%= link_to_function l(:button_edit), "jQuery('#member-#{membership.id}-roles').hide(); jQuery('#member-#{membership.id}-roles-form').show();", class: 'icon icon-edit' %>
<%= link_to(l(:button_remove),
<%= link_to_function icon_wrapper('icon icon-edit', t(:button_edit)),
"jQuery('#member-#{membership.id}-roles').hide(); jQuery('#member-#{membership.id}-roles-form').show();" %>
<%= link_to(icon_wrapper('icon icon-remove', t(:button_remove)),
user_membership_path(user_id: @user, id: membership),
remote: true,
method: :delete,
class: 'icon icon-remove') if membership.deletable? %>
method: :delete) if membership.deletable? %>
</td>
</tr>
<% end %>

@ -89,11 +89,6 @@ end
Capybara.javascript_driver = :selenium
Capybara.server do |app, port|
require 'rack/handler/thin'
Rack::Handler::Thin.run(app, Port: port)
end
# By default, any exception happening in your Rails application will bubble up
# to Cucumber so that your scenario will fail. This is a different from how
# your application behaves in the production environment, where an error page will

Loading…
Cancel
Save