diff --git a/app/controllers/grants_controller.rb b/app/controllers/grants_controller.rb index 554b152..28f828a 100644 --- a/app/controllers/grants_controller.rb +++ b/app/controllers/grants_controller.rb @@ -109,6 +109,8 @@ class GrantsController < ApplicationController :max_amount_curr_id, :min_dot_ammount, :max_dot_ammount, :min_dot_amount_curr_id, :max_dot_amount_curr_id, :start_date_quarter, :end_date_quarter, :ann_date_quarter, + :start_date_month, :end_date_month, :ann_date_month, + :start_date_always, :end_date_always, :ann_date_always, project_ids: [], tag_ids: [], company_activity_ids: [], company_size_ids: [], expense_ids: []) end diff --git a/app/models/dotation.rb b/app/models/dotation.rb index 24052d0..6473094 100644 --- a/app/models/dotation.rb +++ b/app/models/dotation.rb @@ -117,6 +117,8 @@ class Dotation < ApplicationRecord if start_date_quarter.eql?(true) Dotation.display_as_quarter(start_date) + elsif start_date_month.eql?(true) + I18n.l(start_date, format: "%B %Y") else start_date.strftime("%d-%m-%Y") end @@ -127,6 +129,8 @@ class Dotation < ApplicationRecord if end_date_quarter.eql?(true) Dotation.display_as_quarter(end_date) + elsif end_date_month.eql?(true) + I18n.l(end_date, format: "%B %Y") else end_date.strftime("%d-%m-%Y") end @@ -137,6 +141,8 @@ class Dotation < ApplicationRecord if ann_date_quarter.eql?(true) Dotation.display_as_quarter(announcement_date) + elsif ann_date_month.eql?(true) + I18n.l(announcement_date, format: "%B %Y") else announcement_date.strftime("%d-%m-%Y") end diff --git a/app/views/grants/_form.html.erb b/app/views/grants/_form.html.erb index 18791ef..288db13 100644 --- a/app/views/grants/_form.html.erb +++ b/app/views/grants/_form.html.erb @@ -71,17 +71,41 @@ <%= form.check_box(:ann_date_quarter, { class: 'form-check-input' }) %> <%= form.label :ann_date_quarter %> +
| Ogłoszenie aktualnego/najbliższego naboru | #{@dotation.ann_date_ret} |
| Rozpoczęcie aktualnego/najbliższego naboru | #{@dotation.start_date_ret} |
| Zakończenie aktualnego/najbliższego naboru | #{@dotation.end_date_ret} |
| Składanie wniosków | Nabór w trybie ciągłym |
| Ogłoszenie aktualnego/najbliższego naboru | od #{@dotation.ann_date_ret} |
| Rozpoczęcie aktualnego/najbliższego naboru | od #{@dotation.start_date_ret} |
| Zakończenie aktualnego/najbliższego naboru | do #{@dotation.end_date_ret} |
| Co można dofinansować? |
diff --git a/app/views/home/_show.pdf.erb b/app/views/home/_show.pdf.erb
index 389390b..83156af 100644
--- a/app/views/home/_show.pdf.erb
+++ b/app/views/home/_show.pdf.erb
@@ -50,9 +50,13 @@
- <%= raw " Ogłoszenie aktualnego/najbliższego naboru: #{dotation.ann_date_ret}" unless dotation.announcement_date.blank? %> - <%= raw "Rozpoczęcie aktualnego/najbliższego naboru: #{dotation.start_date_ret}" unless dotation.start_date.blank? %> - <%= raw "Zakończenie aktualnego/najbliższego naboru: #{dotation.end_date_ret}" unless dotation.end_date.blank? %> + <% if dotation.start_date_always.eql?(true) || dotation.end_date_always.eql?(true) || dotation.ann_date_always.eql?(true) %> +Składanie wnioskówNabór w trybie ciągłym+ <% else %> + <%= raw "Ogłoszenie aktualnego/najbliższego naboru: #{dotation.ann_date_ret}" unless dotation.announcement_date.blank? %> + <%= raw "Rozpoczęcie aktualnego/najbliższego naboru: #{dotation.start_date_ret}" unless dotation.start_date.blank? %> + <%= raw "Zakończenie aktualnego/najbliższego naboru: #{dotation.end_date_ret}" unless dotation.end_date.blank? %> + <% end %>Co można dofinansować?
Tak - nadpisze dane Nie - uzupełni tylko brakujące dane.' confirm: 'Tak' cancel: 'Nie' + date: + abbr_day_names: + - nie + - pon + - wto + - śro + - czw + - pią + - sob + abbr_month_names: + - + - sty + - lut + - mar + - kwi + - maj + - cze + - lip + - sie + - wrz + - paź + - lis + - gru + day_names: + - niedziela + - poniedziałek + - wtorek + - środa + - czwartek + - piątek + - sobota + formats: + default: "%d-%m-%Y" + long: "%-d %B %Y" + short: "%-d %b" + month_names: + - + - stycznia + - lutego + - marca + - kwietnia + - maja + - czerwca + - lipca + - sierpnia + - września + - października + - listopada + - grudnia + order: + - :day + - :month + - :year + datetime: + distance_in_words: + about_x_hours: + one: około godziny + few: około %{count} godziny + many: około %{count} godzin + other: około %{count} godzin + about_x_months: + one: około miesiąca + few: około %{count} miesiące + many: około %{count} miesięcy + other: około %{count} miesięcy + about_x_years: + one: około rok + few: około %{count} lata + many: około %{count} lat + other: około %{count} lat + almost_x_years: + one: prawie rok + few: prawie %{count} lata + many: prawie %{count} lat + other: prawie %{count} lat + half_a_minute: pół minuty + less_than_x_seconds: + one: mniej niż sekundę + few: mniej niż %{count} sekundy + many: mniej niż %{count} sekund + other: mniej niż %{count} sekund + less_than_x_minutes: + one: mniej niż minutę + few: mniej niż %{count} minuty + many: mniej niż %{count} minut + other: mniej niż %{count} minut + over_x_years: + one: ponad rok + few: ponad %{count} lata + many: ponad %{count} lat + other: ponad %{count} lat + x_seconds: + one: 1 sekunda + few: "%{count} sekundy" + many: "%{count} sekund" + other: "%{count} sekund" + x_minutes: + one: 1 minuta + few: "%{count} minuty" + many: "%{count} minut" + other: "%{count} minut" + x_days: + one: 1 dzień + few: "%{count} dni" + many: "%{count} dni" + other: "%{count} dni" + x_months: + one: 1 miesiąc + few: "%{count} miesiące" + many: "%{count} miesięcy" + other: "%{count} miesięcy" + prompts: + second: Sekundy + minute: Minuta + hour: Godzina + day: Dzień + month: Miesiąc + year: Rok + errors: + format: "%{attribute} %{message}" + messages: + accepted: musi zostać zaakceptowane + blank: nie może być puste + confirmation: musi być taki sam jak w %{attribute} + empty: nie może być puste + equal_to: musi być równe %{count} + even: musi być parzyste + exclusion: jest zarezerwowane + greater_than: musi być większe od %{count} + greater_than_or_equal_to: musi być większe lub równe %{count} + inclusion: nie znajduje się na liście dopuszczalnych wartości + invalid: jest nieprawidłowe + less_than: musi być mniejsze od %{count} + less_than_or_equal_to: musi być mniejsze lub równe %{count} + not_a_number: nie jest liczbą + not_an_integer: musi być liczbą całkowitą + odd: musi być nieparzyste + other_than: musi być inne niż %{count} + present: musi być puste + required: musi istnieć + taken: zostało już zajęte + too_long: + one: jest za długie (maksymalnie jeden znak) + few: jest za długie (maksymalnie %{count} znaki) + many: jest za długie (maksymalnie %{count} znaków) + other: jest za długie (maksymalnie %{count} znaków) + too_short: + one: jest za krótkie (przynajmniej jeden znak) + few: jest za krótkie (przynajmniej %{count} znaki) + many: jest za krótkie (przynajmniej %{count} znaków) + other: jest za krótkie (przynajmniej %{count} znaków) + wrong_length: + one: ma nieprawidłową długość (powinna wynosić jeden znak) + few: ma nieprawidłową długość (powinna wynosić %{count} znaki) + many: ma nieprawidłową długość (powinna wynosić %{count} znaków) + other: ma nieprawidłową długość (powinna wynosić %{count} znaków) + template: + body: 'Błędy dotyczą następujących pól:' + header: + one: "%{model} nie został zachowany z powodu jednego błędu" + few: "%{model} nie został zachowany z powodu %{count} błędów" + many: "%{model} nie został zachowany z powodu %{count} błędów" + other: "%{model} nie został zachowany z powodu %{count} błędów" + helpers: + select: + prompt: Proszę wybrać + submit: + create: Utwórz %{model} + submit: Wyślij %{model} + update: Aktualizuj %{model} + number: + currency: + format: + delimiter: " " + format: "%n %u" + precision: 2 + separator: "," + significant: false + strip_insignificant_zeros: true + unit: zł + format: + delimiter: " " + precision: 3 + separator: "," + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: "%n %u" + units: + billion: Miliard + million: Milion + quadrillion: Biliard + thousand: Tysiąc + trillion: Bilion + unit: '' + format: + delimiter: '' + precision: 3 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: bajt + few: bajty + many: bajtów + other: bajty + gb: GB + kb: KB + mb: MB + tb: TB + percentage: + format: + delimiter: '' + format: "%n%" + precision: + format: + delimiter: '' + support: + array: + last_word_connector: " oraz " + two_words_connector: " i " + words_connector: ", " + time: + am: przed południem + formats: + default: "%a, %-d %b %Y %H:%M:%S %z" + long: "%-d %B %Y %H:%M" + short: "%-d %b %H:%M" + pm: po południu diff --git a/db/migrate/20220615062225_add_checkbox_to_dotations.rb b/db/migrate/20220615062225_add_checkbox_to_dotations.rb new file mode 100644 index 0000000..4c971f2 --- /dev/null +++ b/db/migrate/20220615062225_add_checkbox_to_dotations.rb @@ -0,0 +1,10 @@ +class AddCheckboxToDotations < ActiveRecord::Migration[5.2] + def change + add_column :dotations, :start_date_month, :boolean, default: false + add_column :dotations, :end_date_month, :boolean, default: false + add_column :dotations, :ann_date_month, :boolean, default: false + add_column :dotations, :start_date_always, :boolean, default: false + add_column :dotations, :end_date_always, :boolean, default: false + add_column :dotations, :ann_date_always, :boolean, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index f23520c..d439f1a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_04_29_113929) do +ActiveRecord::Schema.define(version: 2022_06_15_062225) do create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| t.string "name", null: false @@ -112,9 +112,15 @@ ActiveRecord::Schema.define(version: 2022_04_29_113929) do t.integer "min_dot_amount_curr_id", default: 1 t.bigint "max_dot_ammount" t.integer "max_dot_amount_curr_id", default: 1 - t.boolean "start_date_quarter" - t.boolean "end_date_quarter" - t.boolean "ann_date_quarter" + t.boolean "start_date_quarter", default: false + t.boolean "end_date_quarter", default: false + t.boolean "ann_date_quarter", default: false + t.boolean "start_date_month", default: false + t.boolean "end_date_month", default: false + t.boolean "ann_date_month", default: false + t.boolean "start_date_always", default: false + t.boolean "end_date_always", default: false + t.boolean "ann_date_always", default: false t.index ["active"], name: "index_dotations_on_active" t.index ["announcement_date"], name: "index_dotations_on_announcement_date" t.index ["arch"], name: "index_dotations_on_arch" |