Skip to content

Commit

Permalink
Merge pull request #682 from johnnyshields/views-remove-hash-rockets
Browse files Browse the repository at this point in the history
Remove hash rockets from all views
  • Loading branch information
CloCkWeRX committed Jan 7, 2018
2 parents e8812fc + dc41195 commit 28ae63b
Show file tree
Hide file tree
Showing 257 changed files with 911 additions and 911 deletions.
4 changes: 2 additions & 2 deletions app/views/accounts/_account.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- if (params['controller'] == 'accounts') and (template = template_for_current_view).present?
= render(template, :account => account)
= render(template, account: account)
- else
-# default view
= render 'accounts/index_brief', :account => account
= render 'accounts/index_brief', account: account
14 changes: 7 additions & 7 deletions app/views/accounts/_contact_info.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
#account_contact{ hidden_if(collapsed) }
%table
%tr
%td{ :colspan => 3 }
%table{ :width => "100%", :cellpadding => 0, :cellspacing => 0 }
%td{ colspan: 3 }
%table{ width: "100%", cellpadding: 0, cellspacing: 0 }
%tr
%td
.label #{t :phone_toll_free}:
= f.text_field :toll_free_phone, :style => "width:154px"
= f.text_field :toll_free_phone, style: "width:154px"
%td= spacer
%td
.label #{t :phone}:
= f.text_field :phone, :style => "width:154px"
= f.text_field :phone, style: "width:154px"
%td= spacer
%td
.label #{t :fax}:
= f.text_field :fax, :style => "width:154px"
= f.text_field :fax, style: "width:154px"
%tr
%td
.label.top #{t :website}:
Expand All @@ -31,7 +31,7 @@
= f.text_field :email
%tr
%td
= render "shared/address", :f => f, :asset => @account, :type => :billing, :title => :billing_address
= render "shared/address", f: f, asset: @account, type: :billing, title: :billing_address
%td= spacer
%td
= render "shared/address", :f => f, :asset => @account, :type => :shipping, :title => :shipping_address, :same_as_billing => true
= render "shared/address", f: f, asset: @account, type: :shipping, title: :shipping_address, same_as_billing: true
16 changes: 8 additions & 8 deletions app/views/accounts/_edit.html.haml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.remote
= simple_form_for(@account, :html => one_submit_only, :remote => true) do |f|
= simple_form_for(@account, html: one_submit_only, remote: true) do |f|
= link_to_close edit_account_path(@account)
= f.hidden_field :user_id

= f.error_messages :object_name => t('account')
= f.error_messages object_name: t('account')

= render "accounts/top_section", :f => f, :edit => true
= render "fields/edit_custom_field_group", :f => f, :edit => true
= render "accounts/contact_info", :f => f, :edit => true
= render "fields/groups", :f => f, :edit => true
= render "entities/permissions", :f => f, :edit => true, :entity => @account
= render "accounts/top_section", f: f, edit: true
= render "fields/edit_custom_field_group", f: f, edit: true
= render "accounts/contact_info", f: f, edit: true
= render "fields/groups", f: f, edit: true
= render "entities/permissions", f: f, edit: true, entity: @account
= hook(:entity_form, self, {f: f, entity: @account})

.buttonbar
- if Setting.compound_address
= f.submit t(:save_account), :onclick => "crm.clear_all_hints()"
= f.submit t(:save_account), onclick: "crm.clear_all_hints()"
- else
= f.submit t(:save_account)
#{t :or}
Expand Down
14 changes: 7 additions & 7 deletions app/views/accounts/_index_brief.html.haml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- amount = account.pipeline_opportunities.map(&:weighted_amount).sum
%li.highlight[account]
- if account.category
.strip{:class => account.category} #{t(account.category)}
.strip{class: account.category} #{t(account.category)}
- else
.strip{:style => "color: gray;"} #{t :other}
.strip{style: "color: gray;"} #{t :other}

%ul.tools
= hook(:account_tools_before, self, :account => account)
= hook(:account_tools_before, self, account: account)

- if can?(:update, account)
%li= link_to_edit(account)
Expand All @@ -17,16 +17,16 @@
.indent
= link_to(account.name, account)
- if amount != 0.0
%span.amount= number_to_currency(amount, :precision => 0)
%span.amount= number_to_currency(amount, precision: 0)
–
%tt
= account.location + ", " unless account.location.blank?
- user_name = account.user.try(:full_name)
- if user_name
= t(:added_by, :time_ago => timeago(account.created_at), :user => h(user_name)).html_safe << " | "
= t(:added_by, time_ago: timeago(account.created_at), user: h(user_name)).html_safe << " | "
- else
= t(:added_ago, :value => timeago(account.created_at)).html_safe << " | "
= t(:added_ago, value: timeago(account.created_at)).html_safe << " | "
= t('pluralize.contact', account.contacts_count) + " | "
= t('pluralize.opportunity', account.opportunities_count)

= hook(:account_bottom, self, :account => account)
= hook(:account_bottom, self, account: account)
14 changes: 7 additions & 7 deletions app/views/accounts/_index_long.html.haml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- amount = account.pipeline_opportunities.map(&:weighted_amount).sum
%li.highlight[account]
- if account.category
.strip{:class => account.category} #{t(account.category)}
.strip{class: account.category} #{t(account.category)}
- else
.strip{:style => "color: gray;"} #{t :other}
.strip{style: "color: gray;"} #{t :other}

%ul.tools
= hook(:account_tools_before, self, :account => account)
= hook(:account_tools_before, self, account: account)

- if can?(:update, account)
%li= link_to_edit(account)
Expand All @@ -17,15 +17,15 @@
.indent
= link_to(account.name, account)
- if amount != 0.0
%span.amount= number_to_currency(amount, :precision => 0)
%span.amount= number_to_currency(amount, precision: 0)
&ndash;
%tt
= account.location + ", " unless account.location.blank?
- user_name = account.user.try(:full_name)
- if user_name
= t(:added_by, :time_ago => timeago(account.created_at), :user => h(user_name)).html_safe << " | "
= t(:added_by, time_ago: timeago(account.created_at), user: h(user_name)).html_safe << " | "
- else
= t(:added_ago, :value => timeago(account.created_at)).html_safe << " | "
= t(:added_ago, value: timeago(account.created_at)).html_safe << " | "
= t('pluralize.contact', account.contacts_count) + " | "
= t('pluralize.opportunity', account.opportunities_count)

Expand All @@ -39,4 +39,4 @@
%dt
.tags= tags_for_index(account)

= hook(:account_bottom, self, :account => account)
= hook(:account_bottom, self, account: account)
18 changes: 9 additions & 9 deletions app/views/accounts/_new.html.haml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
= simple_form_for(@account, :html => one_submit_only, :remote => true) do |f|
= simple_form_for(@account, html: one_submit_only, remote: true) do |f|
= link_to_close new_account_path
= f.hidden_field :user_id

= f.error_messages :object_name => t('account')
= f.error_messages object_name: t('account')

= render "accounts/top_section", :f => f
= render "fields/edit_custom_field_group", :f => f
= render "shared/add_comment", :f => f
= render "accounts/contact_info", :f => f
= render "fields/groups", :f => f
= render "entities/permissions", :f => f, :entity => @account
= render "accounts/top_section", f: f
= render "fields/edit_custom_field_group", f: f
= render "shared/add_comment", f: f
= render "accounts/contact_info", f: f
= render "fields/groups", f: f
= render "entities/permissions", f: f, entity: @account
= hook(:entity_form, self, {f: f, entity: @account})

.buttonbar
- if Setting.compound_address
= f.submit t(:create_account), :onclick => "crm.clear_all_hints()"
= f.submit t(:create_account), onclick: "crm.clear_all_hints()"
- else
= f.submit t(:create_account)
#{t :or}
Expand Down
10 changes: 5 additions & 5 deletions app/views/accounts/_sidebar_index.html.haml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.filters#filters
.caption= t :account_categories
- Setting.account_category.each do |key|
.check_box{:style => "border-bottom: 1px silver dotted;"}
%div{:style => "float:right;"}
.check_box{style: "border-bottom: 1px silver dotted;"}
%div{style: "float:right;"}
= @account_category_total[key]
= account_category_checkbox(key, @account_category_total[key])
= label_tag(key, t(key))
.check_box{:style => "border-bottom: 1px silver dotted;"}
%div{:style => "float:right;"}
.check_box{style: "border-bottom: 1px silver dotted;"}
%div{style: "float:right;"}
= @account_category_total[:other]
= account_category_checkbox("other", @account_category_total[:other])
= label_tag(:other, t(:other))
.check_box
%div{:style => "float:right;"}
%div{style: "float:right;"}
%b= @account_category_total[:all]
%b #{t :total_accounts}
= hook(:index_account_sidebar_bottom, self)
20 changes: 10 additions & 10 deletions app/views/accounts/_sidebar_show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
%h4= h(@account.name)
- if @account.website
%div
%b= link_to(truncate(@account.website, :length => 30), @account.website.to_url, :"data-popup" => true, :title => t(:open_in_window, @account.website))
%b= link_to(truncate(@account.website, length: 30), @account.website.to_url, :"data-popup" => true, title: t(:open_in_window, @account.website))
- if @account.email.present?
%div
%b= link_to_email(@account.email, 30)
Expand All @@ -21,37 +21,37 @@
- if @account.fax
#{t :fax}: <b>#{@account.fax}</b><br />

%div= render "shared/address_show", :asset => @account, :type => 'billing', :title => :billing_address
%div= render "shared/address_show", :asset => @account, :type => 'shipping', :title => :shipping_address
%div= render "shared/address_show", asset: @account, type: 'billing', title: :billing_address
%div= render "shared/address_show", asset: @account, type: 'shipping', title: :shipping_address

.caption #{t :account_summary}
%li
%dt= pipeline != 0.0 ? number_to_currency(pipeline, :precision => 0) : t(:n_a)
%dt= pipeline != 0.0 ? number_to_currency(pipeline, precision: 0) : t(:n_a)
%tt #{t :pipeline}:
%li
%dt= won != 0.0 ? number_to_currency(won, :precision => 0) : t(:n_a)
%dt= won != 0.0 ? number_to_currency(won, precision: 0) : t(:n_a)
%tt #{t :won}:
%li
%dt= lost != 0.0 ? number_to_currency(lost, :precision => 0) : t(:n_a)
%dt= lost != 0.0 ? number_to_currency(lost, precision: 0) : t(:n_a)
%tt #{t :lost}:
%li
%dt= @account.category ? t(@account.category) : t(:other)
%tt #{t :category}:
%li
%span{:style => "float:right;"}= stars_for(@account)
%span{style: "float:right;"}= stars_for(@account)
%tt #{t :rating}:
%li
%dt= @account.assigned_to ? truncate(@account.assignee.full_name, :length => 16) : nil
%dt= @account.assigned_to ? truncate(@account.assignee.full_name, length: 16) : nil
%tt #{t :assigned_to}:

- unless @account.background_info.blank?
.caption #{t :background_info}
= auto_link(simple_format @account.background_info)

= render "fields/sidebar_show", :asset => @account
= render "fields/sidebar_show", asset: @account

- if @account.tags.present?
%dt
.tags= tags_for_index(@account)

= hook(:show_account_sidebar_bottom, self, :account => @account)
= hook(:show_account_sidebar_bottom, self, account: @account)
4 changes: 2 additions & 2 deletions app/views/accounts/_title_bar.html.haml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#confirm{ hidden }
.title_tools#menu
= link_to_inline(:edit_account, edit_account_path(@account), :text => t(:edit)) + " | "
= link_to_inline(:edit_account, edit_account_path(@account), text: t(:edit)) + " | "
= link_to_function(t(:delete) + '?', confirm_delete(@account))
.title_tools#buttons
= view_buttons
.title#edit_account_title
= h(@account.name)
= image_tag("loading.gif", :size => :thumb, :id => "loading", :style => "display: none;")
= image_tag("loading.gif", size: :thumb, id: "loading", style: "display: none;")

%div#edit_account{ hidden }
14 changes: 7 additions & 7 deletions app/views/accounts/_top_section.html.haml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
= hook(:account_top_section, self, :f => f) do
= hook(:account_top_section, self, f: f) do
.section
%table
%tr
%td(colspan="5")
.label.top.req #{t :name}:
= f.text_field :name, :autofocus => true, :style => "width:500px"
= f.text_field :name, autofocus: true, style: "width:500px"
%tr
%td
.label #{t :assigned_to}:
= user_select(:account, User.without(current_user), current_user)
%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" }
%td= spacer
%td
.label #{t :rating}:
= rating_select "account[rating]", { :id => :account_rating, :selected => @account.rating, :style => "width:160px" }
= rating_select "account[rating]", { id: :account_rating, selected: @account.rating, style: "width:160px" }

- if Setting.background_info && Setting.background_info.include?(:account)
%tr
%td(colspan="5")
.label= t(:background_info) + ':'
= f.text_area :background_info, :style =>"width:500px", :rows => 3
= f.text_area :background_info, style: "width:500px", rows: 3

= render :partial => "/shared/tags", :locals => {:f => f, :span => 3}
= render partial: "/shared/tags", locals: {f: f, span: 3}

= hook(:account_top_section_bottom, self, :f => f)
= hook(:account_top_section_bottom, self, f: f)
6 changes: 3 additions & 3 deletions app/views/accounts/create.js.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
$('##{create_id}_arrow').html(crm.COLLAPSED);
$('##{create_id}_title').html('#{ j t(entity_name.pluralize) }');
$('##{create_id}').slideUp(250);
$('##{entity_name.pluralize}').prepend('#{ j render(:partial => entity_name, :collection => [ @entity ]) }');
$('##{entity_name.pluralize}').prepend('#{ j render(partial: entity_name, collection: [ @entity ]) }');
$('##{dom_id(@entity)}').effect("highlight", { duration:1500 });
= refresh_sidebar(:index, :filters)
$('#paginate').html('#{ j render(:partial => "shared/paginate_with_per_page") }');
$('#paginate').html('#{ j render(partial: "shared/paginate_with_per_page") }');
crm.flick('empty', 'remove');
- else
$('##{create_id}').html('#{ j render(:partial => "new") }');
$('##{create_id}').html('#{ j render(partial: "new") }');
$('##{create_id}').effect("shake", { duration:250, distance: 6 });
$('#new_#{entity_name} input[type!=hidden]').first().focus();
2 changes: 1 addition & 1 deletion app/views/accounts/destroy.js.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

$('##{dom_id(@entity)}').css('background-color', '#ffe4e1').slideUp(250);
= refresh_sidebar(:index, :filters)
$('#paginate').replaceWith('#{ j render(:partial => "shared/paginate_with_per_page") }');
$('#paginate').replaceWith('#{ j render(partial: "shared/paginate_with_per_page") }');
8 changes: 4 additions & 4 deletions app/views/accounts/edit.js.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
crm.flip_form('edit_#{entity_name}');
crm.set_title('edit_#{entity_name}', '#{h @entity.name}');
- else # Called from index page...
$('##{id}').replaceWith('#{ j render(:partial => entity_name, :collection => [ @entity ]) }');
$('##{id}').replaceWith('#{ j render(partial: entity_name, collection: [ @entity ]) }');

- else # <---------------------------------------- Show [Edit] form.

- if params[:cancel].blank? # Called from index page...
- if @previous # Hide open [Edit] form if any.
- if @previous.is_a?(@entity.class)
$('##{dom_id(@previous)}').replaceWith('#{ j render(:partial => entity_name, :collection => [ @previous ]) }');
$('##{dom_id(@previous)}').replaceWith('#{ j render(partial: entity_name, collection: [ @previous ]) }');
- else
crm.flick('#{entity_name}_#{@previous}', 'remove');
-# Disable onMouseOver for the list item.
crm.highlight_off('#{id}');
-# Hide [Create] form if any.
crm.hide_form('create_#{entity_name}');
-# Show [Edit] form.
$('##{id}').html('#{ j render(:partial => "edit") }');
$('##{id}').html('#{ j render(partial: "edit") }');

- elsif params[:cancel].false? # Called from title of the landing page...
$('#edit_#{entity_name}').html('#{ j render(:partial => "edit") }');
$('#edit_#{entity_name}').html('#{ j render(partial: "edit") }');
crm.flip_form('edit_#{entity_name}');
crm.set_title('edit_#{entity_name}', "#{t :edit} #{h @entity.name}");
8 changes: 4 additions & 4 deletions app/views/accounts/index.js.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
- if @entities.any?
$('##{entities}').html('#{ j render(@entities) }');
- else
$('##{entities}').html('#{ j render(:partial => "shared/empty") }');
$('##{entities}').html('#{ j render(partial: "shared/empty") }');

$('#paginate').html('#{ j render(:partial => "shared/paginate_with_per_page") }');
$('#export').html('#{ j render(:partial => "shared/export") }');
$('#search_results_count').html('#{ j render(:plain => t('search_results_count', :count => @search_results_count)) }');
$('#paginate').html('#{ j render(partial: "shared/paginate_with_per_page") }');
$('#export').html('#{ j render(partial: "shared/export") }');
$('#search_results_count').html('#{ j render(plain: t('search_results_count', count: @search_results_count)) }');
2 changes: 1 addition & 1 deletion app/views/accounts/new.js.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ crm.flick('empty', 'toggle');
crm.flip_form('#{create_id}');

- unless params[:cancel].true?
$('##{create_id}').html('#{ j render(:partial => "new") }');
$('##{create_id}').html('#{ j render(partial: "new") }');
crm.set_title('#{create_id}', '#{ j t(create_id) }');
- else
crm.set_title('#{create_id}', '#{ j t(entity_name.pluralize) }');
Loading

0 comments on commit 28ae63b

Please sign in to comment.