diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 5a173fd5..3971f8d2 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -126,6 +126,19 @@ margin-bottom: 0; } +.light-button { + border: 2px solid #3a67e8; + color: #3a67e8; + background-color: inherit; + border-radius: 3px; + margin-bottom: 0; +} + +.light-button:hover { + background-color: #3a67e8; + color: white; +} + .active-topic { background-color: #F3F2F1; padding: 20px 0; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e13dcc1f..19b0b724 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -42,6 +42,10 @@ def disable_feedback @disable_feedback = true end + def disable_current_topic + @active_current_topic = nil + end + private def set_default_metadata diff --git a/app/controllers/apps/president_vote_app/application_forms_controller.rb b/app/controllers/apps/president_vote_app/application_forms_controller.rb new file mode 100644 index 00000000..aa155798 --- /dev/null +++ b/app/controllers/apps/president_vote_app/application_forms_controller.rb @@ -0,0 +1,64 @@ +class Apps::PresidentVoteApp::ApplicationFormsController < ApplicationController + helper FormatDaysHelper + before_action :set_metadata, :check_inactive_president_application, :disable_current_topic + before_action :disable_feedback, only: [:show, :delivery, :create] + + def show + render_step('start') + end + + def delivery + return render_self if request.post? + render_step('delivery') + end + + def permanent_resident + return render_self if request.post? + render_step('permanent_resident') + end + + def create + render_self + end + + private def render_self + @application_form = Apps::PresidentVoteApp::ApplicationForm.new(form_params) + @application_form.run(self) + end + + private def render_step(step) + @application_form = Apps::PresidentVoteApp::ApplicationForm.new(step: step) + render step + end + + private def form_params + params.require(:apps_president_vote_app_application_form).permit( + :step, + :place_first_round, + :place_second_round, + :sk_citizen, + :delivery, + :full_name, :pin, :nationality, :maiden_name, + :authorized_person_full_name, :authorized_person_pin, + :street, :pobox, :municipality, + :same_delivery_address, + :delivery_street, :delivery_pobox, :delivery_municipality, :delivery_country, + :municipality_email, + :municipality_email_verified, + :permanent_resident, + :back + ) + end + + private def set_metadata + @metadata.og.title = 'Žiadosť o hlasovací preukaz' + @metadata.og.image = 'https://volby.digital/images/share-2024.png' + @metadata.og.description = 'Aj keď budete počas volieb mimo trvalého pobytu, voliť sa dá. Stačí požiadať.' + end + + private def check_inactive_president_application + return if Apps::PresidentVoteApp::ApplicationForm.active? + return redirect_to apps_president_vote_app_application_forms_path if action_name != "show" + render 'inactive' + end +end diff --git a/app/controllers/health_controller.rb b/app/controllers/health_controller.rb index abfeb52d..76c84e0e 100644 --- a/app/controllers/health_controller.rb +++ b/app/controllers/health_controller.rb @@ -1,5 +1,44 @@ class HealthController < ApplicationController + def index - head :ok + database_check_results = check_db_connections + if all_database_healthy?(database_check_results) + render json: {status: "ok"}, status: :ok + else + render json: {status: "fail"}, status: :internal_server_error + end + rescue StandardError + render json: {status: "fail"}, status: :internal_server_error + end + + private + def all_database_healthy?(database_check_results) + database_check_results.values.all? { |status| status[:status] == "ok" } + end + + def check_db_connections + db_status = {} + databases.each do |role, connection| + db_status[role] = perform_health_check(connection) + ensure + ActiveRecord::Base.clear_active_connections! + end + db_status + end + + def databases + { + primary: ActiveRecord::Base.connected_to(role: :writing) { ApplicationRecord.connection }, + datahub: ActiveRecord::Base.connected_to(role: :reading) { DatahubRecord.connection } + } + end + + def perform_health_check(connection) + if connection + connection.execute('SELECT 1') + {status: 'ok'} + else + {status: 'fail'} + end end end diff --git a/app/helpers/format_days_helper.rb b/app/helpers/format_days_helper.rb index 61a76c47..3381de29 100644 --- a/app/helpers/format_days_helper.rb +++ b/app/helpers/format_days_helper.rb @@ -11,6 +11,16 @@ def format_remaining_days(remaining_days) "Dnes je posledný možný termín." end end -end - + def format_remaining_days_count(remaining_days) + if remaining_days > 4 + "#{remaining_days} dní" + elsif remaining_days > 1 + "#{remaining_days} dni" + elsif remaining_days == 1 + "1 deň" + elsif remaining_days == 0 + "posledný deň" + end + end +end diff --git a/app/models/apps/parliament_vote_app/application_form.rb b/app/models/apps/parliament_vote_app/application_form.rb index 0dcc9b65..ef903cf1 100644 --- a/app/models/apps/parliament_vote_app/application_form.rb +++ b/app/models/apps/parliament_vote_app/application_form.rb @@ -40,6 +40,7 @@ class ApplicationForm on: [:identity, :world_sk_permanent_resident, :world_abroad_permanent_resident, :authorized_person] validates_presence_of :pin, message: 'Rodné číslo je povinná položka', on: [:identity, :world_sk_permanent_resident, :world_abroad_permanent_resident, :authorized_person] + # validate :pin_is_ok, on: [:identity, :world_sk_permanent_resident, :world_abroad_permanent_resident, :authorized_person] validates_presence_of :street, message: 'Zadajte ulicu alebo názov obce ak obec nemá ulice', on: [:identity, :world_sk_permanent_resident, :authorized_person] validates_presence_of :pobox, message: 'Zadajte poštové smerové čislo', @@ -155,6 +156,33 @@ def world_sk_resident_email_body ) end + private def pin_is_ok + return errors.add(:pin, 'Rodné číslo je pocinná položka') if pin.blank? + + begin + pin.to_i + rescue ArgumentError + return errors.add(:pin, 'Rodné číslo obsahuje neplatné znaky') + end + + pin = self.pin.gsub(%r{/}, '') + return errors.add(:pin, 'Rodné číslo nie je deliteľné číslom 11') if pin.length == 10 and pin.to_i % 11 != 0 + return errors.add(:pin, 'Rodné číslo má nesprávnu dĺžku') if pin.length != 10 and pin.length != 9 + + case pin[2..3].to_i + when 0, 13..50, 63..99 + return errors.add(:pin, 'Rodné číslo obsahuje neplatný mesiac') + end + + month = pin[2..3].to_i % 50 + year = pin[0..1].to_i + (pin[2..3].to_i > 12 ? 1900 : 2000) + begin + Date.new(year, month, pin[4..5].to_i) + rescue ArgumentError + errors.add(:pin, 'Rodné číslo obsahuje neplatný dátum') + end + end + def run(listener) case step when 'start' @@ -192,7 +220,10 @@ def run(listener) end private def sk_citizen_step(listener) - if valid?(:sk_citizen) + if go_back? + self.step = 'start' + listener.render :start + elsif valid?(:sk_citizen) case sk_citizen when 'yes' self.step = 'permanent_resident' @@ -206,7 +237,10 @@ def run(listener) end private def permanent_resident_step(listener) - if valid?(:permanent_resident) + if go_back? + self.step = 'sk_citizen' + listener.render :sk_citizen + elsif valid?(:permanent_resident) case permanent_resident when 'yes' self.step = 'place' @@ -241,7 +275,10 @@ def run(listener) # Home flow private def delivery_step(listener) - if valid?(:delivery) + if go_back? + self.step = 'place' + listener.render :place + elsif valid?(:delivery) case delivery when 'post' self.step = 'identity' diff --git a/app/models/apps/president_vote_app/application_form.rb b/app/models/apps/president_vote_app/application_form.rb new file mode 100644 index 00000000..af529e32 --- /dev/null +++ b/app/models/apps/president_vote_app/application_form.rb @@ -0,0 +1,367 @@ +module Apps + module PresidentVoteApp + class ApplicationForm + FIRST_ROUND_DATE = Date.parse('2024-03-23') + FIRST_ROUND_REQUEST_SENDING_DEADLINE = FIRST_ROUND_DATE - 19.day + SECOND_ROUND_REQUEST_SENDING_DEADLINE = FIRST_ROUND_DATE - 9.day + + include ActiveModel::Model + + attr_accessor :step + attr_accessor :place_first_round + attr_accessor :place_second_round + attr_accessor :place + attr_accessor :sk_citizen + attr_accessor :permanent_resident + attr_accessor :delivery + attr_accessor :full_name, :pin + attr_accessor :authorized_person_full_name, :authorized_person_pin + attr_accessor :street, :pobox, :municipality + attr_accessor :same_delivery_address + attr_accessor :delivery_street, :delivery_pobox, :delivery_municipality, :delivery_country + attr_accessor :municipality_email + attr_accessor :municipality_email_verified + attr_accessor :back + + validates_presence_of :place_second_round, message: 'Vyberte si jednu z možností v druhom kole', + on: [:place_second_round] + + validates_presence_of :sk_citizen, message: 'Vyberte áno pokiaľ ste občan Slovenskej republiky', on: :sk_citizen + validates_presence_of :permanent_resident, message: 'Vyberte áno pokiaľ máte trvalý pobyt na Slovensku', on: :permanent_resident + + validates_presence_of :delivery, message: 'Vyberte si spôsob prevzatia hlasovacieho preukazu', on: :delivery + validates_exclusion_of :delivery, in: %w(post authorized_person), + if: -> { request_sending_expired? }, + message: 'Lehota na zaslanie žiadosti o hlasovací preukaz uplynula 10.2.2020.', on: :delivery + validates_exclusion_of :delivery, in: %w(person), + if: -> { pickup_expired? }, + message: 'Termín na vybavenie hlasovacieho preukazu uplynul 28.2.2020.', on: :delivery + + validates_presence_of :full_name, message: 'Meno je povinná položka', + on: [:identity, :world_abroad_permanent_resident, :authorized_person] + validates_presence_of :pin, message: 'Rodné číslo je povinná položka', + on: [:identity, :world_abroad_permanent_resident, :authorized_person] + # validate :pin_is_ok, on: [:identity, :world_abroad_permanent_resident, :authorized_person] + validates_presence_of :street, message: 'Zadajte ulicu alebo názov obce ak obec nemá ulice', + on: [:identity, :authorized_person] + validates_presence_of :pobox, message: 'Zadajte poštové smerové čislo', + on: [:identity, :authorized_person] + validates_presence_of :municipality, message: 'Vyberte obec', + on: [:identity, :authorized_person] + + validates_presence_of :authorized_person_full_name, message: 'Meno splnomocnenej osoby je povinná položka', + on: [:authorized_person] + validates_presence_of :authorized_person_pin, message: 'Číslo občianskeho preukazu splnomocnenej osoby je povinná položka', + on: [:authorized_person] + + validates_presence_of :same_delivery_address, message: 'Zadajte kam chcete zaslať hlasovací preukaz', + on: :delivery_address + validates_presence_of :delivery_street, message: 'Zadajte ulicu alebo názov obce ak obec nemá ulice', + on: [:delivery_address, :world_abroad_permanent_resident], + if: -> (f) { f.custom_delivery_address? } + validates_presence_of :delivery_pobox, message: 'Zadajte poštové smerové čislo', + on: [:delivery_address, :world_abroad_permanent_resident], + if: -> (f) { f.custom_delivery_address? } + validates_presence_of :delivery_municipality, message: 'Zadajte obec', + on: [:delivery_address, :world_abroad_permanent_resident], + if: -> (f) { f.custom_delivery_address? } + validates_presence_of :delivery_country, message: 'Zadajte štát', + on: [:delivery_address, :world_abroad_permanent_resident], + if: -> (f) { f.custom_delivery_address? } + + def self.active? + Date.current < FIRST_ROUND_DATE + 14.day + end + + def minv_email + "volby@minv.sk" + end + + def year + FIRST_ROUND_DATE.year + end + + def custom_delivery_address? + same_delivery_address == '0' || step == 'world_abroad_permanent_resident' + end + + def municipality_email_verified? + municipality_email_verified == "OK" + end + + def full_address + "#{street}, #{pobox} #{municipality}" + end + + def go_back? + back == "true" + end + + def place_choice + if place_first_round == 'sk' + if place_second_round == 'sk' + 'obe kolá' + else + 'prvé kolo' + end + else + 'druhé kolo' + end + end + + def pickup_remaining_days + if place_first_round == 'sk' + (FIRST_ROUND_DATE - Date.current).to_i - 1 + else + (FIRST_ROUND_DATE - Date.current).to_i + 13 + end + end + + def request_sending_remaining_days + if place_first_round == 'sk' + (FIRST_ROUND_REQUEST_SENDING_DEADLINE - Date.current).to_i + else + (SECOND_ROUND_REQUEST_SENDING_DEADLINE - Date.current).to_i + end + end + + def pickup_expired? + pickup_remaining_days < 0 + end + + def first_round_expired? + (FIRST_ROUND_DATE - Date.current).to_i < 0 + end + + def request_sending_expired? + request_sending_remaining_days < 0 + end + + def from_slovakia_email_body + ActionController::Base.new.render_to_string( + partial: "apps/president_vote_app/application_forms/from_slovakia_email_body", + locals: { model: self }, + ).gsub(/\n/, "\r\n") + end + + def from_slovakia_authorized_person_email_body + ActionController::Base.new.render_to_string( + partial: "apps/president_vote_app/application_forms/from_slovakia_authorized_person_email_body", + locals: { model: self }, + ).gsub(/\n/, "\r\n") + end + + private def pin_is_ok + return errors.add(:pin, 'Rodné číslo je pocinná položka') if pin.blank? + + begin + pin.to_i + rescue ArgumentError + return errors.add(:pin, 'Rodné číslo obsahuje neplatné znaky') + end + + pin = self.pin.gsub(%r{/}, '') + return errors.add(:pin, 'Rodné číslo nie je deliteľné číslom 11') if pin.length == 10 and pin.to_i % 11 != 0 + return errors.add(:pin, 'Rodné číslo má nesprávnu dĺžku') if pin.length != 10 and pin.length != 9 + + case pin[2..3].to_i + when 0, 13..50, 63..99 + return errors.add(:pin, 'Rodné číslo obsahuje neplatný mesiac') + end + + month = pin[2..3].to_i % 50 + year = pin[0..1].to_i + (pin[2..3].to_i > 12 ? 1900 : 2000) + begin + Date.new(year, month, pin[4..5].to_i) + rescue ArgumentError + errors.add(:pin, 'Rodné číslo obsahuje neplatný dátum') + end + end + + def run(listener) + case step + when 'start' + start_step(listener) + when 'place' + place_step(listener) + when 'sk_citizen' + sk_citizen_step(listener) + when 'permanent_resident' + permanent_resident_step(listener) + when 'delivery' + delivery_step(listener) + when 'identity' + identity_step(listener) + when 'authorized_person' + authorized_person_step(listener) + when 'address' + address_step(listener) + when 'delivery_address' + delivery_address_step(listener) + when 'world_abroad_permanent_resident' + world_abroad_permanent_resident_step(listener) + when 'non_sk_nationality' + non_sk_nationality(listener) + when 'home' + home(listener) + end + end + + private def start_step(listener) + self.step = 'sk_citizen' + listener.render :sk_citizen + end + + private def sk_citizen_step(listener) + if go_back? + self.step = 'start' + listener.render :start + elsif valid?(:sk_citizen) + case sk_citizen + when 'yes' + self.step = 'permanent_resident' + listener.render :permanent_resident + when 'no' + listener.redirect_to action: :non_sk_nationality + end + else + listener.render :sk_citizen + end + end + + private def permanent_resident_step(listener) + if go_back? + self.step = 'sk_citizen' + listener.render :sk_citizen + elsif valid?(:permanent_resident) + case permanent_resident + when 'yes' + self.step = 'place' + listener.render :place + when 'no' + listener.redirect_to action: :world + end + else + listener.render :permanent_resident + end + end + + private def place_step(listener) + if go_back? + self.step = 'permanent_resident' + listener.render :permanent_resident + elsif valid?(:place) + if first_round_expired? + if valid?(:place_second_round) + if place_second_round == 'sk' + self.place_first_round = 'home' + self.place_second_round = place_second_round + self.step = 'delivery' + listener.render :delivery + else + listener.redirect_to action: :home + end + else + listener.render :place + end + else + if place_first_round == 'sk' || place_second_round == 'sk' + self.place_first_round = place_first_round + self.place_second_round = place_second_round + self.step = 'delivery' + listener.render :delivery + else + listener.redirect_to action: :home + end + end + else + listener.render :place + end + end + + private def delivery_step(listener) + if go_back? + self.step = 'place' + listener.render :place + elsif valid?(:delivery) + case delivery + when 'post' + self.step = 'identity' + listener.render :identity + when 'authorized_person' + self.step = 'authorized_person' + listener.render :authorized_person + when 'person' + listener.redirect_to action: :person + end + else + listener.render :delivery + end + end + + private def identity_step(listener) + if go_back? + self.step = 'delivery' + listener.render :delivery + elsif valid?(:identity) + self.step = 'delivery_address' + listener.render :delivery_address + else + listener.render :identity + end + end + + private def delivery_address_step(listener) + if go_back? + self.step = 'identity' + listener.render :identity + elsif valid?(:delivery_address) + self.step = 'send' + listener.render :send + else + listener.render :delivery_address + end + end + + private def authorized_person_step(listener) + if go_back? + self.step = 'delivery' + listener.render :delivery + elsif valid?(:authorized_person) + self.step = 'authorized_person_send' + listener.render :authorized_person_send + else + self.step = 'authorized_person' + listener.render :authorized_person + end + end + + private def world_abroad_permanent_resident_step(listener) + if go_back? + self.step = 'permanent_resident' + listener.render :permanent_resident + else + listener.render :world_abroad_permanent_resident + end + end + + private def non_sk_nationality(listener) + if go_back? + self.step = 'sk_citizen' + listener.render :sk_citizen + else + listener.render :non_sk_nationality + end + end + + private def home(listener) + if go_back? + self.step = 'place' + listener.render :place + else + listener.render :home + end + end + end + end +end diff --git a/app/views/apps/parliament_vote_app/application_forms/_municipality_email_warning.html.erb b/app/views/apps/parliament_vote_app/application_forms/_municipality_email_warning.html.erb index 7d19577d..a22e3761 100644 --- a/app/views/apps/parliament_vote_app/application_forms/_municipality_email_warning.html.erb +++ b/app/views/apps/parliament_vote_app/application_forms/_municipality_email_warning.html.erb @@ -2,6 +2,6 @@ Upozornenie - <% unless @application_form.municipality_email_verified? %>Emailové adresy obcí je veľmi problematické získať a adresa tejto obce nebola ešte overená. <% end %>Uistite sa, či dostanete potvrdenie o prijatí žiadosti. Ak potvrdenie nedostanete, kontaktujte obec telefonicky alebo osobne. + Uistite sa, či dostanete potvrdenie o prijatí žiadosti. Ak potvrdenie nedostanete, kontaktujte obec telefonicky alebo osobne. diff --git a/app/views/apps/parliament_vote_app/application_forms/delivery.html.erb b/app/views/apps/parliament_vote_app/application_forms/delivery.html.erb index e5dba084..c12958e2 100644 --- a/app/views/apps/parliament_vote_app/application_forms/delivery.html.erb +++ b/app/views/apps/parliament_vote_app/application_forms/delivery.html.erb @@ -10,6 +10,7 @@ <%= render 'apps/parliament_vote_app/application_forms/subscribe' %> <% else %> <%= form_for @application_form, :builder => AppFormBuilder, url: request.original_url do |f| %> + <%= render 'apps/parliament_vote_app/application_forms/back', form: f %> <%= render 'components/error_summary', form: @application_form %> <%= f.hidden_field :step %> <%= f.hidden_field :sk_citizen %> diff --git a/app/views/apps/parliament_vote_app/application_forms/permanent_resident.erb b/app/views/apps/parliament_vote_app/application_forms/permanent_resident.erb index 05269977..f2ebf44d 100644 --- a/app/views/apps/parliament_vote_app/application_forms/permanent_resident.erb +++ b/app/views/apps/parliament_vote_app/application_forms/permanent_resident.erb @@ -4,6 +4,7 @@
Otvorte - <%= mail_to @application_form.municipality_email, 'pripravenú žiadosť v emailovom klientovi'.html_safe, +
Vygenorovanú žiadosť potrebujete poslať z Vašej emailovej adresy na príslušnú adresu obce: + <%= mail_to @application_form.municipality_email, @application_form.municipality_email, target: '_blank', body: @application_form.from_slovakia_email_body, subject: 'Žiadosť o hlasovací preukaz do parlamentných volieb.' %> - alebo ju manuálne skopírujte a odošlite na emailovú adresu obce: - <%= mail_to @application_form.municipality_email, @application_form.municipality_email %>
<% else %> -Skopírujte text žiadosti a pošlite ho na emailovú adresu obce.
+Vygenorovanú žiadosť potrebujete poslať z Vašej emailovej adresy na príslušnú emailovú adresu obce + <%= @application_form.municipality %>
+Emailovú adresu je možné nájsť na webovej stránke obce.
<% end %>Ak sa vám táto aplikácia páčila, môžete sa zapojiť a pomôcť nám s vývojom či obsahom, alebo nás <%= link_to 'podporte finančne', 'https://slovensko.digital/podpora' %>.
+Na portáli Návody.Digital nájdete <%= link_to 'množstvo ďalších návodov', root_path %> ako vyriešiť aj iné životné situácie, ktoré si vyžadujú kontakt so štátnou byrokraciou.
+ diff --git a/app/views/apps/president_vote_app/application_forms/_subscribe.html.erb b/app/views/apps/president_vote_app/application_forms/_subscribe.html.erb new file mode 100644 index 00000000..68e21097 --- /dev/null +++ b/app/views/apps/president_vote_app/application_forms/_subscribe.html.erb @@ -0,0 +1,3 @@ +<%= render_notification_subscription_component ['VoteSubscription', 'NewsletterSubscription'] do %> +Vygenorovanú žiadosť potrebujete poslať z Vašej emailovej adresy na príslušnú adresu obce: + <%= mail_to @application_form.municipality_email, @application_form.municipality_email, + target: '_blank', + body: @application_form.from_slovakia_authorized_person_email_body, + subject: 'Žiadosť o hlasovací preukaz do prezidentských volieb.' + %> +
+ <% else %> +Vygenorovanú žiadosť potrebujete poslať z Vašej emailovej adresy na príslušnú emailovú adresu obce + <%= @application_form.municipality %>
+Emailovú adresu je možné nájsť na webovej stránke obce.
+ <% end %> +Aby ste mohli v deň volieb voliť mimo vášho trvalého bydliska, musíte požiadať vašu obec o vydanie hlasovacieho preukazu – osobne alebo elektronicky. Hlasovací preukaz vás oprávňuje voliť z ktoréhokoľvek volebného okrsku v SR.
+ <% if false %> +Obce potrebné informácie k žiadostiam v súčastnosti ešte len zverejňujú, ak nám však necháte email, dáme Vám vedieť, keď už bude možné o hlasovací preukaz požiadať. Posledný termín na zaslanie žiadosti je 8. septembra.
+ <%= render 'apps/president_vote_app/application_forms/subscribe' %> + <% else %> + <%= form_for @application_form, :builder => AppFormBuilder, url: request.original_url do |f| %> + <%= render 'apps/president_vote_app/application_forms/back', form: f %> + <%= render 'components/error_summary', form: @application_form %> + <%= f.hidden_field :step %> + <%= f.hidden_field :sk_citizen %> + <%= f.hidden_field :place_first_round %> + <%= f.hidden_field :place_second_round %> +Nezabudnite voliť a voľte zodpovedne.
+Ak ste odoslali žiadosť na úrad, do 3 dní by ste mali od obce dostať potvrdenie o prijatí.
+Volebný preukaz si so sebou musíte vziať, aj keď sa nakoniec rozhodnete voliť v mieste trvalého bydliska.
+ +V čase volieb volíte vo volebnom okrsku, v ktorom ste zapísaný podľa miesta vášho trvalého bydliska.
+O volebnom okrsku informuje obec v oznámení o čase a miesta konania volieb. V deň konania volieb si nezabudnite do volebnej miestnosti priniesť občiansky preukaz.
+ <%= render 'apps/president_vote_app/application_forms/subscribe' %> ++ Vo voľbách prezidenta Slovenskej republiky (prezidentské voľby) môžu voliť len občania Slovenskej republiky. +
+ + <%= render 'apps/president_vote_app/application_forms/subscribe' %> +Na to aby ste nemali trvalý pobyt na Slovensku, museli ste si ho odhlásiť.
+ <%= f.radio_button :permanent_resident, 'yes', label: "Áno" %> + <%= f.radio_button :permanent_resident, 'no', + label: "Nie, mám odhlásený trvalý pobyt zo Slovenska", + hint: "Pri odhlasovaní trvalého pobytu sa odovzdáva občiansky preukaz. Ak ste ho odovzdali, zvoľte túto možnosť." + %> + <% end %> + + <%= f.submit 'Pokračovať' %> + <% end %> +Hlasovací preukaz vám vystavia na počkanie na obecnom úrade v mieste trvalého bydliska. Osobne si preukaz vybavíte najneskôr v posledný pracovný deň pred voľbami, počas pracovných hodín úradu.
+ <%= render 'apps/president_vote_app/application_forms/subscribe' %> ++ Prvé kolo sa už konalo +
+Vygenerovanú žiadosť potrebujete poslať z Vašej emailovej adresy na príslušnú adresu obce: + <%= mail_to @application_form.municipality_email, @application_form.municipality_email, + target: '_blank', + body: @application_form.from_slovakia_email_body, + subject: 'Žiadosť o hlasovací preukaz do prezidentských volieb.' + %> +
+ <% else %> +Vygenerovanú žiadosť potrebujete poslať z Vašej emailovej adresy na príslušnú emailovú adresu obce + <%= @application_form.municipality %>
+Emailovú adresu je možné nájsť na webovej stránke obce.
+ <% end %> +Prezidentské voľby na Slovensku budú 23. marca a prípadné druhé kolo 6. apríla 2024. Hlasovať je možné jedine osobne na území Slovenska.
+Ak budete počas volieb mimo trvalého bydliska, táto služba vám pomôže vytvoriť žiadosť o hlasovací preukaz tak, aby ste na nič dôležité nezabudli. Je to veľmi jednoduché a trvá to len pár minút.
+O hlasovací preukaz môžete požiadať osobne na úrade pre prvé kolo ešte do 22. marca a pre druhé kolo do 5. apríla.
+Používaním tejto služby súhlasíte so spracovaním osobných údajov v rozsahu nevyhnutnom pre určenie spôsobu voľby a vytvorenie žiadosti o hlasovací preukaz. Následne sú všetky údaje nenávratne zmazané.
+ <%= form_for @application_form do |f| %> +Ak nemáte trvalý pobyt na Slovensku, môžete prísť voliť kdekoľvek na území Slovenska. Potrebujete sa preukázať slovenským pasom.
+Okrsková volebná komisia takéhoto voliča dopíše do zoznamu voličov, čo zaznamená v jeho slovenskom cestovnom doklade a poskytne mu na podpis čestné vyhlásenie o trvalom pobyte v cudzine, ktoré pripojí k zoznamu voličov.
+