summaryrefslogtreecommitdiff
path: root/app/views/shared/projects
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/shared/projects')
-rw-r--r--app/views/shared/projects/_archived.html.haml2
-rw-r--r--app/views/shared/projects/_project.html.haml8
-rw-r--r--app/views/shared/projects/_search_bar.html.haml3
-rw-r--r--app/views/shared/projects/protected_branches/_update_protected_branch.html.haml35
4 files changed, 42 insertions, 6 deletions
diff --git a/app/views/shared/projects/_archived.html.haml b/app/views/shared/projects/_archived.html.haml
index fad93d14390..f24fe3a8b89 100644
--- a/app/views/shared/projects/_archived.html.haml
+++ b/app/views/shared/projects/_archived.html.haml
@@ -1,3 +1,3 @@
- if project.archived
- %span.d-flex.badge.badge-warning
+ %span.d-flex.badge-pill.gl-badge.badge-warning.gl-ml-3
= _('archived')
diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml
index 626e94e0202..115d0c9a7c5 100644
--- a/app/views/shared/projects/_project.html.haml
+++ b/app/views/shared/projects/_project.html.haml
@@ -26,7 +26,7 @@
= image_tag avatar_icon_for_user(project.creator, 48), class: "avatar s48", alt:''
- else
= project_icon(project, alt: '', class: 'avatar project-avatar s48', width: 48, height: 48)
- .project-details.d-sm-flex.flex-sm-fill.align-items-center{ data: { qa_selector: 'project', qa_project_name: project.name } }
+ .project-details.d-sm-flex.flex-sm-fill.align-items-center{ data: { qa_selector: 'project_content', qa_project_name: project.name } }
.flex-wrapper
.d-flex.align-items-center.flex-wrap.project-title
%h2.d-flex.gl-mt-3
@@ -40,7 +40,7 @@
= project.name
%span.metadata-info.visibility-icon.gl-mr-3.gl-mt-3.text-secondary.has-tooltip{ data: { container: 'body', placement: 'top' }, title: visibility_icon_description(project) }
- = visibility_level_icon(project.visibility_level, fw: true)
+ = visibility_level_icon(project.visibility_level)
- if explore_projects_tab? && project_license_name(project)
%span.metadata-info.d-inline-flex.align-items-center.gl-mr-3.gl-mt-3
@@ -51,7 +51,7 @@
-# haml-lint:disable UnnecessaryStringOutput
= ' ' # prevent haml from eating the space between elements
.metadata-info.gl-mt-3
- %span.user-access-role.d-block= Gitlab::Access.human_access(access)
+ %span.user-access-role.d-block{ data: { qa_selector: 'user_role_content' } }= Gitlab::Access.human_access(access)
- if !explore_projects_tab?
.metadata-info.gl-mt-3
@@ -64,6 +64,8 @@
.description.d-none.d-sm-block.gl-mr-3
= markdown_field(project, :description)
+ = render_if_exists 'shared/projects/removed', project: project
+
.controls.d-flex.flex-sm-column.align-items-center.align-items-sm-end.flex-wrap.flex-shrink-0.text-secondary{ class: css_controls_class.join(" ") }
.icon-container.d-flex.align-items-center
- if show_pipeline_status_icon
diff --git a/app/views/shared/projects/_search_bar.html.haml b/app/views/shared/projects/_search_bar.html.haml
index c1f2eaba284..a745da32110 100644
--- a/app/views/shared/projects/_search_bar.html.haml
+++ b/app/views/shared/projects/_search_bar.html.haml
@@ -14,7 +14,7 @@
.filtered-search-box-input-container.pl-2
= render 'shared/projects/search_form', admin_view: false, search_form_placeholder: _("Search projects...")
%button.btn.btn-secondary{ type: 'submit', form: 'project-filter-form' }
- = sprite_icon('search', size: 16, css_class: 'search-icon ')
+ = sprite_icon('search', css_class: 'search-icon ')
.filtered-search-dropdown.flex-row.align-items-center.mb-2.m-sm-0#filtered-search-visibility-dropdown{ class: flex_grow_and_shrink_xs }
.filtered-search-dropdown-label.p-0.pl-sm-3.font-weight-bold
%span
@@ -25,4 +25,3 @@
%span
= _("Sort by")
= render 'shared/projects/sort_dropdown'
-
diff --git a/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml b/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml
new file mode 100644
index 00000000000..eafc402f210
--- /dev/null
+++ b/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml
@@ -0,0 +1,35 @@
+- merge_access_levels = protected_branch.merge_access_levels.for_role
+- push_access_levels = protected_branch.push_access_levels.for_role
+
+- user_merge_access_levels = protected_branch.merge_access_levels.for_user
+- user_push_access_levels = protected_branch.push_access_levels.for_user
+
+- group_merge_access_levels = protected_branch.merge_access_levels.for_group
+- group_push_access_levels = protected_branch.push_access_levels.for_group
+
+%td.merge_access_levels-container
+ = hidden_field_tag "allowed_to_merge_#{protected_branch.id}", merge_access_levels.first&.access_level
+ = dropdown_tag( (merge_access_levels.first&.humanize || 'Select') ,
+ options: { toggle_class: 'js-allowed-to-merge qa-allowed-to-merge', dropdown_class: 'dropdown-menu-selectable js-allowed-to-merge-container capitalize-header',
+ data: { field_name: "allowed_to_merge_#{protected_branch.id}", preselected_items: access_levels_data(merge_access_levels) }})
+ - if user_merge_access_levels.any?
+ %p.small
+ = _('The following %{user} can also merge into this branch: %{branch}') % { user: 'user'.pluralize(user_merge_access_levels.size), branch: user_merge_access_levels.map(&:humanize).to_sentence }
+
+ - if group_merge_access_levels.any?
+ %p.small
+ = _('Members of %{group} can also merge into this branch: %{branch}') % { group: (group_merge_access_levels.size > 1 ? 'these groups' : 'this group'), branch: group_merge_access_levels.map(&:humanize).to_sentence }
+
+%td.push_access_levels-container
+ = hidden_field_tag "allowed_to_push_#{protected_branch.id}", push_access_levels.first&.access_level
+ = dropdown_tag( (push_access_levels.first&.humanize || 'Select') ,
+ options: { toggle_class: 'js-allowed-to-push', dropdown_class: 'dropdown-menu-selectable js-allowed-to-push-container capitalize-header',
+ data: { field_name: "allowed_to_push_#{protected_branch.id}", preselected_items: access_levels_data(push_access_levels) }})
+ - if user_push_access_levels.any?
+ %p.small
+ = _('The following %{user} can also push to this branch: %{branch}') % { user: 'user'.pluralize(user_push_access_levels.size), branch: user_push_access_levels.map(&:humanize).to_sentence }
+
+ - if group_push_access_levels.any?
+ %p.small
+ = _('Members of %{group} can also push to this branch: %{branch}') % { group: (group_push_access_levels.size > 1 ? 'these groups' : 'this group'), branch: group_push_access_levels.map(&:humanize).to_sentence }
+