Files
nairobi/app/components/admin/budgets/table_actions_component.rb
Javi Martín 8c1140a1bf Use semantic HTML classes in table actions
Note the CSS could probably be improved to avoid duplication with other
button style definitions. However, that's fine because we're going to
change the style of the links soon.

For the same reason, I haven't bothered to style every single link the
way it was until now.
2020-11-03 14:58:02 +01:00

25 lines
604 B
Ruby

class Admin::Budgets::TableActionsComponent < ApplicationComponent
include TableActionLink
attr_reader :budget
def initialize(budget)
@budget = budget
end
private
def link_to_create_budget_poll
balloting_phase = budget.phases.find_by(kind: "balloting")
link_to t("admin.budgets.index.admin_ballots"),
admin_polls_path(poll: {
name: budget.name,
budget_id: budget.id,
starts_at: balloting_phase.starts_at,
ends_at: balloting_phase.ends_at
}),
class: "ballots-link",
method: :post
end
end