Skip to content

Commit

Permalink
Merge pull request #8236 from dmarcoux/project#new_package
Browse files Browse the repository at this point in the history
Migrate project#new_package
  • Loading branch information
dmarcoux committed Sep 2, 2019
2 parents d5e33e4 + bd571c2 commit 64be21a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
2 changes: 2 additions & 0 deletions src/api/app/controllers/webui/project_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def new

def new_package
authorize @project, :update?

switch_to_webui2
end

def new_package_branch
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
= form_tag(save_new_package_path(project)) do
.form-group
%label{ for: 'name' } Name:
%abbr.text-danger{ title: 'required' } *
= text_field_tag 'name', nil, size: 80, required: true, class: 'form-control', placeholder: 'Enter Name'
.form-group
%label{ for: 'title' } Title:
= text_field_tag 'title', nil, size: 80, class: 'form-control', placeholder: 'Enter Title'
.form-group
%label{ for: 'description' } Description:
= text_area_tag 'description', nil, cols: 80, rows: 10, class: 'form-control'
- unless @configuration['hide_private_options']
.form-group.custom-control.custom-checkbox
= check_box_tag :source_protection, 1, false, class: 'custom-control-input', type: 'checkbox'
%label.custom-control-label{ for: 'source_protection' } Deny access to source of package
.form-group.custom-control.custom-checkbox
= check_box_tag :disable_publishing, 1, false, class: 'custom-control-input', type: 'checkbox'
%label.custom-control-label{ for: 'disable_publishing' } Disable build results publishing
- if defined?(modal)
.modal-footer
= render partial: 'webui2/shared/dialog_action_buttons', locals: { submit_tag_text: 'Create' }
- else
= submit_tag('Create', class: 'btn btn-primary px-4')
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,4 @@
%h5.modal-title#new-package-modal-label
Create Package for #{project.name}
.modal-body
= form_tag(save_new_package_path(project)) do
.form-group
%label{ for: 'name' } Name:
= text_field_tag 'name', nil, size: 80, required: true, class: 'form-control', placeholder: 'Enter Name'
.form-group
%label{ for: 'title' } Title:
= text_field_tag 'title', nil, size: 80, class: 'form-control', placeholder: 'Enter Title'
.form-group
%label{ for: 'description' } Description:
= text_area_tag 'description', nil, cols: 80, rows: 10, class: 'form-control'
- unless @configuration['hide_private_options']
.form-group.custom-control.custom-checkbox
= check_box_tag :source_protection, 1, false, class: 'custom-control-input', type: 'checkbox'
%label.custom-control-label{ for: 'source_protection' } Deny access to source of package
.form-group.custom-control.custom-checkbox
= check_box_tag :disable_publishing, 1, false, class: 'custom-control-input', type: 'checkbox'
%label.custom-control-label{ for: 'disable_publishing' } Disable build results publishing
.modal-footer
= render partial: 'webui2/shared/dialog_action_buttons', locals: { submit_tag_text: 'Create' }
= render partial: 'create_package_form', locals: { project: project, modal: true }
7 changes: 7 additions & 0 deletions src/api/app/views/webui2/webui/project/new_package.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- @pagetitle = "Create package for #{@project}"

.card.mb-3
= render partial: 'tabs', locals: { project: @project }
.card-body
%h3= @pagetitle
= render partial: 'create_package_form', locals: { project: @project }

0 comments on commit 64be21a

Please sign in to comment.