oneclickorgs/one-click-orgs

View on GitHub
app/views/one_click/coop/checklist.html.haml

Summary

Maintainability
Test Coverage
%h2 Checklist

%p Welcome to your draft co-op. There are several things you need to do before you can submit your registration.

%ul.checklist
  %li{:class => co.members.active.count >= 3 ? 'done' : ''}
    %h3 Invite at least three Founder Members.
    %p
      You currently have
      = pluralize(co.members.active.count, "Founder Member.", "Founder Members.")
  %li{:class => co.directors.count >= 3 ? 'done' : ''}
    %h3 Appoint at least three initial Directors.
    %p
      You currently have
      = pluralize(co.directors.count, "Director.", "Directors.")
  %li{:class => co.secretary ? 'done' : ''}
    %h3 Appoint a Secretary.
    %p
      - if co.secretary
        Your secretary is
        = co.secretary.name + '.'
      - else
        You have not appointed a Secretary yet.
  %li{:class => co.rules_filled? ? 'done' : ''}
    %h3 Fill out and choose options for your co-op's Rules.
    %p
      - if co.rules_filled?
        The necessary fields in your Rules have been filled in.
      - else
        You still have some choices to make about your Rules.
  %li{:class => co.registration_form_filled? ? 'done' : ''}
    %h3 Fill out the Registration Details
    %p
      - if co.registration_form_filled?
        The Registration Details have been filled in.
      - else
        The Registration Details have not been filled in yet.
  %li{:class => co.signatories_and_secretary_contact_details_present? ? 'done' : ''}
    %h3 Ensure all founders have entered their contact details
    %p
      - if co.signatories_and_secretary_contact_details_present?
        All necessary founders have entered their contact details.
      - else
        -if co.signatories_and_secretary_without_contact_details.length == 1
          = co.signatories_and_secretary_without_contact_details[0].name
          needs to fill in their contact details.
        - else
          = co.signatories_and_secretary_without_contact_details[0..-2].map(&:name).join(', ')
          and
          = co.signatories_and_secretary_without_contact_details[-1].name
          need to fill in their contact details.