summaryrefslogtreecommitdiff
path: root/app/views/projects/blob/_editor.html.haml
blob: ba3b3439e9ba4947d8c6fa56af04304c5386b812 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
.file-holder.file.append-bottom-default
  .file-title.clearfix
    .editor-ref
      = icon('code-fork')
      = ref
    %span.editor-file-name
      - if current_action?(:edit) || current_action?(:update)
        = text_field_tag 'file_name', (params[:file_name] || @file_path),
                                      class: 'form-control new-file-name'

    - if current_action?(:new) || current_action?(:create)
      %span.editor-file-name
        \/
      = text_field_tag 'file_name', params[:file_name], placeholder: "File name",
        required: true, class: 'form-control new-file-name'

    .pull-right
      .license-selector.js-license-selector-wrap.hidden
        = dropdown_tag("Choose a License template", options: { toggle_class: 'js-license-selector', title: "Choose a license", filter: true, placeholder: "Filter", data: { data: licenses_for_select, project: @project.name, fullname: @project.namespace.human_name } } )
      .gitignore-selector.js-gitignore-selector-wrap.hidden
        = dropdown_tag("Choose a .gitignore template", options: { toggle_class: 'js-gitignore-selector', title: "Choose a template", filter: true, placeholder: "Filter", data: { data: gitignore_names } } )
      .gitlab-ci-yml-selector.js-gitlab-ci-yml-selector-wrap.hidden
        = dropdown_tag("Choose a GitLab CI Yaml template", options: { toggle_class: 'js-gitlab-ci-yml-selector', title: "Choose a template", filter: true, placeholder: "Filter", data: { data: gitlab_ci_ymls } } )
      .encoding-selector
        = select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'select2'

  .file-content.code
    %pre.js-edit-mode-pane#editor #{params[:content] || local_assigns[:blob_data]}
    - if local_assigns[:path]
      .js-edit-mode-pane#preview.hide
        .center
          %h2
            %i.icon-spinner.icon-spin