Skip to content

Commit

Permalink
Merge pull request #2786 from mdeniz/haml_8
Browse files Browse the repository at this point in the history
Replace ERB templates with HAML for webui/download_on_demand views
  • Loading branch information
DavidKang committed Mar 9, 2017
2 parents e753730 + f534bec commit 43b7e08
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 79 deletions.
6 changes: 0 additions & 6 deletions src/api/app/views/webui/download_on_demand/_add.html.erb

This file was deleted.

4 changes: 4 additions & 0 deletions src/api/app/views/webui/download_on_demand/_add.html.haml
@@ -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 }
6 changes: 0 additions & 6 deletions src/api/app/views/webui/download_on_demand/_edit.html.erb

This file was deleted.

4 changes: 4 additions & 0 deletions src/api/app/views/webui/download_on_demand/_edit.html.haml
@@ -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 }
33 changes: 0 additions & 33 deletions src/api/app/views/webui/download_on_demand/_form.html.erb

This file was deleted.

34 changes: 34 additions & 0 deletions src/api/app/views/webui/download_on_demand/_form.html.haml
@@ -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 src/api/app/views/webui/download_on_demand/_index.html.erb

This file was deleted.

29 changes: 29 additions & 0 deletions src/api/app/views/webui/download_on_demand/_index.html.haml
@@ -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 }

0 comments on commit 43b7e08

Please sign in to comment.