Replace add userby email textinput in admin/roles#show with searchable combobox
This commit is contained in:
parent
877402e837
commit
2f1052df1a
7 changed files with 16 additions and 2 deletions
|
|
@ -40,6 +40,8 @@
|
|||
//= require osem-commercials
|
||||
//= require unobtrusive_flash
|
||||
//= require unobtrusive_flash_bootstrap
|
||||
//= require bootstrap-select
|
||||
//= require osem-selectpicker
|
||||
|
||||
$(document).ready(function() {
|
||||
$('a[disabled=disabled]').click(function(event){
|
||||
|
|
|
|||
3
app/assets/javascripts/osem-selectpicker.js
Normal file
3
app/assets/javascripts/osem-selectpicker.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$(function () {
|
||||
$('.selectpicker').selectpicker();
|
||||
});
|
||||
|
|
@ -14,4 +14,6 @@
|
|||
*= require bootstrap-datetimepicker
|
||||
*= require leaflet
|
||||
*= require bootstrap3-switch
|
||||
*= require bootstrap-select
|
||||
*= require osem-selectpicker
|
||||
*/
|
||||
|
|
|
|||
2
app/assets/stylesheets/osem-selectpicker.css
Normal file
2
app/assets/stylesheets/osem-selectpicker.css
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/* Align bootstrap-select with the Add button */
|
||||
.add-user-role > .select { display: inline; }
|
||||
|
|
@ -16,8 +16,8 @@
|
|||
= semantic_form_for :user, url: toggle_user_admin_conference_role_path(@conference.short_title, @role.name), method: :post do |u|
|
||||
|
||||
= u.label 'Add user by email: '
|
||||
.input-group
|
||||
= u.input :email, label: false, placeholder: "User's email"
|
||||
.input-group.add-user-role
|
||||
= u.input :email, label: false, :collection => User.pluck(:email), :input_html => { class: "selectpicker", data: { live_search: "true", size: "10" } ,title: "Select User's email" }
|
||||
.input-group-btn
|
||||
= u.submit 'Add', id: 'user-add', class: 'btn btn-primary'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue