Replace add userby email textinput in admin/roles#show with searchable combobox

This commit is contained in:
Nishanth Vijayan 2016-03-09 17:41:28 +05:30
parent 877402e837
commit 2f1052df1a
7 changed files with 16 additions and 2 deletions

View file

@ -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){

View file

@ -0,0 +1,3 @@
$(function () {
$('.selectpicker').selectpicker();
});

View file

@ -14,4 +14,6 @@
*= require bootstrap-datetimepicker
*= require leaflet
*= require bootstrap3-switch
*= require bootstrap-select
*= require osem-selectpicker
*/

View file

@ -0,0 +1,2 @@
/* Align bootstrap-select with the Add button */
.add-user-role > .select { display: inline; }

View file

@ -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'