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
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
.file-holder-bottom-radius.file-holder.file.append-bottom-default
|
2019-12-21 20:55:43 +05:30
|
|
|
.js-file-title.file-title.align-items-center.clearfix{ data: { current_action: action } }
|
2018-11-20 20:47:30 +05:30
|
|
|
.editor-ref.block-truncated
|
2018-03-17 18:26:18 +05:30
|
|
|
= sprite_icon('fork', 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)
|
2019-02-15 15:39:39 +05:30
|
|
|
%span.pull-left.append-right-10
|
2019-12-21 20:55:43 +05:30
|
|
|
= text_field_tag 'file_path', (params[:file_path] || @path),
|
|
|
|
class: 'form-control new-file-path js-file-path-name-input'
|
|
|
|
= 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)
|
2019-02-15 15:39:39 +05:30
|
|
|
%span.pull-left.append-right-10
|
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",
|
2020-04-08 14:13:33 +05:30
|
|
|
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-12-21 20:55:43 +05:30
|
|
|
= render 'template_selectors'
|
2020-04-08 14:13:33 +05:30
|
|
|
- if should_suggest_gitlab_ci_yml?
|
|
|
|
.js-suggest-gitlab-ci-yml{ data: { toggle: 'popover',
|
|
|
|
target: '#gitlab-ci-yml-selector',
|
|
|
|
track_label: 'suggest_gitlab_ci_yml',
|
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
|
|
|
|
2018-11-20 20:47:30 +05:30
|
|
|
.file-buttons
|
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
|
2017-08-17 22:00:37 +05:30
|
|
|
= button_tag class: 'soft-wrap-toggle btn', type: 'button', tabindex: '-1' do
|
2016-11-03 12:29:30 +05:30
|
|
|
%span.no-wrap
|
|
|
|
= custom_icon('icon_no_wrap')
|
|
|
|
No wrap
|
|
|
|
%span.soft-wrap
|
|
|
|
= custom_icon('icon_soft_wrap')
|
|
|
|
Soft wrap
|
2016-06-02 11:05:42 +05:30
|
|
|
.encoding-selector
|
2017-08-17 22:00:37 +05:30
|
|
|
= select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'select2', tabindex: '-1'
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2016-09-29 09:46:39 +05:30
|
|
|
.file-editor.code
|
2019-09-30 21:07:59 +05:30
|
|
|
%pre.js-edit-mode-pane.qa-editor#editor= 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
|