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

43 lines
1.7 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
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",
2017-08-17 22:00:37 +05:30
required: true, class: 'form-control new-file-name js-file-path-name-input'
2019-12-21 20:55:43 +05:30
= render 'template_selectors'
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
= render 'projects/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