dorsale 3.4.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -2
  3. data/app/assets/javascripts/dorsale/common/upload.coffee +25 -0
  4. data/app/assets/javascripts/dorsale/dependencies.coffee +1 -0
  5. data/app/assets/stylesheets/dorsale/all.sass +0 -1
  6. data/app/assets/stylesheets/dorsale/common.sass +0 -4
  7. data/app/assets/stylesheets/dorsale/dependencies.sass +2 -1
  8. data/app/controllers/dorsale/application_controller.rb +2 -2
  9. data/app/controllers/dorsale/flyboy/tasks_controller.rb +3 -3
  10. data/app/filters/dorsale/billing_machine/small_data/filter_for_invoices.rb +5 -5
  11. data/app/filters/dorsale/billing_machine/small_data/filter_for_quotations.rb +5 -5
  12. data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_customer.rb +1 -1
  13. data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_payment_status.rb +1 -1
  14. data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_state.rb +1 -1
  15. data/app/filters/dorsale/customer_vault/small_data/filter_for_people.rb +3 -3
  16. data/app/filters/dorsale/expense_gun/small_data/filter_for_expenses.rb +3 -3
  17. data/app/filters/dorsale/flyboy/small_data/filter_for_tasks.rb +2 -2
  18. data/app/filters/dorsale/flyboy/small_data/filter_strategy_by_done.rb +1 -1
  19. data/app/helpers/dorsale/all_helpers.rb +2 -10
  20. data/app/helpers/dorsale/flyboy/application_helper.rb +2 -2
  21. data/app/models/dorsale/application_record.rb +7 -9
  22. data/app/models/dorsale/customer_vault/person.rb +1 -1
  23. data/app/models/dorsale/flyboy/task.rb +1 -1
  24. data/app/views/dorsale/billing_machine/invoices/_filters.html.slim +2 -2
  25. data/app/views/dorsale/billing_machine/invoices/_show_actions.html.slim +2 -2
  26. data/app/views/dorsale/billing_machine/invoices/index.xlsx.ruby +1 -1
  27. data/app/views/dorsale/billing_machine/quotations/_filters.html.slim +2 -2
  28. data/app/views/dorsale/billing_machine/quotations/_show_actions.html.slim +1 -1
  29. data/app/views/dorsale/customer_vault/people/index.xlsx.ruby +1 -1
  30. data/app/views/dorsale/expense_gun/expenses/_show_actions.html.slim +4 -4
  31. data/app/views/dorsale/flyboy/tasks/index.xlsx.ruby +1 -1
  32. data/config/locales/dorsale.en.yml +11 -1
  33. data/config/locales/dorsale.fr.yml +10 -0
  34. data/config/routes.rb +0 -6
  35. data/lib/dorsale/engine.rb +4 -1
  36. data/lib/dorsale/version.rb +1 -1
  37. metadata +17 -69
  38. data/app/assets/javascripts/dorsale/common/forms.coffee +0 -58
  39. data/app/assets/javascripts/dorsale/common/modals.coffee +0 -126
  40. data/app/assets/stylesheets/dorsale/common/filters.sass +0 -43
  41. data/app/assets/stylesheets/dorsale/common/flash.sass +0 -6
  42. data/app/assets/stylesheets/dorsale/common/modals.sass +0 -45
  43. data/app/assets/stylesheets/dorsale/common/pagination.sass +0 -8
  44. data/app/assets/stylesheets/dorsale/print.sass +0 -74
  45. data/app/controllers/concerns/dorsale/back_url_concern.rb +0 -18
  46. data/app/controllers/dorsale/small_data/filters_controller.rb +0 -36
  47. data/app/filters/dorsale/small_data/filter.rb +0 -68
  48. data/app/filters/dorsale/small_data/filter_strategy.rb +0 -5
  49. data/app/filters/dorsale/small_data/filter_strategy_by_date.rb +0 -6
  50. data/app/filters/dorsale/small_data/filter_strategy_by_date_begin.rb +0 -6
  51. data/app/filters/dorsale/small_data/filter_strategy_by_date_end.rb +0 -6
  52. data/app/filters/dorsale/small_data/filter_strategy_by_key_value.rb +0 -16
  53. data/app/filters/dorsale/small_data/filter_strategy_by_tags.rb +0 -11
  54. data/app/filters/dorsale/small_data/filter_strategy_by_time_period.rb +0 -37
  55. data/app/helpers/dorsale/bootstrap_helper.rb +0 -6
  56. data/app/helpers/dorsale/button_helper.rb +0 -161
  57. data/app/helpers/dorsale/filters_helper.rb +0 -68
  58. data/app/helpers/dorsale/form_helper.rb +0 -49
  59. data/app/helpers/dorsale/link_helper.rb +0 -52
  60. data/app/helpers/dorsale/pagination_helper.rb +0 -6
  61. data/app/helpers/dorsale/routes_helper.rb +0 -20
  62. data/app/helpers/dorsale/sorting_helper.rb +0 -48
  63. data/app/helpers/dorsale/text_helper.rb +0 -121
  64. data/app/libs/dorsale/sortable_uuid_generator.rb +0 -11
  65. data/app/models/concerns/dorsale/active_record_uuid_concern.rb +0 -15
  66. data/app/models/concerns/dorsale/default_values_concern.rb +0 -13
  67. data/app/models/concerns/dorsale/model_i18n.rb +0 -25
  68. data/app/models/concerns/dorsale/model_to_s.rb +0 -9
  69. data/app/models/concerns/dorsale/polymorphic_id.rb +0 -34
  70. data/app/models/concerns/dorsale/search.rb +0 -30
  71. data/app/models/dorsale/small_data.rb +0 -2
  72. data/app/serializers/dorsale/serializers.rb +0 -2
  73. data/app/serializers/dorsale/serializers/base.rb +0 -17
  74. data/app/serializers/dorsale/serializers/xlsx.rb +0 -36
  75. data/app/views/dorsale/search/_form.html.slim +0 -6
  76. data/config/locales/common.en.yml +0 -210
  77. data/config/locales/common.fr.yml +0 -220
  78. data/lib/dorsale/active_record_comma_type_cast.rb +0 -12
  79. data/lib/dorsale/core_and_rails_ext.rb +0 -3
  80. data/lib/dorsale/form_back_url.rb +0 -18
  81. data/spec/controllers/dorsale/small_data/filters_controller_spec.rb +0 -60
  82. data/spec/filters/dorsale/small_data/filter_spec.rb +0 -39
  83. data/spec/helpers/dorsale/form_helper_spec.rb +0 -11
  84. data/spec/helpers/dorsale/link_helper_spec.rb +0 -31
  85. data/spec/helpers/dorsale/sorting_helper_spec.rb +0 -74
  86. data/spec/helpers/dorsale/text_helper_spec.rb +0 -123
  87. data/spec/libs/dorsale/active_record_comma_type_cast_spec.rb +0 -44
  88. data/spec/libs/dorsale/polymorphic_id_spec.rb +0 -30
  89. data/spec/libs/dorsale/sortable_uuid_generator_spec.rb +0 -29
  90. data/spec/models/concerns/dorsale/model_i18n_spec.rb +0 -21
  91. data/spec/routing/dorsale/small_data_routing_spec.rb +0 -15
  92. data/spec/serializers/dorsale/serializers/xlsx_spec.rb +0 -33
@@ -1,9 +0,0 @@
1
- module Dorsale::ModelToS
2
- def to_s
3
- %w(name title label).map do |m|
4
- return send(m) if respond_to?(m)
5
- end
6
-
7
- super
8
- end
9
- end
@@ -1,34 +0,0 @@
1
- module Dorsale::PolymorphicId
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
- def self.polymorphic_id_for(relation_name)
6
- module_src = File.read(__FILE__).split("__END__").last
7
- module_src = module_src.gsub("relation", relation_name.to_s)
8
- send :include, eval(module_src)
9
- end
10
-
11
- def guid
12
- return nil if new_record?
13
-
14
- "#{self.class.base_class}-#{self.id}"
15
- end
16
- end # included
17
- end # module
18
-
19
- # __END__
20
-
21
- Module.new do
22
- def relation_guid
23
- return nil if relation_type.blank? || relation_id.blank?
24
-
25
- "#{relation_type}-#{relation_id}"
26
- end
27
-
28
- def relation_guid=(guid)
29
- return self.relation = nil if guid.blank?
30
-
31
- type, id = guid.split("-", 2)
32
- self.relation = type.constantize.find(id)
33
- end
34
- end
@@ -1,30 +0,0 @@
1
- module Dorsale::Search
2
- extend ActiveSupport::Concern
3
-
4
- class_methods do
5
- def default_search_fields
6
- fields = columns.map do |column|
7
- "#{table_name}.#{column.name}"
8
- end
9
- end # def default_search_fields
10
-
11
- def search(q, *fields)
12
- words = q.to_s.parameterize.split("-")
13
- fields = default_search_fields if fields.empty?
14
-
15
- sql_query = words.map.with_index do |word, index|
16
- fields.map do |field|
17
- "(LOWER(CAST(#{field} AS TEXT)) LIKE :w#{index})"
18
- end.join(" OR ")
19
- end.map{ |e| "(#{e})" }.join(" AND ")
20
-
21
- sql_params_a = words.map.with_index do |word, index|
22
- ["w#{index}".to_sym, "%#{word}%"]
23
- end
24
-
25
- sql_params_h = Hash[sql_params_a]
26
-
27
- self.where(sql_query, sql_params_h)
28
- end # def search
29
- end # class_methods
30
- end # class Dorsale::Search
@@ -1,2 +0,0 @@
1
- module Dorsale::SmallData
2
- end
@@ -1,2 +0,0 @@
1
- module Dorsale::Serializers
2
- end
@@ -1,17 +0,0 @@
1
- class Dorsale::Serializers::Base
2
- attr_reader :data, :options
3
-
4
- def initialize(data, options = {})
5
- @data = data
6
- @options = options
7
- end
8
-
9
- def render_inline
10
- raise NotImplementedError
11
- end
12
-
13
- def render_file(file_path)
14
- raise NotImplementedError
15
- end
16
-
17
- end
@@ -1,36 +0,0 @@
1
- require "axlsx"
2
-
3
- class Dorsale::Serializers::XLSX < Dorsale::Serializers::Base
4
- def render_inline
5
- xlsx.to_stream.read.force_encoding("BINARY")
6
- end
7
-
8
- def render_file(file_path)
9
- xlsx.serialize(file_path)
10
- end
11
-
12
- def xlsx
13
- @xlsx ||= Axlsx::Package.new do |p|
14
- p.workbook.add_worksheet do |sheet|
15
- data.each do |line|
16
- values = line.map do |value|
17
- if value.is_a?(Integer)
18
- value
19
- elsif value.is_a?(Numeric)
20
- value.to_f # Fix BigDecimal
21
- elsif value == true || value == false
22
- I18n.t(value.to_s)
23
- else
24
- value.to_s
25
- end
26
- end
27
-
28
- sheet.add_row(values)
29
- end
30
- end
31
-
32
- p.use_shared_strings = true
33
- end
34
- end
35
-
36
- end
@@ -1,6 +0,0 @@
1
- form.search method="get" action=action
2
- p.input-group.search
3
- input.form-control name="q" placeholder=t("actions.search") size=25 value=params[:q]
4
- span.input-group-addon
5
- button.nostyle.search-submit type="submit"
6
- = icon :search
@@ -1,210 +0,0 @@
1
- en:
2
- "yes" : "Yes"
3
- "no" : "No"
4
- "true" : "Yes"
5
- "false" : "No"
6
-
7
- actions: &actions
8
- actions : "Actions"
9
- index : "Index"
10
- list : "List"
11
- new : "New"
12
- create : "Create"
13
- read : "Read"
14
- show : "Show"
15
- details : "Détails"
16
- edit : "Edit"
17
- update : "Update"
18
- delete : "Delete"
19
- destroy : "Destroy"
20
- add : "Add"
21
- filter : "Filter"
22
- filter_by : "Filter by"
23
- sort : "Sort"
24
- sort_by : "Sort by"
25
- reset : "Reset"
26
- back : "Back"
27
- save : "Save"
28
- open : "Open"
29
- close : "Close"
30
- lock : "Lock"
31
- unlock : "Unlock"
32
- snooze : "Snooze"
33
- alert : "Alert"
34
- complete : "Complete"
35
- done : "Done"
36
- download : "Download"
37
- upload : "Upload"
38
- preview : "Preview"
39
- confirm : "Confirm this action ?"
40
- cancel : "Cancel"
41
- search : "Search"
42
- sign_in : "Sign in"
43
- signin : "Sign in"
44
- log_in : "Log in"
45
- login : "Log in"
46
- sign_out : "Sign out"
47
- signout : "Sign out"
48
- log_out : "Log out"
49
- logout : "Log out"
50
- sign_up : "Sign up"
51
- signup : "Sign up"
52
- browse : "Choose file..."
53
- cut : "Cut"
54
- copy : "Copy"
55
- paste : "Paste"
56
- duplicate : "Duplicate"
57
- export : "Export"
58
- export_csv : "Export CSV"
59
- export_xls : "Export XLS"
60
- export_xlsx: "Export XLSX"
61
- export_pdf : "Export PDF"
62
- import : "Import"
63
- import_csv : "Import CSV"
64
- import_xls : "Import XLS"
65
- import_xlsx: "Import XLSX"
66
- import_pdf : "Import PDF"
67
- send : "Send"
68
- comment : "Comment"
69
- add_line : "Add line"
70
- remove_line: "Remove line"
71
- pay : "Pay"
72
- paid : "Payd"
73
- continue : "Continue"
74
- rename : "Rename"
75
- email : "Send by email"
76
- print : "Print"
77
- submit : "Submit"
78
- accept : "Accept"
79
- refuse : "Refuse"
80
-
81
- attributes: &attributes
82
- id : "Id"
83
- type : "Type"
84
- code : "Code"
85
- reference : "Réference"
86
- created_at : "Created at"
87
- updated_at : "Updated at"
88
- name : "Name"
89
- title : "Title"
90
- label : "Label"
91
- first_name : "First name"
92
- last_name : "Last name"
93
- email : "E-mail"
94
- www : "Web site"
95
- phone : "Phone"
96
- mobile : "Mobile"
97
- fax : "Fax"
98
- password : "Password"
99
- password_confirmation : "Password (confirm)"
100
- description : "Description"
101
- text : "Text"
102
- date : "Date"
103
- state : "State"
104
- status : "Status"
105
- file : "File"
106
- address : "Address"
107
- address1 : "Address"
108
- address2 : "Address (rest)"
109
- street : "Address"
110
- street_bis : "Address (rest)"
111
- zip : "Zip"
112
- city : "City"
113
- country : "Country"
114
- tags : "Tags"
115
- tag_list : "Tags"
116
- budget : "Budget"
117
- probability : "Probability"
118
- access : "Access"
119
- color : "Color"
120
- data : "Data"
121
- comment : "Comment"
122
- written_by : "Written by"
123
- details : "Datails"
124
- quantity : "Quantity"
125
- due_date : "Due date"
126
- paid : "Paid ?"
127
- customer : "Customer"
128
- customer_guid : "Customer"
129
- tracking : "Tracking ID"
130
- tracking_id : "Tracking ID"
131
- unique_index : "Tracking ID"
132
- count : "Number"
133
- length : "Number"
134
- number : "Number"
135
- message : "Message"
136
- skype : "Skype"
137
- facebook : "Facebook"
138
- twitter : "Twitter"
139
- linkedin : "Linkedin"
140
- viadeo : "Viadeo"
141
- subject : "Subject"
142
- body : "Message"
143
- attachment : "Attachment"
144
- avatar : "Avatar"
145
- current_avatar : "Current avatar"
146
- logo : "Logo"
147
- active : "Active ?"
148
- user : "User"
149
- category : "Category"
150
- corporation_name : "Name"
151
- author : "Author"
152
- sender : "Author"
153
- total : "Total"
154
- version : "Version"
155
- commentable : "Origin"
156
- addressable : "Origin"
157
- attachable : "Origin"
158
- email_subject : "Subject"
159
- email_from : "Sender"
160
- email_to : "Recipient"
161
- email_attachment : "Attachment"
162
- email_body : "Message"
163
-
164
- errors:
165
- messages:
166
- extension_white_list_error : "This file type is not supported"
167
-
168
- filters:
169
- all_customers: "All customers"
170
- all_owners: "All all owners"
171
- date_begin: "Date begin"
172
- date_end: "Date end"
173
-
174
- time_periods:
175
- all_time: "All time"
176
- tomorrow: "Tomorrow"
177
- today: "Today"
178
- yesterday: "Yesterday"
179
- this_week: "This week"
180
- this_month: "This month"
181
- this_year: "This year"
182
- last_week: "Last week"
183
- last_month: "Last month"
184
- last_year: "Last year"
185
- delayed: "Delayed"
186
- next_week: "Next week"
187
- next_next_week: "In two weeks"
188
- custom_date: "Custom date"
189
-
190
- labels:
191
- <<: *attributes
192
-
193
- activerecord:
194
- models:
195
- dorsale/address:
196
- one: "Address"
197
- other: "Addresses"
198
-
199
- dorsale/comment:
200
- one: "Comment"
201
- other: "Comments"
202
-
203
-
204
- simple_form:
205
- "yes" : 'Yes'
206
- "no" : 'No'
207
-
208
- required:
209
- text: 'Required'
210
- mark: '*'
@@ -1,220 +0,0 @@
1
- fr:
2
- "yes" : "Oui"
3
- "no" : "Non"
4
- "true" : "Oui"
5
- "false" : "Non"
6
-
7
- date:
8
- formats:
9
- default: "%d/%m/%Y"
10
-
11
- time:
12
- formats:
13
- default: "%d/%m/%Y à %H:%M"
14
-
15
- actions: &actions
16
- actions : "Actions"
17
- index : "Liste"
18
- list : "Liste"
19
- new : "Nouveau"
20
- create : "Créer"
21
- read : "Afficher"
22
- show : "Afficher"
23
- details : "Détails"
24
- edit : "Modifier"
25
- update : "Modifier"
26
- delete : "Supprimer"
27
- destroy : "Supprimer"
28
- add : "Ajouter"
29
- filter : "Filtrer"
30
- filter_by : "Filtrer par"
31
- sort : "Trier"
32
- sort_by : "Trier par"
33
- reset : "Mettre à zéro"
34
- back : "Retour"
35
- save : "Enregistrer"
36
- open : "Ouvrir"
37
- close : "Fermer"
38
- lock : "Fermer"
39
- unlock : "Ouvrir"
40
- snooze : "Reporter"
41
- alert : "Alerter"
42
- complete : "Marquer terminé"
43
- done : "Terminer"
44
- download : "Télécharger"
45
- upload : "Envoyer"
46
- preview : "Aperçu"
47
- confirm : "Confirmer cette action ?"
48
- cancel : "Annuler"
49
- search : "Rechercher"
50
- sign_in : "Se connecter"
51
- signin : "Se connecter"
52
- log_in : "Se connecter"
53
- login : "Se connecter"
54
- sign_out : "Se déconnecter"
55
- signout : "Se déconnecter"
56
- log_out : "Se déconnecter"
57
- logout : "Se déconnecter"
58
- sign_up : "S'enregistrer"
59
- signup : "S'enregistrer"
60
- browse : "Sélectionner le fichier..."
61
- cut : "Couper"
62
- copy : "Copier"
63
- paste : "Coller"
64
- duplicate : "Dupliquer"
65
- export : "Exporter"
66
- export_csv : "Export CSV"
67
- export_xls : "Export XLS"
68
- export_xlsx: "Export XLSX"
69
- export_pdf : "Export PDF"
70
- import : "Importer"
71
- import_csv : "Import CSV"
72
- import_xls : "Import XLS"
73
- import_xlsx: "Import XLSX"
74
- import_pdf : "Import PDF"
75
- send : "Envoyer"
76
- comment : "Commenter"
77
- add_line : "Ajoute une ligne"
78
- remove_line: "Supprimer la ligne"
79
- pay : "Payer"
80
- paid : "Payée"
81
- continue : "Continuer"
82
- rename : "Renommer"
83
- email : "Envoyer par email"
84
- print : "Imprimer"
85
- submit : "Soumettre"
86
- accept : "Accepter"
87
- refuse : "Refuser"
88
-
89
- attributes: &attributes
90
- id : "Id"
91
- type : "Type"
92
- code : "Code"
93
- reference : "Référence"
94
- created_at : "Créé le"
95
- updated_at : "Modifié le"
96
- name : "Nom"
97
- title : "Titre"
98
- label : "Libellé"
99
- first_name : "Prénom"
100
- last_name : "Nom"
101
- email : "E-mail"
102
- www : "Site web"
103
- phone : "Téléphone"
104
- mobile : "Mobile"
105
- fax : "Fax"
106
- password : "Mot de passe"
107
- password_confirmation : "Mot de passe (confirmer)"
108
- description : "Description"
109
- text : "Description"
110
- date : "Date"
111
- state : "État"
112
- status : "État"
113
- file : "Fichier"
114
- address : "Adresse"
115
- address1 : "Adresse"
116
- address2 : "Adresse (suite)"
117
- street : "Adresse"
118
- street_bis : "Adresse (suite)"
119
- zip : "Code postal"
120
- city : "Ville"
121
- country : "Pays"
122
- tags : "Tags"
123
- tag_list : "Tags"
124
- budget : "Budget"
125
- probability : "Probabilité"
126
- access : "Accès"
127
- color : "Couleur"
128
- data : "Informations"
129
- comment : "Commentaire"
130
- comments : "Commentaires"
131
- written_by : "écrit par"
132
- details : "Détails"
133
- quantity : "Quantité"
134
- due_date : "Échéance"
135
- paid : "Payée ?"
136
- customer : "Client"
137
- customer_guid : "Client"
138
- tracking : "Numéro"
139
- tracking_id : "Numéro"
140
- unique_index : "Numéro"
141
- count : "Nombre"
142
- length : "Nombre"
143
- number : "Nombre"
144
- message : "Message"
145
- skype : "Skype"
146
- facebook : "Facebook"
147
- twitter : "Twitter"
148
- linkedin : "Linkedin"
149
- viadeo : "Viadeo"
150
- is_active : "Actif ?"
151
- short_name : "Initiales"
152
- subject : "Objet"
153
- body : "Message"
154
- attachment : "Pièce jointe"
155
- avatar : "Avatar"
156
- current_avatar : "Avatar actuel"
157
- logo : "Logo"
158
- active : "Actif ?"
159
- user : "Utilisateur"
160
- category : "Catégorie"
161
- corporation_name : "Nom"
162
- author : "Auteur"
163
- sender : "Auteur"
164
- total : "Total"
165
- version : "Version"
166
- commentable : "Origine"
167
- addressable : "Origine"
168
- attachable : "Origine"
169
- email_subject : "Object"
170
- email_from : "Expéditeur"
171
- email_to : "Destinataire"
172
- email_attachment : "Pièce jointe"
173
- email_body : "Message"
174
-
175
- errors:
176
- messages:
177
- extension_white_list_error : "Ce type de fichier n'est pas prit en charge"
178
-
179
- filters:
180
- all_customers: "Tous les clients"
181
- all_owners: "Tout le monde"
182
- date_begin: "Date début"
183
- date_end: "Date fin"
184
-
185
- time_periods:
186
- all_time: "Depuis toujours"
187
- tomorrow: "Demain"
188
- today: "Aujourd'hui"
189
- yesterday: "Hier"
190
- this_week: "Cette semaine"
191
- this_month: "Ce mois"
192
- this_year: "Cette année"
193
- last_week: "La semaine dernière"
194
- last_month: "Le mois dernier"
195
- last_year: "L'année dernière"
196
- delayed: "En retard"
197
- next_week: "La semaine prochaine"
198
- next_next_week: "Dans deux semaines"
199
- custom_date: "Choisir une date"
200
-
201
- labels:
202
- <<: *attributes
203
-
204
- activerecord:
205
- models:
206
- dorsale/address:
207
- one: "Adresse"
208
- other: "Adresses"
209
-
210
- dorsale/comment:
211
- one: "Commentaire"
212
- other: "Commentaires"
213
-
214
- simple_form:
215
- "yes" : 'Oui'
216
- "no" : 'Non'
217
-
218
- required:
219
- text: 'Requis'
220
- mark: '*'