From 0a59dc6b5d76cb19de5081c26d998e26a8499ab5 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 7 Jan 2019 10:50:10 +0100 Subject: [PATCH] display previous closings in modal --- .../controllers/admin/invoices.js.erb | 3 +- app/assets/stylesheets/modules/invoice.scss | 40 ++++++++- .../admin/invoices/closePeriodModal.html.erb | 87 ++++++++++++++++++- config/locales/app.admin.en.yml | 5 ++ config/locales/app.admin.es.yml | 5 ++ config/locales/app.admin.fr.yml | 5 ++ config/locales/app.admin.pt.yml | 15 ++-- 7 files changed, 150 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/controllers/admin/invoices.js.erb b/app/assets/javascripts/controllers/admin/invoices.js.erb index acf3706e6..a7f0c62cd 100644 --- a/app/assets/javascripts/controllers/admin/invoices.js.erb +++ b/app/assets/javascripts/controllers/admin/invoices.js.erb @@ -391,7 +391,8 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I // open modal $uibModal.open({ templateUrl: '<%= asset_path "admin/invoices/closePeriodModal.html" %>', - controller: 'ClosePeriodModalController' + controller: 'ClosePeriodModalController', + size: 'lg' }); } diff --git a/app/assets/stylesheets/modules/invoice.scss b/app/assets/stylesheets/modules/invoice.scss index 452138f54..682456da9 100644 --- a/app/assets/stylesheets/modules/invoice.scss +++ b/app/assets/stylesheets/modules/invoice.scss @@ -178,4 +178,42 @@ border-radius: 5px; font-size: small; } -} \ No newline at end of file +} + +table.closings-table { + width: 100%; + border-spacing: 0; + + thead, tbody, tr, th, td { display: block; } + + thead tr { + /* fallback */ + width: 97%; + /* minus scroll bar width */ + width: -webkit-calc(100% - 16px); + width: -moz-calc(100% - 16px); + width: calc(100% - 16px); + } + + thead tr th { + border-bottom: 0; + } + + tr:after { /* clearing float */ + content: ' '; + display: block; + visibility: hidden; + clear: both; + } + + tbody { + height: 200px; + overflow-y: auto; + overflow-x: hidden; + } + + tbody td, thead th { + width: 24%; /* 24% is less than (100% / 4 cols) = 25% */ + float: left; + } +} diff --git a/app/assets/templates/admin/invoices/closePeriodModal.html.erb b/app/assets/templates/admin/invoices/closePeriodModal.html.erb index f52d11b94..186a6dbca 100644 --- a/app/assets/templates/admin/invoices/closePeriodModal.html.erb +++ b/app/assets/templates/admin/invoices/closePeriodModal.html.erb @@ -2,8 +2,8 @@

{{ 'invoices.close_accounting_period' }}