From 4fb131e0e11810b70d9acc74367992921cc49b4d Mon Sep 17 00:00:00 2001 From: Adrian Hinz Date: Wed, 4 May 2022 16:26:39 +0200 Subject: [PATCH] css fixes --- Gemfile.lock | 7 ++++ app/controllers/home_controller.rb | 6 ++-- app/views/home/_dotation_card.html.erb | 33 +++++++++-------- app/views/home/_filter_form.html.erb | 4 +-- app/views/home/_show.html.erb | 49 ++++++++++++++++---------- app/views/home/_show.pdf.erb | 2 +- 6 files changed, 61 insertions(+), 40 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 309a646..fc6bd3f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -76,6 +76,9 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) + combine_pdf (1.0.22) + matrix + ruby-rc4 (>= 0.1.5) concurrent-ruby (1.1.9) crass (1.0.6) devise (4.6.2) @@ -170,6 +173,7 @@ GEM actionpack (>= 4.2.0, < 6.0) railties (>= 4.2.0, < 6.0) rexml (3.2.5) + ruby-rc4 (0.1.5) ruby_dep (1.5.0) rubyzip (2.3.2) sass (3.7.4) @@ -220,6 +224,7 @@ GEM websocket-extensions (0.1.5) wicked_pdf (2.1.0) activesupport + wkhtmltopdf-binary (0.12.4) xpath (3.2.0) nokogiri (~> 1.8) @@ -233,6 +238,7 @@ DEPENDENCIES capybara (>= 2.15) chromedriver-helper coffee-rails (~> 4.2) + combine_pdf devise friendly_id (~> 5.4.0) jbuilder (~> 2.5) @@ -250,6 +256,7 @@ DEPENDENCIES uglifier (>= 1.3.0) web-console (>= 3.3.0) wicked_pdf + wkhtmltopdf-binary (= 0.12.4) RUBY VERSION ruby 2.6.0p0 diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 20b8af0..25e0b13 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -88,7 +88,7 @@ class HomeController < ApplicationController # pdf1b = WickedPdf.new.pdf_from_string( render_cover_footer(@dotation, @company_sizes), - {pdf: 'cover_header', + {pdf: 'cover_footer', dpi: 300, margin: { top: 0, bottom: 0, left: 0, right: 0 }, background: true, @@ -141,7 +141,7 @@ class HomeController < ApplicationController # pdf1b = WickedPdf.new.pdf_from_string( render_cover_footer(dotation, @company_sizes), - {pdf: 'cover_header', + {pdf: 'cover_footer', dpi: 300, margin: { top: 0, bottom: 0, left: 0, right: 0 }, background: true, @@ -151,7 +151,7 @@ class HomeController < ApplicationController combiner << CombinePDF.parse(pdf1a) combiner << CombinePDF.parse(pdf1) combiner << CombinePDF.parse(pdf1b) - send_data combiner.to_pdf + send_data combiner.to_pdf, filename: "zestawienie_dotacji_#{Time.now.strftime('%d%m%Y')}.pdf" end end end diff --git a/app/views/home/_dotation_card.html.erb b/app/views/home/_dotation_card.html.erb index 7b9e7ee..5af5724 100644 --- a/app/views/home/_dotation_card.html.erb +++ b/app/views/home/_dotation_card.html.erb @@ -9,11 +9,27 @@
+
+
+

<%= dotation.formal_name %>

+
+
-

<%= dotation.formal_name %>

+

<%= dotation.localization %>

+ <% unless dotation.max_percent.blank? %> +
+
+

Poziom dofinansowania

+
+
+

do <%= dotation.max_percent %>% dotacji

+
+
+ <% end %> + <% if !dotation.start_date.blank? || !dotation.end_date.blank? %>

Składanie wniosków

@@ -25,14 +41,11 @@
+ <% end %>
-

<%= dotation.localization %>

-
-
- <% unless dotation.max_amount.blank? %>
@@ -43,16 +56,6 @@
<% end %> - <% unless dotation.max_percent.blank? %> -
-
-
Poziom dofinansowania
-
-
-
do <%= dotation.max_percent %>% dotacji
-
-
- <% end %>
diff --git a/app/views/home/_filter_form.html.erb b/app/views/home/_filter_form.html.erb index 20b19ba..b0707a2 100644 --- a/app/views/home/_filter_form.html.erb +++ b/app/views/home/_filter_form.html.erb @@ -1,7 +1,7 @@ <%= form_tag(home_search_path, method: :get, remote: true, id: 'filter_form') do %> -
+
-

Aktywne filtry

+

Użyj filtrów, aby szybko odnaleźć interesującą Cię dotację

<% unless params[:search].blank? %> diff --git a/app/views/home/_show.html.erb b/app/views/home/_show.html.erb index 836bf7b..84652b1 100644 --- a/app/views/home/_show.html.erb +++ b/app/views/home/_show.html.erb @@ -35,10 +35,10 @@ - + <%= render '/experts/expert_show', expert: @dotation.expert %> - +
<%= raw @dotation.expert_info %>
@@ -54,23 +54,34 @@
- <%= 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? %> -

Co można dofinansować?

-
    - <% @dotation.expenses.each do |expense| %> -
  • <%= expense.name %>
  • - <% end %> -
- <% unless @dotation.localization.blank? %> -

Miejsce realizacji projektu

-

<%= @dotation.localization %>

- <% end %> - <%= raw "

Minimalna wartość projektu (wydatków): #{HomeHelper.change_ammount(@dotation.min_amount)} #{@dotation.min_amount_curr.name}

" unless @dotation.min_amount.blank? %> - <%= raw "

Maksymalna wartość projektu (wydatków): #{HomeHelper.change_ammount(@dotation.max_amount)} #{@dotation.max_amount_curr.name}

" unless @dotation.max_amount.blank? %> - <%= raw "

Minimalna wartość dotacji: #{HomeHelper.change_ammount(@dotation.min_dot_ammount)} #{@dotation.min_dot_amount_curr.name}

" unless @dotation.min_dot_ammount.blank? %> - <%= raw "

Maksymalna wartość dotacji: #{HomeHelper.change_ammount(@dotation.max_dot_ammount)} #{@dotation.max_dot_amount_curr.name}

" unless @dotation.max_dot_ammount.blank? %> + + + <%= raw "" unless @dotation.announcement_date.blank? %> + <%= raw "" unless @dotation.start_date.blank? %> + <%= raw "" unless @dotation.end_date.blank? %> + + + + + <% unless @dotation.localization.blank? %> + + + + + <% end %> + <%= raw "" unless @dotation.min_amount.blank? %> + <%= raw "" unless @dotation.max_amount.blank? %> + <%= raw "" unless @dotation.min_dot_ammount.blank? %> + <%= raw "" unless @dotation.max_dot_ammount.blank? %> + +
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}
Co można dofinansować? +
    + <% @dotation.expenses.each do |expense| %> +
  • <%= expense.name %>
  • + <% end %> +
+
Miejsce realizacji projektu<%= @dotation.localization %>
Minimalna wartość projektu (wydatków): #{HomeHelper.change_ammount(@dotation.min_amount)} #{@dotation.min_amount_curr.name}
Maksymalna wartość projektu (wydatków): #{HomeHelper.change_ammount(@dotation.max_amount)} #{@dotation.max_amount_curr.name}
Minimalna wartość dotacji: #{HomeHelper.change_ammount(@dotation.min_dot_ammount)} #{@dotation.min_dot_amount_curr.name}
Maksymalna wartość dotacji: #{HomeHelper.change_ammount(@dotation.max_dot_ammount)} #{@dotation.max_dot_amount_curr.name}
+

Szczegółowy opis dotacji

diff --git a/app/views/home/_show.pdf.erb b/app/views/home/_show.pdf.erb index 9fa0604..2223011 100644 --- a/app/views/home/_show.pdf.erb +++ b/app/views/home/_show.pdf.erb @@ -33,7 +33,7 @@ -
+ <%= render '/experts/expert_show', expert: dotation.expert %>