debian-mirror-gitlab/app/views/projects/blob/_editor.html.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
2.4 KiB
Text
Raw Normal View History

2017-08-17 22:00:37 +05:30
- action = current_action?(:edit) || current_action?(:update) ? 'edit' : 'create'
2019-02-15 15:39:39 +05:30
- file_name = params[:id].split("/").last ||= ""
- is_markdown = Gitlab::MarkupHelper.gitlab_markdown?(file_name)
2017-08-17 22:00:37 +05:30
2020-07-28 23:09:34 +05:30
.file-holder-bottom-radius.file-holder.file.gl-mb-3
2021-06-08 01:23:25 +05:30
.js-file-title.file-title.gl-display-flex.gl-align-items-center.clearfix{ data: { current_action: action } }
2020-07-28 23:09:34 +05:30
.editor-ref.block-truncated.has-tooltip{ title: ref }
2021-10-27 15:23:28 +05:30
= sprite_icon('branch', size: 12)
2015-04-26 12:48:37 +05:30
= ref
2018-11-20 20:47:30 +05:30
- if current_action?(:edit) || current_action?(:update)
2020-10-24 23:57:45 +05:30
%span.float-left.gl-mr-3
2019-12-21 20:55:43 +05:30
= text_field_tag 'file_path', (params[:file_path] || @path),
2021-03-11 19:13:27 +05:30
class: 'form-control gl-form-input new-file-path js-file-path-name-input'
2019-12-21 20:55:43 +05:30
= render 'template_selectors'
2015-04-26 12:48:37 +05:30
2015-12-23 02:04:40 +05:30
- if current_action?(:new) || current_action?(:create)
2020-10-24 23:57:45 +05:30
%span.float-left.gl-mr-3
2015-04-26 12:48:37 +05:30
\/
2023-01-13 00:05:48 +05:30
= text_field_tag 'file_name', params[:file_name], placeholder: "File name", data: { qa_selector: 'file_name_field' },
2021-03-11 19:13:27 +05:30
required: true, class: 'form-control gl-form-input new-file-name js-file-path-name-input', value: params[:file_name] || (should_suggest_gitlab_ci_yml? ? '.gitlab-ci.yml' : '')
2019-12-21 20:55:43 +05:30
= render 'template_selectors'
2020-04-08 14:13:33 +05:30
- if should_suggest_gitlab_ci_yml?
2021-01-03 14:25:43 +05:30
.js-suggest-gitlab-ci-yml{ data: { target: '#gitlab-ci-yml-selector',
2020-04-08 14:13:33 +05:30
track_label: 'suggest_gitlab_ci_yml',
2020-11-24 15:15:51 +05:30
merge_request_path: params[:mr_path],
2020-04-22 19:07:51 +05:30
dismiss_key: @project.id,
2020-04-08 14:13:33 +05:30
human_access: human_access } }
2015-12-23 02:04:40 +05:30
2021-06-08 01:23:25 +05:30
.file-buttons.gl-display-flex.gl-align-items-center.gl-justify-content-end
2019-02-15 15:39:39 +05:30
- if is_markdown
2023-03-04 22:38:38 +05:30
- unless Feature.enabled?(:source_editor_toolbar, current_user)
= render 'shared/blob/markdown_buttons', show_fullscreen_button: false, supports_file_upload: false
2022-11-25 23:54:43 +05:30
%span.soft-wrap-toggle
= render Pajamas::ButtonComponent.new(icon: 'soft-unwrap', button_options: { class: 'no-wrap' }) do
= _("No wrap")
= render Pajamas::ButtonComponent.new(icon: 'soft-wrap', button_options: { class: 'soft-wrap' }) do
= _("Soft wrap")
2015-04-26 12:48:37 +05:30
2016-09-29 09:46:39 +05:30
.file-editor.code
2022-07-16 23:28:13 +05:30
- if Feature.enabled?(:source_editor_toolbar, current_user)
#editor-toolbar
2023-01-13 00:05:48 +05:30
.js-edit-mode-pane#editor{ data: { 'editor-loading': true, qa_selector: 'source_editor_preview_container' } }<
2020-10-24 23:57:45 +05:30
%pre.editor-loading-content= params[:content] || local_assigns[:blob_data]
2015-04-26 12:48:37 +05:30
- if local_assigns[:path]
.js-edit-mode-pane#preview.hide
.center
2022-05-07 20:08:51 +05:30
= gl_loading_icon(size: 'lg')