app/views/initiatives/contributions/show.html.slim
- suppress_headline_and_article!
- content_for :title do
- if policy(@contribution).update? && @contribution.created_at > 2.days.ago
= t('.thank_you', initiative: @initiative.name)
- else
= "#{Contribution.model_name.human} #{t('to')} #{@initiative.name}"
article
h2
- if policy(@contribution).update? && @contribution.created_at > 2.days.ago
== t('.thank_you', initiative: link_to(@initiative.name, initiative_by_permalink_path(@initiative)))
- else
== "#{Contribution.model_name.human} #{t('to')} #{link_to @initiative.name, initiative_by_permalink_path(@initiative)}"
.contribution
.image
- if @contribution.hide_name? && !policy(@initiative).update? && !policy(@contribution).update?
= image_tag('user.svg')
- else
= @contribution.user.display_image
.info
h4
- if @contribution.hide_name? && !policy(@initiative).update? && !policy(@contribution).update?
= Contribution.human_attribute_name(:hide_name?)
- elsif policy(@initiative).update?
= mail_to @contribution.user.email, @contribution.user.display_name
- else
= @contribution.user.display_name
- unless @contribution.hide_value? && !policy(@initiative).update? && !policy(@contribution).update?
h5= @contribution.display_value
em== t('.summary', created_at: l(@contribution.created_at, format: :short), sandbox: ("<strong>#{t('activerecord.state_machines.gateway.state.states.sandbox').downcase}</strong> " if @contribution.gateway_state == 'sandbox'), gateway: @contribution.gateway.name)
- if policy(@contribution).update?
.options id=dom_id(@contribution) data-url=initiative_contribution_path(@contribution.initiative.id, @contribution.id)
.field
= check_box_tag :"hide_name_#{@contribution.id}", "1", @contribution.hide_name, :class => "editable", :"data-attribute" => "hide_name", :"data-formtype" => "checkbox"
= label_tag :"hide_name_#{@contribution.id}", Contribution.human_attribute_name(:hide_name)
.field
= check_box_tag :"hide_value_#{@contribution.id}", "1", @contribution.hide_value, :class => "editable", :"data-attribute" => "hide_value", :"data-formtype" => "checkbox"
= label_tag :"hide_value_#{@contribution.id}", Contribution.human_attribute_name(:hide_value)
- if policy(@contribution).update?
.gateway_data class=(@contribution.active? ? 'success' : ('failure' if @contribution.suspended?))
h4= "#{@contribution.class.model_name.human} #{@contribution.human_state_name.downcase}"
ul
li== t('.gateway_identifier', gateway_identifier: @contribution.gateway_identifier)
li== t('.payments', link: link_to(@contribution.gateway.name, @contribution.gateway.url, target: :_blank))
li== t('.suspend')
li== t('.next_invoice', date: @contribution.next_invoice_date)
.links
- if @contribution.can_activate?
= link_to t('activerecord.state_machines.contribution.state.events.activate'), "/#{I18n.locale}#{@contribution.gateway.path}/#{@contribution.id}/activate", method: :put, class: "button"
- if @contribution.can_suspend?
= link_to t('activerecord.state_machines.contribution.state.events.suspend'), "/#{I18n.locale}#{@contribution.gateway.path}/#{@contribution.id}/suspend", method: :put, class: "button suspend"