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 | 51 | .input-mn-300 { |
| 52 | 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 | 1 | /** Select2 selectbox style override **/ |
| 2 | - | |
| 3 | 2 | .select2-container, .select2-container.select2-drop-above { |
| 4 | 3 | .select2-choice { |
| 5 | 4 | background: #FFF; |
| ... | ... | @@ -12,9 +11,13 @@ |
| 12 | 11 | } |
| 13 | 12 | |
| 14 | 13 | .select2-drop-active { |
| 15 | - border: 1px solid #BBB; | |
| 14 | + border: 1px solid #BBB !important; | |
| 16 | 15 | margin-top: 4px; |
| 17 | 16 | |
| 17 | + &.select2-drop-above { | |
| 18 | + margin-bottom: 8px; | |
| 19 | + } | |
| 20 | + | |
| 18 | 21 | .select2-search input { |
| 19 | 22 | background: #fafafa; |
| 20 | 23 | border-color: #DDD; | ... | ... |
app/views/projects/issues/_form.html.haml
| ... | ... | @@ -24,7 +24,7 @@ |
| 24 | 24 | %i.icon-user |
| 25 | 25 | Assign to |
| 26 | 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 | 29 | = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' |
| 30 | 30 | .form-group | ... | ... |
app/views/projects/merge_requests/_form.html.haml
| ... | ... | @@ -47,7 +47,7 @@ |
| 47 | 47 | %i.icon-user |
| 48 | 48 | Assign to |
| 49 | 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 | 52 | = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' |
| 53 | 53 | .form-group | ... | ... |