gitlab-org--gitlab-foss/app/views/projects/blob/_editor.html.haml

37 lines
1.4 KiB
Plaintext
Raw Normal View History

- action = current_action?(:edit) || current_action?(:update) ? 'edit' : 'create'
.file-holder-bottom-radius.file-holder.file.append-bottom-default
.js-file-title.file-title.clearfix{ data: { current_action: action } }
2015-01-27 04:57:42 +00:00
.editor-ref
= sprite_icon('fork')
2015-01-27 04:57:42 +00:00
= ref
%span.editor-file-name
2016-07-06 17:51:02 +00:00
- if current_action?(:edit) || current_action?(:update)
2016-07-13 10:19:14 +00:00
= text_field_tag 'file_path', (params[:file_path] || @path),
class: 'form-control new-file-path js-file-path-name-input'
2015-01-27 04:57:42 +00:00
- if current_action?(:new) || current_action?(:create)
%span.editor-file-name
2015-01-27 04:57:42 +00:00
\/
= text_field_tag 'file_name', params[:file_name], placeholder: "File name",
required: true, class: 'form-control new-file-name js-file-path-name-input'
2016-11-02 18:34:17 +00:00
.pull-right.file-buttons
= button_tag class: 'soft-wrap-toggle btn', type: 'button', tabindex: '-1' do
2016-09-27 21:08:05 +00:00
%span.no-wrap
= custom_icon('icon_no_wrap')
No wrap
%span.soft-wrap
= custom_icon('icon_soft_wrap')
Soft wrap
.encoding-selector
= select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'select2', tabindex: '-1'
2015-01-27 04:57:42 +00:00
2016-07-05 12:52:20 +00:00
.file-editor.code
%pre.js-edit-mode-pane#editor= params[:content] || local_assigns[:blob_data]
2015-01-27 04:57:42 +00:00
- if local_assigns[:path]
.js-edit-mode-pane#preview.hide
.center
%h2
%i.icon-spinner.icon-spin