summaryrefslogtreecommitdiff
path: root/app/views/profiles/personal_access_tokens/index.html.haml
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-04-25 14:30:59 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-04-28 22:28:36 +0530
commitbafbf22c6ab613d25287d7119d7e30770c531fdb (patch)
treeecca5245e02a992e4fbbc029102d5d717b32aee8 /app/views/profiles/personal_access_tokens/index.html.haml
parentfe5eca8b38e28ad3c77d3d71297cca110306cab9 (diff)
downloadgitlab-ce-bafbf22c6ab613d25287d7119d7e30770c531fdb.tar.gz
Address @DouweM's feedback on !3749.
- Use `TokenAuthenticatable` to generate the personal access token - Remove a check for `authenticity_token` in application controller; this should've been `authentication_token`, maybe, and doesn't make any sense now. - Have the datepicker appear inline
Diffstat (limited to 'app/views/profiles/personal_access_tokens/index.html.haml')
-rw-r--r--app/views/profiles/personal_access_tokens/index.html.haml18
1 files changed, 4 insertions, 14 deletions
diff --git a/app/views/profiles/personal_access_tokens/index.html.haml b/app/views/profiles/personal_access_tokens/index.html.haml
index 02800c37917..f7482d2c87d 100644
--- a/app/views/profiles/personal_access_tokens/index.html.haml
+++ b/app/views/profiles/personal_access_tokens/index.html.haml
@@ -21,7 +21,8 @@
.form-group
= f.label :expires_at, class: 'label-light'
- = f.text_field :expires_at, class: "form-control datepicker", required: false
+ = f.hidden_field :expires_at, class: "form-control", required: false
+ .datepicker
.prepend-top-default
= f.submit 'Add Personal Access Token', class: "btn btn-create"
@@ -90,16 +91,5 @@
:javascript
$(".datepicker").datepicker({
dateFormat: "yy-mm-dd",
- beforeShow: function() {
- ////////////////////////////////////////////////////////////////
- // 1. Need the setTimeout because the datepicker doesn't have //
- // an `afterShow` callback. //
- // 2. Need to set the z-index like this because we don't want //
- // to target datepickers outside the current page, which //
- // will happen if we set this in CSS directly. //
- ////////////////////////////////////////////////////////////////
- setTimeout(function(){
- $('.ui-datepicker').css('z-index', 3);
- }, 0);
- }
- });
+ onSelect: function(dateText, inst) { $("#personal_access_token_params_expires_at").val(dateText) }
+ }).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#personal_access_token_params_expires_at').val()));