diff options
Diffstat (limited to 'app/views/shared/snippets')
-rw-r--r-- | app/views/shared/snippets/_blob.html.haml | 14 | ||||
-rw-r--r-- | app/views/shared/snippets/_form.html.haml | 41 | ||||
-rw-r--r-- | app/views/shared/snippets/_visibility_level.html.haml | 27 |
3 files changed, 0 insertions, 82 deletions
diff --git a/app/views/shared/snippets/_blob.html.haml b/app/views/shared/snippets/_blob.html.haml deleted file mode 100644 index 30458793fd1..00000000000 --- a/app/views/shared/snippets/_blob.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -- unless @snippet.content.empty? - - if gitlab_markdown?(@snippet.file_name) - .file-content.wiki - = preserve do - = markdown(@snippet.data) - - elsif markup?(@snippet.file_name) - .file-content.wiki - = render_markup(@snippet.file_name, @snippet.data) - - else - .file-content.code - = render 'shared/file_highlight', blob: @snippet -- else - .file-content.code - .nothing-here-block Empty file diff --git a/app/views/shared/snippets/_form.html.haml b/app/views/shared/snippets/_form.html.haml deleted file mode 100644 index 4e0663ea208..00000000000 --- a/app/views/shared/snippets/_form.html.haml +++ /dev/null @@ -1,41 +0,0 @@ -.snippet-form-holder - = form_for @snippet, url: url, html: { class: "form-horizontal snippet-form" } do |f| - - if @snippet.errors.any? - .alert.alert-danger - %ul - - @snippet.errors.full_messages.each do |msg| - %li= msg - - .form-group - = f.label :title, class: 'control-label' - .col-sm-10= f.text_field :title, placeholder: "Example Snippet", class: 'form-control', required: true - - = render "shared/snippets/visibility_level", f: f, visibility_level: gitlab_config.default_projects_features.visibility_level, can_change_visibility_level: true - - .form-group - .file-editor - = f.label :file_name, "File", class: 'control-label' - .col-sm-10 - .file-holder.snippet - .file-title - = f.text_field :file_name, placeholder: "example.rb", class: 'form-control snippet-file-name', required: true - .file-content.code - %pre#editor= @snippet.content - = f.hidden_field :content, class: 'snippet-file-content' - - .form-actions - - if @snippet.new_record? - = f.submit 'Create snippet', class: "btn-create btn" - - else - = f.submit 'Save', class: "btn-save btn" - - - if @snippet.respond_to?(:project) - = link_to "Cancel", namespace_project_snippets_path(@project.namespace, @project), class: "btn btn-cancel" - - else - = link_to "Cancel", snippets_path(@project), class: "btn btn-cancel" - -:javascript - var editor = ace.edit("editor"); - $(".snippet-form-holder form").submit(function(){ - $(".snippet-file-content").val(editor.getValue()); - }); diff --git a/app/views/shared/snippets/_visibility_level.html.haml b/app/views/shared/snippets/_visibility_level.html.haml deleted file mode 100644 index 9acff18e450..00000000000 --- a/app/views/shared/snippets/_visibility_level.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -.form-group.project-visibility-level-holder - = f.label :visibility_level, class: 'control-label' do - Visibility Level - = link_to "(?)", help_page_path("public_access", "public_access") - .col-sm-10 - - if can_change_visibility_level - - Gitlab::VisibilityLevel.values.each do |level| - .radio - - restricted = restricted_visibility_levels.include?(level) - = f.radio_button :visibility_level, level, disabled: restricted - = label "#{dom_class(@snippet)}_visibility_level", level do - = visibility_level_icon(level) - .option-title - = visibility_level_label(level) - .option-descr - = snippet_visibility_level_description(level) - - unless restricted_visibility_levels.empty? - .col-sm-10 - %span.info - Some visibility level settings have been restricted by the administrator. - - else - .col-sm-10 - %span.info - = visibility_level_icon(visibility_level) - %strong - = visibility_level_label(visibility_level) - .light= visibility_level_description(visibility_level) |