diff --git a/app/assets/images/ansol-logo-white.png b/app/assets/images/ansol-logo-white.png deleted file mode 100644 index bd6898f..0000000 Binary files a/app/assets/images/ansol-logo-white.png and /dev/null differ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index a5418a4..7687ced 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -15,13 +15,10 @@ main { .banner { width: 100%; - height: 30px; padding: 15px; - background-image: url(logo.svg); background-size: auto 30px; background-repeat: no-repeat; background-position: center; - background-color: #041952; } footer { diff --git a/app/lib/config.rb b/app/lib/config.rb index 975f53e..81984e4 100644 --- a/app/lib/config.rb +++ b/app/lib/config.rb @@ -1,34 +1,9 @@ module Config - def self.organization_full_name - "ANSOL - Associação Nacional para o Software Livre" - end - - def self.organization_website - "https://ansol.org" - end - - def self.regular_payment_value - 30 - end - - def self.reduced_payment_value - 6 - end - - def self.ifthenpay_payment_title - "Quotas ANSOL" - end - - def self.payment_iban - "PT50 0035 2178 00027478430 14" - end - - def self.payment_proof_email - "direccao@ansol.org" - end - - def self.reduced_payment_description - "Caso queiras usufruir da quota reduzida de 6.00€ para estudantes, pessoas - desempregadas ou reformadas, envia-nos um comprovativo desse estatuto." + class <() { @member.email } + def expiration_in_60d set_notification - mail to: @notification.member.email + mail end def expiration_in_30d set_notification - mail to: @notification.member.email + mail end def expired set_notification - mail to: @notification.member.email + mail end def expired_30d_ago set_notification - mail to: @notification.member.email + mail end def expired_60d_ago set_notification - mail to: @notification.member.email + mail end def cancelled set_notification - mail to: @notification.member.email + mail end def registration - @member = params[:member] - @payment = @member.create_payment - mail to: @member.email + set_member + mail end def first_payment_confirmation - @contribution = params[:contribution] - mail to: @contribution.member.email + set_contribution + mail end def payment_renewal_confirmation - @contribution = params[:contribution] - mail to: @contribution.member.email + set_contribution + mail end private def set_notification @notification = params[:notification] + @member = @notification.member @payment = @notification.member.create_payment end + + def set_contribution + @contribution = params[:contribution] + @member = @contribution.member + end + + def set_member + @member = params[:member] + @payment = @member.create_payment + end + + def default_i18n_subject + mailer_scope = self.class.mailer_name.tr("/", ".") + I18n.t(:subject, scope: [mailer_scope, action_name], organization_short_name: Config.organization_short_name) + end end diff --git a/app/models/member.rb b/app/models/member.rb index c8a7eaf..b29a9bf 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -14,11 +14,11 @@ class Member < ApplicationRecord end def cancelled_on - expires_on + 90.days + expires_on + Config.payment_pending_grace_period end def obtains_full_rights_on - joined_on + 6.months + joined_on + Config.full_rights_vesting_period end def reset_status! @@ -26,6 +26,7 @@ class Member < ApplicationRecord end def employed? + # normal is deprecated, here for retrocompatibility reasons category == "normal" || category == "employed" end @@ -111,7 +112,7 @@ class Member < ApplicationRecord { to_be_sent_on: expires_on + 0.days, template: "expired" }, { to_be_sent_on: expires_on + 30.days, template: "expired_30d_ago" }, { to_be_sent_on: expires_on + 60.days, template: "expired_60d_ago" }, - { to_be_sent_on: expires_on + 90.days, template: "cancelled" }, + { to_be_sent_on: expires_on + Config.payment_pending_grace_period, template: "cancelled" }, ].reject do |n| n[:to_be_sent_on].before?(from) || dates.include?(n[:to_be_sent_on]) end.each do |n| diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6931a1f..f969838 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -11,7 +11,9 @@ - + <% if signed_in? %>