Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2786 from mdeniz/haml_8
Replace ERB templates with HAML for webui/download_on_demand views
- Loading branch information
Showing
8 changed files
with
71 additions
and
79 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
.box{ style: "margin: 1em" } | ||
%h2.box-header | ||
Add Download on Demand for #{repository.name} | ||
= render partial: 'webui/download_on_demand/form', locals: { project: project, repository: repository, download_on_demand: download_on_demand } |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
.box{style: "margin: 1em"} | ||
%h2.box-header | ||
Edit Download on Demand for #{repository.name} / #{download_on_demand.arch} | ||
= render partial: 'webui/download_on_demand/form', locals: { project: project, repository: repository, download_on_demand: download_on_demand } |
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
src/api/app/views/webui/download_on_demand/_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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
= form_for(download_on_demand) do |form| | ||
%div{ style: "margin-bottom: 1.2em; margin-left: 2em" } | ||
= form.label :arch, 'Architecture', style: "display:inline-block;width:100px;" | ||
= form.select :arch, options_for_select(Architecture.available, download_on_demand.try(:arch)) | ||
%br/ | ||
%br/ | ||
= form.label :repotype, 'Type', style: "display:inline-block;width:100px;" | ||
= form.select :repotype, options_for_select(DownloadRepository::REPOTYPES, download_on_demand.try(:repotype)) | ||
%br/ | ||
%br/ | ||
= form.label :url, style: "display:inline-block;width:100px;" | ||
= form.text_field :url | ||
%br/ | ||
%br/ | ||
= form.label :archfilter, 'Arch. Filter' , style: "display:inline-block;width:100px;" | ||
= form.text_field :archfilter | ||
%br/ | ||
%br/ | ||
= form.label :masterurl, 'Master Url', style: "display:inline-block;width:100px;" | ||
= form.text_field :masterurl | ||
%br/ | ||
%br/ | ||
= form.label :mastersslfingerprint, 'SSL Fingerprint', style: "display:inline-block;width:100px;" | ||
= form.text_field :mastersslfingerprint | ||
%br/ | ||
%br/ | ||
= form.label :pubkey, 'Public Key', style: "display:inline-block;width:100px;" | ||
= form.text_area :pubkey | ||
= form.hidden_field :repository_id | ||
= hidden_field_tag :project, project | ||
- if form.object.new_record? | ||
%p= form.submit "Add Download on Demand", id: "add_dod_button" | ||
- else | ||
%p= form.submit "Update Download on Demand", id: "update_dod_button-#{download_on_demand}" |
34 changes: 0 additions & 34 deletions
34
src/api/app/views/webui/download_on_demand/_index.html.erb
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
src/api/app/views/webui/download_on_demand/_index.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,29 @@ | ||
- repository_id = valid_xml_id(repository.name) | ||
%div{ style: "margin-top: 10px" } | ||
%b Download on demand sources | ||
- if User.current.is_admin? | ||
%span.add-dod-repository-link-container | ||
= sprite_tag('drive_add') | ||
= link_to('Add', '#', data: { "dod-repository-add": true }) | ||
.hidden.add-dod-repository-form | ||
= render partial: 'webui/download_on_demand/add', locals: { project: project, repository: repository, download_on_demand: DownloadRepository.new(repository_id: repository.id) } | ||
%ul{ style: "list-style-type: none;" } | ||
- repository.download_repositories.each do |dod_element| | ||
%li | ||
%b | ||
= dod_element.arch | ||
\: | ||
%a{ href: "#{dod_element.url}", target: "_blank", title: "Go to the repository" } | ||
= dod_element.url | ||
(#{dod_element.repotype}) | ||
- if User.current.is_admin? | ||
|
||
%span.edit-dod-repository-link-container | ||
= sprite_tag('drive_edit') | ||
= link_to('Edit', '#', data: { "dod-repository-edit": true }) | ||
= sprite_tag('drive_delete', title: 'Delete repository') | ||
= link_to "Delete", download_repository_path(dod_element, project: project), | ||
{ data: { confirm: "Really remove Download on Demand for '#{repository.name} / #{dod_element.arch}'?" }, class: 'x', method: :delete } | ||
.hidden.edit-dod-repository-form | ||
= render partial: 'webui/download_on_demand/edit', locals: { project: project, repository: repository, download_on_demand: dod_element } |