2017-04-03 13:54:40 -04:00
|
|
|
- action = current_action?(:edit) || current_action?(:update) ? 'edit' : 'create'
|
2018-12-14 12:56:25 -05:00
|
|
|
- file_name = params[:id].split("/").last ||= ""
|
|
|
|
- is_markdown = Gitlab::MarkupHelper.gitlab_markdown?(file_name)
|
2017-04-03 13:54:40 -04:00
|
|
|
|
2020-06-22 11:09:27 -04:00
|
|
|
.file-holder-bottom-radius.file-holder.file.gl-mb-3
|
2019-10-10 05:06:08 -04:00
|
|
|
.js-file-title.file-title.align-items-center.clearfix{ data: { current_action: action } }
|
2020-07-09 11:08:59 -04:00
|
|
|
.editor-ref.block-truncated.has-tooltip{ title: ref }
|
2017-12-01 14:30:49 -05:00
|
|
|
= sprite_icon('fork', size: 12)
|
2015-01-26 23:57:42 -05:00
|
|
|
= ref
|
2018-08-09 18:17:13 -04:00
|
|
|
- if current_action?(:edit) || current_action?(:update)
|
2020-07-29 08:09:45 -04:00
|
|
|
%span.float-left.gl-mr-3
|
2019-10-10 05:06:08 -04:00
|
|
|
= text_field_tag 'file_path', (params[:file_path] || @path),
|
|
|
|
class: 'form-control new-file-path js-file-path-name-input'
|
|
|
|
= render 'template_selectors'
|
2015-01-26 23:57:42 -05:00
|
|
|
|
2015-12-02 08:47:19 -05:00
|
|
|
- if current_action?(:new) || current_action?(:create)
|
2020-07-29 08:09:45 -04:00
|
|
|
%span.float-left.gl-mr-3
|
2015-01-26 23:57:42 -05:00
|
|
|
\/
|
2015-12-02 08:47:19 -05:00
|
|
|
= text_field_tag 'file_name', params[:file_name], placeholder: "File name",
|
2020-03-04 04:08:20 -05:00
|
|
|
required: true, class: 'form-control new-file-name js-file-path-name-input', value: params[:file_name] || (should_suggest_gitlab_ci_yml? ? '.gitlab-ci.yml' : '')
|
2019-10-10 05:06:08 -04:00
|
|
|
= render 'template_selectors'
|
2020-03-04 04:08:20 -05:00
|
|
|
- if should_suggest_gitlab_ci_yml?
|
2020-10-15 11:08:45 -04:00
|
|
|
.js-suggest-gitlab-ci-yml{ data: { target: '#gitlab-ci-yml-selector',
|
2020-03-09 14:07:59 -04:00
|
|
|
track_label: 'suggest_gitlab_ci_yml',
|
2020-08-26 14:11:43 -04:00
|
|
|
merge_request_path: params[:mr_path],
|
2020-03-25 05:08:11 -04:00
|
|
|
dismiss_key: @project.id,
|
2020-03-12 17:09:45 -04:00
|
|
|
human_access: human_access } }
|
2015-12-02 08:47:19 -05:00
|
|
|
|
2018-08-09 18:17:13 -04:00
|
|
|
.file-buttons
|
2018-12-14 12:56:25 -05:00
|
|
|
- if is_markdown
|
2020-06-11 11:08:36 -04:00
|
|
|
= render 'shared/blob/markdown_buttons', show_fullscreen_button: false
|
2020-09-22 14:09:54 -04:00
|
|
|
= button_tag class: 'soft-wrap-toggle btn gl-button', type: 'button', tabindex: '-1' do
|
2016-09-27 17:08:05 -04:00
|
|
|
%span.no-wrap
|
|
|
|
= custom_icon('icon_no_wrap')
|
|
|
|
No wrap
|
|
|
|
%span.soft-wrap
|
|
|
|
= custom_icon('icon_soft_wrap')
|
|
|
|
Soft wrap
|
2016-03-01 07:36:50 -05:00
|
|
|
.encoding-selector
|
2017-04-03 13:54:40 -04:00
|
|
|
= select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'select2', tabindex: '-1'
|
2015-01-26 23:57:42 -05:00
|
|
|
|
2016-07-05 08:52:20 -04:00
|
|
|
.file-editor.code
|
2020-07-31 17:10:12 -04:00
|
|
|
.js-edit-mode-pane.qa-editor#editor{ data: { 'editor-loading': true } }<
|
|
|
|
%pre.editor-loading-content= params[:content] || local_assigns[:blob_data]
|
2015-01-26 23:57:42 -05:00
|
|
|
- if local_assigns[:path]
|
2018-04-23 15:30:22 -04:00
|
|
|
.js-edit-mode-pane#preview.hide
|
2015-01-26 23:57:42 -05:00
|
|
|
.center
|
|
|
|
%h2
|
|
|
|
%i.icon-spinner.icon-spin
|