Revision bb25ebe6
Added by Tomer Brisker about 8 years ago
app/views/compute_resources/show.html.erb | ||
---|---|---|
</div>
|
||
<% if @compute_resource.capabilities.include?(:image) %>
|
||
<div id="images" class="tab-pane">
|
||
<%= title_actions(display_link_if_authorized(_("New Image"), hash_for_new_compute_resource_image_path(:compute_resource_id => @compute_resource.id), :class => "btn btn-success", :data=>{:target=>"full-page"})) %>
|
||
<%= title_actions(new_link(_("New Image"), { :compute_resource_id => @compute_resource.id, :controller => :images }, { :data=>{:target=>"full-page"} })) %>
|
||
<div id="images_list" data-url=<%= compute_resource_images_path(@compute_resource) %>>
|
||
<%= spinner(_('Loading images information ...')) %>
|
||
</div>
|
Also available in: Unified diff
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.