fat_free_crm 0.19.2 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fat_free_crm might be problematic. Click here for more details.

Files changed (226) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/brakeman-analysis.yml +46 -0
  3. data/.github/workflows/rubocop-analysis.yml +40 -0
  4. data/.github/workflows/ruby.yml +52 -0
  5. data/.rubocop_todo.yml +49 -43
  6. data/.travis.yml +1 -20
  7. data/CHANGELOG.md +13 -0
  8. data/Gemfile +9 -5
  9. data/Gemfile.lock +163 -119
  10. data/README.md +4 -3
  11. data/SECURITY.md +11 -0
  12. data/app/assets/javascripts/application.js.erb +3 -0
  13. data/app/assets/stylesheets/application.css.erb +1 -0
  14. data/app/assets/stylesheets/base.scss +9 -2
  15. data/app/assets/stylesheets/bootstrap-custom.scss +206 -0
  16. data/app/assets/stylesheets/common.scss +87 -67
  17. data/app/assets/stylesheets/header.scss +0 -8
  18. data/app/controllers/admin/field_groups_controller.rb +1 -1
  19. data/app/controllers/admin/fields_controller.rb +1 -1
  20. data/app/controllers/admin/groups_controller.rb +1 -1
  21. data/app/controllers/admin/tags_controller.rb +2 -2
  22. data/app/controllers/admin/users_controller.rb +2 -1
  23. data/app/controllers/application_controller.rb +10 -0
  24. data/app/controllers/comments_controller.rb +1 -1
  25. data/app/controllers/entities/accounts_controller.rb +1 -1
  26. data/app/controllers/entities/campaigns_controller.rb +1 -1
  27. data/app/controllers/home_controller.rb +3 -1
  28. data/app/controllers/lists_controller.rb +1 -1
  29. data/app/controllers/tasks_controller.rb +3 -3
  30. data/app/controllers/users_controller.rb +3 -1
  31. data/app/helpers/accounts_helper.rb +12 -0
  32. data/app/helpers/application_helper.rb +3 -5
  33. data/app/helpers/tasks_helper.rb +2 -2
  34. data/app/models/entities/account.rb +1 -1
  35. data/app/models/entities/account_contact.rb +1 -1
  36. data/app/models/entities/account_opportunity.rb +1 -1
  37. data/app/models/entities/campaign.rb +1 -1
  38. data/app/models/entities/contact.rb +1 -1
  39. data/app/models/entities/lead.rb +1 -1
  40. data/app/models/entities/opportunity.rb +1 -1
  41. data/app/models/fields/custom_field_pair.rb +2 -2
  42. data/app/models/observers/opportunity_observer.rb +1 -1
  43. data/app/models/polymorphic/address.rb +1 -1
  44. data/app/models/polymorphic/comment.rb +1 -1
  45. data/app/models/polymorphic/email.rb +1 -1
  46. data/app/models/polymorphic/task.rb +1 -1
  47. data/app/models/setting.rb +4 -2
  48. data/app/models/users/preference.rb +2 -2
  49. data/app/models/users/user.rb +2 -2
  50. data/app/views/accounts/_edit.html.haml +2 -2
  51. data/app/views/accounts/_new.html.haml +2 -2
  52. data/app/views/accounts/_sidebar_index.html.haml +2 -2
  53. data/app/views/accounts/_sidebar_show.html.haml +19 -19
  54. data/app/views/accounts/create.js.haml +1 -2
  55. data/app/views/accounts/destroy.js.haml +1 -1
  56. data/app/views/accounts/show.html.haml +1 -0
  57. data/app/views/accounts/update.js.haml +2 -3
  58. data/app/views/admin/field_groups/create.js.haml +0 -1
  59. data/app/views/admin/field_groups/destroy.js.haml +0 -1
  60. data/app/views/admin/field_groups/update.js.haml +0 -1
  61. data/app/views/admin/fields/create.js.haml +0 -1
  62. data/app/views/admin/fields/destroy.js.haml +0 -1
  63. data/app/views/admin/fields/update.js.haml +0 -1
  64. data/app/views/admin/groups/create.js.haml +0 -1
  65. data/app/views/admin/groups/destroy.js.haml +0 -1
  66. data/app/views/admin/groups/update.js.haml +0 -1
  67. data/app/views/admin/tags/create.js.haml +0 -1
  68. data/app/views/admin/tags/destroy.js.haml +0 -1
  69. data/app/views/admin/tags/update.js.haml +0 -1
  70. data/app/views/admin/users/create.js.haml +0 -1
  71. data/app/views/admin/users/destroy.js.haml +0 -1
  72. data/app/views/admin/users/update.js.haml +0 -1
  73. data/app/views/campaigns/_edit.html.haml +1 -1
  74. data/app/views/campaigns/_new.html.haml +1 -1
  75. data/app/views/campaigns/_sidebar_index.html.haml +2 -2
  76. data/app/views/campaigns/_sidebar_show.html.haml +68 -67
  77. data/app/views/campaigns/create.js.haml +1 -2
  78. data/app/views/campaigns/destroy.js.haml +1 -1
  79. data/app/views/campaigns/show.html.haml +1 -0
  80. data/app/views/campaigns/update.js.haml +3 -4
  81. data/app/views/comments/_edit.html.haml +1 -1
  82. data/app/views/comments/_new.html.haml +1 -1
  83. data/app/views/comments/update.js.haml +0 -1
  84. data/app/views/contacts/_edit.html.haml +1 -1
  85. data/app/views/contacts/_new.html.haml +1 -1
  86. data/app/views/contacts/_sidebar_show.html.haml +18 -18
  87. data/app/views/contacts/create.js.haml +0 -1
  88. data/app/views/contacts/destroy.js.haml +1 -1
  89. data/app/views/contacts/show.html.haml +1 -0
  90. data/app/views/contacts/update.js.haml +2 -3
  91. data/app/views/entities/_title_bar.html.haml +1 -1
  92. data/app/views/entities/attach.js.haml +2 -2
  93. data/app/views/entities/discard.js.haml +2 -2
  94. data/app/views/home/_opportunity.html.haml +1 -1
  95. data/app/views/home/_task.html.haml +1 -1
  96. data/app/views/home/index.xls.builder +51 -0
  97. data/app/views/layouts/_sidebar.html.haml +2 -2
  98. data/app/views/layouts/_tabbed.html.haml +14 -11
  99. data/app/views/layouts/application.html.haml +2 -2
  100. data/app/views/leads/_edit.html.haml +2 -2
  101. data/app/views/leads/_new.html.haml +2 -2
  102. data/app/views/leads/_sidebar_index.html.haml +2 -2
  103. data/app/views/leads/_sidebar_show.html.haml +30 -30
  104. data/app/views/leads/create.js.haml +2 -3
  105. data/app/views/leads/destroy.js.haml +2 -2
  106. data/app/views/leads/promote.js.haml +3 -4
  107. data/app/views/leads/reject.js.haml +3 -3
  108. data/app/views/leads/show.html.haml +1 -1
  109. data/app/views/leads/update.js.haml +4 -5
  110. data/app/views/lists/create.js.haml +0 -1
  111. data/app/views/opportunities/_edit.html.haml +1 -1
  112. data/app/views/opportunities/_index_brief.html.haml +1 -1
  113. data/app/views/opportunities/_index_long.html.haml +1 -1
  114. data/app/views/opportunities/_new.html.haml +1 -1
  115. data/app/views/opportunities/_sidebar_index.html.haml +2 -2
  116. data/app/views/opportunities/_sidebar_show.html.haml +47 -46
  117. data/app/views/opportunities/create.js.haml +3 -4
  118. data/app/views/opportunities/destroy.js.haml +3 -3
  119. data/app/views/opportunities/show.html.haml +1 -0
  120. data/app/views/opportunities/update.js.haml +5 -6
  121. data/app/views/shared/_inline_styles.html.haml +0 -26
  122. data/app/views/tasks/_assigned.html.haml +1 -1
  123. data/app/views/tasks/_completed.html.haml +1 -1
  124. data/app/views/tasks/_edit.html.haml +1 -1
  125. data/app/views/tasks/_new.html.haml +1 -1
  126. data/app/views/tasks/_pending.html.haml +1 -1
  127. data/app/views/tasks/_related.html.haml +1 -1
  128. data/app/views/tasks/_selector.html.haml +7 -8
  129. data/app/views/tasks/_sidebar_index.html.haml +2 -2
  130. data/app/views/tasks/_title.html.haml +1 -1
  131. data/app/views/tasks/complete.js.haml +1 -1
  132. data/app/views/tasks/create.js.haml +1 -2
  133. data/app/views/tasks/destroy.js.haml +1 -1
  134. data/app/views/tasks/uncomplete.js.haml +1 -2
  135. data/app/views/tasks/update.js.haml +0 -1
  136. data/app/views/users/change_password.js.haml +0 -1
  137. data/app/views/users/update.js.haml +0 -1
  138. data/app/views/users/upload_avatar.js.haml +0 -1
  139. data/app/views/versions/_version_item.html.haml +1 -1
  140. data/bin/setup +6 -6
  141. data/config/application.rb +1 -1
  142. data/config/environment.rb +1 -1
  143. data/config/initializers/content_security_policy.rb +5 -0
  144. data/config/initializers/new_framework_defaults_6_0.rb +46 -0
  145. data/config/initializers/simple_form.rb +135 -55
  146. data/config/initializers/simple_form_bootstrap.rb +433 -0
  147. data/config/locales/fat_free_crm.cs.yml +86 -47
  148. data/config/locales/fat_free_crm.ru.yml +1 -0
  149. data/config/settings.default.yml +0 -41
  150. data/db/migrate/20200806004152_add_pattern_to_fields.rb +7 -0
  151. data/db/migrate/20200806004459_add_html5_to_fields.rb +10 -0
  152. data/db/schema.rb +11 -6
  153. data/fat_free_crm.gemspec +4 -4
  154. data/lib/fat_free_crm/core_ext.rb +1 -1
  155. data/lib/fat_free_crm/gem_ext.rb +0 -1
  156. data/lib/fat_free_crm/tabs.rb +2 -2
  157. data/lib/fat_free_crm/version.rb +2 -2
  158. data/lib/gravatar_image_tag.rb +1 -1
  159. data/lib/tasks/ffcrm/preference_update.rake +19 -0
  160. data/lib/tasks/ffcrm/setup.rake +1 -1
  161. data/lib/templates/erb/scaffold/_form.html.erb +4 -2
  162. data/spec/controllers/comments_controller_spec.rb +6 -6
  163. data/spec/controllers/home_controller_spec.rb +3 -3
  164. data/spec/controllers/users_controller_spec.rb +13 -1
  165. data/spec/factories/user_factories.rb +5 -2
  166. data/spec/features/acceptance_helper.rb +1 -1
  167. data/spec/features/accounts_spec.rb +2 -2
  168. data/spec/features/admin/groups_spec.rb +1 -1
  169. data/spec/features/admin/users_spec.rb +1 -1
  170. data/spec/features/campaigns_spec.rb +2 -2
  171. data/spec/features/contacts_spec.rb +2 -5
  172. data/spec/features/leads_spec.rb +11 -7
  173. data/spec/features/opportunities_spec.rb +4 -4
  174. data/spec/features/support/browser.rb +6 -2
  175. data/spec/features/support/selector_helpers.rb +10 -1
  176. data/spec/features/tasks_spec.rb +6 -6
  177. data/spec/helpers/accounts_helper_spec.rb +57 -0
  178. data/spec/models/entities/opportunity_spec.rb +2 -2
  179. data/spec/models/fields/custom_field_pair_spec.rb +2 -2
  180. data/spec/models/observers/entity_observer_spec.rb +3 -3
  181. data/spec/models/polymorphic/task_spec.rb +11 -11
  182. data/spec/models/polymorphic/version_spec.rb +2 -2
  183. data/spec/models/users/preference_spec.rb +1 -1
  184. data/spec/views/accounts/_edit.haml_spec.rb +1 -1
  185. data/spec/views/accounts/_new.haml_spec.rb +1 -1
  186. data/spec/views/accounts/create.js.haml_spec.rb +0 -1
  187. data/spec/views/accounts/update.js.haml_spec.rb +2 -5
  188. data/spec/views/admin/field_groups/create.js.haml_spec.rb +0 -1
  189. data/spec/views/admin/field_groups/update.js.haml_spec.rb +0 -1
  190. data/spec/views/admin/users/create.js.haml_spec.rb +0 -1
  191. data/spec/views/admin/users/destroy.js.haml_spec.rb +0 -6
  192. data/spec/views/admin/users/update.js.haml_spec.rb +1 -2
  193. data/spec/views/campaigns/_edit.haml_spec.rb +1 -1
  194. data/spec/views/campaigns/_new.haml_spec.rb +1 -1
  195. data/spec/views/campaigns/create.js.haml_spec.rb +0 -1
  196. data/spec/views/campaigns/destroy.js.haml_spec.rb +0 -1
  197. data/spec/views/campaigns/update.js.haml_spec.rb +2 -6
  198. data/spec/views/contacts/_edit.haml_spec.rb +1 -1
  199. data/spec/views/contacts/_new.haml_spec.rb +1 -1
  200. data/spec/views/contacts/create.js.haml_spec.rb +0 -1
  201. data/spec/views/contacts/update.js.haml_spec.rb +3 -7
  202. data/spec/views/home/index.haml_spec.rb +2 -2
  203. data/spec/views/leads/_edit.haml_spec.rb +1 -1
  204. data/spec/views/leads/_new.haml_spec.rb +1 -1
  205. data/spec/views/leads/create.js.haml_spec.rb +0 -3
  206. data/spec/views/leads/destroy.js.haml_spec.rb +0 -2
  207. data/spec/views/leads/promote.js.haml_spec.rb +3 -11
  208. data/spec/views/leads/reject.js.haml_spec.rb +0 -3
  209. data/spec/views/leads/update.js.haml_spec.rb +3 -11
  210. data/spec/views/opportunities/_edit.haml_spec.rb +1 -1
  211. data/spec/views/opportunities/_new.haml_spec.rb +1 -1
  212. data/spec/views/opportunities/create.js.haml_spec.rb +0 -2
  213. data/spec/views/opportunities/destroy.js.haml_spec.rb +0 -3
  214. data/spec/views/opportunities/update.js.haml_spec.rb +3 -11
  215. data/spec/views/tasks/_edit.haml_spec.rb +1 -1
  216. data/spec/views/tasks/complete.js.haml_spec.rb +0 -1
  217. data/spec/views/tasks/create.js.haml_spec.rb +0 -2
  218. data/spec/views/tasks/destroy.js.haml_spec.rb +0 -1
  219. data/spec/views/tasks/uncomplete.js.haml_spec.rb +0 -1
  220. data/spec/views/tasks/update.js.haml_spec.rb +1 -4
  221. data/spec/views/users/change_password.js.haml_spec.rb +1 -2
  222. data/spec/views/users/update.js.haml_spec.rb +1 -2
  223. data/spec/views/users/upload_avatar.js.haml_spec.rb +1 -2
  224. metadata +23 -14
  225. data/config/initializers/new_framework_defaults_5_2.rb +0 -40
  226. data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +0 -24
@@ -1,82 +1,83 @@
1
1
  .panel#summary
2
2
  .caption #{t :campaign_summary}
3
- %li
4
- %dt= @campaign.starts_on ? l(@campaign.starts_on, format: :mmdd) : t(:n_a)
5
- %tt #{t :start_date}:
6
- %li
7
- %dt= @campaign.ends_on ? l(@campaign.ends_on, format: :mmdd) : t(:n_a)
8
- %tt #{t :end_date}:
9
- %li
10
- %dt= @campaign.status ? t(@campaign.status) : t(:n_a)
11
- %tt #{t :status}:
12
- %li.last
13
- %dt= number_to_currency(@campaign.budget, precision: 0) || t(:n_a)
14
- %tt #{t :budget}:
3
+ %dl
4
+ %li
5
+ %dt= @campaign.starts_on ? l(@campaign.starts_on, format: :mmdd) : t(:n_a)
6
+ %tt #{t :start_date}:
7
+ %li
8
+ %dt= @campaign.ends_on ? l(@campaign.ends_on, format: :mmdd) : t(:n_a)
9
+ %tt #{t :end_date}:
10
+ %li
11
+ %dt= @campaign.status ? t(@campaign.status) : t(:n_a)
12
+ %tt #{t :status}:
13
+ %li.last
14
+ %dt= number_to_currency(@campaign.budget, precision: 0) || t(:n_a)
15
+ %tt #{t :budget}:
15
16
 
16
17
  .caption #{t :campaign_targets}
18
+ %dl
19
+ -# Target Leads.
20
+ -#---------------------------------------------------------------------------
21
+ %li
22
+ %dt= @campaign.target_leads || t(:n_a)
23
+ %tt #{t :leads}:
17
24
 
18
- -# Target Leads.
19
- -#---------------------------------------------------------------------------
20
- %li
21
- %dt= @campaign.target_leads || t(:n_a)
22
- %tt #{t :leads}:
23
-
24
- -# Target Conversion Ratio.
25
- -#---------------------------------------------------------------------------
26
- %li
27
- %dt= number_to_percentage(@campaign.target_conversion, precision: 1) || t(:n_a)
28
- %tt #{t :conversion}:
25
+ -# Target Conversion Ratio.
26
+ -#---------------------------------------------------------------------------
27
+ %li
28
+ %dt= number_to_percentage(@campaign.target_conversion, precision: 1) || t(:n_a)
29
+ %tt #{t :conversion}:
29
30
 
30
- -# Target Opportunities: calculated based on target number of leads and
31
- -# expected conversion ratio.
32
- -#---------------------------------------------------------------------------
33
- %li
34
- - if @campaign.target_leads.to_i > 0 && @campaign.target_conversion.to_i > 0
35
- - opportunities = @campaign.target_leads * @campaign.target_conversion / 100
36
- %dt= opportunities.to_i
37
- - else
38
- %dt N/A
39
- %tt #{t :opportunities}:
31
+ -# Target Opportunities: calculated based on target number of leads and
32
+ -# expected conversion ratio.
33
+ -#---------------------------------------------------------------------------
34
+ %li
35
+ - if @campaign.target_leads.to_i > 0 && @campaign.target_conversion.to_i > 0
36
+ - opportunities = @campaign.target_leads * @campaign.target_conversion / 100
37
+ %dt= opportunities.to_i
38
+ - else
39
+ %dt N/A
40
+ %tt #{t :opportunities}:
40
41
 
41
- -# Target Revenue.
42
- -#---------------------------------------------------------------------------
43
- %li.last
44
- %dt= number_to_currency(@campaign.target_revenue, precision: 0) || t(:n_a)
45
- %tt #{t :revenue}:
42
+ -# Target Revenue.
43
+ -#---------------------------------------------------------------------------
44
+ %li.last
45
+ %dt= number_to_currency(@campaign.target_revenue, precision: 0) || t(:n_a)
46
+ %tt #{t :revenue}:
46
47
 
47
48
  .caption #{t :actual_performance}
49
+ %dl
50
+ -# Actual Number of Leads.
51
+ -#---------------------------------------------------------------------------
52
+ %li
53
+ %dt= @campaign.leads_count || t(:n_a)
54
+ %tt== #{t :leads}: #{performance(@campaign.leads_count, @campaign.target_leads)}
48
55
 
49
- -# Actual Number of Leads.
50
- -#---------------------------------------------------------------------------
51
- %li
52
- %dt= @campaign.leads_count || t(:n_a)
53
- %tt== #{t :leads}: #{performance(@campaign.leads_count, @campaign.target_leads)}
54
-
55
- -# Actual Conversion Ratio: calculated based on actual number of leads
56
- -# and opportunities.
57
- -#---------------------------------------------------------------------------
58
- %li
59
- - if @campaign.opportunities_count.to_i > 0 && @campaign.leads_count.to_i > 0
60
- - conversion = @campaign.opportunities_count * 100 / @campaign.leads_count
61
- %dt= number_to_percentage(conversion, precision: 1)
62
- %tt== #{t :conversion}: #{performance(conversion, @campaign.target_conversion)}
63
- - else
64
- %dt #{t :n_a}
65
- %tt #{t :conversion}:
56
+ -# Actual Conversion Ratio: calculated based on actual number of leads
57
+ -# and opportunities.
58
+ -#---------------------------------------------------------------------------
59
+ %li
60
+ - if @campaign.opportunities_count.to_i > 0 && @campaign.leads_count.to_i > 0
61
+ - conversion = @campaign.opportunities_count * 100 / @campaign.leads_count
62
+ %dt= number_to_percentage(conversion, precision: 1)
63
+ %tt== #{t :conversion}: #{performance(conversion, @campaign.target_conversion)}
64
+ - else
65
+ %dt #{t :n_a}
66
+ %tt #{t :conversion}:
66
67
 
67
- -# Actual Opportunities.
68
- -#---------------------------------------------------------------------------
69
- %li
70
- %dt= @campaign.opportunities_count || t(:n_a)
71
- %tt
72
- #{t :opportunities}:
73
- = performance(@campaign.opportunities_count, opportunities)
68
+ -# Actual Opportunities.
69
+ -#---------------------------------------------------------------------------
70
+ %li
71
+ %dt= @campaign.opportunities_count || t(:n_a)
72
+ %tt
73
+ #{t :opportunities}:
74
+ = performance(@campaign.opportunities_count, opportunities)
74
75
 
75
- -# Actual Revenue.
76
- -#---------------------------------------------------------------------------
77
- %li.last
78
- %dt= number_to_currency(@campaign.revenue, precision: 0) || t(:n_a)
79
- %tt== #{t :revenue}: #{performance(@campaign.revenue, @campaign.target_revenue)}
76
+ -# Actual Revenue.
77
+ -#---------------------------------------------------------------------------
78
+ %li.last
79
+ %dt= number_to_currency(@campaign.revenue, precision: 0) || t(:n_a)
80
+ %tt== #{t :revenue}: #{performance(@campaign.revenue, @campaign.target_revenue)}
80
81
 
81
82
  - unless @campaign.background_info.blank?
82
83
  .caption #{t :background_info}
@@ -8,12 +8,11 @@
8
8
  $('##{create_id}').slideUp(250);
9
9
  $('##{entity_name.pluralize}').prepend('#{ j render(partial: entity_name, collection: [ @entity ]) }');
10
10
  $('##{dom_id(@entity)}').effect("highlight", { duration:1500 });
11
- = refresh_sidebar(:index, :filters)
11
+ = refresh_sidebar(:index)
12
12
  $('#paginate').html('#{ j render(partial: "shared/paginate_with_per_page") }');
13
13
  crm.flick('empty', 'remove');
14
14
  - else
15
15
  $('##{create_id}').html('#{ j render(partial: "new") }');
16
- $('##{create_id}').effect("shake", { duration:250, distance: 6 });
17
16
  - if @entity.errors[:name].blank? and @entity.errors[:ends_on].present?
18
17
  $('#campaign_ends_on').focus();
19
18
  - else
@@ -2,5 +2,5 @@
2
2
  - @entity = instance_variable_get("@#{entity_name}")
3
3
 
4
4
  $('##{dom_id(@entity)}').css('background-color', '#ffe4e1').slideUp(250)
5
- = refresh_sidebar(:index, :filters)
5
+ = refresh_sidebar(:index)
6
6
  $('#paginate').replaceWith('#{ j render(partial: "shared/paginate_with_per_page") }');
@@ -7,6 +7,7 @@
7
7
  = styles_for :task, :lead, :opportunity
8
8
 
9
9
  = render 'campaigns/title_bar', campaign: @campaign
10
+ = render 'campaigns/sidebar_show', campaign: @campaign
10
11
 
11
12
  = render "comments/new", commentable: @campaign
12
13
  = render partial: "shared/timeline", collection: @timeline
@@ -6,17 +6,16 @@
6
6
  - if called_from_landing_page?
7
7
  crm.flip_form('edit_#{entity_name}');
8
8
  crm.set_title('edit_#{entity_name}', '#{h @entity.name}');
9
- = refresh_sidebar(:show, :summary)
9
+ = refresh_sidebar(:show)
10
10
  - else
11
11
  $('##{id}').replaceWith('#{ j render(partial: entity_name, collection: [ @entity ]) }');
12
12
  $('##{id}').effect("highlight", { duration:1500 });
13
- = refresh_sidebar(:index, :filters)
13
+ = refresh_sidebar(:index)
14
14
  - else
15
15
  $('##{id}').html('#{ j render(partial: "edit") }');
16
- $('##{id}').effect("shake", { duration:250, distance: 6 });
17
16
  - if @campaign.errors[:name].blank? and @campaign.errors[:ends_on].present?
18
17
  $('#campaign_ends_on').focus();
19
18
  - else
20
19
  $('##{dom_id(@entity, :edit)} input[type!=hidden]').first().focus();
21
20
 
22
- = hook(:entity_update, self, {entity: @entity})
21
+ = hook(:entity_update, self, {entity: @entity})
@@ -6,6 +6,6 @@
6
6
  = hidden_field_tag "comment[commentable_type]", class_name.classify
7
7
  = f.text_area :comment, id: dom_id(@comment, :text)
8
8
  .buttons
9
- = f.submit t(:save_note)
9
+ = f.submit t(:save_note), class: 'btn btn-primary'
10
10
  #{t :or}
11
11
  = link_to(t(:cancel), edit_comment_path(@comment, "#{class_name}_id" => commentable.id, cancel: true), remote: true)
@@ -25,7 +25,7 @@
25
25
  = f.text_area :comment, id: "#{id_prefix}_comment_comment"
26
26
  .buttons
27
27
  = image_tag("loading.gif", size: :thumb, class: "spinner", style: "display: none;")
28
- = f.submit t(:add_note), id: "#{id_prefix}_comment_submit"
28
+ = f.submit t(:add_note), id: "#{id_prefix}_comment_submit", class: 'btn btn-primary'
29
29
  #{t :or}
30
30
  = link_to(t(:cancel), '#', class: 'cancel')
31
31
  %div{ {id: "#{id_prefix}_ask"}.merge(hidden_if(false))}
@@ -5,5 +5,4 @@
5
5
  $('##{id}').effect("highlight", { duration:1500 });
6
6
  - else
7
7
  $('##{id}').html('#{ j render(partial: "edit") }');
8
- $('##{id}').effect("shake", { duration:250, distance: 6 });
9
8
  $('#comment_comment').focus();
@@ -14,6 +14,6 @@
14
14
  = hook(:entity_form, self, {f: f, entity: @contact})
15
15
 
16
16
  .buttonbar
17
- = f.submit t(:save_contact), onclick: "crm.save_contact()"
17
+ = f.submit t(:save_contact), onclick: "crm.save_contact()", class: 'btn btn-primary'
18
18
  #{t :or}
19
19
  = link_to_cancel edit_contact_path(@contact)
@@ -15,6 +15,6 @@
15
15
  = hook(:entity_form, self, {f: f, entity: @contact})
16
16
 
17
17
  .buttonbar
18
- = f.submit t(:create_contact), onclick: "crm.create_contact()"
18
+ = f.submit t(:create_contact), onclick: "crm.create_contact()", class: 'btn btn-primary'
19
19
  #{t :or}
20
20
  = link_to_cancel new_contact_path
@@ -1,6 +1,5 @@
1
1
  .panel#summary
2
2
  %span{style: "float:right"}= avatar_for(@contact, size: "50x50")
3
- %h4= h(@contact.full_name)
4
3
  = account_with_title_and_department(@contact)
5
4
 
6
5
  %div= render "shared/address_show", asset: @contact, type: 'business', title: :address
@@ -21,23 +20,24 @@
21
20
  = web_presence_icons(@contact)
22
21
 
23
22
  .caption #{t :contact_summary}
24
- %li
25
- %dt= @contact.assigned_to ? truncate(@contact.assignee.full_name, length: 16) : nil
26
- %tt #{t :assigned_to}:
27
- %li
28
- %dt
29
- - if @contact.lead
30
- = link_to(truncate(@contact.lead.name, length: 16), @contact.lead, title: @contact.lead.name)
31
- - else
32
- #{t :n_a}
33
- %tt #{t :lead}:
34
- %li
35
- %dt
36
- - if @contact.lead.try(:campaign)
37
- = link_to(truncate(@contact.lead.campaign.name, length: 16), @contact.lead.campaign, title: @contact.lead.campaign.name)
38
- - else
39
- #{t :n_a}
40
- %tt #{t :campaign}:
23
+ %dl
24
+ %li
25
+ %dt= @contact.assigned_to ? truncate(@contact.assignee.full_name, length: 16) : nil
26
+ %tt #{t :assigned_to}:
27
+ %li
28
+ %dt
29
+ - if @contact.lead
30
+ = link_to(truncate(@contact.lead.name, length: 16), @contact.lead, title: @contact.lead.name)
31
+ - else
32
+ #{t :n_a}
33
+ %tt #{t :lead}:
34
+ %li
35
+ %dt
36
+ - if @contact.lead.try(:campaign)
37
+ = link_to(truncate(@contact.lead.campaign.name, length: 16), @contact.lead.campaign, title: @contact.lead.campaign.name)
38
+ - else
39
+ #{t :n_a}
40
+ %tt #{t :campaign}:
41
41
 
42
42
  - unless @contact.background_info.blank?
43
43
  .caption #{t :background_info}
@@ -19,5 +19,4 @@
19
19
  - else
20
20
  $('##{create_id}').html('#{ j render(partial: "new") }');
21
21
  crm.create_or_select_account(#{ request.referer =~ /\/accounts\// || @account.id.blank? });
22
- $('##{create_id}').effect("shake", { duration:250, distance: 6 });
23
22
  $('#new_#{entity_name} input[type!=hidden]').first().focus();
@@ -3,7 +3,7 @@
3
3
 
4
4
  $('##{dom_id(@entity)}').css('background-color', '#ffe4e1').slideUp(250);
5
5
  - if called_from_index_page?
6
- = refresh_sidebar(:index, :filters)
6
+ = refresh_sidebar(:index)
7
7
  $('#paginate').html('#{ j render(partial: "shared/paginate_with_per_page") }');
8
8
  - else
9
9
  $('#recently').replaceWith('#{ j render(partial: "shared/recently") }');
@@ -7,6 +7,7 @@
7
7
  = styles_for :task, :opportunity
8
8
 
9
9
  = render 'contacts/title_bar', contact: @contact
10
+ = render 'contacts/sidebar_show', contact: @contact
10
11
 
11
12
  = render "comments/new", commentable: @contact
12
13
  = render partial: "shared/timeline", collection: @timeline
@@ -7,7 +7,7 @@
7
7
  - if called_from_landing_page?
8
8
  crm.flip_form('edit_#{entity_name}');
9
9
  crm.set_title('edit_#{entity_name}', '#{h @entity.full_name}');
10
- = refresh_sidebar(:show, :summary)
10
+ = refresh_sidebar(:show)
11
11
  - else
12
12
  $('##{id}').replaceWith('#{ j render(partial: entity_name, collection: [ @entity ]) }');
13
13
  $('##{id}').effect("highlight", { duration:1500 });
@@ -18,7 +18,6 @@
18
18
  - else
19
19
  $('##{id}').html('#{ j render(partial: "edit") }');
20
20
  crm.create_or_select_account(#{ request.referer =~ /\/accounts\// || @account.id.blank? });
21
- $('##{id}').effect("shake", { duration:250, distance: 6 });
22
21
  $('##{dom_id(@entity, :edit)} input[type!=hidden]').first().focus();
23
22
 
24
- = hook(:entity_update, self, {entity: @entity})
23
+ = hook(:entity_update, self, {entity: @entity})
@@ -5,7 +5,7 @@
5
5
  #buttons
6
6
  = view_buttons
7
7
  .create_asset
8
- = link_to_inline("create_#{model_name}".to_sym, send("new_#{model_name}_path"), text: t("create_#{model_name}".to_sym))
8
+ = link_to_inline("create_#{model_name}".to_sym, send("new_#{model_name}_path"), {text: t("create_#{model_name}".to_sym), class: 'btn-sm btn-primary'})
9
9
 
10
10
  .title
11
11
  %span{id: "create_#{model_name}_title"} #{t controller_name.to_sym}
@@ -14,8 +14,8 @@
14
14
  - else
15
15
  $('##{h params[:assets]}').prepend('#{ j render(partial: "#{params[:assets]}/#{partial}", collection: [ @attachment ]) }');
16
16
  - if called_from_landing_page?(:accounts)
17
- = refresh_sidebar_for(:accounts, :show, :summary)
17
+ = refresh_sidebar_for(:accounts, :show)
18
18
  - elsif called_from_landing_page?(:campaigns)
19
- = refresh_sidebar_for(:campaigns, :show, :summary)
19
+ = refresh_sidebar_for(:campaigns, :show)
20
20
 
21
21
  $('##{partial}_#{h params[:asset_id]}').effect("highlight", { duration:1500 });
@@ -1,6 +1,6 @@
1
1
  $('##{dom_id(@attachment)}').slideUp(250);
2
2
 
3
3
  - if called_from_landing_page?(:accounts)
4
- = refresh_sidebar_for(:accounts, :show, :summary)
4
+ = refresh_sidebar_for(:accounts, :show)
5
5
  - elsif called_from_landing_page?(:campaigns)
6
- = refresh_sidebar_for(:campaigns, :show, :summary)
6
+ = refresh_sidebar_for(:campaigns, :show)
@@ -2,7 +2,7 @@
2
2
  - if opportunity.stage
3
3
  .strip{class: opportunity.stage}= t(opportunity.stage)
4
4
  - else
5
- .strip.white #{t :other}
5
+ .strip.other #{t :other}
6
6
 
7
7
  .indent
8
8
  = link_to(h(opportunity.name), opportunity)
@@ -2,7 +2,7 @@
2
2
  - unless task.category.blank?
3
3
  .strip{class: task.category}= t(task.category)
4
4
  - else
5
- .strip.white #{t :other}
5
+ .strip.other #{t :other}
6
6
  .indent
7
7
  %label{ id: dom_id(task, :name) }
8
8
  - if task.user.id != current_user.id
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+ xml.Worksheet 'ss:Name' => I18n.t(:tab_dashboard) do
3
+ xml.Table do
4
+ unless @activities.empty?
5
+
6
+ xml.Row do
7
+ heads = ["Id",
8
+ "Item type",
9
+ "Item",
10
+ "Event",
11
+ "Whodunnit",
12
+ "Object",
13
+ "Created at",
14
+ "Object changes",
15
+ "Related",
16
+ "Related type",
17
+ "Transaction"]
18
+
19
+ heads.each do |head|
20
+ xml.Cell do
21
+ xml.Data head,
22
+ 'ss:Type' => 'String'
23
+ end
24
+ end
25
+ end
26
+
27
+ @activities.each do |activity|
28
+ xml.Row do
29
+ data = [activity.id,
30
+ activity.item_type,
31
+ activity.item_id,
32
+ activity.event,
33
+ activity.whodunnit,
34
+ activity.object,
35
+ activity.created_at,
36
+ activity.object_changes,
37
+ activity.related_id,
38
+ activity.related_type,
39
+ activity.transaction_id]
40
+
41
+ data.each do |value|
42
+ xml.Cell do
43
+ xml.Data value,
44
+ 'ss:Type' => (value.respond_to?(:abs) ? 'Number' : 'String').to_s
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -1,11 +1,11 @@
1
1
  - view ||= controller.controller_name
2
2
  - action ||= controller.action_name
3
- - sidebar = "#{view}/sidebar_#{action}"
3
+ - sidebar = "#{view}/sidebar_#{action}" unless action.to_s == 'show'
4
4
  - sidebar = "admin/#{sidebar}" if controller.class.to_s.starts_with?("Admin::")
5
5
 
6
6
  = content_for :sidebar
7
7
  - begin
8
- = render sidebar
8
+ = render sidebar if sidebar
9
9
  - rescue MissingTemplate
10
10
 
11
11
  = render "lists/lists"
@@ -1,15 +1,18 @@
1
- .tabs
2
- %ul
3
- - tabs.each do |tab|
4
- %li
5
- = link_to(tab[:url], class: tab[:active] ? "active" : nil) do
6
- %i.fa{class: tab[:icon]}
7
- = t(tab[:text])
1
+ .navbar.navbar-expand-lg.tabs
2
+ .container-fluid
3
+ %button{"class" => "navbar-toggler", "type" => "button", "data-bs-toggle" => "collapse", "data-bs-target" => "#navbarNav", "aria-controls" => "navbarNav", "aria-expanded" => "false", "aria-label" => "Toggle navigation"}
4
+ %span.navbar-toggler-icon
5
+ %ul.navbar-nav.collapse.navbar-collapse.me-auto.mb-2.mg-lg-0{id:"navbarNav"}
6
+ - tabs.each do |tab|
7
+ %li.nav-item
8
+ = link_to(tab[:url], class: tab[:active] ? "nav-link active" : "nav-link") do
9
+ %i.fa{class: tab[:icon]}
10
+ = t(tab[:text])
8
11
 
9
12
  = show_flash
10
- %table{ width: "100%", height: "100%", cellpadding: 0, cellspacing: 0, class: :tabbed }
11
- %tr
12
- %td{ class: :sidebar, id: :sidebar, valign: :top }
13
+ %div{ id: 'primary-application-pane' }
14
+ %div{ class: 'row' }
15
+ %div{ class: 'sidebar', id: :sidebar }
13
16
  = render "layouts/sidebar"
14
- %td{ class: :main, id: :main, valign: :top }
17
+ %div{ class: 'main', id: :main }
15
18
  = yield
@@ -13,8 +13,8 @@
13
13
  = javascript_include_tag :application
14
14
 
15
15
  - unless tabless_layout? || %w(en-US en-GB).include?(I18n.locale.to_s)
16
- = javascript_include_tag "jquery_ui_datepicker/jquery.ui.datepicker-#{I18n.locale}"
17
- = javascript_include_tag "jquery_ui_datepicker/jquery-ui-timepicker-#{I18n.locale}"
16
+ = javascript_include_tag "vendor/jquery_ui_datepicker/jquery.ui.datepicker-#{I18n.locale}"
17
+ = javascript_include_tag "vendor/jquery_ui_datepicker/jquery-ui-timepicker-#{I18n.locale}"
18
18
 
19
19
  = csrf_meta_tag
20
20
  = hook(:javascript_includes, self)
@@ -16,8 +16,8 @@
16
16
 
17
17
  .buttonbar
18
18
  - if Setting.compound_address
19
- = f.submit t(:save_lead), onclick: "crm.clear_all_hints()"
19
+ = f.submit t(:save_lead), onclick: "crm.clear_all_hints()", class: 'btn btn-primary'
20
20
  - else
21
- = f.submit t(:save_lead)
21
+ = f.submit t(:save_lead), class: 'btn btn-primary'
22
22
  #{t :or}
23
23
  = link_to_cancel edit_lead_path(@lead)
@@ -17,8 +17,8 @@
17
17
 
18
18
  .buttonbar
19
19
  - if Setting.compound_address
20
- = f.submit t(:create_lead), onclick: "crm.clear_all_hints()"
20
+ = f.submit t(:create_lead), onclick: "crm.clear_all_hints()", class: 'btn btn-primary'
21
21
  - else
22
- = f.submit t(:create_lead)
22
+ = f.submit t(:create_lead), class: 'btn btn-primary'
23
23
  #{t :or}
24
24
  = link_to_cancel new_lead_path
@@ -1,13 +1,13 @@
1
1
  .filters#filters
2
2
  .caption= t :lead_statuses
3
3
  - Setting.lead_status.each do |key|
4
- .check_box{style: "border-bottom: 1px silver dotted;"}
4
+ .check_box
5
5
  %div{style: "float:right;"}
6
6
  = @lead_status_total[key]
7
7
  = lead_status_checkbox(key, @lead_status_total[key])
8
8
  = label_tag(key, t(key))
9
9
 
10
- .check_box{style: "border-bottom: 1px silver dotted;"}
10
+ .check_box
11
11
  %div{style: "float:right;"}
12
12
  = @lead_status_total[:other]
13
13
  = lead_status_checkbox("other", @lead_status_total[:other])
@@ -1,6 +1,5 @@
1
1
  .panel#summary
2
2
  %span{style: "float:right"}= avatar_for(@lead, size: "50x50")
3
- %h4= h(@lead.full_name)
4
3
  - if !@lead.title.blank? && !@lead.company.blank?
5
4
  -# works_at: "{{job_title}} at {{company}}"
6
5
  %div= t(:works_at, job_title: @lead.title, company: @lead.company)
@@ -22,35 +21,36 @@
22
21
  = web_presence_icons(@lead)
23
22
 
24
23
  .caption #{t :lead_summary}
25
- %li
26
- %dt= t(@lead.status, default: :n_a)
27
- %tt #{t :status}:
28
- %li
29
- %dt= t(@lead.source, default: :n_a)
30
- %tt #{t :source}:
31
- %li
32
- %span{style: "float:right;"}= stars_for(@lead)
33
- %tt #{t :rating}:
34
- %li
35
- %dt= @lead.referred_by ? truncate(@lead.referred_by, length: 16) : t(:n_a)
36
- %tt #{t :referred_by}:
37
- %li
38
- %dt= @lead.assigned_to ? truncate(@lead.assignee.full_name, length: 16) : nil
39
- %tt #{t :assigned_to}:
40
- %li
41
- %dt
42
- - if @lead.campaign
43
- = link_to(truncate(@lead.campaign.name, length: 16), @lead.campaign, title: @lead.campaign.name)
44
- - else
45
- #{t :n_a}
46
- %tt #{t :campaign}:
47
- %li
48
- %dt
49
- - if @lead.contact
50
- = link_to(truncate(@lead.contact.name, length: 16), @lead.contact, title: @lead.contact.name)
51
- - else
52
- #{t :n_a}
53
- %tt #{t :contact}:
24
+ %dl
25
+ %li
26
+ %dt= t(@lead.status, default: :n_a)
27
+ %tt #{t :status}:
28
+ %li
29
+ %dt= t(@lead.source, default: :n_a)
30
+ %tt #{t :source}:
31
+ %li
32
+ %span{style: "float:right;"}= stars_for(@lead)
33
+ %tt #{t :rating}:
34
+ %li
35
+ %dt= @lead.referred_by ? truncate(@lead.referred_by, length: 16) : t(:n_a)
36
+ %tt #{t :referred_by}:
37
+ %li
38
+ %dt= @lead.assigned_to ? truncate(@lead.assignee.full_name, length: 16) : nil
39
+ %tt #{t :assigned_to}:
40
+ %li
41
+ %dt
42
+ - if @lead.campaign
43
+ = link_to(truncate(@lead.campaign.name, length: 16), @lead.campaign, title: @lead.campaign.name)
44
+ - else
45
+ #{t :n_a}
46
+ %tt #{t :campaign}:
47
+ %li
48
+ %dt
49
+ - if @lead.contact
50
+ = link_to(truncate(@lead.contact.name, length: 16), @lead.contact, title: @lead.contact.name)
51
+ - else
52
+ #{t :n_a}
53
+ %tt #{t :contact}:
54
54
 
55
55
  - unless @lead.background_info.blank?
56
56
  .caption #{t :background_info}
@@ -9,13 +9,12 @@
9
9
  $('##{entity_name.pluralize}').prepend('#{ j render(partial: entity_name, collection: [ @entity ]) }');
10
10
  $('##{dom_id(@entity)}').effect("highlight", { duration:1500 });
11
11
  - if called_from_index_page?
12
- = refresh_sidebar(:index, :filters)
12
+ = refresh_sidebar(:index)
13
13
  $('#paginate').html('#{ j render(partial: "shared/paginate_with_per_page") }');
14
14
  - elsif called_from_landing_page?("campaigns")
15
15
  - @campaign.reload
16
- = refresh_sidebar_for(:campaigns, :show, :summary)
16
+ = refresh_sidebar_for(:campaigns, :show)
17
17
  crm.flick('empty', 'remove');
18
18
  - else
19
19
  $('##{create_id}').html('#{ j render(partial: "new") }');
20
- $('##{create_id}').effect("shake", { duration:250, distance: 6 });
21
20
  $('#new_#{entity_name} input[type!=hidden]').first().focus();