-
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.
Merge pull request #6452 from ChrisBr/bootstrap/subprojects
Migrate Subprojects to Bootstrap
- Loading branch information
Showing
7 changed files
with
113 additions
and
7 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
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 |
---|---|---|
|
@@ -31,5 +31,5 @@ | |
<% end %> | ||
<br/> | ||
</p> | ||
<p><%= submit_tag "Create Project" %></p> | ||
<p><%= submit_tag 'Accept' %></p> | ||
<% end %> |
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
8 changes: 8 additions & 0 deletions
8
src/api/app/views/webui2/webui/project/_add_new_subproject_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,8 @@ | ||
.modal.fade#add-new-subproject-modal{ tabindex: -1, role: 'dialog', aria: { labelledby: 'add-new-subproject-modal-label', hidden: true } } | ||
.modal-dialog.modal-lg{ role: 'document' } | ||
.modal-content | ||
.modal-header | ||
%h5.modal-title#add-new-subproject-modal-label | ||
Create subproject | ||
.modal-body | ||
= render partial: 'form', locals: { project: Project.new, namespace: project.name, configuration: configuration } |
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,35 @@ | ||
= form_for(project, url: projects_create_path, method: :post) do |form| | ||
.form-group | ||
- if local_assigns.key?(:namespace) | ||
= hidden_field_tag(:ns, namespace) | ||
= form.label(:name, 'Subproject Name:') | ||
.input-group | ||
.input-group-prepend | ||
%span.input-group-text | ||
#{namespace}: | ||
= form.text_field(:name, required: true, class: 'form-control') | ||
- else | ||
= form.label(:name, 'Project Name:', class: 'form-control') | ||
= form.text_field(:name, required: true, class: 'form-control') | ||
.form-group | ||
= form.label(:title, 'Title:') | ||
= form.text_field(:title, class: 'form-control') | ||
.form-group | ||
= form.label(:description, 'Description:') | ||
= form.text_area(:description, rows: 8, class: 'form-control') | ||
- unless configuration['hide_private_options'] | ||
.form-group.custom-control.custom-checkbox | ||
= check_box_tag(:access_protection, 1, false, class: 'custom-control-input') | ||
= label_tag(:access_protection, 'Hide the entire project', class: 'custom-control-label') | ||
.form-group.custom-control.custom-checkbox | ||
= check_box_tag(:source_protection, 1, false, class: 'custom-control-input') | ||
= label_tag(:source_protection, 'Deny access to sources of project', class: 'custom-control-label') | ||
.form-group.custom-control.custom-checkbox | ||
= check_box_tag(:disable_publishing, 1, false, class: 'custom-control-input') | ||
= label_tag(:disable_publishing, 'Disable build results publishing', class: 'custom-control-label') | ||
|
||
- if @show_restore_message | ||
= hidden_field_tag(:restore_option_provided, true) | ||
|
||
.modal-footer | ||
= render partial: 'webui2/shared/dialog_action_buttons' |
61 changes: 61 additions & 0 deletions
61
src/api/app/views/webui2/webui/project/subprojects.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,61 @@ | ||
:ruby | ||
@pagetitle = "Subprojects of #{@project}" | ||
|
||
.card.mb-3 | ||
= render partial: 'tabs', locals: { project: @project } | ||
.card-body | ||
.row | ||
.col-md-12 | ||
- if @parentprojects.present? | ||
%h3 Parent projects of #{@project} | ||
%table.responsive.table.table-striped.table-bordered.subproject-table | ||
%thead | ||
%tr | ||
%th Parent Project | ||
%th Title | ||
%tbody | ||
- @parentprojects.each do |project| | ||
%tr | ||
%td.project_name= link_to(word_break(project.name), project_show_path(project)) | ||
%td.project_title= word_break(project.title) | ||
.row{ class: ('mt-3' if @parentprojects.present?) } | ||
.col-md-12 | ||
%h3.d-md-inline-block Subprojects of #{@project} | ||
- if @subprojects.present? | ||
%table.responsive.table.table-striped.table-bordered.subproject-table | ||
%thead | ||
%tr | ||
%th Subproject | ||
%th Title | ||
%tbody | ||
- @subprojects.each do |project| | ||
%tr | ||
%td.project_name= link_to(word_break(remove_parent_name(project.name, @project.name), 50), project_show_path(project)) | ||
%td.project_title= word_break(project.title) | ||
- else | ||
%p | ||
%i This project has no subprojects | ||
- if User.current.can_modify?(@project) | ||
= link_to('#', data: { toggle: 'modal', target: '#add-new-subproject-modal' }, title: 'Add New Subproject', class: 'nav-link') do | ||
%i.fas.fa-plus-circle.text-primary | ||
Add New Subproject | ||
|
||
.row.mt-3 | ||
.col-md-12 | ||
- if @siblings.present? | ||
%h3 Sibling projects of #{@project} | ||
%table.responsive.table.table-striped.table-bordered.subproject-table | ||
%thead | ||
%tr | ||
%th Sibling Project | ||
%th Title | ||
%tbody | ||
- @siblings.each do |project| | ||
%tr | ||
%td.project_name= link_to(word_break(remove_parent_name(project.name, @parent_name), 50), project_show_path(project)) | ||
%td.project_title= word_break(project.title) | ||
|
||
= render partial: 'add_new_subproject_modal', locals: { project: @project, configuration: @configuration } | ||
|
||
:javascript | ||
initializeDataTable('.subproject-table'); |
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