SumOfUs/Champaign

View on GitHub
app/views/pages/_shares_editor.slim

Summary

Maintainability
Test Coverage
.shares-editor
  .shares-editor__view-toggle.btn-group
    = toggle_switch 'summary', 'summary', 'Summary view'
    = toggle_switch 'stats', 'summary', 'Analysis view'

  table.table.shares-editor__existing__shareprogress
    thead.shares-editor__stats-heading.hidden-closed
      = render 'sp_share_analytics_header', hide_title: @sp_variations.blank?

    tbody
      - @sp_variations.each do |variation|
        = render variation, page: @page
  = render 'links_to_share_progress'

  table.table.shares-editor__existing__champaign
    thead.shares-editor__stats-heading.hidden-closed
      = render 'local_share_analytics_header', hide_title: @local_variations.blank?

    tbody
      - @local_variations.each do |variation|
        = render variation, page: @page

  .col-md-6
    .well
      h4 data-toggle="collapse" data-target=".shares-editor__new-forms" aria-expanded="false"
        i.fa.fa-caret-right
        = t('share.form.new_variation')
        = render 'tooltip', tooltip_text: t('tooltips.shares.new'), space_left: true

      .shares-editor__new-forms.collapse
        .form-group
          .shares-editor__new-type-toggle.btn-group
            = toggle_switch 'facebook', 'facebook', 'Facebook'
            = toggle_switch 'twitter', 'facebook', 'Twitter'
            = toggle_switch 'email', 'facebook', 'Email'
            = toggle_switch 'whatsapp', 'facebook', 'WhatsApp'

        = render 'share/new_form', page: @page, share: Share::Facebook.new, css_class: nil
        = render 'share/new_form', page: @page, share: prefill_link(Share::Twitter.new), css_class: 'hidden-closed'
        = render 'share/new_form', page: @page, share: prefill_link(Share::Email.new), css_class: 'hidden-closed'
        = render 'share/new_form', page: @page, share: prefill_link(Share::Whatsapp.new), css_class: 'hidden-closed'

  .col-md-6
    #share-url-updater
      = render 'share/update_urls_form'