-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DoD repository to Bootstrap repository page
This part was missed in: #6471 TODO (from Add DoD repository): - Convert create dod repository to `form_for` and use `dod_source_field` partial. Co-authored-by: David Kang <dkang@suse.com>
- Loading branch information
Showing
10 changed files
with
158 additions
and
3 deletions.
There are no files selected for viewing
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
47 changes: 47 additions & 0 deletions
47
src/api/app/views/webui2/webui/repositories/_add_dod_repository_modal.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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.modal.fade#add-dod-repository-modal{ tabindex: -1, role: 'dialog', aria: { labelledby: 'add-dod-repository-label', hidden: 'true' } } | ||
.modal-dialog.modal-dialog-centered{ role: 'document' } | ||
.modal-content | ||
=# TODO: Convert this to form_for and use dod_source_field partial | ||
= form_tag(create_dod_repository_path(project: project), method: 'post') do | ||
.modal-header | ||
%h5.modal-title#add-dod-repository-label Add DoD repository | ||
.modal-body | ||
.form-group.row | ||
= label_tag :name, 'Repository name', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= text_field_tag :name, nil, required: true, class: 'form-control' | ||
.form-group | ||
%h6 Download on Demand Source | ||
.form-group.row | ||
= label_tag :arch, 'Architecture', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= select_tag :arch, options_for_select(Architecture.available, ''), required: true, | ||
class: 'custom-select' | ||
.form-group.row | ||
= label_tag :repotype, 'Type', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= select_tag :repotype, options_for_select(DownloadRepository::REPOTYPES, ''), | ||
class: 'custom-select' | ||
.form-group.row | ||
= label_tag :url, 'Url', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= text_field_tag(:url, nil, required: true, class: 'form-control') | ||
.form-group.row | ||
= label_tag :archfilter, 'Arch. Filter', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= text_field_tag :archfilter, nil, class: 'form-control' | ||
.form-group.row | ||
= label_tag :masterurl, 'Master Url', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= text_field_tag :masterurl, nil, class: 'form-control' | ||
.form-group.row | ||
= label_tag :mastersslfingerprint, 'SSL Fingerprint', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= text_field_tag :mastersslfingerprint, nil, class: 'form-control' | ||
.form-group.row | ||
= label_tag :pubkey, 'Public Key', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= text_area_tag :pubkey, nil, row: 2, class: 'form-control' | ||
.modal-footer | ||
= render partial: 'webui2/shared/dialog_action_buttons' | ||
|
4 changes: 4 additions & 0 deletions
4
src/api/app/views/webui2/webui/repositories/_add_dod_source_modal.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.modal.fade{ id: "add-dod-source-modal-#{repository.id}", tabindex: -1, role: 'dialog', aria: { labelledby: 'add-dod-source-label', hidden: 'true' } } | ||
= render partial: 'dod_source_fields', locals: { download_on_demand: download_on_demand, | ||
project: project, | ||
title: "Add Download on Demand for #{repository.name}" } |
14 changes: 14 additions & 0 deletions
14
src/api/app/views/webui2/webui/repositories/_delete_dod_source_modal.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.modal.fade{ id: "delete-dod-source-#{download_on_demand.id}", tabindex: -1, role: 'dialog', | ||
aria: { labelledby: 'delete-repository-label', hidden: true } } | ||
.modal-dialog.modal-dialog-centered{ role: 'document' } | ||
.modal-content | ||
.modal-header | ||
%h5.modal-title | ||
Delete Download on Demand? | ||
.modal-body | ||
%p Please confirm deletion of '#{download_on_demand.arch}' Download on Demand | ||
= form_tag(download_repository_path(download_on_demand, project: project), method: :delete) do | ||
.modal-footer | ||
%a.btn.btn-sm.btn-outline-secondary.px-4{ data: { dismiss: 'modal' } } | ||
Cancel | ||
= submit_tag('Delete', class: 'btn btn-sm btn-danger px-4') |
31 changes: 31 additions & 0 deletions
31
src/api/app/views/webui2/webui/repositories/_dod_repository_card_content.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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.card-body | ||
Download on demand sources: | ||
%ul.list-unstyled.ml-3 | ||
- repository.download_repositories.each do |dod_element| | ||
%li | ||
%small.font-weight-bold | ||
= dod_element.arch | ||
= link_to("#{dod_element.url}", target: '_blank', title: 'Go to the repository') do | ||
= dod_element.url | ||
(#{dod_element.repotype}) | ||
= link_to('#', title: 'Edit DoD Source', data: { toggle: 'modal', target: "#edit-dod-source-modal-#{dod_element.id}" }) do | ||
%i.fas.fa-edit.text-secondary | ||
= link_to('#', title: 'Delete Downdload on Demand source', | ||
data: { toggle: 'modal', target: "#delete-dod-source-#{dod_element.id}" }) do | ||
%i.fas.fa-times-circle.text-danger | ||
= render partial: 'edit_dod_source_modal', locals: { repository: repository, project: project, download_on_demand: dod_element } | ||
= render partial: 'delete_dod_source_modal', locals: { repository: repository, project: project, download_on_demand: dod_element } | ||
.card-footer.text-center | ||
.row | ||
.col | ||
= link_to('#', title: 'Add DoD Source', data: { toggle: 'modal', target: "#add-dod-source-modal-#{repository.id}" }) do | ||
%i.fas.fa-plus-circle.text-primary | ||
- if User.current.can_modify?(project) | ||
.col | ||
= link_to('#', title: 'Delete Repository', data: { toggle: 'modal', target: "#delete-repository-#{repository.id}" }) do | ||
%i.fas.fa-times-circle.text-danger | ||
|
||
= render partial: 'add_dod_source_modal', locals: { repository: repository, | ||
project: project, | ||
download_on_demand: DownloadRepository.new(repository_id: repository.id) } | ||
= render partial: 'delete_repository_modal', locals: { repository: repository, project: project } |
41 changes: 41 additions & 0 deletions
41
src/api/app/views/webui2/webui/repositories/_dod_source_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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.modal-dialog.modal-dialog-centered{ role: 'document' } | ||
.modal-content | ||
= form_for(download_on_demand) do |f| | ||
.modal-header | ||
%h5.modal-title#edit-dod-source-label= title | ||
.modal-body | ||
.form-group.row | ||
= f.label :arch, 'Architecture', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= f.select :arch, options_for_select(Architecture.available, download_on_demand.try(:arch)), {}, required: true, | ||
class: 'custom-select' | ||
.form-group.row | ||
= f.label :repotype, 'Type', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= f.select :repotype, options_for_select(DownloadRepository::REPOTYPES, download_on_demand.try(:repotype)), {}, | ||
class: 'custom-select' | ||
.form-group.row | ||
= f.label :url, 'Url', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= f.text_field(:url, required: true, class: 'form-control') | ||
.form-group.row | ||
= f.label :archfilter, 'Arch. Filter', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= f.text_field :archfilter, class: 'form-control' | ||
.form-group.row | ||
= f.label :masterurl, 'Master Url', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= f.text_field :masterurl, class: 'form-control' | ||
.form-group.row | ||
= f.label :mastersslfingerprint, 'SSL Fingerprint', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= f.text_field :mastersslfingerprint, class: 'form-control' | ||
.form-group.row | ||
= f.label :pubkey, 'Public Key', class: 'col-sm-4 col-form-label' | ||
.col-sm-8 | ||
= f.text_area :pubkey, row: 2, class: 'form-control' | ||
.form-group.row | ||
= f.hidden_field :repository_id | ||
= hidden_field_tag :project, project | ||
.modal-footer | ||
= render partial: 'webui2/shared/dialog_action_buttons' |
5 changes: 5 additions & 0 deletions
5
src/api/app/views/webui2/webui/repositories/_edit_dod_source_modal.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.modal.fade{ id: "edit-dod-source-modal-#{download_on_demand.id}", tabindex: -1, role: 'dialog', | ||
aria: { labelledby: 'edit-dod-source-label', hidden: 'true' } } | ||
= render partial: 'dod_source_fields', locals: { download_on_demand: download_on_demand, | ||
project: project, | ||
title: "Edit #{download_on_demand.try(:arch)} Download on demand" } |
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
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
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