diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-02-23 20:47:06 +0300 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-03-01 01:15:40 +0300 |
commit | 9f2e4742e354f5548b4956060f1bfa5ee3bd6657 (patch) | |
tree | 45067268ebbcfb48d51c627ef13c2820cad2ad1f /app/views/shared/_personal_access_tokens_form.html.haml | |
parent | f0ea7130f7bf0e7a3702d863b4d246f524b6c14a (diff) |
applies relevant changes to the code and code structure
Diffstat (limited to 'app/views/shared/_personal_access_tokens_form.html.haml')
-rw-r--r-- | app/views/shared/_personal_access_tokens_form.html.haml | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app/views/shared/_personal_access_tokens_form.html.haml b/app/views/shared/_personal_access_tokens_form.html.haml new file mode 100644 index 00000000000..546e90a1d62 --- /dev/null +++ b/app/views/shared/_personal_access_tokens_form.html.haml @@ -0,0 +1,37 @@ +- impersonation = impersonation || false +- personal_access_token = local_assigns.fetch(:personal_access_token) +- scopes = local_assigns.fetch(:scopes) + += form_for personal_access_token, url: path, method: :post, html: { class: 'js-requires-input' } do |f| + + = form_errors(personal_access_token) + + .form-group + = f.label :name, class: 'label-light' + = f.text_field :name, class: "form-control", required: true + + .form-group + = f.label :expires_at, class: 'label-light' + = f.text_field :expires_at, class: "datepicker form-control" + + .form-group + = f.label :scopes, class: 'label-light' + = render 'shared/tokens/scopes_form', prefix: 'personal_access_token', token: personal_access_token, scopes: scopes + + .prepend-top-default + - type = impersonation ? "Impersonation" : "Personal Access" + = f.submit "Create #{type} Token", class: "btn btn-create" + +:javascript + var $dateField = $('.datepicker'); + var date = $dateField.val(); + + new Pikaday({ + field: $dateField.get(0), + theme: 'gitlab-theme', + format: 'YYYY-MM-DD', + minDate: new Date(), + onSelect: function(dateText) { + $dateField.val(dateFormat(new Date(dateText), 'yyyy-mm-dd')); + } + }); |