Skip to content

Commit

Permalink
apply select2 at select-lists
Browse files Browse the repository at this point in the history
  • Loading branch information
swatijadhav committed May 29, 2014
1 parent adb7339 commit 1cdb354
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/views/accounts/_top_section.html.haml
Expand Up @@ -12,7 +12,7 @@
%td= spacer
%td
.label #{t :category}:
= f.select :category, Setting.unroll(:account_category), { :selected => (@account.category || "other").to_sym, :include_blank => t(:other) }, { :style => "width:160px" }
= f.select :category, Setting.unroll(:account_category), { :selected => (@account.category || "other").to_sym, :include_blank => t(:other) }, { :style => "width:160px", class: 'select2' }
%td= spacer
%td
.label #{t :rating}:
Expand Down
6 changes: 3 additions & 3 deletions app/views/admin/field_groups/_top_section.html.haml
@@ -1,7 +1,7 @@
.section
= f.hidden_field :klass_name

%table{:style => 'width:auto;'}
%table{style: 'width:auto;'}
%tr
%td
.label.top.req= t(:label) + ":"
Expand All @@ -10,5 +10,5 @@
%td
.label.top
=t(:restrict_by_tag)
%small= t(:restrict_by_tag_info, :assets => f.object.klass_name.downcase.pluralize)
= f.select :tag_id, Tag.all.map { |tag| [tag.name, tag.id] }, :include_blank => true
%small= t(:restrict_by_tag_info, assets: f.object.klass_name.downcase.pluralize)
= f.select :tag_id, Tag.all.map { |tag| [tag.name, tag.id] }, { include_blank: true}, { class: 'select2' }
2 changes: 1 addition & 1 deletion app/views/admin/fields/_form.html.haml
Expand Up @@ -21,7 +21,7 @@
%td= spacer
%td
.label.top.req Field type:
= select :field, :as, field_edit_as_options(@field), :include_blank => true, :id => nil
= select :field, :as, field_edit_as_options(@field), { include_blank: true, id: nil }, { class: 'select2'}

.subform
= render(:partial => 'admin/fields/subform') unless new_field
Expand Down
2 changes: 1 addition & 1 deletion app/views/campaigns/_top_section.html.haml
Expand Up @@ -16,7 +16,7 @@
%td= spacer
%td
.label #{t :status}:
= f.select :status, Setting.unroll(:campaign_status), { :selected => (@campaign.status || "planned").to_sym }, { :style => "width:250px" }
= f.select :status, Setting.unroll(:campaign_status), { :selected => (@campaign.status || "planned").to_sym }, { :style => "width:250px", class: 'select2' }

- if Setting.background_info && Setting.background_info.include?(:campaign)
%tr
Expand Down
4 changes: 2 additions & 2 deletions app/views/leads/_convert_permissions.html.haml
Expand Up @@ -23,9 +23,9 @@
%td
= label_tag :lead_user_ids, "#{t(:users)}:"
%br
= select :lead, :user_ids, user_options, {}, :multiple => true
= select :lead, :user_ids, user_options, {}, :multiple => true, class: 'select2'
%tr
%td
= label_tag :lead_group_ids, "#{t(:groups)}:"
%br
= select :lead, :group_ids, group_options, {}, :multiple => true
= select :lead, :group_ids, group_options, {}, :multiple => true, class: 'select2'
2 changes: 1 addition & 1 deletion app/views/leads/_opportunity.html.haml
Expand Up @@ -16,7 +16,7 @@
%td= spacer
%td
.label #{t :stage}:
= o.select :stage, Setting.unroll(:opportunity_stage), { :selected => @opportunity.stage ? @opportunity.stage.to_sym : nil }, { :style => "width:160px" }
= o.select :stage, Setting.unroll(:opportunity_stage), { :selected => @opportunity.stage ? @opportunity.stage.to_sym : nil }, { :style => "width:160px", class: 'select2' }

%table
%tr
Expand Down
10 changes: 5 additions & 5 deletions app/views/leads/_status.html.haml
Expand Up @@ -14,7 +14,7 @@
%td= spacer
%td
.label.top #{t :status}:
= f.select :status, lead_status_codes_for(@lead), { :selected => (@lead.status || "new").to_sym }, { :style => "width:160px" }
= f.select :status, lead_status_codes_for(@lead), { :selected => (@lead.status || "new").to_sym }, { :style => "width:160px", class: 'select2' }
%td= spacer
%td
.label.top #{t :rating}:
Expand All @@ -23,14 +23,14 @@
%td
.label #{t :source}:
- if @campaign && !edit # Create a lead from Campaign landing page: select :campaign as a source and disable the dropdown.
= f.select :source, Setting.unroll(:lead_source), { :selected => :campaign }, { :style => "width:160px;", :disabled => true }
= f.select :source, Setting.unroll(:lead_source), { :selected => :campaign }, { :style => "width:160px;", :disabled => true, class: 'select2' }
= hidden_field_tag "lead[source]", "campaign"
- else
= f.select :source, Setting.unroll(:lead_source), { :selected => (@lead.source || "other").to_sym }, { :style => "width:160px" }
= f.select :source, Setting.unroll(:lead_source), { :selected => (@lead.source || "other").to_sym }, { :style => "width:160px", class: 'select2' }
%td= spacer
%td{ :colspan => 3 }
.label #{t :campaign}:
- if @campaign && !edit # Create a lead from Campaign landing page: select current campaign and disable the dropdown.
= collection_select :lead, :campaign_id, @campaigns, :id, :name, { :selected => @campaign.id }, { :style => "width:100%", :disabled => true }
= collection_select :lead, :campaign_id, @campaigns, :id, :name, { :selected => @campaign.id }, { :style => "width:100%", :disabled => true, class: 'select2' }
- else
= collection_select :lead, :campaign_id, @campaigns, :id, :name, { :selected => @lead.campaign_id, :include_blank => t(:select_none) }, { :style => "width:100%", :onchange => "crm.flip_campaign_permissions(this.value)" }
= collection_select :lead, :campaign_id, @campaigns, :id, :name, { :selected => @lead.campaign_id, :include_blank => t(:select_none) }, { :style => "width:100%", :onchange => "crm.flip_campaign_permissions(this.value)", class: 'select2' }
2 changes: 1 addition & 1 deletion app/views/opportunities/_top_section.html.haml
Expand Up @@ -8,7 +8,7 @@
%td= spacer
%td
.label.req.top #{t :stage}:
= f.select :stage, @stage, { :selected => @opportunity.stage ? @opportunity.stage.to_sym : nil }, { :style => "width:160px" }
= f.select :stage, @stage, { :selected => @opportunity.stage ? @opportunity.stage.to_sym : nil }, { :style => "width:160px", class: 'select2' }

%table{ :border => 0, :width => 500, :cellpadding => 0, :cellspacing => 0 }
%tr
Expand Down
6 changes: 3 additions & 3 deletions app/views/tasks/_top_section.html.haml
Expand Up @@ -10,10 +10,10 @@
- bucket = (params[:bucket].blank? ? @task.bucket : params[:bucket]) || "due_asap"
- with_time = Setting.task_calendar_with_time
- if @task.bucket != "specific_time"
= f.select :bucket, @bucket, { :selected => bucket.to_sym }, { :style => "width:160px;", :onchange => "crm.flip_calendar(this.value)" }
= f.select :bucket, @bucket, { :selected => bucket.to_sym }, { :style => "width:160px;", :onchange => "crm.flip_calendar(this.value)", class: 'select2' }
= f.text_field :calendar, :style => "width:160px; display:none;", :autocomplete => :off, :class => (with_time ? 'datetime' : 'date')
- else
= f.select :bucket, @bucket, { :selected => :specific_time }, { :style => "width:160px; display:none;", :onchange => "crm.flip_calendar(this.value)" }
= f.select :bucket, @bucket, { :selected => :specific_time }, { :style => "width:160px; display:none;", :onchange => "crm.flip_calendar(this.value)", class: 'select2' }
- fmt = with_time ? '%Y-%m-%d %H:%M' : '%Y-%m-%d'
= f.text_field :calendar, :value => f.object.due_at.strftime(fmt), :style => "width:160px;", :autocomplete => :off, :class => (with_time ? 'datetime' : 'date')
%td= spacer
Expand All @@ -23,7 +23,7 @@
%td= spacer
%td
.label.req #{t :category}:
= f.select :category, @category, { :selected => @task.category.blank? ? nil : @task.category.to_sym, :include_blank => t(:select_blank) }, { :style => "width:160px" }
= f.select :category, @category, { :selected => @task.category.blank? ? nil : @task.category.to_sym, :include_blank => t(:select_blank) }, { :style => "width:160px", class: 'select2' }

- if Setting.background_info && Setting.background_info.include?(:task)
%tr
Expand Down

0 comments on commit 1cdb354

Please sign in to comment.