Skip to content

Commit

Permalink
Ported campaigns, leads and accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
ndbroadbent committed Sep 17, 2012
1 parent f898134 commit 1cfc33c
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 56 deletions.
9 changes: 1 addition & 8 deletions app/helpers/campaigns_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@ module CampaignsHelper
# Sidebar checkbox control for filtering campaigns by status.
#----------------------------------------------------------------------------
def campaign_status_checkbox(status, count)
checked = (session[:campaigns_filter] ? session[:campaigns_filter].split(",").include?(status.to_s) : count.to_i > 0)
onclick = remote_function(
:url => { :action => :filter },
:with => h(%Q/"status=" + $$("input[name='status[]']").findAll(function (el) { return el.checked }).pluck("value")/),
:loading => "$('loading').show()",
:complete => "$('loading').hide()"
)
check_box_tag("status[]", status, checked, :id => status, :onclick => onclick)
entity_filter_checkbox(:status, status, count)
end

#----------------------------------------------------------------------------
Expand Down
9 changes: 1 addition & 8 deletions app/helpers/leads_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,7 @@ def confirm_reject(lead)
# Sidebar checkbox control for filtering leads by status.
#----------------------------------------------------------------------------
def lead_status_checkbox(status, count)
checked = (session[:leads_filter] ? session[:leads_filter].split(",").include?(status.to_s) : count.to_i > 0)
onclick = remote_function(
:url => { :action => :filter },
:with => h(%Q/"status=" + $$("input[name='status[]']").findAll(function (el) { return el.checked }).pluck("value")/),
:loading => "$('loading').show()",
:complete => "$('loading').hide()"
)
check_box_tag("status[]", status, checked, :id => status, :onclick => onclick)
entity_filter_checkbox(:status, status, count)
end

# Returns default permissions intro for leads
Expand Down
2 changes: 0 additions & 2 deletions app/views/accounts/_sidebar_index.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.filters#filters
= render "shared/search"
= hook(:index_account_sidebar_bottom, self)
- Setting.account_category.each do |key|
.check_box{:style => "border-bottom: 1px silver dotted;"}
%div{:style => "float:right;"}
Expand Down
1 change: 0 additions & 1 deletion app/views/accounts/create.js.rjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
if @account.valid?
page[:create_account_arrow].replace_html "►"
page[:create_account_title].replace_html t(:accounts)
page.visual_effect :toggle_blind, :create_account, :duration => 0.3, :afterFinish => 'function(effect) {effect.element.update("")}'
page.insert_html :top, :accounts, :partial => "account", :collection => [ @account ]
page[dom_id(@account)].visual_effect :highlight, :duration => 1.5
Expand Down
21 changes: 10 additions & 11 deletions app/views/accounts/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
= styles_for :account

.title_tools
= link_to_inline(:create_account, new_account_path, :text => t(:create_account)) << " | "
= link_to_inline(:advanced_search, advanced_search_accounts_path, :text => t(:advanced_search)) << " | "
= link_to_inline(:options, options_accounts_path, :text=> t(:options))
= image_tag("loading.gif", :size => :thumb, :id => "loading", :style => "display: none;")

#buttons
= render 'format_buttons'
.create_asset
= link_to_inline(:create_account, new_account_path, :text => t(:create_account))

= render 'search'

.title
%span#create_account_title #{t :accounts}
= image_tag("loading.gif", :size => :thumb, :id => "loading", :style => "display: none;")
.remote#options{ hidden }
.remote#advanced_search{ hidden_if(!params[:q]) }
- if params[:q]
= render :partial => "advanced_search"
.remote#create_account{ hidden }

.remote#options{ hidden }

.list#accounts
- if @accounts.any?
= render @accounts
Expand Down
1 change: 0 additions & 1 deletion app/views/campaigns/_sidebar_index.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.filters#filters
= render "shared/search"
- Setting.campaign_status.each do |key|
.check_box{:style => "border-bottom: 1px silver dotted;"}
%div{:style => "float:right;"}
Expand Down
1 change: 0 additions & 1 deletion app/views/campaigns/create.js.rjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
if @campaign.valid?
page[:create_campaign_arrow].replace_html "&#9658;"
page[:create_campaign_title].replace_html t(:campaigns)
page.visual_effect :toggle_blind, :create_campaign, :duration => 0.3, :afterFinish => 'function(effect) {effect.element.update("")}'
page.insert_html :top, :campaigns, :partial => "campaign", :collection => [ @campaign ]
page[dom_id(@campaign)].visual_effect :highlight, :duration => 1.5
Expand Down
21 changes: 10 additions & 11 deletions app/views/campaigns/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
= styles_for :campaign

.title_tools
= link_to_inline(:create_campaign, new_campaign_path, :text => t(:create_campaign)) << " | "
= link_to_inline(:advanced_search, advanced_search_campaigns_path, :text => t(:advanced_search)) << " | "
= link_to_inline(:options, options_campaigns_path, :text => t(:options))
= image_tag("loading.gif", :size => :thumb, :id => "loading", :style => "display: none;")

#buttons
= render 'format_buttons'
.create_asset
= link_to_inline(:create_campaign, new_campaign_path, :text => t(:create_campaign))

= render 'search'

.title
%span#create_campaign_title #{t :campaigns}
= image_tag("loading.gif", :size => :thumb, :id => "loading", :style => "display: none;")
.remote#options{ hidden }
.remote#advanced_search{ hidden_if(!params[:q]) }
- if params[:q]
= render :partial => "advanced_search"
.remote#create_campaign{ hidden }

.remote#options{ hidden }

.list#campaigns
- if @campaigns.any?
= render @campaigns
Expand Down
1 change: 0 additions & 1 deletion app/views/leads/_sidebar_index.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.filters#filters
= render "shared/search"
- Setting.lead_status.each do |key|
.check_box{:style => "border-bottom: 1px silver dotted;"}
%div{:style => "float:right;"}
Expand Down
1 change: 0 additions & 1 deletion app/views/leads/create.js.rjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
if @lead.valid?
page[:create_lead_arrow].replace_html "&#9658;".html_safe
page[:create_lead_title].replace_html t(:leads)
page.visual_effect :toggle_blind, :create_lead, :duration => 0.3, :afterFinish => 'function(effect) {effect.element.update("")}'
page.insert_html :top, :leads, :partial => "lead", :collection => [ @lead ]
page[dom_id(@lead)].visual_effect :highlight, :duration => 1.5
Expand Down
21 changes: 10 additions & 11 deletions app/views/leads/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
= styles_for :lead

.title_tools
= link_to_inline(:create_lead, new_lead_path, :text => t(:create_lead)) << " | "
= link_to_inline(:advanced_search, advanced_search_leads_path, :text => t(:advanced_search)) << " | "
= link_to_inline(:options, options_leads_path, :text => t(:options))
= image_tag("loading.gif", :size => :thumb, :id => "loading", :style => "display: none;")

#buttons
= render 'format_buttons'
.create_asset
= link_to_inline(:create_lead, new_lead_path, :text => t(:create_lead))

= render 'search'

.title
%span#create_lead_title #{t :leads}
= image_tag("loading.gif", :size => :thumb, :id => "loading", :style => "display: none;")
.remote#options{ hidden }
.remote#advanced_search{ hidden_if(!params[:q]) }
- if params[:q]
= render :partial => "advanced_search"
.remote#create_lead{ hidden }

.remote#options{ hidden }

.list#leads
- if @leads.any?
= render @leads
Expand Down

0 comments on commit 1cfc33c

Please sign in to comment.