Project

General

Profile

« Previous | Next » 

Revision bb25ebe6

Added by Tomer Brisker about 8 years ago

Fixes #12979 - Create helper for "new" button

Previously the button classes were applied to new buttons using jQuery.
This commit creates a `new_link` helper that makes sure all new buttons
will receive the correct class and only display if authorized. Also a
little bit of cleanup.

View differences:

app/views/hosts/index.html.erb
<% title_actions multiple_actions_select, button_group(display_link_if_authorized _("New Host"), hash_for_new_host_path) %>
<% title_actions multiple_actions_select, button_group(new_link(_("New Host"))) %>
<%= render 'list', :hosts => @hosts, :header => @title || _("Hosts") %>

Also available in: Unified diff