Commit ea1e92a0b660ebf2bcc99015301a367fe947d84b
1 parent
9b572805
Exists in
spb-stable
and in
3 other branches
Use project_users_select_tag for Issue form and MR form
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
4 changed files
with
31 additions
and
4 deletions
Show diff stats
app/assets/stylesheets/generic/forms.scss
| @@ -51,3 +51,27 @@ label { | @@ -51,3 +51,27 @@ label { | ||
| 51 | .input-mn-300 { | 51 | .input-mn-300 { |
| 52 | min-width: 300px; | 52 | min-width: 300px; |
| 53 | } | 53 | } |
| 54 | + | ||
| 55 | +.custom-form-control { | ||
| 56 | + width: 150px; | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +@media (min-width: $screen-sm-min) { | ||
| 60 | + .custom-form-control { | ||
| 61 | + width: 150px; | ||
| 62 | + } | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | +/* Medium devices (desktops, 992px and up) */ | ||
| 66 | +@media (min-width: $screen-md-min) { | ||
| 67 | + .custom-form-control { | ||
| 68 | + width: 170px; | ||
| 69 | + } | ||
| 70 | +} | ||
| 71 | + | ||
| 72 | +/* Large devices (large desktops, 1200px and up) */ | ||
| 73 | +@media (min-width: $screen-lg-min) { | ||
| 74 | + .custom-form-control { | ||
| 75 | + width: 200px; | ||
| 76 | + } | ||
| 77 | +} |
app/assets/stylesheets/generic/selects.scss
| 1 | /** Select2 selectbox style override **/ | 1 | /** Select2 selectbox style override **/ |
| 2 | - | ||
| 3 | .select2-container, .select2-container.select2-drop-above { | 2 | .select2-container, .select2-container.select2-drop-above { |
| 4 | .select2-choice { | 3 | .select2-choice { |
| 5 | background: #FFF; | 4 | background: #FFF; |
| @@ -12,9 +11,13 @@ | @@ -12,9 +11,13 @@ | ||
| 12 | } | 11 | } |
| 13 | 12 | ||
| 14 | .select2-drop-active { | 13 | .select2-drop-active { |
| 15 | - border: 1px solid #BBB; | 14 | + border: 1px solid #BBB !important; |
| 16 | margin-top: 4px; | 15 | margin-top: 4px; |
| 17 | 16 | ||
| 17 | + &.select2-drop-above { | ||
| 18 | + margin-bottom: 8px; | ||
| 19 | + } | ||
| 20 | + | ||
| 18 | .select2-search input { | 21 | .select2-search input { |
| 19 | background: #fafafa; | 22 | background: #fafafa; |
| 20 | border-color: #DDD; | 23 | border-color: #DDD; |
app/views/projects/issues/_form.html.haml
| @@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
| 24 | %i.icon-user | 24 | %i.icon-user |
| 25 | Assign to | 25 | Assign to |
| 26 | .col-sm-10 | 26 | .col-sm-10 |
| 27 | - = f.select(:assignee_id, assignee_options(@issue), { include_blank: "Select a user" }, {class: 'select2'}) | 27 | + = project_users_select_tag('issue[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control') |
| 28 | | 28 | |
| 29 | = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' | 29 | = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' |
| 30 | .form-group | 30 | .form-group |
app/views/projects/merge_requests/_form.html.haml
| @@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
| 47 | %i.icon-user | 47 | %i.icon-user |
| 48 | Assign to | 48 | Assign to |
| 49 | .col-sm-10 | 49 | .col-sm-10 |
| 50 | - = f.select(:assignee_id, assignee_options(@merge_request), { include_blank: "Select a user" }, {class: 'select2'}) | 50 | + = project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control') |
| 51 | | 51 | |
| 52 | = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' | 52 | = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' |
| 53 | .form-group | 53 | .form-group |