diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 18:08:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 18:08:52 +0300 |
commit | 0ab47b994caa80c5587f33dc818626b66cfdafe2 (patch) | |
tree | 5ef3976d2f84e3368903a67ba2dbd87a74b9a43c /app/views | |
parent | 1308dc5eb484ab0f8064989fc551ebdb4b1a7976 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/dashboard/_activities.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/snippets/edit.html.haml | 1 | ||||
-rw-r--r-- | app/views/projects/snippets/new.html.haml | 1 | ||||
-rw-r--r-- | app/views/shared/snippets/_form.html.haml | 52 | ||||
-rw-r--r-- | app/views/snippets/edit.html.haml | 1 | ||||
-rw-r--r-- | app/views/snippets/new.html.haml | 1 |
6 files changed, 37 insertions, 22 deletions
diff --git a/app/views/dashboard/_activities.html.haml b/app/views/dashboard/_activities.html.haml index 4359a2c3c2b..2db3e35250f 100644 --- a/app/views/dashboard/_activities.html.haml +++ b/app/views/dashboard/_activities.html.haml @@ -5,4 +5,5 @@ %i.fa.fa-rss .content_list -= spinner +.loading + .spinner.spinner-md diff --git a/app/views/projects/snippets/edit.html.haml b/app/views/projects/snippets/edit.html.haml index 6dbd67df886..9f5af1cfe1e 100644 --- a/app/views/projects/snippets/edit.html.haml +++ b/app/views/projects/snippets/edit.html.haml @@ -1,6 +1,7 @@ - add_to_breadcrumbs _("Snippets"), project_snippets_path(@project) - breadcrumb_title @snippet.to_reference - page_title _("Edit"), "#{@snippet.title} (#{@snippet.to_reference})", _("Snippets") +- @content_class = "limit-container-width" unless fluid_layout %h3.page-title = _("Edit Snippet") diff --git a/app/views/projects/snippets/new.html.haml b/app/views/projects/snippets/new.html.haml index d64e3a49a81..d55a1160d48 100644 --- a/app/views/projects/snippets/new.html.haml +++ b/app/views/projects/snippets/new.html.haml @@ -1,6 +1,7 @@ - add_to_breadcrumbs _("Snippets"), project_snippets_path(@project) - breadcrumb_title _("New") - page_title _("New Snippet") +- @content_class = "limit-container-width" unless fluid_layout %h3.page-title = _("New Snippet") diff --git a/app/views/shared/snippets/_form.html.haml b/app/views/shared/snippets/_form.html.haml index 73401029da4..f867fb2b6f7 100644 --- a/app/views/shared/snippets/_form.html.haml +++ b/app/views/shared/snippets/_form.html.haml @@ -6,27 +6,37 @@ html: { class: "snippet-form js-requires-input js-quick-submit common-note-form" } do |f| = form_errors(@snippet) - .form-group.row - .col-sm-2.col-form-label - = f.label :title - .col-sm-10 - = f.text_field :title, class: 'form-control qa-snippet-title', required: true, autofocus: true - - = render 'shared/form_elements/description', model: @snippet, project: @project, form: f - - = render 'shared/old_visibility_level', f: f, visibility_level: @snippet.visibility_level, can_change_visibility_level: true, form_model: @snippet, with_label: false - - .file-editor - .form-group.row - .col-sm-2.col-form-label - = f.label :file_name, "File" - .col-sm-10 - .file-holder.snippet - .js-file-title.file-title-flex-parent - = f.text_field :file_name, placeholder: "Optionally name this file to add code highlighting, e.g. example.rb for Ruby.", class: 'form-control snippet-file-name qa-snippet-file-name' - .file-content.code - %pre#editor= @snippet.content - = f.hidden_field :content, class: 'snippet-file-content' + .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 + .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 + = 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 snippet-file-name qa-snippet-file-name' + .file-content.code + %pre#editor= @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}" diff --git a/app/views/snippets/edit.html.haml b/app/views/snippets/edit.html.haml index f5ffb037152..66f5e8148e1 100644 --- a/app/views/snippets/edit.html.haml +++ b/app/views/snippets/edit.html.haml @@ -1,4 +1,5 @@ - page_title _("Edit"), "#{@snippet.title} (#{@snippet.to_reference})", _("Snippets") +- @content_class = "limit-container-width" unless fluid_layout %h3.page-title = _("Edit Snippet") diff --git a/app/views/snippets/new.html.haml b/app/views/snippets/new.html.haml index 9d462865471..acc0ce0fff3 100644 --- a/app/views/snippets/new.html.haml +++ b/app/views/snippets/new.html.haml @@ -1,6 +1,7 @@ - @hide_top_links = true - @hide_breadcrumbs = true - page_title _("New Snippet") +- @content_class = "limit-container-width" unless fluid_layout .page-title-holder.d-flex.align-items-center %h1.page-title= _('New Snippet') |