summaryrefslogtreecommitdiff
path: root/app/views/shared
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-20 18:38:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-20 18:38:24 +0000
commit983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch)
treeb153cd387c14ba23bd5a07514c7c01fddf6a78a0 /app/views/shared
parenta2bddee2cdb38673df0e004d5b32d9f77797de64 (diff)
downloadgitlab-ce-983a0bba5d2a042c4a3bbb22432ec192c7501d82.tar.gz
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'app/views/shared')
-rw-r--r--app/views/shared/projects/_project.html.haml4
-rw-r--r--app/views/shared/runners/_form.html.haml11
-rw-r--r--app/views/shared/snippets/_form.html.haml112
3 files changed, 73 insertions, 54 deletions
diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml
index d29ba3eedc6..3d61943193f 100644
--- a/app/views/shared/projects/_project.html.haml
+++ b/app/views/shared/projects/_project.html.haml
@@ -54,6 +54,10 @@
.metadata-info.prepend-top-8
%span.user-access-role.d-block= Gitlab::Access.human_access(access)
+ - if !explore_projects_tab?
+ .metadata-info.prepend-top-8
+ = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: project
+
- if show_last_commit_as_description
.description.d-none.d-sm-block.append-right-default
= link_to_markdown(project.commit.title, project_commit_path(project, project.commit), class: "commit-row-message")
diff --git a/app/views/shared/runners/_form.html.haml b/app/views/shared/runners/_form.html.haml
index 24b4eae0c58..675a8f922c4 100644
--- a/app/views/shared/runners/_form.html.haml
+++ b/app/views/shared/runners/_form.html.haml
@@ -47,5 +47,16 @@
.col-sm-10
= f.text_field :tag_list, value: runner.tag_list.sort.join(', '), class: 'form-control'
.form-text.text-muted= _('You can set up jobs to only use Runners with specific tags. Separate tags with commas.')
+ - if local_assigns[:in_gitlab_com_admin_context]
+ .form-group.row
+ = label_tag :public_projects_minutes_cost_factor, class: 'col-form-label col-sm-2' do
+ = _('Public projects Minutes cost factor')
+ .col-sm-10
+ = f.text_field :public_projects_minutes_cost_factor, class: 'form-control'
+ .form-group.row
+ = label_tag :private_projects_minutes_cost_factor, class: 'col-form-label col-sm-2' do
+ = _('Private projects Minutes cost factor')
+ .col-sm-10
+ = f.text_field :private_projects_minutes_cost_factor, class: 'form-control'
.form-actions
= f.submit _('Save changes'), class: 'btn btn-success'
diff --git a/app/views/shared/snippets/_form.html.haml b/app/views/shared/snippets/_form.html.haml
index 5ba6d52fefe..396b6e56ea9 100644
--- a/app/views/shared/snippets/_form.html.haml
+++ b/app/views/shared/snippets/_form.html.haml
@@ -1,54 +1,58 @@
-- content_for :page_specific_javascripts do
- = page_specific_javascript_tag('lib/ace.js')
-
-.snippet-form-holder
- = form_for @snippet, url: url,
- html: { class: "snippet-form js-requires-input js-quick-submit common-note-form" },
- data: { "snippet-type": @snippet.project_id ? 'project' : 'personal'} do |f|
- = form_errors(@snippet)
-
- .form-group
- = f.label :title, class: 'label-bold'
- = f.text_field :title, class: 'form-control qa-snippet-title', required: true, autofocus: true
-
- .form-group.js-description-input
- - description_placeholder = s_('Snippets|Optionally add a description about what your snippet does or how to use it...')
- - is_expanded = @snippet.description && !@snippet.description.empty?
- = f.label :description, s_("Snippets|Description (optional)"), class: 'label-bold'
- .js-collapsible-input
- .js-collapsed{ class: ('d-none' if is_expanded) }
- = text_field_tag nil, nil, class: 'form-control', placeholder: description_placeholder, data: { qa_selector: 'description_placeholder' }
- .js-expanded{ class: ('d-none' if !is_expanded) }
- = render layout: 'projects/md_preview', locals: { url: preview_markdown_path(@project), referenced_users: true } do
- = render 'projects/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: description_placeholder, qa_selector: 'description_field'
- = render 'shared/notes/hints'
-
- .form-group.file-editor
- = f.label :file_name, s_('Snippets|File')
- .file-holder.snippet
- .js-file-title.file-title-flex-parent
- = f.text_field :file_name, placeholder: s_("Snippets|Give your file a name to add code highlighting, e.g. example.rb for Ruby"), class: 'form-control js-snippet-file-name qa-snippet-file-name'
- .file-content.code
- %pre#editor{ data: { 'editor-loading': true } }= @snippet.content
- = f.hidden_field :content, class: 'snippet-file-content'
-
- .form-group
- .font-weight-bold
- = _('Visibility level')
- = link_to icon('question-circle'), help_page_path("public_access/public_access"), target: '_blank'
- = render 'shared/visibility_level', f: f, visibility_level: @snippet.visibility_level, can_change_visibility_level: true, form_model: @snippet, with_label: false
-
- - if params[:files]
- - params[:files].each_with_index do |file, index|
- = hidden_field_tag "files[]", file, id: "files_#{index}"
-
- .form-actions
- - if @snippet.new_record?
- = f.submit 'Create snippet', class: "btn-success btn qa-create-snippet-button"
- - else
- = f.submit 'Save changes', class: "btn-success btn"
-
- - if @snippet.project_id
- = link_to "Cancel", project_snippets_path(@project), class: "btn btn-cancel"
- - else
- = link_to "Cancel", snippets_path(@project), class: "btn btn-cancel"
+- if Feature.disabled?(:monaco_snippets)
+ - content_for :page_specific_javascripts do
+ = page_specific_javascript_tag('lib/ace.js')
+
+- if Feature.enabled?(:snippets_edit_vue)
+ #js-snippet-edit.snippet-form{ data: {'project_path': @snippet.project&.full_path, 'snippet-gid': @snippet.new_record? ? '' : @snippet.to_global_id, 'markdown-preview-path': preview_markdown_path(parent), 'markdown-docs-path': help_page_path('user/markdown'), 'visibility-help-link': help_page_path("public_access/public_access") } }
+- else
+ .snippet-form-holder
+ = form_for @snippet, url: url,
+ html: { class: "snippet-form js-requires-input js-quick-submit common-note-form" },
+ data: { "snippet-type": @snippet.project_id ? 'project' : 'personal'} do |f|
+ = form_errors(@snippet)
+
+ .form-group
+ = f.label :title, class: 'label-bold'
+ = f.text_field :title, class: 'form-control qa-snippet-title', required: true, autofocus: true
+
+ .form-group.js-description-input
+ - description_placeholder = s_('Snippets|Optionally add a description about what your snippet does or how to use it...')
+ - is_expanded = @snippet.description && !@snippet.description.empty?
+ = f.label :description, s_("Snippets|Description (optional)"), class: 'label-bold'
+ .js-collapsible-input
+ .js-collapsed{ class: ('d-none' if is_expanded) }
+ = text_field_tag nil, nil, class: 'form-control', placeholder: description_placeholder, data: { qa_selector: 'description_placeholder' }
+ .js-expanded{ class: ('d-none' if !is_expanded) }
+ = render layout: 'projects/md_preview', locals: { url: preview_markdown_path(@project), referenced_users: true } do
+ = render 'projects/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: description_placeholder, qa_selector: 'description_field'
+ = render 'shared/notes/hints'
+
+ .form-group.file-editor
+ = f.label :file_name, s_('Snippets|File')
+ .file-holder.snippet
+ .js-file-title.file-title-flex-parent
+ = f.text_field :file_name, placeholder: s_("Snippets|Give your file a name to add code highlighting, e.g. example.rb for Ruby"), class: 'form-control js-snippet-file-name qa-snippet-file-name'
+ .file-content.code
+ %pre#editor{ data: { 'editor-loading': true } }= @snippet.content
+ = f.hidden_field :content, class: 'snippet-file-content'
+
+ .form-group
+ .font-weight-bold
+ = _('Visibility level')
+ = link_to icon('question-circle'), help_page_path("public_access/public_access"), target: '_blank'
+ = render 'shared/visibility_level', f: f, visibility_level: @snippet.visibility_level, can_change_visibility_level: true, form_model: @snippet, with_label: false
+
+ - if params[:files]
+ - params[:files].each_with_index do |file, index|
+ = hidden_field_tag "files[]", file, id: "files_#{index}"
+
+ .form-actions
+ - if @snippet.new_record?
+ = f.submit 'Create snippet', class: "btn-success btn qa-create-snippet-button"
+ - else
+ = f.submit 'Save changes', class: "btn-success btn"
+
+ - if @snippet.project_id
+ = link_to "Cancel", project_snippets_path(@project), class: "btn btn-cancel"
+ - else
+ = link_to "Cancel", snippets_path(@project), class: "btn btn-cancel"