From 073c3d15c71a0f877b62c7d3d7417a9721da1dba Mon Sep 17 00:00:00 2001 From: Anton Davydov Date: Tue, 1 Mar 2016 15:36:50 +0300 Subject: Initial implementation if license template selector and /licenses/:key API endpoint --- app/views/projects/blob/_editor.html.haml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'app/views/projects/blob') diff --git a/app/views/projects/blob/_editor.html.haml b/app/views/projects/blob/_editor.html.haml index f8b6fa253c4..8ebbc91f81d 100644 --- a/app/views/projects/blob/_editor.html.haml +++ b/app/views/projects/blob/_editor.html.haml @@ -13,7 +13,11 @@ required: true, class: 'form-control new-file-name' .pull-right - = select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'select2' + .license-selector.js-license-selector.hide + = select_tag :license_type, grouped_options_for_select(@licenses, @current_license_key), include_blank: true, class: 'select2 license-select', data: { fullname: @repository.project.creator.name } + + .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]} @@ -22,3 +26,8 @@ .center %h2 %i.icon-spinner.icon-spin + +:javascript + window.onload = function() { + new BlobLicenseSelector(blob.editor) + } -- cgit v1.2.1