Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-08-18 16:12:48 +0300
committerSean McGivern <sean@gitlab.com>2016-08-18 16:14:22 +0300
commitdd4784f3b16218cadfa3f73dce2250d4276ffb1f (patch)
treebe35a0f37a75d445d5351f18957a615747d98e34 /app/views/shared/members
parentc90d167b5ec020138f7d72cb1006d1436c980a2a (diff)
Add MemberExpirationDate JS helper
This helper adds a datepicker to all `js-access-expiration-date` elements. If that element is a child of a `clearable-input` element and has a sibling `js-clear-input` element, then it will show a working clear button to the right of the input field.
Diffstat (limited to 'app/views/shared/members')
-rw-r--r--app/views/shared/members/_member.html.haml16
1 files changed, 11 insertions, 5 deletions
diff --git a/app/views/shared/members/_member.html.haml b/app/views/shared/members/_member.html.haml
index 7dde9442e24..c959c41b221 100644
--- a/app/views/shared/members/_member.html.haml
+++ b/app/views/shared/members/_member.html.haml
@@ -77,11 +77,17 @@
- if show_roles
.edit-member.hide.js-toggle-content
%br
- = form_for member, remote: true do |f|
- .prepend-top-10
- = f.select :access_level, options_for_select(member.class.access_level_roles, member.access_level), {}, class: 'form-control'
+ = form_for member, remote: true, html: { class: 'form-horizontal' } do |f|
+ .form-group
+ = label_tag :expires_at, 'Project access', class: 'control-label'
+ .col-sm-10
+ = f.select :access_level, options_for_select(member.class.access_level_roles, member.access_level), {}, class: 'form-control'
- if member.is_a?(ProjectMember)
- .prepend-top-10
- = f.text_field :expires_at, class: 'form-control js-access-expiration-date', placeholder: 'Access expiration date', id: "member_expires_at_#{member.id}"
+ .form-group
+ = label_tag :expires_at, 'Access expiration date', class: 'control-label'
+ .col-sm-10
+ .clearable-input
+ = f.text_field :expires_at, class: 'form-control js-access-expiration-date', placeholder: 'Select access expiration date', id: "member_expires_at_#{member.id}"
+ %i.clear-icon.js-clear-input
.prepend-top-10
= f.submit 'Save', class: 'btn btn-save btn-sm'