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

50 lines
2.3 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
\/
2015-12-23 02:04:40 +05:30
= text_field_tag 'file_name', params[:file_name], placeholder: "File name",
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
2020-06-23 00:09:42 +05:30
= render 'shared/blob/markdown_buttons', show_fullscreen_button: false
2021-06-08 01:23:25 +05:30
= button_tag class: 'soft-wrap-toggle btn gl-button btn-default', type: 'button', tabindex: '-1' do
.no-wrap
= sprite_icon('soft-unwrap', css_class: 'gl-button-icon')
%span.gl-button-text
No wrap
.soft-wrap
= sprite_icon('soft-wrap', css_class: 'gl-button-icon')
%span.gl-button-text
Soft wrap
2015-04-26 12:48:37 +05:30
2016-09-29 09:46:39 +05:30
.file-editor.code
2020-10-24 23:57:45 +05:30
.js-edit-mode-pane.qa-editor#editor{ data: { 'editor-loading': true } }<
%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
%h2
%i.icon-spinner.icon-spin