Skip to content

Commit

Permalink
[webui] Refactor check of section for Image editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Moises Deniz Aleman authored and eduardoj committed Nov 9, 2017
1 parent fd9b095 commit 7a48507
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/api/app/controllers/webui/kiwi/images_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def show
def edit
@image.build_description if @image.description.nil?
@description = @image.description.specification
@version = 'x.x.x'
@version = 'x.x.x'
@package_groups = @image.default_package_group
@author = @image.description.author
@contact = @image.description.contact

@is_edit_details_action = params[:section] == 'details'
@is_edit_details_action = params[:section] == 'details' || params[:section].nil?
@is_edit_software_action = params[:section] == 'software'

respond_to do |format|
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/views/webui/kiwi/_tabs.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
link_to_software = (action_name == 'edit') ? '#' : { controller: 'kiwi/images', action: 'edit', section: 'software' }
%>
<%= content_tag('li', link_to('Details', link_to_details, { id: "kiwi_details_trigger"}),
class: "#{'selected' if params[:section] == 'details'}", id: "kiwi_details_tab" ) %>
class: "#{'selected' if @is_edit_details_action}", id: "kiwi_details_tab" ) %>
<%= content_tag('li', link_to('Software', link_to_software, { id: "kiwi_software_trigger"}),
class: "#{'selected' if params[:section] == 'software'}", id: "kiwi_software_tab" ) %>
class: "#{'selected' if @is_edit_software_action}", id: "kiwi_software_tab" ) %>
</ul>
</div>

0 comments on commit 7a48507

Please sign in to comment.