2017-04-03 13:54:40 -04:00
|
|
|
- action = current_action?(:edit) || current_action?(:update) ? 'edit' : 'create'
|
|
|
|
|
2017-10-16 13:53:12 -04:00
|
|
|
.file-holder-bottom-radius.file-holder.file.append-bottom-default
|
2017-04-03 13:54:40 -04:00
|
|
|
.js-file-title.file-title.clearfix{ data: { current_action: action } }
|
2018-08-03 13:51:54 -04:00
|
|
|
.editor-ref.block-truncated
|
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)
|
2018-11-20 13:47:38 -05:00
|
|
|
%span.pull-left.append-right-10
|
2016-07-13 06:19:14 -04:00
|
|
|
= text_field_tag 'file_path', (params[:file_path] || @path),
|
2017-04-03 13:54:40 -04:00
|
|
|
class: 'form-control new-file-path js-file-path-name-input'
|
2015-01-26 23:57:42 -05:00
|
|
|
|
2015-12-02 08:47:19 -05:00
|
|
|
- if current_action?(:new) || current_action?(:create)
|
2018-11-20 13:47:38 -05:00
|
|
|
%span.pull-left.append-right-10
|
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",
|
2017-04-03 13:54:40 -04:00
|
|
|
required: true, class: 'form-control new-file-name js-file-path-name-input'
|
2015-12-02 08:47:19 -05:00
|
|
|
|
2018-08-09 18:17:13 -04:00
|
|
|
.file-buttons
|
2017-04-03 13:54:40 -04:00
|
|
|
= button_tag class: 'soft-wrap-toggle btn', 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
|
2017-01-13 11:07:21 -05:00
|
|
|
%pre.js-edit-mode-pane#editor= 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
|