fat_free_crm 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fat_free_crm might be problematic. Click here for more details.
- data/.gitignore +1 -0
- data/.travis.yml +2 -2
- data/Gemfile +15 -2
- data/Gemfile.lock +34 -14
- data/README.md +37 -124
- data/app/assets/javascripts/application.js.erb +1 -1
- data/app/assets/javascripts/crm.js +22 -1
- data/app/assets/javascripts/crm_fields.js +2 -3
- data/app/assets/javascripts/jquery-noconflict.js +17 -0
- data/app/assets/stylesheets/application.css.erb +1 -0
- data/app/assets/stylesheets/common.scss +26 -0
- data/app/assets/stylesheets/ffcrm_chosen.scss +1 -1
- data/app/controllers/admin/application_controller.rb +1 -1
- data/app/controllers/application_controller.rb +0 -8
- data/app/controllers/{accounts_controller.rb → entities/accounts_controller.rb} +1 -13
- data/app/controllers/{campaigns_controller.rb → entities/campaigns_controller.rb} +1 -13
- data/app/controllers/{contacts_controller.rb → entities/contacts_controller.rb} +1 -7
- data/app/controllers/{leads_controller.rb → entities/leads_controller.rb} +1 -1
- data/app/controllers/{opportunities_controller.rb → entities/opportunities_controller.rb} +1 -7
- data/app/controllers/{tasks_controller.rb → entities/tasks_controller.rb} +1 -1
- data/app/controllers/{base_controller.rb → entities_controller.rb} +32 -1
- data/app/controllers/home_controller.rb +9 -9
- data/app/controllers/lists_controller.rb +17 -0
- data/app/helpers/admin/tags_helper.rb +1 -1
- data/app/helpers/application_helper.rb +14 -14
- data/app/helpers/crm_tags_helper.rb +1 -1
- data/app/helpers/home_helper.rb +13 -15
- data/app/helpers/lists_helper.rb +17 -0
- data/app/inputs/date_time_input.rb +17 -0
- data/app/inputs/text_input.rb +17 -1
- data/app/models/{base → entities}/account.rb +0 -1
- data/app/models/{base → entities}/account_contact.rb +0 -0
- data/app/models/{base → entities}/account_opportunity.rb +0 -0
- data/app/models/{base → entities}/campaign.rb +0 -1
- data/app/models/{base → entities}/contact.rb +0 -1
- data/app/models/{base → entities}/contact_opportunity.rb +0 -0
- data/app/models/{base → entities}/lead.rb +0 -1
- data/app/models/{base → entities}/opportunity.rb +0 -1
- data/app/models/{base → entities}/task.rb +5 -6
- data/app/models/list.rb +17 -0
- data/app/models/observers/lead_observer.rb +39 -0
- data/app/models/observers/opportunity_observer.rb +54 -0
- data/app/models/observers/task_observer.rb +41 -0
- data/app/models/polymorphic/address.rb +1 -3
- data/app/models/polymorphic/avatar.rb +0 -5
- data/app/models/polymorphic/comment.rb +2 -11
- data/app/models/polymorphic/email.rb +2 -9
- data/app/models/polymorphic/tag.rb +17 -0
- data/app/models/polymorphic/tagging.rb +17 -0
- data/app/models/users/ability.rb +13 -0
- data/app/models/users/user.rb +1 -4
- data/app/views/accounts/_account.html.haml +10 -6
- data/app/views/accounts/index.html.haml +1 -1
- data/app/views/accounts/show.html.haml +6 -24
- data/app/views/admin/fields/_field.html.haml +6 -6
- data/app/views/admin/tags/_tag.html.haml +2 -2
- data/app/views/admin/tags/index.html.haml +1 -1
- data/app/views/admin/users/_user.html.haml +3 -3
- data/app/views/admin/users/index.html.haml +1 -1
- data/app/views/campaigns/_campaign.html.haml +9 -5
- data/app/views/campaigns/index.html.haml +1 -1
- data/app/views/campaigns/show.html.haml +4 -24
- data/app/views/comments/_comment.html.haml +17 -14
- data/app/views/comments/_edit.html.haml +1 -1
- data/app/views/comments/_new.html.haml +3 -3
- data/app/views/contacts/_contact.html.haml +33 -15
- data/app/views/contacts/_contacts.html.haml +6 -0
- data/app/views/contacts/_sidebar_show.html.haml +1 -1
- data/app/views/contacts/index.html.haml +1 -1
- data/app/views/contacts/show.html.haml +3 -19
- data/app/views/emails/_email.html.haml +24 -21
- data/app/views/{base → entities}/_advanced_search.html.haml +0 -0
- data/app/views/{base → entities}/_condition_fields.html.haml +0 -0
- data/app/views/{base → entities}/_grouping_fields.html.haml +0 -0
- data/app/views/{base → entities}/_sort_fields.html.haml +0 -0
- data/app/views/{base → entities}/advanced_search.js.rjs +0 -0
- data/app/views/entities/contacts.js.rjs +3 -0
- data/app/views/entities/leads.js.rjs +3 -0
- data/app/views/entities/opportunities.js.rjs +3 -0
- data/app/views/entities/versions.js.rjs +3 -0
- data/app/views/home/_activity.html.haml +19 -18
- data/app/views/home/_events_menu.html.haml +8 -0
- data/app/views/home/_options.html.haml +2 -3
- data/app/views/home/index.html.haml +1 -1
- data/app/views/leads/_lead.html.haml +42 -23
- data/app/views/leads/_leads.html.haml +6 -0
- data/app/views/leads/_sidebar_show.html.haml +1 -1
- data/app/views/leads/index.html.haml +1 -1
- data/app/views/leads/show.html.haml +3 -13
- data/app/views/opportunities/_opportunities.html.haml +6 -0
- data/app/views/opportunities/_opportunity.html.haml +23 -11
- data/app/views/opportunities/index.html.haml +1 -1
- data/app/views/opportunities/show.html.haml +4 -18
- data/app/views/shared/_comment.html.haml +3 -3
- data/app/views/shared/_edit_comment.html.haml +1 -1
- data/app/views/shared/_recent.html.haml +4 -4
- data/app/views/shared/_recently.html.haml +3 -3
- data/app/views/shared/_timeline.html.haml +2 -3
- data/app/views/tasks/_assigned.html.haml +4 -4
- data/app/views/tasks/_completed.html.haml +2 -2
- data/app/views/tasks/_pending.html.haml +2 -2
- data/app/views/tasks/_related.html.haml +4 -5
- data/app/views/tasks/_tasks.html.haml +3 -0
- data/app/views/tasks/_title.html.haml +1 -1
- data/app/views/tasks/index.html.haml +1 -1
- data/app/views/users/_avatar.html.haml +2 -2
- data/app/views/versions/_version.html.haml +9 -12
- data/app/views/versions/_versions.html.haml +11 -0
- data/config/application.rb +3 -2
- data/config/environments/development.rb +2 -2
- data/config/environments/production.rb +0 -4
- data/config/environments/staging.rb +1 -1
- data/config/initializers/action_mailer.rb +9 -0
- data/config/initializers/paper_trail.rb +80 -0
- data/config/initializers/relative_url_root.rb +23 -0
- data/config/locales/cz_fat_free_crm.yml +1 -1
- data/config/locales/en-US_fat_free_crm.yml +22 -17
- data/config/locales/fr_fat_free_crm.yml +349 -134
- data/config/routes.rb +144 -140
- data/config/settings.default.yml +14 -2
- data/db/demo/addresses.yml +2 -2
- data/db/demo/emails.yml +2 -2
- data/db/migrate/20120216042541_is_paranoid_to_paper_trail.rb +1 -2
- data/db/migrate/20120309070209_add_versions_related.rb +6 -0
- data/db/migrate/20120316045804_activities_to_versions.rb +35 -0
- data/db/schema.rb +79 -53
- data/fat_free_crm.gemspec +8 -4
- data/lib/development_tasks/gem.rake +18 -1
- data/lib/development_tasks/license.rake +2 -4
- data/lib/development_tasks/rdoc.rake +17 -0
- data/lib/development_tasks/rspec.rake +17 -0
- data/lib/fat_free_crm.rb +20 -14
- data/lib/fat_free_crm/core_ext/array.rb +0 -27
- data/lib/fat_free_crm/dropbox.rb +11 -1
- data/lib/fat_free_crm/engine.rb +21 -3
- data/lib/fat_free_crm/gem_dependencies.rb +26 -0
- data/lib/fat_free_crm/gem_ext.rb +18 -1
- data/lib/fat_free_crm/gem_ext/active_record/schema_dumper.rb +18 -1
- data/lib/fat_free_crm/gem_ext/authlogic/session/cookies.rb +17 -0
- data/lib/fat_free_crm/gem_ext/rails/engine.rb +17 -0
- data/lib/fat_free_crm/gem_ext/rails/text_helper.rb +17 -0
- data/lib/fat_free_crm/gem_ext/rake/task.rb +17 -0
- data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +18 -1
- data/lib/fat_free_crm/plugin_dependencies.rb +23 -5
- data/lib/fat_free_crm/renderers.rb +17 -0
- data/lib/fat_free_crm/syck_yaml.rb +17 -0
- data/lib/fat_free_crm/version.rb +1 -1
- data/lib/{country_select → plugins/country_select}/MIT-LICENSE +0 -0
- data/lib/{country_select → plugins/country_select}/README +0 -0
- data/lib/{country_select → plugins/country_select}/init.rb +0 -0
- data/lib/{country_select → plugins/country_select}/install.rb +0 -0
- data/lib/{country_select → plugins/country_select}/lib/country_select.rb +0 -0
- data/lib/{country_select → plugins/country_select}/uninstall.rb +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/Gemfile +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/README.textile +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/ROADMAP.textile +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/Rakefile +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/VERSION +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/gravatar_image_tag.gemspec +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/init.rb +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/lib/gravatar_image_tag.rb +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/spec/gravatar_image_tag_spec.rb +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/spec/test_helper.rb +0 -0
- data/lib/tasks/demo.rake +32 -29
- data/lib/tasks/dropbox.rake +1 -1
- data/lib/tasks/fat_free_crm.rake +3 -2
- data/lib/tasks/plugins.rake +1 -0
- data/spec/controllers/accounts_controller_spec.rb +7 -5
- data/spec/controllers/campaigns_controller_spec.rb +11 -9
- data/spec/controllers/contacts_controller_spec.rb +7 -5
- data/spec/controllers/home_controller_spec.rb +2 -2
- data/spec/controllers/leads_controller_spec.rb +7 -5
- data/spec/controllers/opportunities_controller_spec.rb +7 -5
- data/spec/factories/shared_factories.rb +8 -11
- data/spec/lib/dropbox_spec.rb +1 -0
- data/spec/models/polymorphic/version_spec.rb +247 -0
- data/spec/models/users/user_spec.rb +0 -9
- data/spec/spec_helper.rb +4 -0
- data/spec/views/home/index.haml_spec.rb +1 -1
- data/spec/views/home/index.rjs_spec.rb +4 -4
- data/spec/views/tasks/new.rjs_spec.rb +2 -2
- data/vendor/assets/javascripts/calendar_date_select/format_french.js +24 -0
- metadata +167 -126
- data/app/models/observers/activity_observer.rb +0 -84
- data/app/models/polymorphic/activity.rb +0 -106
- data/app/views/accounts/contacts.js.rjs +0 -3
- data/app/views/accounts/opportunities.js.rjs +0 -3
- data/app/views/campaigns/leads.js.rjs +0 -3
- data/app/views/campaigns/opportunities.js.rjs +0 -3
- data/app/views/contacts/opportunities.js.rjs +0 -3
- data/app/views/home/_actions_menu.html.haml +0 -8
- data/lib/dynamic_form/MIT-LICENSE +0 -20
- data/lib/dynamic_form/README +0 -13
- data/lib/dynamic_form/Rakefile +0 -10
- data/lib/dynamic_form/dynamic_form.gemspec +0 -12
- data/lib/dynamic_form/init.rb +0 -2
- data/lib/dynamic_form/lib/action_view/helpers/dynamic_form.rb +0 -301
- data/lib/dynamic_form/lib/action_view/locale/en-US.yml +0 -8
- data/lib/dynamic_form/lib/dynamic_form.rb +0 -6
- data/lib/dynamic_form/test/dynamic_form_i18n_test.rb +0 -42
- data/lib/dynamic_form/test/dynamic_form_test.rb +0 -370
- data/lib/dynamic_form/test/test_helper.rb +0 -10
- data/lib/responds_to_parent/MIT-LICENSE +0 -20
- data/lib/responds_to_parent/README +0 -47
- data/lib/responds_to_parent/Rakefile +0 -22
- data/lib/responds_to_parent/init.rb +0 -2
- data/lib/responds_to_parent/install.rb +0 -2
- data/lib/responds_to_parent/lib/responds_to_parent.rb +0 -70
- data/lib/responds_to_parent/test/responds_to_parent_test.rb +0 -11
- data/lib/responds_to_parent/test/test_helper.rb +0 -7
- data/lib/responds_to_parent/uninstall.rb +0 -2
- data/spec/models/polymorphic/activity_spec.rb +0 -303
@@ -0,0 +1,3 @@
|
|
1
|
+
contacts = @entity.contacts.paginate(:page => params[:page], :per_page => 20)
|
2
|
+
page['contacts'].replace_html :partial => 'contacts/contact', :collection => contacts
|
3
|
+
page['contacts_pagination'].replace_html will_paginate(contacts, :container => false, :params => {:action => :contacts})
|
@@ -0,0 +1,3 @@
|
|
1
|
+
opportunities = @entity.opportunities.paginate(:page => params[:page], :per_page => 20)
|
2
|
+
page['opportunities'].replace_html :partial => 'opportunities/opportunity', :collection => @opportunities
|
3
|
+
page['opportunities_pagination'].replace_html will_paginate(opportunities, :container => false, :params => {:action => :opportunities})
|
@@ -0,0 +1,3 @@
|
|
1
|
+
versions = Version.history(@entity).paginate(:page => params[:page], :per_page => 10)
|
2
|
+
page['versions'].replace_html :partial => 'versions/version', :collection => versions
|
3
|
+
page['versions_pagination'].replace_html will_paginate(versions, :container => false, :params => {:action => :versions})
|
@@ -1,22 +1,23 @@
|
|
1
|
-
|
2
|
-
.tools
|
3
|
-
%small= l(activity.created_at, :format => :short)
|
4
|
-
%tt
|
5
|
-
= link_to avatar_for(activity.user, :size => "16x16"), user_path(activity.user)
|
1
|
+
- user = link_to(h(activity.user.full_name), user_path(activity.user)) if activity.user
|
6
2
|
|
7
|
-
|
8
|
-
|
9
|
-
-
|
10
|
-
- subject = if activity.subject
|
11
|
-
- if activity.subject.respond_to?(:full_name)
|
12
|
-
- link_to(h(activity.subject.full_name), polymorphic_url(activity.subject))
|
13
|
-
- elsif activity.subject_type != "Task"
|
14
|
-
- link_to(h(activity.subject.name), polymorphic_url(activity.subject))
|
15
|
-
- else
|
16
|
-
- %Q{<span style="color:black;">#{h(activity.subject.name)}</span>} # Individual tasks have no landing pages where we could link to.
|
17
|
-
- else
|
18
|
-
- activity.info # Use info if the subject has been deleted.
|
3
|
+
- subject = if (item = activity.related || activity.item)
|
4
|
+
- if item.respond_to?(:full_name)
|
5
|
+
- link_to item.full_name, polymorphic_url(item)
|
19
6
|
|
20
|
-
|
7
|
+
- elsif [Account, Campaign, Contact, Lead, Opportunity].include?(item.class)
|
8
|
+
- link_to item.name, polymorphic_url(item)
|
21
9
|
|
10
|
+
- elsif item.respond_to?(:name)
|
11
|
+
- content_tag :span, item.name, :style => "color:black;" # Individual tasks have no landing pages where we could link to.
|
22
12
|
|
13
|
+
- if user.present? and subject.present?
|
14
|
+
%li[activity]
|
15
|
+
.tools
|
16
|
+
%small
|
17
|
+
= l(activity.created_at, :format => :short)
|
18
|
+
%tt
|
19
|
+
= link_to avatar_for(activity.user, :size => :thumb), user_path(activity.user)
|
20
|
+
|
21
|
+
- action = t('action_' + activity.event)
|
22
|
+
- type = t('subject_' + activity.item_type.downcase)
|
23
|
+
= t("activity_text", :user => user, :action => action, :type => type, :subject => subject, :default => "#{user} #{action} #{type} #{subject}").html_safe # locales optionally can change the word order for activities using 'activity_text'
|
@@ -3,12 +3,11 @@
|
|
3
3
|
= hidden_field_tag "account[user_id]", @current_user.id
|
4
4
|
|
5
5
|
-# activity_options: Show %{models} %{action_type} performed by %{user} in the past %{period}
|
6
|
-
= t(:activity_options, :models => link_to(t(@asset).singularize.downcase, "#", :id => :asset), :action_type => link_to(t(@action + "_past_participle").downcase, "#", :id => :
|
6
|
+
= t(:activity_options, :models => link_to(t(@asset).singularize.downcase, "#", :id => :asset), :action_type => link_to(t(@action + "_past_participle").downcase, "#", :id => :event), :user => link_to(t(@user), "#", :id => :user), :period => link_to(t(@duration).downcase, "#", :id => :duration)).html_safe
|
7
7
|
%p
|
8
8
|
|
9
9
|
%script
|
10
10
|
= render "assets_menu"
|
11
|
-
= render "
|
11
|
+
= render "events_menu"
|
12
12
|
= render "users_menu"
|
13
13
|
= render "duration_menu"
|
14
|
-
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
.title
|
5
5
|
%span#title #{t :recent_activity}
|
6
|
-
= image_tag("loading.gif", :size =>
|
6
|
+
= image_tag("loading.gif", :size => :thumb, :id => "loading", :style => "display: none;")
|
7
7
|
.remote#options{ hidden }
|
8
8
|
|
9
9
|
.list#activities
|
@@ -1,40 +1,59 @@
|
|
1
|
-
%li[lead]
|
1
|
+
%li.highlight[lead]
|
2
2
|
- if lead.status
|
3
|
-
.strip{:class => lead.status}
|
3
|
+
.strip{:class => lead.status}= t lead.status
|
4
4
|
- else
|
5
|
-
.strip{:style => "color: gray;"}
|
6
|
-
|
7
|
-
.tools
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
5
|
+
.strip{:style => "color: gray;"}= t :other
|
6
|
+
|
7
|
+
%ul.tools
|
8
|
+
- if can?(:update, lead)
|
9
|
+
%li= link_to_edit(lead)
|
10
|
+
|
11
|
+
- if %w(converted rejected).include?(lead.status)
|
12
|
+
%li
|
13
|
+
%font{ :color => 'silver' }= t :convert
|
14
|
+
- elsif can?(:update, lead)
|
15
|
+
%li= link_to_convert(lead)
|
16
|
+
|
17
|
+
- if lead.status == "rejected"
|
18
|
+
%li
|
19
|
+
%font{ :color => 'silver' }= t :reject
|
20
|
+
- elsif can?(:update, lead)
|
21
|
+
%li= link_to_reject(lead)
|
22
|
+
|
23
|
+
- if shown_on_landing_page?
|
24
|
+
%li= link_to_discard(lead)
|
25
|
+
|
26
|
+
- if can?(:destroy, lead)
|
27
|
+
%li= link_to_delete(lead)
|
19
28
|
|
20
29
|
.indent
|
21
|
-
=
|
30
|
+
= link_to_if can?(:read, lead), lead.full_name(@current_user.preference[:leads_naming]), lead
|
22
31
|
%tt
|
23
32
|
- if lead.company? && lead.title?
|
24
33
|
= t(:works_at, :job_title => lead.title, :company => lead.company)
|
25
34
|
- else
|
26
35
|
= lead.company if lead.company?
|
27
36
|
= lead.title if lead.title?
|
28
|
-
-#= link_to(h(lead.campaign.name), lead.campaign) if lead.campaign_id
|
29
37
|
- if lead.referred_by?
|
30
38
|
–
|
31
|
-
|
39
|
+
== #{t :referred_by_small} #{lead.referred_by}
|
40
|
+
|
32
41
|
- unless @current_user.preference[:leads_outline] == "brief"
|
33
42
|
%dt
|
34
|
-
= stars_for(lead)
|
35
|
-
|
36
|
-
|
37
|
-
|
43
|
+
= stars_for(lead)
|
44
|
+
|
|
45
|
+
- if can?(:read, lead)
|
46
|
+
- if lead.email.present?
|
47
|
+
= link_to_email(lead.email)
|
48
|
+
|
|
49
|
+
- if lead.phone.present?
|
50
|
+
== #{t :phone_small}:
|
51
|
+
%b= lead.phone
|
52
|
+
|
|
53
|
+
- if lead.mobile.present?
|
54
|
+
== #{t :mobile_small}:
|
55
|
+
%b= lead.mobile
|
56
|
+
|
|
38
57
|
= t(:added_ago, time_ago_in_words(lead.created_at))
|
39
58
|
- if lead.tag_list.present?
|
40
59
|
%dt
|
@@ -0,0 +1,6 @@
|
|
1
|
+
= section(object, :leads)
|
2
|
+
.list#leads
|
3
|
+
- leads = object.leads.paginate(:page => 1, :per_page => 20)
|
4
|
+
= render :partial => "leads/lead", :collection => object.leads.paginate(:page => 1, :per_page => 20)
|
5
|
+
|
6
|
+
= will_paginate leads, :id => 'leads_pagination', :params => {:action => :leads}
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
.title
|
10
10
|
%span#create_lead_title #{t :leads}
|
11
|
-
= image_tag("loading.gif", :size =>
|
11
|
+
= image_tag("loading.gif", :size => :thumb, :id => "loading", :style => "display: none;")
|
12
12
|
.remote#options{ hidden }
|
13
13
|
.remote#advanced_search{ hidden_if(!params[:q]) }
|
14
14
|
- if @search
|
@@ -18,18 +18,8 @@
|
|
18
18
|
|
19
19
|
= hook(:show_lead_bottom, self) do
|
20
20
|
|
21
|
-
=
|
22
|
-
.log#tasks
|
23
|
-
= render "shared/tasks"
|
21
|
+
= render :partial => "tasks/tasks", :locals => {:object => @lead}
|
24
22
|
|
25
|
-
=
|
26
|
-
|
27
|
-
%br( style="clear:both" )
|
23
|
+
= render :partial => "versions/versions", :locals => {:object => @lead}
|
28
24
|
|
29
|
-
|
30
|
-
%br
|
31
|
-
= content_tag(:div, t(:versions), :class => :subtitle)
|
32
|
-
.list#versions
|
33
|
-
- @versions = @lead.versions.except(:order).order('created_at DESC').paginate(:page => 1, :per_page => 20)
|
34
|
-
= render :partial => "versions/version", :collection => @versions
|
35
|
-
= will_paginate @versions, :id => true, :params => {:action => :versions}
|
25
|
+
= load_select_popups_for(@lead, :tasks)
|
@@ -0,0 +1,6 @@
|
|
1
|
+
= section(object, :opportunities)
|
2
|
+
.list#opportunities
|
3
|
+
- opportunities = object.opportunities.paginate(:page => 1, :per_page => 20)
|
4
|
+
= render :partial => "opportunities/opportunity", :collection => opportunities
|
5
|
+
|
6
|
+
= will_paginate opportunities, :id => 'opportunities_pagination', :params => {:action => :opportunities}
|
@@ -1,29 +1,40 @@
|
|
1
|
-
%li[opportunity]
|
1
|
+
%li.highlight[opportunity]
|
2
2
|
- if opportunity.stage
|
3
3
|
.strip{:class => opportunity.stage}= t(opportunity.stage)
|
4
4
|
- else
|
5
5
|
.strip.white #{t :other}
|
6
6
|
|
7
|
-
.tools
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
%ul.tools
|
8
|
+
- if can?(:update, opportunity)
|
9
|
+
%li= link_to_edit(opportunity)
|
10
|
+
|
11
|
+
- if shown_on_landing_page?
|
12
|
+
%li= link_to_discard(opportunity)
|
13
|
+
|
14
|
+
- if can?(:destroy, opportunity)
|
15
|
+
%li= link_to_delete(opportunity)
|
11
16
|
|
12
17
|
.indent
|
13
|
-
=
|
14
|
-
- if opportunity.account &&
|
15
|
-
== #{t :from} #{
|
18
|
+
= link_to_if can?(:read, opportunity), opportunity.name, opportunity
|
19
|
+
- if (account = opportunity.account) && account.id
|
20
|
+
== #{t :from} #{link_to_if can?(:read, account), account.name, account_path(account)}
|
16
21
|
%tt
|
17
22
|
–
|
18
|
-
|
23
|
+
- user_name = opportunity.user_id == @current_user.id ? t(:me) : opportunity.user.full_name
|
24
|
+
= t(:added_by, :time_ago => time_ago_in_words(opportunity.created_at), :user => user_name)
|
25
|
+
|
19
26
|
- unless @current_user.preference[:opportunities_outline] == "brief"
|
20
27
|
%dt
|
21
28
|
%b= number_to_currency(opportunity.weighted_amount, :precision => 0) + " | "
|
22
29
|
- won_or_lost = %w(won lost).include?(opportunity.stage)
|
23
30
|
- unless won_or_lost
|
24
|
-
|
25
|
-
|
31
|
+
= number_to_currency(opportunity.amount || 0, :precision => 0)
|
32
|
+
- if opportunity.discount
|
33
|
+
= t(:discount_number, number_to_currency(opportunity.discount, :precision => 0))
|
34
|
+
- else
|
35
|
+
= t(:no_discount)
|
26
36
|
= t(:probability_number, (opportunity.probability || 0).to_s + '%') + " | "
|
37
|
+
|
27
38
|
- if opportunity.closes_on
|
28
39
|
- if won_or_lost
|
29
40
|
- if opportunity.closes_on >= Date.today
|
@@ -38,6 +49,7 @@
|
|
38
49
|
%span.warn= t(:past_due, distance_of_time_in_words(opportunity.closes_on, Date.today))
|
39
50
|
- else
|
40
51
|
= t(:no_closing_date)
|
52
|
+
|
41
53
|
- if opportunity.tag_list.present?
|
42
54
|
%dt
|
43
55
|
.tags= tags_for_index(opportunity)
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
.title
|
10
10
|
%span#create_opportunity_title #{t :opportunities}
|
11
|
-
= image_tag("loading.gif", :size =>
|
11
|
+
= image_tag("loading.gif", :size => :thumb, :id => "loading", :style => "display: none;")
|
12
12
|
.remote#options{ hidden }
|
13
13
|
.remote#advanced_search{ hidden_if(!params[:q]) }
|
14
14
|
- if @search
|
@@ -13,24 +13,10 @@
|
|
13
13
|
|
14
14
|
= hook(:show_opportunity_bottom, self) do
|
15
15
|
|
16
|
-
=
|
17
|
-
.log#tasks
|
18
|
-
= render "shared/tasks"
|
16
|
+
= render :partial => "tasks/tasks", :locals => {:object => @opportunity}
|
19
17
|
|
20
|
-
=
|
21
|
-
.list#contacts
|
22
|
-
- @contacts = @opportunity.contacts.paginate(:page => 1, :per_page => 20)
|
23
|
-
= render :partial => "contacts/contact", :collection => @opportunity.contacts.paginate(:page => 1, :per_page => 20)
|
24
|
-
= will_paginate @contacts, :id => true, :params => {:action => :contacts}
|
18
|
+
= render :partial => "contacts/contacts", :locals => {:object => @opportunity}
|
25
19
|
|
26
|
-
=
|
27
|
-
|
28
|
-
%br( style="clear:both" )
|
20
|
+
= render :partial => "versions/versions", :locals => {:object => @opportunity}
|
29
21
|
|
30
|
-
|
31
|
-
%br
|
32
|
-
= content_tag(:div, t(:versions), :class => :subtitle)
|
33
|
-
.list#versions
|
34
|
-
- @versions = @opportunity.versions.except(:order).order('created_at DESC').paginate(:page => 1, :per_page => 20)
|
35
|
-
= render :partial => "versions/version", :collection => @versions
|
36
|
-
= will_paginate @versions, :id => true, :params => {:action => :versions}
|
22
|
+
= load_select_popups_for(@opportunity, :tasks, :contacts)
|
@@ -1,7 +1,7 @@
|
|
1
|
-
%li[comment]
|
2
|
-
= link_to avatar_for(comment.user, :size =>
|
1
|
+
%li.highlight[comment]
|
2
|
+
= link_to avatar_for(comment.user, :size => :small), user_path(comment.user)
|
3
3
|
|
4
|
-
.tools
|
4
|
+
.tools
|
5
5
|
= link_to_edit(comment) + " | "
|
6
6
|
= link_to_delete(comment)
|
7
7
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
- class_name = commentable.class.name.downcase
|
2
2
|
.comment#comment_edit{:style => "margin: 5px 0px 0px 0px"}
|
3
|
-
= link_to avatar_for(@current_user, :size =>
|
3
|
+
= link_to avatar_for(@current_user, :size => :small), user_path(@current_user)
|
4
4
|
#post
|
5
5
|
= form_for(@comment, :remote => true) do |f|
|
6
6
|
= hidden_field_tag "comment[user_id]", @current_user.id
|
@@ -1,4 +1,4 @@
|
|
1
|
-
- title = (recent.
|
2
|
-
%li{ :class => recent != @
|
3
|
-
%dt= link_to(truncate(title, :length => 19), polymorphic_url(recent.
|
4
|
-
%tt= t(recent.
|
1
|
+
- title = (recent.item.respond_to?(:full_name) ? recent.item.full_name : recent.item.name)
|
2
|
+
%li{ :class => recent != @versions.last ? "" : "last" }
|
3
|
+
%dt= link_to(truncate(title, :length => 19), polymorphic_url(recent.item), :title => title)
|
4
|
+
%tt= t(recent.item_type.downcase) + ":"
|
@@ -1,7 +1,7 @@
|
|
1
|
-
- @
|
1
|
+
- @versions = Version.recent_for_user(@current_user)
|
2
2
|
.panel#recently
|
3
3
|
.caption #{t :recent_items}
|
4
|
-
-
|
5
|
-
= render :partial => "shared/recent", :collection => @
|
4
|
+
- if @versions.present?
|
5
|
+
= render :partial => "shared/recent", :collection => @versions
|
6
6
|
- else
|
7
7
|
%div #{t :no_recent_items}
|
@@ -1,3 +1,2 @@
|
|
1
|
-
- type = timeline.class.
|
2
|
-
|
3
|
-
= render template, :"#{type}" => timeline
|
1
|
+
- type = timeline.class.name.downcase
|
2
|
+
= render "#{type.pluralize}/#{type}", type.to_sym => timeline
|
@@ -1,10 +1,10 @@
|
|
1
|
-
%li[assigned]
|
1
|
+
%li.highlight[assigned]
|
2
2
|
- unless assigned.category.blank?
|
3
3
|
.strip{:class => assigned.category}= t(assigned.category)
|
4
4
|
- else
|
5
5
|
.strip.white #{t :other}
|
6
6
|
|
7
|
-
.tools
|
7
|
+
.tools
|
8
8
|
= link_to_task_edit(assigned, bucket) + " | "
|
9
9
|
= link_to_discard(assigned) + " | " if shown_on_landing_page?
|
10
10
|
= link_to_task_delete(assigned, bucket)
|
@@ -26,7 +26,7 @@
|
|
26
26
|
- if assigned.at_specific_time?
|
27
27
|
- if assigned.due_at < Time.now
|
28
28
|
%span.warn= distance_of_time_in_words(assigned.due_at, Time.now)
|
29
|
-
= t(:task_overdue)
|
29
|
+
= t(:task_overdue)
|
30
30
|
= l(assigned.due_at.localtime, :format => :mmddhhss)
|
31
31
|
- else
|
32
32
|
= t(:task_due_in, distance_of_time_in_words(Time.now, assigned.due_at))
|
@@ -34,7 +34,7 @@
|
|
34
34
|
|
35
35
|
- else
|
36
36
|
- if assigned.due_at < Date.today
|
37
|
-
%span.warn= distance_of_time_in_words(assigned.due_at, Time.now)
|
37
|
+
%span.warn= distance_of_time_in_words(assigned.due_at, Time.now)
|
38
38
|
= t(:task_overdue)
|
39
39
|
= l(assigned.due_at.localtime.to_date, :format => :mmdd)
|
40
40
|
- elsif assigned.due_at > Date.today
|
@@ -1,10 +1,10 @@
|
|
1
|
-
%li[completed]
|
1
|
+
%li.highlight[completed]
|
2
2
|
- unless completed.category.blank?
|
3
3
|
.strip{:class => completed.category}= t(completed.category)
|
4
4
|
- else
|
5
5
|
.strip.white #{t :other}
|
6
6
|
|
7
|
-
.tools
|
7
|
+
.tools
|
8
8
|
- if shown_on_landing_page?
|
9
9
|
= link_to_discard(completed) + (@current_user == completed.user ? ' | ' : '')
|
10
10
|
= link_to_task_delete(completed, bucket) if @current_user == completed.user
|
@@ -1,10 +1,10 @@
|
|
1
|
-
%li[pending]
|
1
|
+
%li.highlight[pending]
|
2
2
|
- unless pending.category.blank?
|
3
3
|
.strip{:class => pending.category}= t(pending.category)
|
4
4
|
- else
|
5
5
|
.strip.white #{t :other}
|
6
6
|
|
7
|
-
.tools
|
7
|
+
.tools
|
8
8
|
= link_to_task_edit(pending, bucket) + " | "
|
9
9
|
= link_to_discard(pending) + " | " if shown_on_landing_page?
|
10
10
|
= link_to_task_delete(pending, bucket)
|
@@ -1,10 +1,9 @@
|
|
1
|
-
%li[related]
|
1
|
+
%li.highlight[related]
|
2
2
|
- unless related.category.blank?
|
3
3
|
.strip{:class => related.category}= t(related.category)
|
4
4
|
- else
|
5
5
|
.strip{:style => "color:white"} #{t :other}
|
6
6
|
%div
|
7
|
-
.tools{ invisible, :id => dom_id(related, :tools) }
|
8
7
|
- if related.assigned_to
|
9
8
|
= link_to(related.assignee.full_name, user_path(related.assignee))
|
10
9
|
- else
|
@@ -18,16 +17,16 @@
|
|
18
17
|
%span.cool
|
19
18
|
= t(:task_completed_ago, distance_of_time_in_words(related.completed_at, Time.now))
|
20
19
|
- elsif related.bucket == "due_asap"
|
21
|
-
%span.urgent
|
20
|
+
%span.urgent
|
22
21
|
== #{t :due_now}.
|
23
22
|
- elsif related.bucket == "due_later"
|
24
23
|
== #{t :due_later}.
|
25
24
|
- elsif related.due_at < Date.today
|
26
|
-
%span.warn= distance_of_time_in_words(related.due_at, Date.today)
|
25
|
+
%span.warn= distance_of_time_in_words(related.due_at, Date.today)
|
27
26
|
== #{t :overdue} #{related.due_at.strftime('%b %e')}
|
28
27
|
- elsif related.due_at > Date.today
|
29
28
|
= t(:task_due_in, distance_of_time_in_words(Time.now, related.due_at.end_of_day))
|
30
29
|
- else
|
31
30
|
%span.cool
|
32
31
|
== #{t :due_today}.
|
33
|
-
|
32
|
+
|