added monthly and always on grants
This commit is contained in:
parent
4751c2ec09
commit
ad08144d2c
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -71,18 +71,42 @@
|
|||
<%= form.check_box(:ann_date_quarter, { class: 'form-check-input' }) %>
|
||||
<%= form.label :ann_date_quarter %>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<%= form.check_box(:ann_date_month, { class: 'form-check-input' }) %>
|
||||
<%= form.label :ann_date_month %>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<%= form.check_box(:ann_date_always, { class: 'form-check-input' }) %>
|
||||
<%= form.label :ann_date_always %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<%= form.check_box(:start_date_quarter, { class: 'form-check-input' }) %>
|
||||
<%= form.label :start_date_quarter %>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<%= form.check_box(:start_date_month, { class: 'form-check-input' }) %>
|
||||
<%= form.label :start_date_month %>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<%= form.check_box(:start_date_always, { class: 'form-check-input' }) %>
|
||||
<%= form.label :start_date_always %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<%= form.check_box(:end_date_quarter, { class: 'form-check-input' }) %>
|
||||
<%= form.label :end_date_quarter %>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<%= form.check_box(:end_date_month, { class: 'form-check-input' }) %>
|
||||
<%= form.label :end_date_month %>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<%= form.check_box(:end_date_always, { class: 'form-check-input' }) %>
|
||||
<%= form.label :end_date_always %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -37,8 +37,12 @@
|
|||
<div class="col-sm-6">
|
||||
<h4>
|
||||
<strong>
|
||||
<% if dotation.start_date_always.eql?(true) || dotation.end_date_always.eql?(true) || dotation.ann_date_always.eql?(true) %>
|
||||
Nabór w trybie ciągłym
|
||||
<% else %>
|
||||
<% unless dotation.start_date.blank? %>od <%= dotation.start_date_ret %><br /><% end %>
|
||||
<% unless dotation.end_date.blank? %>do <%= dotation.end_date_ret %><% end %>
|
||||
<% end %>
|
||||
</strong>
|
||||
</h4>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,8 +10,12 @@
|
|||
<tr>
|
||||
<td><strong>Składanie wniosków</strong></td>
|
||||
<h4>
|
||||
<% if dotation.start_date_always.eql?(true) || dotation.end_date_always.eql?(true) || dotation.ann_date_always.eql?(true) %>
|
||||
Nabór w trybie ciągłym
|
||||
<% else %>
|
||||
<% unless dotation.start_date.blank? %>od <%= dotation.start_date_ret %><br /><% end %>
|
||||
<% unless dotation.end_date.blank? %>do <%= dotation.end_date_ret %><% end %>
|
||||
<% end %>
|
||||
</h4>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -56,9 +56,13 @@
|
|||
<div class="col-md-12">
|
||||
<table class="table table-lg table-bordered">
|
||||
<tbody>
|
||||
<%= raw "<tr><td><span style='text-transform: uppercase;'><b>Ogłoszenie aktualnego/najbliższego naboru</b></td><td>#{@dotation.ann_date_ret}</span></td></tr>" unless @dotation.announcement_date.blank? %>
|
||||
<%= raw "<tr><td><span style='text-transform: uppercase;'><b>Rozpoczęcie aktualnego/najbliższego naboru</b></td><td>#{@dotation.start_date_ret}</span></td></tr>" unless @dotation.start_date.blank? %>
|
||||
<%= raw "<tr><td><span style='text-transform: uppercase;'><b>Zakończenie aktualnego/najbliższego naboru</b></td><td>#{@dotation.end_date_ret}</span></td></tr>" unless @dotation.end_date.blank? %>
|
||||
<% if @dotation.start_date_always.eql?(true) || @dotation.end_date_always.eql?(true) || @dotation.ann_date_always.eql?(true) %>
|
||||
<tr><td><span style='text-transform: uppercase;'><b>Składanie wniosków</b></span></td><td>Nabór w trybie ciągłym</td></tr>
|
||||
<% else %>
|
||||
<%= raw "<tr><td><span style='text-transform: uppercase;'><b>Ogłoszenie aktualnego/najbliższego naboru</b></span></td><td>od #{@dotation.ann_date_ret}</td></tr>" unless @dotation.announcement_date.blank? %>
|
||||
<%= raw "<tr><td><span style='text-transform: uppercase;'><b>Rozpoczęcie aktualnego/najbliższego naboru</b></span></td><td>od #{@dotation.start_date_ret}</td></tr>" unless @dotation.start_date.blank? %>
|
||||
<%= raw "<tr><td><span style='text-transform: uppercase;'><b>Zakończenie aktualnego/najbliższego naboru</b></span></td><td>do #{@dotation.end_date_ret}</td></tr>" unless @dotation.end_date.blank? %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td style='text-transform: uppercase;'><b>Co można dofinansować? </b></td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -50,9 +50,13 @@
|
|||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<% if dotation.start_date_always.eql?(true) || dotation.end_date_always.eql?(true) || dotation.ann_date_always.eql?(true) %>
|
||||
<h3 style='text-transform: uppercase;'><b>Składanie wniosków</b><span style='font-weight: normal;'>Nabór w trybie ciągłym</span></h3>
|
||||
<% else %>
|
||||
<%= raw "<h3 style='text-transform: uppercase;'><b>Ogłoszenie aktualnego/najbliższego naboru: </b><span style='font-weight: normal;'>#{dotation.ann_date_ret}</span></h3>" unless dotation.announcement_date.blank? %>
|
||||
<%= raw "<h3 style='text-transform: uppercase;'><b>Rozpoczęcie aktualnego/najbliższego naboru: </b><span style='font-weight: normal;'>#{dotation.start_date_ret}</span></h3>" unless dotation.start_date.blank? %>
|
||||
<%= raw "<h3 style='text-transform: uppercase;'><b>Zakończenie aktualnego/najbliższego naboru: </b><span style='font-weight: normal;'>#{dotation.end_date_ret}</span></h3>" unless dotation.end_date.blank? %>
|
||||
<% end %>
|
||||
<h3 style='text-transform: uppercase;'><b>Co można dofinansować? </b></h3>
|
||||
<ul>
|
||||
<% dotation.expenses.each do |expense| %>
|
||||
|
|
|
|||
|
|
@ -33,6 +33,12 @@ pl:
|
|||
start_date_quarter: Wyświetl jako kwartał
|
||||
end_date_quarter: Wyświetl jako kwartał
|
||||
ann_date_quarter: Wyświetl jako kwartał
|
||||
start_date_month: Wyświetl jako miesiąc
|
||||
end_date_month: Wyświetl jako miesiąc
|
||||
ann_date_month: Wyświetl jako miesiąc
|
||||
start_date_always: Nabór w trybie ciągłym
|
||||
end_date_always: Nabór w trybie ciągłym
|
||||
ann_date_always: Nabór w trybie ciągłym
|
||||
tags: Tagi
|
||||
full_descr: Pełny opis dotacji
|
||||
positioning_text: Tekst pozycjonujący
|
||||
|
|
|
|||
|
|
@ -242,3 +242,235 @@ pl:
|
|||
content: 'Część z danych pobranych z publicznej bazy podmiotów zastąpi obecne. Nadpisać dane?<br/><br/><strong>Tak</strong> - nadpisze dane<br/><strong>Nie</strong> - 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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
14
db/schema.rb
14
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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue