danielweinmann/unlock

View on GitHub
app/views/initiatives/contributions/new.html.slim

Summary

Maintainability
Test Coverage
- suppress_headline_and_article!
- content_for :title do
  = "#{t('contribute_to')} #{@initiative.name}"
article
  h2== "#{t('contribute_to')} #{link_to @initiative.name, initiative_by_permalink_path(@initiative)}"
  = render partial: 'error_explanation', locals: { resource: @contribution }
  - if(first_gateway = @gateways.first) && @gateways.size == 1
    = render partial: "/#{first_gateway.module_name.underscore}/contributions/form", locals: { gateway: first_gateway }
  - else
    ul.accordion
      - if current_user.module_name.present?
        - expanded = current_user.module_name
      - else
        - expanded = first_gateway.module_name
      - @gateways.each do |gateway|
        li class=('expanded' if gateway.module_name == expanded)
          h4= gateway.display_title
          .content= render partial: "/#{gateway.module_name.underscore}/contributions/form", locals: { gateway: gateway }