-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Bento views by Bootstrap views for kiwi images
- Loading branch information
Showing
29 changed files
with
306 additions
and
699 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
#kiwi-description | ||
.nested-fields | ||
%h2#image-name | ||
= @image.name | ||
%p.detailed-info{ class: "#{'hidden' if @is_edit_software_action}" } | ||
= image.name | ||
%p.detailed-info{ class: "#{'d-none' if is_edit_software_action}" } | ||
%span.fill{ data: { tag: 'specification' } } | ||
= @description | ||
%ul.inline.detailed-info{ class: "#{'hidden' unless @is_edit_details_action}" } | ||
%li | ||
= description | ||
%ul.list-inline{ class: "#{'d-none' unless is_edit_details_action}" } | ||
%li.list-inline-item | ||
%strong Author: | ||
%span.fill{ data: { tag: 'author' } }= @author | ||
%li | ||
%span.fill{ data: { tag: 'author' } }= author | ||
%li.list-inline-item | ||
%strong Contact: | ||
%span.fill{ data: { tag: 'contact' } }= @contact | ||
%p | ||
= link_to(sprited_text('package', 'View Package'), package_show_path(@package.project, @package)) | ||
= link_to(sprited_text('package_edit', 'Edit details'), '#', class: "description_edit detailed-info #{'hidden' unless @is_edit_details_action}") | ||
%span.fill{ data: { tag: 'contact' } }= contact | ||
%ul.list-inline.mb-0 | ||
%li.list-inline-item | ||
= link_to(package_show_path(package.project, package)) do | ||
%i.text-warning.fa.fa-archive | ||
View package | ||
%li.list-inline-item{ class: "#{'d-none' unless is_edit_details_action}" } | ||
= link_to('#', data: { 'target': '#description-edit', 'toggle': 'modal' }) do | ||
%i.text-info.fa.fa-cog | ||
Edit details | ||
- if User.session | ||
= link_to(sprited_text('drive_web', 'Cloud Upload'), cloud_upload_index_path, id: 'cloud-upload') | ||
%li.list-inline-item | ||
= link_to(cloud_upload_index_path, id: 'cloud-upload') do | ||
%i.fas.fa-cloud-upload-alt.text-secondary | ||
Cloud upload | ||
- if action_name == 'edit' | ||
= render partial: 'description_form', locals: { f: f } |
File renamed without changes.
59 changes: 23 additions & 36 deletions
59
src/api/app/views/webui/kiwi/images/_build_info.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,25 @@ | ||
.box-header.header-tabs | ||
%ul | ||
%li.selected | ||
%a.result-select-link#result-select-link{ href: '#' } Build Results | ||
= sprite_tag('reload', title: 'Reload', accesskey: 'r', onclick: 'update_build_result()', class: "result_reload", id: "result_reload") | ||
= image_tag('ajax-loader.gif', id: "result_spinner") | ||
:ruby | ||
index ||= '' | ||
ajax_data = {} | ||
ajax_data['project'] = h(project) if defined?(project) | ||
ajax_data['package'] = h(package) if defined?(package) | ||
ajax_data['index'] = h(index) if defined?(index) | ||
|
||
.result-display#result-display | ||
.card | ||
.bg-light#buildresult-urls{ data: { buildresult_url: defined?(package) ? package_buildresult_path : project_buildresult_path } } | ||
%ul.nav.nav-tabs.pt-2.px-3.flex-nowrap#buildresult-box{ role: 'tablist', data: ajax_data } | ||
%li.nav-item | ||
= link_to("#build#{index}", id: "build#{index}-tab", class: 'nav-link active text-nowrap', | ||
data: { toggle: 'tab' }, role: 'tab', aria: { controls: "build#{index}", selected: true }) do | ||
Build Results | ||
.card-body | ||
.tab-content | ||
.tab-pane.fade.show.active{ id: "build#{index}", role: 'tabpanel', aria: { labelledby: "build#{index}-tab" } } | ||
.btn.btn-sm.btn-outline-primary.mb-2.build-refresh{ accesskey: 'r', title: 'Refresh Build Results' } | ||
Refresh | ||
%i.fas.fa-sm.fa-sync-alt{ id: "build#{index}-reload" } | ||
.result | ||
- ajax_data = [] | ||
- ajax_data.push("'project': '#{h(@project)}'") | ||
- ajax_data.push("'package': '#{h(@package)}'") | ||
- ajax_data = raw(ajax_data.join ', ') | ||
|
||
= javascript_tag do | ||
:plain | ||
function update_build_result() { | ||
$('#result_spinner').show(); | ||
$('#result_reload').hide(); | ||
$.ajax({ | ||
url: '#{ url_for(controller: '/webui/kiwi/images', action: 'build_result') }', | ||
data: {#{ajax_data}}, | ||
success: function(data) { | ||
$('#result-display').html(data); | ||
}, | ||
error: function(data) { | ||
$('#result-display').html('<p>No build results available</p>'); | ||
}, | ||
complete: function(data) { | ||
$('#result_spinner').hide(); | ||
if ($('#result-select-link').parent().hasClass('selected')) { | ||
$('#result_reload').show(); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
update_build_result(); | ||
:javascript | ||
updateBuildResult('#{index}'); | ||
$('.build-refresh').click(function() { updateBuildResult('#{index}'); }); |
32 changes: 0 additions & 32 deletions
32
src/api/app/views/webui/kiwi/images/_build_status.html.erb
This file was deleted.
Oops, something went wrong.
42 changes: 20 additions & 22 deletions
42
src/api/app/views/webui/kiwi/images/_description_form.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
.dialog.darkgrey_box.hidden{ style: "width: 500px; left: 45%;" } | ||
.box.box-shadow | ||
%h2.box-header Edit Kiwi Details | ||
.modal.fade#description-edit{ 'tabindex': '-1', role: 'dialog' } | ||
.modal-dialog{ role: 'document' } | ||
.modal-content | ||
.modal-header | ||
%h5.modal-title Edit Kiwi Details | ||
|
||
.dialog-content | ||
%p | ||
= f.label :name | ||
= f.text_field :name, data: { default: f.object.name } | ||
#flash-messages | ||
%p.ui-state-error.alert-danger.p-3.mb-0.d-none | ||
Kiwi Image name cannot be empty! | ||
.modal-body | ||
.dialog | ||
= f.label :name | ||
= f.text_field :name, data: { default: f.object.name }, class: 'form-control' | ||
|
||
%p | ||
= f.fields_for :description, f.object.description do |description_fields| | ||
%p | ||
= f.fields_for :description, f.object.description do |description_fields| | ||
= description_fields.label :author | ||
= description_fields.text_field :author, data: { default: description_fields.object.author } | ||
%p | ||
= description_fields.text_field :author, data: { default: description_fields.object.author }, class: 'form-control' | ||
= description_fields.label :contact | ||
= description_fields.text_field :contact, data: { default: description_fields.object.contact } | ||
%p | ||
= description_fields.text_field :contact, data: { default: description_fields.object.contact }, class: 'form-control' | ||
= description_fields.label :specification | ||
= description_fields.text_field :specification, data: { default: description_fields.object.specification } | ||
= description_fields.text_field :specification, data: { default: description_fields.object.specification }, class: 'form-control' | ||
|
||
%p#flash-messages | ||
%p.ui-state-error.ui-widget-shadow.hidden | ||
Kiwi Image name can not be empty! | ||
|
||
.dialog-buttons | ||
= link_to('Cancel', '#', title: 'Cancel', class: 'revert-dialog') | ||
= link_to('Continue', '#', title: 'Continue', class: 'close-description-dialog') | ||
.modal-footer | ||
%a.btn.btn-sm.btn-outline-danger.px-4{ data: { dismiss: 'modal' } } | ||
Cancel | ||
= link_to('Continue', '#', title: 'Continue', class: 'btn btn-sm btn-primary px-4 close-description-dialog') |
35 changes: 18 additions & 17 deletions
35
src/api/app/views/webui/kiwi/images/_details_overview.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
%h3 Details | ||
%p | ||
%strong Author | ||
%p | ||
= @author | ||
= "(#{@contact})" unless @contact.blank? | ||
%p | ||
%strong Software | ||
%p | ||
- if @image.use_project_repositories | ||
This image uses the repositories set in the project | ||
- else | ||
= @repositories_count | ||
repositories selected | ||
%p | ||
= @packages_count | ||
package/s selected | ||
%h5.card-header Details | ||
.card-body | ||
%p | ||
%strong Author | ||
%p | ||
= author | ||
= "(#{contact})" if contact.present? | ||
%p | ||
%strong Software | ||
%p | ||
- if image.use_project_repositories | ||
This image uses the repositories set in the project | ||
- else | ||
= repositories_count | ||
repositories selected | ||
%p | ||
= pluralize(packages_count, 'package', plural: 'packages') | ||
selected |
70 changes: 41 additions & 29 deletions
70
src/api/app/views/webui/kiwi/images/_package_fields.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,48 @@ | ||
.nested-fields.kiwi_fields | ||
%div{ class: "kiwi_list_item #{'has-error' if f.object.errors.present?}" } | ||
%span | ||
= link_to '#', class: "package_edit kiwi_element_name" do | ||
.nested-fields.kiwi_fields.col-lg-2.col-md-3.col-sm-4 | ||
.d-flex.justify-content-between.kiwi_list_item{ class: "#{'has-error' if f.object.errors.present?}" } | ||
%span.btn.btn-link.text-truncate{ title: f.object.name } | ||
= link_to '', class: 'package_edit kiwi_element_name', data: { 'target': "#package-#{f.object.name}", 'toggle': 'modal' } do | ||
= f.object.name | ||
- if f.object.arch.present? | ||
%small (#{f.object.arch}) | ||
%span.kiwi_actions.hidden | ||
= link_to_remove_association sprite_tag("req-decline", title: 'remove'), f | ||
%span.btn.btn-link.kiwi_actions | ||
= link_to_remove_association f do | ||
%i.fas.fa-times.text-danger | ||
|
||
.dialog.darkgrey_box{ style: "width: 500px; left: 45%;", class: "#{'hidden' if f.object.name.present?} #{'new_element' if f.object.new_record?}" } | ||
.box.box-shadow | ||
%h2.box-header #{f.object.name.present? ? 'Edit' : 'Add'} package | ||
.modal.fade{ 'tabindex': '-1', role: 'dialog', id: "#{f.object.name.present? ? 'package-' + f.object.name : 'add-package'}", | ||
class: "#{'new_element' if f.object.new_record?}" } | ||
.modal-dialog{ role: 'document' } | ||
.modal-content | ||
.modal-header | ||
%h5.modal-title #{f.object.name.present? ? 'Edit' : 'Add'} package | ||
|
||
.dialog-content | ||
%p | ||
= f.label :name, 'Name:' | ||
= f.text_field :name, data: { ajaxurl: url_for(controller: '/webui/kiwi/images', action: 'autocomplete_binaries'), default: f.object.name } | ||
%p | ||
= f.label :arch, 'Arch:' | ||
= f.text_field :arch, data: { default: f.object.arch } | ||
= f.label :replaces, 'Replaces:' | ||
= f.text_field :replaces, data: { default: f.object.replaces } | ||
%p | ||
= f.check_box :bootinclude, data: { default: f.object.bootinclude } | ||
= f.label :bootinclude | ||
= f.check_box :bootdelete, data: { default: f.object.bootdelete } | ||
= f.label :bootdelete | ||
#flash-messages | ||
%p.ui-state-error.alert-danger.p-3.mb-0.d-none | ||
The name can not be empty! | ||
|
||
%p#flash-messages | ||
%p.ui-state-error.ui-widget-shadow.hidden | ||
The name can not be empty! | ||
.modal-body | ||
.form-group.ui-front | ||
= f.label :name | ||
.input-group | ||
.input-group-prepend | ||
%span.input-group-text | ||
%i.fas.fa-search | ||
= f.text_field :name, required: true, | ||
placeholder: 'Type to autocomplete...', | ||
class: 'form-control kiwi-package-search', | ||
data: { source: autocomplete_binaries_kiwi_image_path, default: f.object.name } | ||
.form-group | ||
= f.label :arch, 'Arch:' | ||
= f.text_field :arch, data: { default: f.object.arch }, class: 'form-control' | ||
= f.label :replaces, 'Replaces:' | ||
= f.text_field :replaces, data: { default: f.object.replaces }, class: 'form-control' | ||
.custom-control.custom-checkbox | ||
= f.check_box :bootinclude, data: { default: f.object.bootinclude }, class: 'custom-control-input' | ||
= f.label :bootinclude, class: 'custom-control-label' | ||
.custom-control.custom-checkbox | ||
= f.check_box :bootdelete, data: { default: f.object.bootdelete }, class: 'custom-control-input' | ||
= f.label :bootdelete, class: 'custom-control-label' | ||
|
||
.dialog-buttons | ||
= link_to('Cancel', '#', title: 'Cancel', class: 'revert-dialog') | ||
= link_to('Continue', '#', title: 'Continue', class: 'close-dialog') | ||
.modal-footer | ||
= link_to('Cancel', '#', title: 'Cancel', class: 'revert-dialog btn btn-sm btn-outline-danger px-4') | ||
= link_to('Continue', '#', title: 'Continue', class: 'close-dialog btn btn-sm btn-primary px-4') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
%h3 Packages | ||
#kiwi-packages-list | ||
%p#no-packages{ class: "#{'hidden' if @package_groups.packages.present?}" }= 'There are no packages.' | ||
%h5.card-header Packages | ||
.card-body#kiwi-packages-list | ||
%p#no-packages{ class: "#{'d-none' if package_groups.packages.present?}" }= 'There are no packages.' | ||
= f.fields_for :package_groups, @package_groups do |package_group_fields| | ||
= package_group_fields.fields_for :packages do |kiwi_package_fields| | ||
= render 'package_fields', f: kiwi_package_fields | ||
%p | ||
= link_to_add_association(sprite_tag("package_add", title: 'Add package') + ' Add package', package_group_fields, :packages) | ||
.row | ||
= f.fields_for :package_groups, package_groups do |package_group_fields| | ||
= package_group_fields.fields_for :packages do |kiwi_package_fields| | ||
= render 'package_fields', f: kiwi_package_fields | ||
.col-12.mt-2.mb-4 | ||
= link_to_add_association(package_group_fields, :packages) do | ||
%i.fas.fa-plus-circle.text-primary | ||
Add package |
Oops, something went wrong.