Adds dues to navigation and fixes amount calculation

main
Hugo Peixoto 3 months ago
parent b4dda05575
commit f956a65100
  1. 2
      app/controllers/contributions_controller.rb
  2. 4
      app/models/member.rb
  3. 1
      app/views/layouts/application.html.erb
  4. 1
      config/locales/en.yml
  5. 1
      config/locales/pt.yml

@ -33,7 +33,7 @@ class ContributionsController < ApplicationController
[year, @due_members.select {|m| m.expires_on < Date.new(year, 12, 31) }.map { |m|
OpenStruct.new(
member: m,
amount: m.category == 'normal' ? 30 : 6,
amount: m.employed? ? 30 : 6,
)
}]
end

@ -12,6 +12,10 @@ class Member < ApplicationRecord
update(status: expected_status)
end
def employed?
category == "normal" || category == "employed"
end
def remove_personal_information!
update(
excluded: true,

@ -18,6 +18,7 @@
<li><%= link_to t('navigation.board'), edit_board_path %></li>
<li><%= link_to t('navigation.notifications'), notifications_path %></li>
<li><%= link_to t('navigation.contributions'), contributions_path %></li>
<li><%= link_to t('navigation.due_contributions'), due_contributions_path %></li>
<li>
<%= button_to sign_out_path, method: :delete do %>
Sign out of <%= current_user.email %>

@ -4,6 +4,7 @@ en:
board: "Board"
notifications: "Notificações"
contributions: "Contributions"
due_contributions: "Dues"
members:
index:
title: "Members"

@ -7,6 +7,7 @@ pt:
board: "Direcção"
notifications: "Notificações"
contributions: "Contribuições"
due_contributions: "Dívidas"
members:
delete:
confirmation_message: |

Loading…
Cancel
Save