cirandas.net

ref: master

plugins/suppliers/views/suppliers_plugin/consumer/index.slim


= javascript_include_tag 'plugins/suppliers/javascripts/consumers'

= js_translations_include plugin: :suppliers

- search_url = url_for(:controller => :profile_members, :action => 'search_user', :profile => profile.identifier, :role => @role.id)
- object = SuppliersPlugin::ConsumersPageSerializer.new(profile, scope: self).to_hash.merge!({tasks_count: @tasks_count})
.consumers-page

  consumer-page


javascript:
  riot.mount($('consumer-page'), #{object.to_json})

  jQuery('#search_input')
  .tokenInput("#{search_url}", {
    hintText: #{_('Type in a search term for users').to_json},
    noResultsText: #{_('No results').to_json},
    searchingText: #{ _('Searching...').to_json},
    searchDelay: 500,
    minChars: 3,
    backspaceDeleteItem: false,
    preventDuplicates: true,
    queryParam: #{('q_'+@role.key).to_json}
  });

  jQuery(document)
  .on("keydown","#token-input-search-enterprises", function(event){
    if(event.keyCode == "13") return false;
  });
  var input = jQuery('.token-input-input-token input')
  input.blur();
  if (input[0])
    input[0].focus();