From 983a0bba5d2a042c4a3bbb22432ec192c7501d82 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 20 Apr 2020 18:38:24 +0000 Subject: Add latest changes from gitlab-org/gitlab@12-10-stable-ee --- app/views/admin/runners/show.html.haml | 2 +- app/views/ci/variables/_index.html.haml | 2 +- app/views/layouts/_page.html.haml | 3 +- .../header/_current_user_dropdown.html.haml | 2 +- app/views/notify/issues_csv_email.html.haml | 9 ++ app/views/notify/issues_csv_email.text.erb | 5 + app/views/projects/_flash_messages.html.haml | 2 + app/views/projects/_home_panel.html.haml | 1 + app/views/projects/commits/_commits.html.haml | 9 +- app/views/projects/cycle_analytics/show.html.haml | 40 ++++---- app/views/projects/import/jira/show.html.haml | 7 +- app/views/projects/issues/_nav_btns.html.haml | 4 +- .../projects/issues/export_csv/_button.html.haml | 4 + .../projects/issues/export_csv/_modal.html.haml | 22 ++++ app/views/projects/services/_form.html.haml | 9 +- .../projects/services/prometheus/_help.html.haml | 6 +- .../settings/operations/_prometheus.html.haml | 6 +- app/views/shared/projects/_project.html.haml | 4 + app/views/shared/runners/_form.html.haml | 11 ++ app/views/shared/snippets/_form.html.haml | 112 +++++++++++---------- 20 files changed, 163 insertions(+), 97 deletions(-) create mode 100644 app/views/notify/issues_csv_email.html.haml create mode 100644 app/views/notify/issues_csv_email.text.erb create mode 100644 app/views/projects/issues/export_csv/_button.html.haml create mode 100644 app/views/projects/issues/export_csv/_modal.html.haml (limited to 'app/views') diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml index f860b7a61a2..0120d4038b9 100644 --- a/app/views/admin/runners/show.html.haml +++ b/app/views/admin/runners/show.html.haml @@ -28,7 +28,7 @@ %hr .append-bottom-20 - = render 'shared/runners/form', runner: @runner, runner_form_url: admin_runner_path(@runner) + = render 'shared/runners/form', runner: @runner, runner_form_url: admin_runner_path(@runner), in_gitlab_com_admin_context: Gitlab.com? .row .col-md-6 diff --git a/app/views/ci/variables/_index.html.haml b/app/views/ci/variables/_index.html.haml index 3fa957f38a0..4d8df4cc12a 100644 --- a/app/views/ci/variables/_index.html.haml +++ b/app/views/ci/variables/_index.html.haml @@ -5,7 +5,7 @@ - link_start = ''.html_safe % { url: help_page_path('ci/variables/README', anchor: 'protected-variables') } = s_('Environment variables are configured by your administrator to be %{link_start}protected%{link_end} by default').html_safe % { link_start: link_start, link_end: ''.html_safe } -- if Feature.enabled?(:new_variables_ui, @project || @group) +- if Feature.enabled?(:new_variables_ui, @project || @group, default_enabled: true) - is_group = !@group.nil? #js-ci-project-variables{ data: { endpoint: save_endpoint, project_id: @project&.id || '', group: is_group.to_s, maskable_regex: ci_variable_maskable_regex} } diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index 06e3bca99a1..80a14412968 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -5,7 +5,8 @@ .mobile-overlay .alert-wrapper = render 'shared/outdated_browser' - = render_if_exists "layouts/header/ee_license_banner" + - if Feature.enabled?(:subscribable_banner_license) + = render_if_exists "layouts/header/ee_subscribable_banner" = render "layouts/broadcast" = render "layouts/header/read_only_banner" = render "layouts/nav/classification_level_banner" diff --git a/app/views/layouts/header/_current_user_dropdown.html.haml b/app/views/layouts/header/_current_user_dropdown.html.haml index c6299f244ec..410b120396d 100644 --- a/app/views/layouts/header/_current_user_dropdown.html.haml +++ b/app/views/layouts/header/_current_user_dropdown.html.haml @@ -26,7 +26,7 @@ - if current_user_menu?(:settings) %li = link_to s_("CurrentUser|Settings"), profile_path, data: { qa_selector: 'settings_link' } - = render_if_exists 'layouts/header/buy_ci_minutes' + = render_if_exists 'layouts/header/buy_ci_minutes', project: @project, namespace: @group - if current_user_menu?(:help) %li.divider.d-md-none diff --git a/app/views/notify/issues_csv_email.html.haml b/app/views/notify/issues_csv_email.html.haml new file mode 100644 index 00000000000..b777ca1e57d --- /dev/null +++ b/app/views/notify/issues_csv_email.html.haml @@ -0,0 +1,9 @@ +-# haml-lint:disable NoPlainNodes +%p{ style: 'font-size:18px; text-align:center; line-height:30px;' } + Your CSV export of #{ pluralize(@written_count, 'issue') } from project + %a{ href: project_url(@project), style: "color:#3777b0; text-decoration:none; display:block;" } + = @project.full_name + has been added to this email as an attachment. + - if @truncated + %p + This attachment has been truncated to avoid exceeding a maximum allowed attachment size of 15MB. #{ @written_count } of #{ @issues_count } issues have been included. Consider re-exporting with a narrower selection of issues. diff --git a/app/views/notify/issues_csv_email.text.erb b/app/views/notify/issues_csv_email.text.erb new file mode 100644 index 00000000000..5d4128e3ae9 --- /dev/null +++ b/app/views/notify/issues_csv_email.text.erb @@ -0,0 +1,5 @@ +Your CSV export of <%= pluralize(@written_count, 'issue') %> from project <%= @project.full_name %> (<%= project_url(@project) %>) has been added to this email as an attachment. + +<% if @truncated %> +This attachment has been truncated to avoid exceeding a maximum allowed attachment size of 15MB. <%= @written_count %> of <%= @issues_count %> issues have been included. Consider re-exporting with a narrower selection of issues. +<% end %> diff --git a/app/views/projects/_flash_messages.html.haml b/app/views/projects/_flash_messages.html.haml index f9222387e97..8217608db4e 100644 --- a/app/views/projects/_flash_messages.html.haml +++ b/app/views/projects/_flash_messages.html.haml @@ -8,4 +8,6 @@ - unless project.empty_repo? = render 'shared/auto_devops_implicitly_enabled_banner', project: project = render_if_exists 'projects/above_size_limit_warning', project: project + - if Feature.enabled?(:subscribable_banner_subscription) + = render_if_exists "layouts/header/ee_subscribable_banner", subscription: true = render_if_exists 'shared/shared_runners_minutes_limit', project: project, classes: [container_class, ("limit-container-width" unless fluid_layout)] diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index d9887cb470a..be58ecb3572 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -14,6 +14,7 @@ = @project.name %span.visibility-icon.text-secondary.prepend-left-4.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@project) } = visibility_level_icon(@project.visibility_level, fw: false, options: {class: 'icon'}) + = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: @project .home-panel-metadata.d-flex.flex-wrap.text-secondary - if can?(current_user, :read_project, @project) %span.text-secondary diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml index ec05ff50f25..2e5953bf0a6 100644 --- a/app/views/projects/commits/_commits.html.haml +++ b/app/views/projects/commits/_commits.html.haml @@ -4,11 +4,12 @@ - commits = @commits - hidden = @hidden_commit_count +- commits_count = @commits.size - commits.chunk { |c| c.committed_date.in_time_zone.to_date }.each do |day, commits| %li.commit-header.js-commit-header{ data: { day: day } } %span.day= l(day, format: '%d %b, %Y') - %span.commits-count= n_("%d commit", "%d commits", commits.count) % commits.count + %span.commits-count= n_("%d commit", "%d commits", commits_count) % commits_count %li.commits-row{ data: { day: day } } %ul.content-list.commit-list.flex-list @@ -17,3 +18,9 @@ - if hidden > 0 %li.alert.alert-warning = n_('%s additional commit has been omitted to prevent performance issues.', '%s additional commits have been omitted to prevent performance issues.', hidden) % number_with_delimiter(hidden) + +- if commits_count == 0 + .mt-4.text-center + .bold + = _('Your search didn\'t match any commits.') + = _('Try changing or removing filters.') diff --git a/app/views/projects/cycle_analytics/show.html.haml b/app/views/projects/cycle_analytics/show.html.haml index b0d9dfb0d37..da20fee227a 100644 --- a/app/views/projects/cycle_analytics/show.html.haml +++ b/app/views/projects/cycle_analytics/show.html.haml @@ -10,27 +10,25 @@ .card .card-header {{ __('Recent Project Activity') }} - .content-block - .container-fluid - .row - .col-12.column{ "v-for" => "item in state.summary", ":class" => "summaryTableColumnClass" } - %h3.header {{ item.value }} - %p.text {{ item.title }} - .col-12.column{ ":class" => "summaryTableColumnClass" } - .dropdown.inline.js-ca-dropdown - %button.dropdown-menu-toggle{ "data-toggle" => "dropdown", :type => "button" } - %span.dropdown-label {{ n__('Last %d day', 'Last %d days', 30) }} - %i.fa.fa-chevron-down - %ul.dropdown-menu.dropdown-menu-right - %li - %a{ "href" => "#", "data-value" => "7" } - {{ n__('Last %d day', 'Last %d days', 7) }} - %li - %a{ "href" => "#", "data-value" => "30" } - {{ n__('Last %d day', 'Last %d days', 30) }} - %li - %a{ "href" => "#", "data-value" => "90" } - {{ n__('Last %d day', 'Last %d days', 90) }} + .d-flex.justify-content-between + .flex-grow.text-center{ "v-for" => "item in state.summary" } + %h3.header {{ item.value }} + %p.text {{ item.title }} + .flex-grow.align-self-center.text-center + .dropdown.inline.js-ca-dropdown + %button.dropdown-menu-toggle{ "data-toggle" => "dropdown", :type => "button" } + %span.dropdown-label {{ n__('Last %d day', 'Last %d days', 30) }} + %i.fa.fa-chevron-down + %ul.dropdown-menu.dropdown-menu-right + %li + %a{ "href" => "#", "data-value" => "7" } + {{ n__('Last %d day', 'Last %d days', 7) }} + %li + %a{ "href" => "#", "data-value" => "30" } + {{ n__('Last %d day', 'Last %d days', 30) }} + %li + %a{ "href" => "#", "data-value" => "90" } + {{ n__('Last %d day', 'Last %d days', 90) }} .stage-panel-container .card.stage-panel .card-header.border-bottom-0 diff --git a/app/views/projects/import/jira/show.html.haml b/app/views/projects/import/jira/show.html.haml index 6003f33f0ba..4106bcc2e5a 100644 --- a/app/views/projects/import/jira/show.html.haml +++ b/app/views/projects/import/jira/show.html.haml @@ -1,6 +1,9 @@ -- if Feature.enabled?(:jira_issue_import_vue, @project) +- if Feature.enabled?(:jira_issue_import_vue, @project, default_enabled: true) .js-jira-import-root{ data: { project_path: @project.full_path, - is_jira_configured: @is_jira_configured.to_s, + issues_path: project_issues_path(@project), + is_jira_configured: @project.jira_service.present?.to_s, + jira_projects: @jira_projects.to_json, + in_progress_illustration: image_path('illustrations/export-import.svg'), setup_illustration: image_path('illustrations/manual_action.svg') } } - else - title = _('Jira Issue Import') diff --git a/app/views/projects/issues/_nav_btns.html.haml b/app/views/projects/issues/_nav_btns.html.haml index c347b8d2c9c..71c9bb36936 100644 --- a/app/views/projects/issues/_nav_btns.html.haml +++ b/app/views/projects/issues/_nav_btns.html.haml @@ -8,7 +8,7 @@ .btn-group - if show_export_button - = render_if_exists 'projects/issues/export_csv/button' + = render 'projects/issues/export_csv/button' - if show_import_button = render 'projects/issues/import_csv/button' @@ -23,7 +23,7 @@ id: "new_issue_link" - if show_export_button - = render_if_exists 'projects/issues/export_csv/modal' + = render 'projects/issues/export_csv/modal' - if show_import_button = render 'projects/issues/import_csv/modal' diff --git a/app/views/projects/issues/export_csv/_button.html.haml b/app/views/projects/issues/export_csv/_button.html.haml new file mode 100644 index 00000000000..ef3fb438641 --- /dev/null +++ b/app/views/projects/issues/export_csv/_button.html.haml @@ -0,0 +1,4 @@ +- if current_user + %button.csv_download_link.btn.has-tooltip{ title: _('Export as CSV'), + data: { toggle: 'modal', target: '.issues-export-modal', qa_selector: 'export_as_csv_button' } } + = sprite_icon('export') diff --git a/app/views/projects/issues/export_csv/_modal.html.haml b/app/views/projects/issues/export_csv/_modal.html.haml new file mode 100644 index 00000000000..af3a087ca59 --- /dev/null +++ b/app/views/projects/issues/export_csv/_modal.html.haml @@ -0,0 +1,22 @@ +-# haml-lint:disable NoPlainNodes +- if current_user + .issues-export-modal.modal + .modal-dialog + .modal-content{ data: { qa_selector: 'export_issues_modal' } } + .modal-header + %h3 + = _('Export issues') + .svg-content.import-export-svg-container + = image_tag 'illustrations/export-import.svg', alt: _('Import/Export illustration'), class: 'illustration' + %a.close{ href: '#', 'data-dismiss' => 'modal' } + = sprite_icon('close', size: 16, css_class: 'gl-icon') + .modal-body + .modal-subheader + = icon('check', { class: 'checkmark' }) + %strong.prepend-left-10 + - issues_count = issuables_count_for_state(:issues, params[:state]) + = n_('%d issue selected', '%d issues selected', issues_count) % issues_count + .modal-text + = _('The CSV export will be created in the background. Once finished, it will be sent to %{email} in an attachment.').html_safe % { email: @current_user.notification_email } + .modal-footer + = link_to _('Export issues'), export_csv_project_issues_path(@project, request.query_parameters), method: :post, class: 'btn btn-success float-left', title: _('Export issues'), data: { track_label: "export_issues_csv", track_event: "click_button", track_value: "", qa_selector: "export_issues_button" } diff --git a/app/views/projects/services/_form.html.haml b/app/views/projects/services/_form.html.haml index bd9defe5f74..0dbd6a48ec5 100644 --- a/app/views/projects/services/_form.html.haml +++ b/app/views/projects/services/_form.html.haml @@ -12,11 +12,10 @@ .col-lg-9 = form_for(@service, as: :service, url: scoped_integration_path(@service), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'can-test' => @service.can_test?, 'test-url' => test_project_service_path(@project, @service) } }) do |form| = render 'shared/service_settings', form: form, service: @service - - if @service.editable? - .footer-block.row-content-block - = service_save_button(@service) -   - = link_to _('Cancel'), project_settings_integrations_path(@project), class: 'btn btn-cancel' + .footer-block.row-content-block + = service_save_button(@service) +   + = link_to _('Cancel'), project_settings_integrations_path(@project), class: 'btn btn-cancel' - if lookup_context.template_exists?('show', "projects/services/#{@service.to_param}", true) %hr diff --git a/app/views/projects/services/prometheus/_help.html.haml b/app/views/projects/services/prometheus/_help.html.haml index 35d655e4b32..1b5b794a7aa 100644 --- a/app/views/projects/services/prometheus/_help.html.haml +++ b/app/views/projects/services/prometheus/_help.html.haml @@ -3,7 +3,5 @@ %h4.append-bottom-default = s_('PrometheusService|Manual configuration') - -- unless @service.editable? - .info-well - = s_('PrometheusService|To enable manual configuration, uninstall Prometheus from your clusters') +%p + = s_('PrometheusService|Select the Active checkbox to override the Auto Configuration with custom settings. If unchecked, Auto Configuration settings are used.') diff --git a/app/views/projects/settings/operations/_prometheus.html.haml b/app/views/projects/settings/operations/_prometheus.html.haml index 3d7a6b021a8..b0fa750e131 100644 --- a/app/views/projects/settings/operations/_prometheus.html.haml +++ b/app/views/projects/settings/operations/_prometheus.html.haml @@ -13,7 +13,5 @@ %b.append-bottom-default = s_('PrometheusService|Manual configuration') - - - unless service.editable? - .info-well - = s_('PrometheusService|To enable manual configuration, uninstall Prometheus from your clusters') + %p + = s_('PrometheusService|Select the Active checkbox to override the Auto Configuration with custom settings. If unchecked, Auto Configuration settings are used.') 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" -- cgit v1.2.3