dorsale 3.2.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/app/assets/javascripts/dorsale/common/forms.coffee +3 -14
  4. data/app/assets/stylesheets/dorsale/common/contexts.sass +0 -23
  5. data/app/assets/stylesheets/dorsale/common/styles.sass +5 -0
  6. data/app/assets/stylesheets/dorsale/engines/billing_machine.sass +3 -0
  7. data/app/assets/stylesheets/dorsale/print.sass +1 -0
  8. data/app/helpers/dorsale/button_helper.rb +18 -0
  9. data/app/helpers/dorsale/context_helper.rb +2 -6
  10. data/app/views/dorsale/_page.html.slim +40 -0
  11. data/app/views/dorsale/billing_machine/id_cards/_index_actions.html.slim +2 -0
  12. data/app/views/dorsale/billing_machine/id_cards/index.html.slim +2 -3
  13. data/app/views/dorsale/billing_machine/invoices/_details.html.slim +0 -14
  14. data/app/views/dorsale/billing_machine/invoices/_index_actions.html.slim +6 -0
  15. data/app/views/dorsale/billing_machine/invoices/_show_title.html.slim +12 -0
  16. data/app/views/dorsale/billing_machine/invoices/index.html.slim +2 -6
  17. data/app/views/dorsale/billing_machine/invoices/index.pdf.ruby +5 -0
  18. data/app/views/dorsale/billing_machine/invoices/show.html.slim +7 -3
  19. data/app/views/dorsale/billing_machine/payment_terms/_index_actions.html.slim +2 -0
  20. data/app/views/dorsale/billing_machine/payment_terms/index.html.slim +2 -3
  21. data/app/views/dorsale/billing_machine/quotations/_details.html.slim +1 -0
  22. data/app/views/dorsale/billing_machine/quotations/_index_actions.html.slim +2 -0
  23. data/app/views/dorsale/billing_machine/quotations/_show_title.html.slim +1 -0
  24. data/app/views/dorsale/billing_machine/quotations/index.html.slim +2 -3
  25. data/app/views/dorsale/billing_machine/quotations/show.html.slim +7 -4
  26. data/app/views/dorsale/customer_vault/links/edit.html.slim +1 -1
  27. data/app/views/dorsale/customer_vault/links/index.html.slim +6 -7
  28. data/app/views/dorsale/customer_vault/links/new.html.slim +1 -1
  29. data/app/views/dorsale/customer_vault/people/{_actions.html.slim → _index_actions.html.slim} +1 -1
  30. data/app/views/dorsale/customer_vault/people/_show_layout.html.slim +3 -4
  31. data/app/views/dorsale/customer_vault/people/_show_tabs.html.slim +26 -0
  32. data/app/views/dorsale/customer_vault/people/activity.slim +3 -3
  33. data/app/views/dorsale/customer_vault/people/edit.html.slim +2 -2
  34. data/app/views/dorsale/customer_vault/people/index.html.slim +2 -2
  35. data/app/views/dorsale/customer_vault/people/invoices.html.slim +2 -3
  36. data/app/views/dorsale/customer_vault/people/new.html.slim +2 -2
  37. data/app/views/dorsale/customer_vault/people/show.html.slim +1 -1
  38. data/app/views/dorsale/customer_vault/people/tasks.html.slim +4 -3
  39. data/app/views/dorsale/expense_gun/categories/_index_actions.html.slim +2 -0
  40. data/app/views/dorsale/expense_gun/categories/index.html.slim +2 -3
  41. data/app/views/dorsale/expense_gun/expenses/_index_actions.html.slim +2 -0
  42. data/app/views/dorsale/expense_gun/expenses/_show_actions.html.slim +19 -0
  43. data/app/views/dorsale/expense_gun/expenses/index.html.slim +2 -3
  44. data/app/views/dorsale/expense_gun/expenses/show.html.slim +36 -49
  45. data/app/views/dorsale/flyboy/folders/_context.html.slim +1 -1
  46. data/app/views/dorsale/flyboy/folders/{_actions.html.slim → _context_actions.html.slim} +0 -0
  47. data/app/views/dorsale/flyboy/folders/_index_actions.html.slim +2 -0
  48. data/app/views/dorsale/flyboy/folders/edit.html.slim +3 -3
  49. data/app/views/dorsale/flyboy/folders/index.html.slim +2 -3
  50. data/app/views/dorsale/flyboy/folders/show.html.slim +8 -3
  51. data/app/views/dorsale/flyboy/tasks/_index_actions.html.slim +2 -0
  52. data/app/views/dorsale/flyboy/tasks/_tasks_for_taskable.html.slim +4 -3
  53. data/app/views/dorsale/flyboy/tasks/edit.html.slim +3 -3
  54. data/app/views/dorsale/flyboy/tasks/index.html.slim +2 -3
  55. data/app/views/dorsale/flyboy/tasks/new.html.slim +3 -3
  56. data/app/views/dorsale/flyboy/tasks/show.html.slim +3 -3
  57. data/app/views/dorsale/users/_index_actions.html.slim +2 -0
  58. data/app/views/dorsale/users/index.html.slim +2 -3
  59. data/config/locales/common.en.yml +5 -0
  60. data/config/locales/common.fr.yml +5 -9
  61. data/config/locales/customer_vault.fr.yml +1 -1
  62. data/config/locales/expense_gun.fr.yml +0 -4
  63. data/lib/dorsale/version.rb +1 -1
  64. data/spec/controllers/dorsale/billing_machine/invoices_controller_spec.rb +10 -0
  65. data/spec/models/dorsale/i18n_spec.rb +3 -5
  66. metadata +20 -8
  67. data/app/views/dorsale/_contextual.html.slim +0 -11
  68. data/app/views/dorsale/_index.html.slim +0 -24
  69. data/app/views/dorsale/customer_vault/people/_tabs.html.slim +0 -24
  70. data/app/views/dorsale/flyboy/tasks/_actions.html.slim +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3238d078981accff66147d5fb412740e482a115f
4
- data.tar.gz: bb228e445bec72569f5083bd8ea6322702ba8ebd
3
+ metadata.gz: d434a4d088da9d112016b8b105a585e3c6ab6d5d
4
+ data.tar.gz: 8e168b8193bba3d7ed57847a461feebd36b3e0d8
5
5
  SHA512:
6
- metadata.gz: 45e05fc44b6d74b7f44becd523c8dd7c7d306a82479adf5e86e7c9a677dc2285ab8cd9b56a2d1f2f405427014dc21a0d959192659c5f797ce5bc0c0ac5979b6c
7
- data.tar.gz: 5ffd84a943253a3e8fdb99a5adad1286e62299106b62f604074f6ff6e745f0efaf2879dba8266d5540b73438fb1bec7990e3991d19a26957d382c353a17c5779
6
+ metadata.gz: c7ab336441e22590d30bc06da433455fddfed6579cce0ab693f59bb243e073ebfd1ec29afdb631373abcea83b3cd650edb05c0a4f0dbc8e99742a03702d380d5
7
+ data.tar.gz: 8d4c15c6f3adf0c3a0375f451e03643f8a0b415ab33195e0dd862a7da9ae89ed8ba961b9c2bdfcfd7f5fb57fdc9c4241270cd93513aac610ece2d7f8ca14b72d
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## Next version
4
+
5
+ Nothing.
6
+
7
+ ## 3.3.0
8
+
9
+ - Add download of all invoices in pdf
10
+ - Rename `render_dorsale_index` to `render_dorsale_page`
11
+ - Replace `render_contextual` by `render_dorsale_page`
12
+ - Change some view/partial names
13
+ - Fix js reset button
14
+ - Print CSS add flash
15
+
3
16
  ## 3.2.0
4
17
 
5
18
  - Add print CSS
@@ -27,20 +27,9 @@ window.setupUploadInputs = (scope = document) ->
27
27
  $(document).on "turbolinks:load", ->
28
28
  $("button.reset").click ->
29
29
  form = $(this).parents("form")
30
-
31
- form.find("select option:first-child").map ->
32
- this.selected = true
33
-
34
- form.find("input").map ->
35
- return if this.type.match(/submit|hidden|button/)
36
- this.value = $(this).data("default-value") || ""
37
-
38
- form.find("textarea").map ->
39
- this.value = $(this).data("default-value") || ""
40
-
41
- form.find("select").map ->
42
- this.selectize.clear() if this.selectize
43
- $(this).val("").trigger("change")
30
+ form.find("input, textarea, select").map ->
31
+ return if String(this.type).match(/submit|hidden|button/)
32
+ $(this).val String($(this).data("default-value") || "")
44
33
 
45
34
  # Referer with anchor
46
35
  $("form").submit ->
@@ -27,28 +27,5 @@
27
27
  margin-right: auto
28
28
  padding: 0 0.25em
29
29
 
30
-
31
- .actions.top
32
- text-align: right
33
- margin: 1em 0
34
-
35
- .btn
36
- @extend .btn
37
-
38
- a.btn[href*='/new']
39
- @extend .btn-success
40
-
41
- .btn-primary
42
- @extend .btn-primary
43
-
44
- .btn-success
45
- @extend .btn-success
46
-
47
- .btn-danger
48
- @extend .btn-danger
49
-
50
- .btn-warning
51
- @extend .btn-warning
52
-
53
30
  form.search
54
31
  margin: 1em 0
@@ -39,3 +39,8 @@ img.avatar
39
39
 
40
40
  .well
41
41
  box-shadow: none
42
+
43
+ .panel-title .btn-xs,
44
+ .panel-title .label,
45
+ position: relative
46
+ top: -2px
@@ -46,6 +46,9 @@
46
46
  display: inline-block
47
47
  margin: 0.5em 0.75em
48
48
 
49
+ .panel-title .label
50
+ margin: 0 0 0 1.5em
51
+
49
52
 
50
53
  #billing_machine-form,
51
54
  #billing_machine-show,
@@ -38,6 +38,7 @@
38
38
  .nav,
39
39
  .nav-tabs,
40
40
  a[href]:after,
41
+ #flash,
41
42
  display: none !important
42
43
 
43
44
  .panel,
@@ -65,6 +65,24 @@ module Dorsale::ButtonHelper
65
65
  dorsale_button(url, options)
66
66
  end
67
67
 
68
+ def export_button(url, options = {})
69
+ ext = url.split(".").last
70
+
71
+ if ext.length <= 4
72
+ action = :"export_#{ext}"
73
+ else
74
+ action = :export
75
+ end
76
+
77
+ options = {
78
+ :icon => "cloud-download",
79
+ :action => action,
80
+ :download => url,
81
+ }.merge(options)
82
+
83
+ dorsale_button(url, options)
84
+ end
85
+
68
86
  def update_button(url, options = {})
69
87
  options = {
70
88
  :icon => :pencil,
@@ -16,11 +16,7 @@ module Dorsale::ContextHelper
16
16
  }
17
17
  end
18
18
 
19
- def render_contextual
20
- render "dorsale/contextual"
21
- end
22
-
23
- def render_dorsale_index
24
- render "dorsale/index"
19
+ def render_dorsale_page
20
+ render "dorsale/page"
25
21
  end
26
22
  end
@@ -0,0 +1,40 @@
1
+ #page_header = content_for(:page_header)
2
+
3
+ - if content_for(:search)
4
+ .row
5
+ .col-md-8
6
+ .col-md-4
7
+ = content_for(:search)
8
+
9
+ = content_for(:filters)
10
+
11
+ - content_for(:main)
12
+ = content_for(:tabs)
13
+
14
+ - unless content_for?(:title)
15
+ p.text-right = content_for(:actions)
16
+
17
+ - if content_for?(:title) || content_for?(:table)
18
+ .panel.panel-default
19
+ - if content_for?(:title)
20
+ .panel-heading: .panel-title
21
+ = content_for(:title)
22
+ .pull-right = content_for(:actions)
23
+
24
+ = content_for(:table)
25
+
26
+ = content_for(:page_body)
27
+
28
+ - if content_for?(:context)
29
+ .row
30
+ aside#context.col-sm-4.col-xs-12
31
+ = content_for(:context)
32
+ #context-main.col-sm-8.col-xs-12
33
+ = content_for(:main)
34
+ - else
35
+ = content_for(:main)
36
+
37
+
38
+ = content_for(:pagination)
39
+
40
+ #page_footer = content_for(:page_footer)
@@ -0,0 +1,2 @@
1
+ - if policy(::Dorsale::BillingMachine::IdCard).create?
2
+ = create_button new_billing_machine_id_card_path, action: :create
@@ -3,10 +3,9 @@
3
3
  = ::Dorsale::BillingMachine::IdCard.ts
4
4
 
5
5
  - content_for :actions
6
- - if policy(::Dorsale::BillingMachine::IdCard).create?
7
- = create_button new_billing_machine_id_card_path, action: :create
6
+ = render "dorsale/billing_machine/id_cards/index_actions"
8
7
 
9
8
  - content_for :table
10
9
  = render "dorsale/billing_machine/id_cards/list", id_cards: @id_cards
11
10
 
12
- = render_dorsale_index
11
+ = render_dorsale_page
@@ -2,20 +2,6 @@
2
2
  - document_type = document.class.to_s.split("::").last.downcase.to_sym
3
3
 
4
4
  #billing_machine-show
5
- h1
6
- = document.t
7
- - if document.tracking_id.present?
8
- = " n° "
9
- = document.tracking_id
10
-
11
- - if document_type == :invoice
12
- .label class="invoice #{document.payment_status}"
13
- = document.t("payment_status.#{document.payment_status}")
14
-
15
- - if document_type == :quotation
16
- .label class="quotation #{quotation_state_classes(document)}"
17
- = document.t("state.#{document.state}")
18
-
19
5
  .row
20
6
  .col-md-6
21
7
  .well
@@ -0,0 +1,6 @@
1
+ - if policy(::Dorsale::BillingMachine::Invoice).create?
2
+ = create_button dorsale.new_billing_machine_invoice_path
3
+
4
+ - if policy(::Dorsale::BillingMachine::Invoice).export?
5
+ = export_button dorsale.billing_machine_invoices_path(format: :xlsx), download: "#{model.ts}.xlsx"
6
+ = export_button dorsale.billing_machine_invoices_path(format: :pdf), download: "#{model.ts}.pdf"
@@ -0,0 +1,12 @@
1
+ = document.t
2
+ - if document.tracking_id.present?
3
+ = " n° "
4
+ = document.tracking_id
5
+
6
+ - if document.is_a?(Dorsale::BillingMachine::Invoice)
7
+ .label class="invoice #{document.payment_status}"
8
+ = document.t("payment_status.#{document.payment_status}")
9
+
10
+ - if document.is_a?(Dorsale::BillingMachine::Quotation)
11
+ .label class="quotation #{quotation_state_classes(document)}"
12
+ = document.t("state.#{document.state}")
@@ -11,11 +11,7 @@
11
11
  = Dorsale::BillingMachine::Invoice.ts
12
12
 
13
13
  - content_for :actions
14
- - if policy(::Dorsale::BillingMachine::Invoice).create?
15
- = create_button dorsale.new_billing_machine_invoice_path
16
-
17
- - if policy(::Dorsale::BillingMachine::Invoice).export?
18
- = download_button dorsale.billing_machine_invoices_path(format: :xlsx), download: "#{model.ts}.xlsx"
14
+ = render "dorsale/billing_machine/invoices/index_actions"
19
15
 
20
16
  - content_for :table
21
17
  = render "dorsale/billing_machine/invoices/list", invoices: @invoices
@@ -23,4 +19,4 @@
23
19
  - content_for :pagination
24
20
  = paginate @invoices
25
21
 
26
- = render_dorsale_index
22
+ = render_dorsale_page
@@ -0,0 +1,5 @@
1
+ pdf = CombinePDF.new
2
+ @invoices_without_pagination.each do |invoice|
3
+ pdf << CombinePDF.parse(invoice.to_pdf)
4
+ end
5
+ pdf.to_pdf
@@ -1,7 +1,11 @@
1
1
  .billing_machine
2
- .actions.top
2
+ - content_for :title
3
+ = render "dorsale/billing_machine/invoices/show_title", document: @invoice
4
+
5
+ - content_for :actions
3
6
  = render "dorsale/billing_machine/invoices/show_actions"
4
7
 
5
- hr
8
+ - content_for :page_body
9
+ = render "dorsale/billing_machine/invoices/details", document: @invoice
6
10
 
7
- = render "dorsale/billing_machine/invoices/details", document: @invoice
11
+ = render_dorsale_page
@@ -0,0 +1,2 @@
1
+ - if policy(::Dorsale::BillingMachine::PaymentTerm).create?
2
+ = create_button new_billing_machine_payment_term_path, action: :create
@@ -3,10 +3,9 @@
3
3
  = ::Dorsale::BillingMachine::PaymentTerm.ts
4
4
 
5
5
  - content_for :actions
6
- - if policy(::Dorsale::BillingMachine::PaymentTerm).create?
7
- = create_button new_billing_machine_payment_term_path, action: :create
6
+ = render "dorsale/billing_machine/payment_terms/index_actions"
8
7
 
9
8
  - content_for :table
10
9
  = render "dorsale/billing_machine/payment_terms/list", payment_terms: @payment_terms
11
10
 
12
- = render_dorsale_index
11
+ = render_dorsale_page
@@ -0,0 +1 @@
1
+ = render "dorsale/billing_machine/invoices/details", document: document
@@ -0,0 +1,2 @@
1
+ - if policy(Dorsale::BillingMachine::Quotation).create?
2
+ = create_button dorsale.new_billing_machine_quotation_path
@@ -0,0 +1 @@
1
+ = render "dorsale/billing_machine/invoices/show_title", document: document
@@ -11,8 +11,7 @@
11
11
  = Dorsale::BillingMachine::Quotation.ts
12
12
 
13
13
  - content_for :actions
14
- - if policy(Dorsale::BillingMachine::Quotation).create?
15
- = create_button dorsale.new_billing_machine_quotation_path
14
+ = render "dorsale/billing_machine/quotations/index_actions"
16
15
 
17
16
  - content_for :table
18
17
  = render "dorsale/billing_machine/quotations/list", quotations: @quotations
@@ -20,4 +19,4 @@
20
19
  - content_for :pagination
21
20
  = paginate @quotations
22
21
 
23
- = render_dorsale_index
22
+ = render_dorsale_page
@@ -1,8 +1,11 @@
1
1
  .billing_machine
2
- .actions.top
3
- = render "dorsale/billing_machine/quotations/show_actions"
2
+ - content_for :title
3
+ = render "dorsale/billing_machine/quotations/show_title", document: @quotation
4
4
 
5
- hr
5
+ - content_for :actions
6
+ = render "dorsale/billing_machine/quotations/show_actions"
6
7
 
7
- = render "dorsale/billing_machine/invoices/details", document: @quotation
8
+ - content_for :page_body
9
+ = render "dorsale/billing_machine/quotations/details", document: @quotation
8
10
 
11
+ = render_dorsale_page
@@ -1,4 +1,4 @@
1
- - content_for :person_page
1
+ - content_for :page_body
2
2
  .panel.panel-default
3
3
  .panel-heading: .panel-title
4
4
  = @link.t
@@ -1,10 +1,9 @@
1
- - content_for :person_page
2
- .linkable
3
- - @person.links.each do |link|
4
- = render "dorsale/customer_vault/people/list_item", person: link.other_person, link: link
1
+ - content_for :actions
2
+ - if policy(@person).update?
3
+ = create_button dorsale.new_customer_vault_person_link_path(@person), action: :new_link
5
4
 
6
- .text-center
7
- - if policy(@person).update?
8
- = create_button dorsale.new_customer_vault_person_link_path(@person), action: :new_link
5
+ - content_for :page_body
6
+ - @person.links.each do |link|
7
+ = render "dorsale/customer_vault/people/list_item", person: link.other_person, link: link
9
8
 
10
9
  = render "dorsale/customer_vault/people/show_layout"
@@ -1,4 +1,4 @@
1
- - content_for :person_page
1
+ - content_for :page_body
2
2
  .panel.panel-default
3
3
  .panel-heading: .panel-title
4
4
  = t("actions.new_link")
@@ -3,4 +3,4 @@
3
3
  = create_button dorsale.new_customer_vault_corporation_path, action: :new_corporation
4
4
 
5
5
  - if @people_without_pagination && policy(model).export?
6
- = download_button url_for(format: :xlsx), download: "#{model.ts}.xlsx"
6
+ = export_button url_for(format: :xlsx), download: "#{model.ts}.xlsx"
@@ -3,8 +3,7 @@
3
3
  = render "dorsale/customer_vault/people/context", person: @person
4
4
  = render "dorsale/customer_vault/people/data_context", person: @person
5
5
 
6
- - content_for :main
7
- = render "dorsale/customer_vault/people/tabs"
8
- = content_for :person_page
6
+ - content_for :tabs
7
+ = render "dorsale/customer_vault/people/show_tabs"
9
8
 
10
- = render_contextual
9
+ = render_dorsale_page
@@ -0,0 +1,26 @@
1
+ .nav.nav-tabs#person-tabs
2
+ li class=("active" if request.path == dorsale.customer_vault_person_path(@person))
3
+ a href=dorsale.customer_vault_person_path(@person)
4
+ = t("customer_vault.activity")
5
+ = " "
6
+ span.badge = @person.comments.count
7
+
8
+ li class=("active" if request.path.start_with? dorsale.customer_vault_person_links_path(@person))
9
+ a href=dorsale.customer_vault_person_links_path(@person)
10
+ = Dorsale::CustomerVault::Link.ts
11
+ = " "
12
+ span.badge = @person.links.length
13
+
14
+ - if policy(Dorsale::Flyboy::Task).list?
15
+ li class=("active" if request.path == dorsale.tasks_customer_vault_person_path(@person))
16
+ a href=dorsale.tasks_customer_vault_person_path(@person)
17
+ = Dorsale::Flyboy::Task.ts
18
+ = " "
19
+ span.badge = @person.tasks.count
20
+
21
+ - if policy(Dorsale::BillingMachine::Invoice).list?
22
+ li class=("active" if request.path == dorsale.invoices_customer_vault_person_path(@person))
23
+ a href=dorsale.invoices_customer_vault_person_path(@person)
24
+ = Dorsale::BillingMachine::Invoice.ts
25
+ = " "
26
+ span.badge = @person.invoices.count
@@ -5,10 +5,10 @@
5
5
  = t("customer_vault.activity")
6
6
 
7
7
  - content_for :actions
8
- = render "dorsale/customer_vault/people/actions"
8
+ = render "dorsale/customer_vault/people/index_actions"
9
9
 
10
10
  - content_for :page_header
11
- = render "dorsale/customer_vault/people/index_tabs"
11
+ = render "dorsale/customer_vault/people/index_tabs"
12
12
 
13
13
  - content_for :page_body
14
14
  - if @comments.empty?
@@ -21,4 +21,4 @@
21
21
  - content_for :pagination
22
22
  = paginate @comments
23
23
 
24
- = render_dorsale_index
24
+ = render_dorsale_page