= render partial: 'layouts/shared'
- content_for :header_app_name do
  =link_to app_title, home_path
  = render "shared/loginout"
- content_for :content do
  #wrapper
    %main#content{role: 'main'}
      = yield :editing_alert
      = flash_messages
      .grid-wrapper
        .grid.grid-1-3.new-profile
          .inner-block
            - if can_add_person_here?
              = link_to 'Create a new profile', new_person_path, class: 'add-new-person'
        .grid.grid-2-3
          .inner-block
            %nav
              .breadcrumbs= yield :breadcrumbs
      - if logged_in? && !@login_screen && !@editing_mode
        .grid-wrapper
          .grid.grid-2-3
            .inner-block= render 'shared/search'
          / .grid.grid-1-3
          /   .inner-block= render 'shared/edit_links'
      .inner-block
        = yield
        #report_link
          = yield :report_link
        #last_update
          = last_update
- content_for :cookie_message do
  %p= t('shared.cookie_message_html')
= render partial: "shared/feedback_form"
= render partial: "layouts/footer"
= render 'layouts/script'
= render template: "layouts/peoplefinder"

Move Create profile link and extend breadcrumbs full width

= render partial: 'layouts/shared'
- content_for :header_app_name do
  =link_to app_title, home_path
  = render "shared/loginout"
- content_for :content do
  #wrapper
    %main#content{role: 'main'}
      = yield :editing_alert
      = flash_messages
      .grid-wrapper
        .grid.grid-3-3
          .inner-block
            %nav
              .breadcrumbs= yield :breadcrumbs
      - if logged_in? && !@login_screen && !@editing_mode
        .grid-wrapper
          .grid.grid-2-3
            .inner-block= render 'shared/search'
          .grid.grid-1-3.new-profile
            .inner-block
              - if can_add_person_here?
                = link_to 'Create a new profile', new_person_path, class: 'add-new-person'
      .inner-block
        = yield
        #report_link
          = yield :report_link
        #last_update
          = last_update
- content_for :cookie_message do
  %p= t('shared.cookie_message_html')
= render partial: "shared/feedback_form"
= render partial: "layouts/footer"
= render 'layouts/script'
= render template: "layouts/peoplefinder"


!!!
%html
  %head
    %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
    %title StrangerTeams
    = csrf_meta_tags
    = stylesheet_link_tag    'application', media: 'all'
    = stylesheet_link_tag    'jansy-bootstrap.min'
    = javascript_include_tag 'application'
    = javascript_include_tag 'jansy-bootstrap.min'

  %body
    #flash-container
      - if flash[:notice]
        %p.notice= notice
      - if flash[:alert]
        %p.alert= alert
    %header#header
      %ul#nav

        %li= link_to "Home", root_path
        - if teacher_signed_in?
          %li= link_to "Teachers", teachers_path
          %li= link_to "Profile", teacher_path(current_teacher)
          %li= link_to "Logout", destroy_teacher_session_path, method: :delete
        - else
          %li= link_to "Register", new_teacher_registration_path
          %li= link_to "Log In", teacher_session_path
      %h1 Stranger Teams
    = yield

Add bootstrap classes to nav and add missing nav items

!!!
%html
  %head
    %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
    %title StrangerTeams
    = csrf_meta_tags
    = stylesheet_link_tag    'application', media: 'all'
    = stylesheet_link_tag    'jansy-bootstrap.min'
    = javascript_include_tag 'application'
    = javascript_include_tag 'jansy-bootstrap.min'

  %body
    #flash-container
      - if flash[:notice]
        %p.notice= notice
      - if flash[:alert]
        %p.alert= alert
    %header#header
      %nav.navbar.navbar-default
        %ul.nav.navbar-nav
          %li.nav-left= link_to "Home", root_path
          - if teacher_signed_in?
            %li.nav-left= link_to "All Teachers", teachers_path
            %li.nav-left= link_to "All Students", students_path
            %li.nav-left= link_to "Add Student", new_student_path
            %li.nav-left= link_to "Bulk Import", students_import_path
            / Nav left and nav right seem not to be working
            %li.nav-right= link_to "Profile", teacher_path(current_teacher)
            %li.nav-right= link_to "Logout", destroy_teacher_session_path, method: :delete
          - else
            %li.nav-right= link_to "Register", new_teacher_registration_path
            %li.nav-right= link_to "Log In", teacher_session_path
      %h1 Stranger Teams
    = yield


!!! 5
%html{:lang => "en"}
  %head
    %title UFSMCWeb
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags
    = google_webfonts_init google: ['Istok Web']
  %body{:role => "document"}
    %nav{:class => "navbar navbar-inverse navbar-fixed-top"}
      .container
        .navbar-header.navbar-brand Sparse Matrix Collection
    .container.theme-showcase{:role => "main"}
      = yield

Move Google Webfonts to beginning of header to avoid rendering artifacts

!!! 5
%html{:lang => "en"}
  %head
    %title UFSMCWeb
    = google_webfonts_init google: ['Istok Web']
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags
  %body{:role => "document"}
    %nav{:class => "navbar navbar-inverse navbar-fixed-top"}
      .container
        .navbar-header.navbar-brand Sparse Matrix Collection
    .container.theme-showcase{:role => "main"}
      = yield


= form_for [@project, @sweep], html: { role: 'form' } do |f|
  = render 'shared/error_explanation', instance: @sweep

  .form-group
    = f.label :title, 'Title', class: 'control-label'
    = f.text_field :title, class: 'form-control',
      autofocus: true, required: true
  .form-group
    = f.label :description, 'Description', class: 'control-label'
    = f.text_area :description, rows: 4, class: 'form-control'
  .form-group
    = f.label :email, 'E-mail', class: 'control-label'
    = f.text_field :email, class: 'form-control', type: 'email'
    %p.help-block
      If you specify an email address here, a message will be sent to it when
      all snapshots are ready.
  .form-group
    = f.label :delay_seconds, 'Delay snapshotting (seconds)', class: 'control-label'
    = f.text_field :delay_seconds, class: 'form-control', type: 'number',
      min: '1', step: '1', pattern: '\d+'
    %p.help-block
      Enter the number of seconds you wish to delay the start of snapshot
      creation with. Leave empty to start snapshotting immediately.
  .form-group
    = f.submit 'Save', class: 'btn btn-primary'

Change button text when starting sweeps

= form_for [@project, @sweep], html: { role: 'form' } do |f|
  = render 'shared/error_explanation', instance: @sweep

  .form-group
    = f.label :title, 'Title', class: 'control-label'
    = f.text_field :title, class: 'form-control',
      autofocus: true, required: true
  .form-group
    = f.label :description, 'Description', class: 'control-label'
    = f.text_area :description, rows: 4, class: 'form-control'
  .form-group
    = f.label :email, 'E-mail', class: 'control-label'
    = f.text_field :email, class: 'form-control', type: 'email'
    %p.help-block
      If you specify an email address here, a message will be sent to it when
      all snapshots are ready.
  .form-group
    = f.label :delay_seconds, 'Delay snapshotting (seconds)', class: 'control-label'
    = f.text_field :delay_seconds, class: 'form-control', type: 'number',
      min: '1', step: '1', pattern: '\d+'
    %p.help-block
      Enter the number of seconds you wish to delay the start of snapshot
      creation with. Leave empty to start snapshotting immediately.
  .form-group
    = f.submit 'Start sweep', class: 'btn btn-primary'


= repository_nav ontology.repository, :ontologies

= ontology_nav ontology, :theorems

%h3
  = link_to theorem, locid_for(theorem)
  = render partial: 'theorems/proof_status', locals: {proof_status: theorem.proof_status}

%h4 Proof Attempts
= link_to t('theorems.show.prove'), [*resource_chain, theorem, :proofs, :new], class: 'btn btn-primary'
- if collection.empty?
  = t('theorems.show.proof_attemps_empty')
- else
  %table
    %thead
      %tr
        %th Number
        %th Status
        %th Date
        %th Time taken
        %th Prover
        %th State
    - collection.latest.each do |proof_attempt|
      %tr
        %td= link_to proof_attempt.number, proof_attempt.locid
        %td= render partial: 'theorems/proof_status', locals: {proof_status: proof_attempt.proof_status}
        %td
          = link_to proof_attempt.locid do
            %span.timestamp= proof_attempt.created_at
        %td
          = proof_attempt.time_taken
          = t('proof_attempts.show.seconds')
        %td= proof_attempt.prover
        %td= state_tag(proof_attempt)

Move status column to the right

= repository_nav ontology.repository, :ontologies

= ontology_nav ontology, :theorems

%h3
  = link_to theorem, locid_for(theorem)
  = render partial: 'theorems/proof_status', locals: {proof_status: theorem.proof_status}

%h4 Proof Attempts
= link_to t('theorems.show.prove'), [*resource_chain, theorem, :proofs, :new], class: 'btn btn-primary'
- if collection.empty?
  = t('theorems.show.proof_attemps_empty')
- else
  %table
    %thead
      %tr
        %th Number
        %th Date
        %th Time taken
        %th Prover
        %th Status
        %th State
    - collection.latest.each do |proof_attempt|
      %tr
        %td= link_to proof_attempt.number, proof_attempt.locid
        %td
          = link_to proof_attempt.locid do
            %span.timestamp= proof_attempt.created_at
        %td
          = proof_attempt.time_taken
          = t('proof_attempts.show.seconds')
        %td= proof_attempt.prover
        %td= render partial: 'theorems/proof_status', locals: {proof_status: proof_attempt.proof_status}
        %td= state_tag(proof_attempt)


= link_to "Home", root_path, :class => 'brand'
%ul.nav
  - if user_signed_in?
    %li
      = link_to('Logout', destroy_user_session_path)
    %li
      = link_to('Dashboard', dashboard_path)
  - else
    %li
      = link_to('Login', new_user_session_path)
  - if user_signed_in?
    %li
      = link_to('Edit account', edit_user_registration_path)
  - else
    %li
      = link_to('Sign up', new_user_registration_path)
  %li
    = link_to('Challenges', challenges_path)

Hide irrelevant links from navbar

= link_to "Home", root_path, :class => 'brand'
%ul.nav
  - if user_signed_in?
    %li
      = link_to('Dashboard', dashboard_path)
    %li
      = link_to('Challenges', challenges_path)
    %li
      = link_to('Edit account', edit_user_registration_path)
    %li.pull-right
      = link_to('Logout', destroy_user_session_path)

  - else
    %li
      = link_to('Login', new_user_session_path)


!!!
%html
  %head
    %title App
    = csrf_meta_tags
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload'
    = javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
  %body
    %p.notice= notice
    %p.alert= alert
    = yield

Add logout button if user is signed in

!!!
%html
  %head
    %title App
    = csrf_meta_tags
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload'
    = javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
  %body
    %p.notice= notice
    %p.alert= alert
    - if user_signed_in?
      = link_to('Logout', destroy_user_session_path, method: :delete)
    = yield


<!DOCTYPE html>
<html>
<head>
  <title>F2jLang</title>
  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

</body>
</html>

Convert application layout from ERB to Haml.

!!!
%html
  %head
    %title System F Compiler
    = stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true
    = javascript_include_tag "application", "data-turbolinks-track" => true
    = csrf_meta_tags
  %body
    .container= yield


- content_for :header_tags do
  - plugin = Rails.env.development? ? 'redmine_dashboard_linked' : 'redmine_dashboard'
  = stylesheet_link_tag 'dashboard.css', :plugin => plugin
  = stylesheet_link_tag 'dashboard.ui.css', :plugin => plugin
  = stylesheet_link_tag 'dashboard.issues.css', :plugin => plugin
  = stylesheet_link_tag 'dashboard.taskboard.css', :plugin => plugin
  = javascript_include_tag 'jquery.autoellipsis.js', :plugin => plugin
  = javascript_include_tag 'jquery.total-storage.js', :plugin => plugin
  = javascript_include_tag 'dashboard.js', :plugin => plugin
  = javascript_include_tag 'dashboard.ui.js', :plugin => plugin
  = javascript_include_tag 'dashboard.taskboard.js', :plugin => plugin

#rdb
  #rdb-wrapper
    = render :partial => @board.id.to_s

  #rdb-errors
  = render :partial => 'footer'

Add base path to rdb root tag.

- content_for :header_tags do
  - plugin = Rails.env.development? ? 'redmine_dashboard_linked' : 'redmine_dashboard'
  = stylesheet_link_tag 'dashboard.css', :plugin => plugin
  = stylesheet_link_tag 'dashboard.ui.css', :plugin => plugin
  = stylesheet_link_tag 'dashboard.issues.css', :plugin => plugin
  = stylesheet_link_tag 'dashboard.taskboard.css', :plugin => plugin
  = javascript_include_tag 'jquery.autoellipsis.js', :plugin => plugin
  = javascript_include_tag 'jquery.total-storage.js', :plugin => plugin
  = javascript_include_tag 'dashboard.js', :plugin => plugin
  = javascript_include_tag 'dashboard.ui.js', :plugin => plugin
  = javascript_include_tag 'dashboard.taskboard.js', :plugin => plugin

#rdb{:data => { :'rdb-base' => rdb_board_path }}
  #rdb-wrapper
    = render :partial => @board.id.to_s

  #rdb-errors
  #rdb-dialogs
  = render :partial => 'footer'


%h5 Legalities
%ul.legalities
  - legality = card.legality_information
  - if legality.legal_everywhere?
    %li
      #{card.name} is legal in every format.
  - elsif legality.legal_nowhere?
    %li
      #{card.name} is not legal in any format.
  - else
    - card.legality_information.to_h.sort.each do |format_name, status|
      %li
        - if status.start_with? "restricted-"
          - points = status.split("-")[1].to_i
          %i{class: "legality-restricted"}= "#{points} point#{points == 1 ? "" : "s"}"
        - elsif status.start_with? "banned-"
          - votes = status.split("-")[1].to_i
          = link_to({controller: "exh", action: "vote", name: card.name}, class: "legality-banned") do
            %i{class: (signed_in? && exh_card(card).voters.include?(current_user)) ? "voted" : ""}
              = "#{votes} point#{votes == 1 ? "" : "s"}"
        - else
          %i{class: "legality-#{status}"}= status
        = " " # make sure there's a space here since sequential a tags normally aren't spaced
        = link_to format_name, controller: "format", action: "show", id: format_name.parameterize

Fix text on EXH legality info

%h5 Legalities
%ul.legalities
  - legality = card.legality_information
  - if legality.legal_everywhere?
    %li
      #{card.name} is legal in every format.
  - elsif legality.legal_nowhere?
    %li
      #{card.name} is not legal in any format.
  - else
    - card.legality_information.to_h.sort.each do |format_name, status|
      %li
        - if status.start_with? "restricted-"
          - points = status.split("-")[1].to_i
          %i{class: "legality-restricted"}= "#{points} point#{points == 1 ? "" : "s"}"
        - elsif status.start_with? "banned-"
          - votes = status.split("-")[1].to_i
          = link_to({controller: "exh", action: "vote", name: card.name}, class: "legality-banned") do
            %i{class: (signed_in? && exh_card(card).voters.include?(current_user)) ? "voted" : ""}
              = "#{votes} vote#{votes == 1 ? "" : "s"}"
        - else
          %i{class: "legality-#{status}"}= status
        = " " # make sure there's a space here since sequential a tags normally aren't spaced
        = link_to format_name, controller: "format", action: "show", id: format_name.parameterize


- if current_user.persona.admin?
  = render 'nav_tabs'

%header.page-title
  %h1
    = t('.claims')
  = link_to t('link.add_claim'), new_advocates_claim_path, class: 'button'

#summary
  = render partial: 'financial_summary', locals: { financial_summary: @financial_summary }

#search-options
  = render partial: 'search_form'

#search-summary
  - if params[:search].present?
    = render partial: 'shared/search_summary'

#claim-accordion
  %h2
    =t('.draft')
    (#{@draft_claims.count})
  %section#draft
    = render partial: 'claims', locals: { claims: @draft_claims }

  %h2
    =t('.rejected')
    (#{@rejected_claims.count})
  %section#rejected
    = render partial: 'claims', locals: { claims: @rejected_claims }

  %h2
    = t('.submitted')
    (#{@submitted_claims.count})
  %section#submitted
    = render partial: 'claims', locals: { claims: @submitted_claims }

  %h2
    =t('.part_paid')
    (#{@part_paid_claims.count})
  %section#part_paid
    = render partial: 'claims', locals: { claims: @part_paid_claims }

  %h2
    =t('.completed')
    (#{@completed_claims.count})
  %section#completed
    = render partial: 'claims', locals: { claims: @completed_claims }

Remove tabs from the advocate admin users home page


%footer.container
  .row
    .twelve.columns
      © 2013 Ernte teilen
      |
      = link_to t('.about_menu_item', default: 'About'), about_path, title: t('.about_menu_item_title', default: 'Click here to get background information about the project.')
      |
      = link_to t('.contact_menu_item', default: 'Contact'), contact_path, title: t('.contact_menu_item_title', default: 'Click here to write a message.')
      |
      = link_to t('.terms_menu_item', default: 'Terms & Conditions'), contact_path, title: t('.terms_menu_item_title', default: 'Click here to review the terms and conditions.')

Update development years in page footer.

%footer.container
  .row
    .twelve.columns
      © 2012-2014 Ernte teilen
      |
      = link_to t('.about_menu_item', default: 'About'), about_path, title: t('.about_menu_item_title', default: 'Click here to get background information about the project.')
      |
      = link_to t('.contact_menu_item', default: 'Contact'), contact_path, title: t('.contact_menu_item_title', default: 'Click here to write a message.')
      |
      = link_to t('.terms_menu_item', default: 'Terms & Conditions'), contact_path, title: t('.terms_menu_item_title', default: 'Click here to review the terms and conditions.')


.row.append-bottom-20
  .col-md-2.append-bottom-10
    = render partial: 'shared/ref_switcher', locals: {destination: 'graph'}
  .col-md-10
    = form_tag project_network_path(@project, @id), method: :get, class: 'form-inline network-form' do |f|
      = label_tag :search , "Looking for", class: 'light inline-label'
      = text_field_tag :extended_sha1, @options[:extended_sha1], placeholder: "Input an extended SHA1 syntax", class: "search-input form-control input-mx-250"
      = button_tag type: 'submit', class: 'btn btn-success' do
        %i.icon-search

      .inline.prepend-left-20
        .checkbox.light
          = label_tag :filter_ref do
            = check_box_tag :filter_ref, 1, @options[:filter_ref]
            %span Begin with the selected commit

Change the Label for SHA1-Seach inside the Network

.row.append-bottom-20
  .col-md-2.append-bottom-10
    = render partial: 'shared/ref_switcher', locals: {destination: 'graph'}
  .col-md-10
    = form_tag project_network_path(@project, @id), method: :get, class: 'form-inline network-form' do |f|
      = label_tag :extended_sha1 , "Looking for", class: 'light inline-label'
      = text_field_tag :extended_sha1, @options[:extended_sha1], placeholder: "Input an extended SHA1 syntax", class: "search-input form-control input-mx-250"
      = button_tag type: 'submit', class: 'btn btn-success' do
        %i.icon-search

      .inline.prepend-left-20
        .checkbox.light
          = label_tag :filter_ref do
            = check_box_tag :filter_ref, 1, @options[:filter_ref]
            %span Begin with the selected commit


%table.table.table-striped.table-bordered.breakable
  %thead
    %tr
      - @report.headers.each_with_index do |header, i|
        - unless @report.column_is_hidden?(@report.col_order[i])
          %th
            = h(header)
  %tbody
    = @data.html_safe

Add translated report headers to PDF reports

%table.table.table-striped.table-bordered.breakable
  %thead
    %tr
      - @report.headers.each_with_index do |header, i|
        - unless @report.column_is_hidden?(@report.col_order[i])
          %th
            = h(_(header))
  %tbody
    = @data.html_safe


- main_toolbar do |t|
  = t.edit resource
  - if resource.in_progress?
    = t.abort resource, method: :post, data: { confirm: :are_you_sure.tl }
  - else
    = t.run resource, method: :post

= main_informations do
  = attributes_list do |l|
    - l.attribute :importer, url: true
    - l.attribute :state
    - l.attribute :imported_at
  = render 'progress', import: resource

Add class primary to the 'Run' button

- main_toolbar do |t|
  = t.edit resource
  - if resource.in_progress?
    = t.abort resource, method: :post, data: { confirm: :are_you_sure.tl }
  - else
    = t.run resource, method: :post, class: 'primary'

= main_informations do
  = attributes_list do |l|
    - l.attribute :importer, url: true
    - l.attribute :state
    - l.attribute :imported_at
  = render 'progress', import: resource


%a{:href => object.link, :target => "_blank", :style => "font-size: 19px"} #{URI(object.link).host} #{fa_icon("external-link")}
%p
  written by #{object.author}
  <br>
  - object.tags.each do |tag|
    %u
      %b= tag
  %span.pull-right #{link_to(fa_icon("pencil", class: "fa-2x"), edit_article_path(object))}  #{link_to(fa_icon("trash", class: "fa-2x"), article_path(object), method: :delete, data: { confirm: "Are you sure you want to delete that article?" } )}
%blockquote.article-quote #{object.quote}

Remove the trailing space shown in the article thumb

%a{:href => object.link, :target => "_blank", :style => "font-size: 19px"} #{URI(object.link).host} #{fa_icon("external-link")}
%p
  written by #{object.author}
  <br>
  - object.tags.each do |tag|
    %u>
      %b>= tag
    ,
  %span.pull-right #{link_to(fa_icon("pencil", class: "fa-2x"), edit_article_path(object))}  #{link_to(fa_icon("trash", class: "fa-2x"), article_path(object), method: :delete, data: { confirm: "Are you sure you want to delete that article?" } )}
%blockquote.article-quote #{object.quote}


%h2
  = t('.sign_up', :default => "Sign up")

= form_for(resource, as: resource_name, url: user_registration_path) do |f|
  = devise_error_messages!

  .field
    = f.label :first_name
    = f.text_field :first_name

  .field
    = f.label :last_name
    = f.text_field :last_name

  .field
    = f.label :language
    = f.select :language, collection: languages

  .field
    = f.label :email
    = f.email_field :email

  .field
    = f.label :password
    = f.password_field :password

  .field
    = f.label :password_confirmation
    = f.password_field :password_confirmation

  .field
    = f.submit t('.sign_up', default: "Sign up")

= render "devise/shared/links"

Use only available languages in signup form

%h2
  = t('.sign_up', :default => "Sign up")

= form_for(resource, as: resource_name, url: user_registration_path) do |f|
  = devise_error_messages!

  .field
    = f.label :first_name
    = f.text_field :first_name

  .field
    = f.label :last_name
    = f.text_field :last_name

  .field
    = f.label :language
    = f.select :language, available_languages

  .field
    = f.label :email
    = f.email_field :email

  .field
    = f.label :password
    = f.password_field :password

  .field
    = f.label :password_confirmation
    = f.password_field :password_confirmation

  .field
    = f.submit t('.sign_up', default: "Sign up")

= render "devise/shared/links"


- if pitch.editable_by?(current_user) || pitch.featureable_by?(current_user) || pitch.postable_by?(current_user) || (pitch.story && pitch.fact_checker == current_user) || (pitch.fully_funded? && current_user == pitch.user)
  .block-spacer-negative
- if pitch.editable_by?(current_user)
  .centered= link_to image_tag("edit_this_pitch_b.png"), edit_pitch_path(pitch)
- if pitch.featureable_by?(current_user)
  - if pitch.featured?
    .centered= link_to image_tag('un-feature.gif'), unfeature_pitch_path(pitch), :method => :put
  - else
    .centered= link_to image_tag('feature_this_pitch.png'), feature_pitch_path(pitch), :method => :put
- if pitch.postable_by?(current_user)
  = link_to image_tag('make_blog_post.gif'), new_pitch_post_path(pitch)
- if pitch.story && pitch.fact_checker == current_user
  = link_to image_tag('go_to_story.gif'), story_path(pitch.story)
- if pitch.fully_funded? && current_user == pitch.user
  = link_to image_tag('report.gif'), edit_story_path(pitch.story)

Remove excessive logic in action buttons partial

- if pitch.editable_by?(current_user) || pitch.featureable_by?(current_user) || pitch.postable_by?(current_user)
  .block-spacer-negative
- if pitch.editable_by?(current_user)
  .centered= link_to image_tag("edit_this_pitch_b.png"), edit_pitch_path(pitch)
- if pitch.featureable_by?(current_user)
  - if pitch.featured?
    .centered= link_to image_tag('un-feature.gif'), unfeature_pitch_path(pitch), :method => :put
  - else
    .centered= link_to image_tag('feature_this_pitch.png'), feature_pitch_path(pitch), :method => :put
- if pitch.postable_by?(current_user)
  = link_to image_tag('make_blog_post.gif'), new_pitch_post_path(pitch)
- if pitch.story && pitch.fact_checker == current_user
  = link_to image_tag('go_to_story.gif'), story_path(pitch.story)
- if pitch.fully_funded? && current_user == pitch.user
  = link_to image_tag('report.gif'), edit_story_path(pitch.story)


- content_for(:title, 'Activation du compte administrateur')

%p
  Bonjour,

%p
  Je vous remercie de l’intérêt que vous portez à notre outil de dématérialisation de démarches.

%p
  Votre compte administrateur a été créé pour l'adresse email #{@admin.email}.

%p
  %b
    Pour l’activer, cliquez sur le lien suivant :
    = link_to(admin_activate_url(token: @reset_password_token), admin_activate_url(token: @reset_password_token))

%p
  Afin de vous accompagner dans la découverte de demarches-simplifiees.fr, je vous propose de m’appeler pour faire un point sur vos besoins de dématérialisation.
  %br
  Vous pouvez me joindre au numéro suivant :
  = CONTACT_PHONE
  \.

%p
  Je vous invite également à consulter notre site de documentation qui regroupe l'ensemble des informations relatives à demarches-simplifiees.fr ainsi que des tutoriels d’utilisation :
  = link_to(DOC_URL, DOC_URL)

%p
  = render partial: "layouts/mailers/bizdev_signature", locals: { author_name: @author_name }

Make the phone number a link

- content_for(:title, 'Activation du compte administrateur')

%p
  Bonjour,

%p
  Je vous remercie de l’intérêt que vous portez à notre outil de dématérialisation de démarches.

%p
  Votre compte administrateur a été créé pour l'adresse email #{@admin.email}.

%p
  %b
    Pour l’activer, cliquez sur le lien suivant :
    = link_to(admin_activate_url(token: @reset_password_token), admin_activate_url(token: @reset_password_token))

%p
  Afin de vous accompagner dans la découverte de demarches-simplifiees.fr, je vous propose de m’appeler pour faire un point sur vos besoins de dématérialisation.
  %br
  Vous pouvez me joindre au numéro suivant :
  = link_to(CONTACT_PHONE, "tel:#{CONTACT_PHONE}")
  \.

%p
  Je vous invite également à consulter notre site de documentation qui regroupe l'ensemble des informations relatives à demarches-simplifiees.fr ainsi que des tutoriels d’utilisation :
  = link_to(DOC_URL, DOC_URL)

%p
  = render partial: "layouts/mailers/bizdev_signature", locals: { author_name: @author_name }


%nav
  %ol
    %li= link_to t(".back"), {action: :index}

%section.thread
  %h1= @thread.title
  .info
    .privacy
      - if @thread.private_to_group?
        = t ".private_to_group_message", group: @thread.group.name
      - else
        = t ".public_message"

  - @messages.each do |message|
    %article.message{id: dom_id(message)}
      .details
        .author
          = link_to message.created_by.name, user_profile_path(message.created_by)
          %br
          = image_tag message.created_by.profile.picture_thumbnail.url
        %time{datetime: message.created_at}
          = t ".posted_date", time_ago: time_ago_in_words(message.created_at)
      .body
        - if message.component
          = render "message/#{message_controller_map(message.component)}/show", message: message
        = message.body
  = render "messages/new"

Add missing guard for non-existent user thumbnail.

%nav
  %ol
    %li= link_to t(".back"), {action: :index}

%section.thread
  %h1= @thread.title
  .info
    .privacy
      - if @thread.private_to_group?
        = t ".private_to_group_message", group: @thread.group.name
      - else
        = t ".public_message"

  - @messages.each do |message|
    %article.message{id: dom_id(message)}
      .details
        .author
          = link_to message.created_by.name, user_profile_path(message.created_by)
          - if message.created_by.profile.picture
            %br
            = image_tag message.created_by.profile.picture_thumbnail.url
        %time{datetime: message.created_at}
          = t ".posted_date", time_ago: time_ago_in_words(message.created_at)
      .body
        - if message.component
          = render "message/#{message_controller_map(message.component)}/show", message: message
        = message.body
  = render "messages/new"


.item
  .content
    - if portal_school.errors.any?
      %ul.menu_v.error-explanation
        %li School can't be saved, there are errors in form:
        - portal_school.errors.full_messages.each do |msg|
          %li= msg
    %p
      %ul.menu_v
        %li
          Name:
          = f.text_field :name
        %li
          Description:
          = f.text_area :description, class: 'mceNoEditor'
        %li
          Zipcode:
          = f.text_field :zipcode
        %li
          City:
          = f.text_field :city
        %li
          State or province:
          = f.select(:state, @states_and_provinces, {:prompt => "Select a state or province ..."})

        %li
          District:
          = f.select(:state, @districts, {:prompt => "Select a district ..."})

      = submit_tag

Fix duplicate HTML ids for District and State in school creation page.

.item
  .content
    - if portal_school.errors.any?
      %ul.menu_v.error-explanation
        %li School can't be saved, there are errors in form:
        - portal_school.errors.full_messages.each do |msg|
          %li= msg
    %p
      %ul.menu_v
        %li
          Name:
          = f.text_field :name
        %li
          Description:
          = f.text_area :description, class: 'mceNoEditor'
        %li
          Zipcode:
          = f.text_field :zipcode
        %li
          City:
          = f.text_field :city
        %li
          State or province:
          = f.select(:state, @states_and_provinces, {:prompt => "Select a state or province ..."})

        %li
          District:
          = f.select(:district_id, @districts, {:prompt => "Select a district ..."})

      = submit_tag


.modal-content
  %h4 Ajouter une nouvelle adresse de redirection
  %p Ajouter ici une nouvelle adresse mail vers laquelle seront transférés les emails envoyés sur tes adresses @gadz.org.
  %p
    Nous de conseillons d'
    %b>éviter
    %span
      au maximum les adresses
    %b LaPoste.net, Free, Yahoo,
    Microsoft (hotmail.com et live.com) et dbmail
    qui refusent régulierement les mails de la communauté ;

    %p %b LaPoste.net et Free ont tendance à refuser quasiment 10% des mails transférés par Gadz.org (sur quelques milliers par jour).

  =form_for  [user,new_era], :remote=>true  do |f|
    .input-field.s8{style: "margin-bottom: 0px;"}
      =f.email_field :redirect, required: "required", class: "validate"
      =label_tag(:redirect, "Entre ici la nouvelle adresse. Un code de vérification y sera envoyé","data-error"=>"Cette adresse n'est pas au bon format")

      =f.submit 'Ajouter cette adresse',:class => "waves-effect waves-light btn", id: :new_email_redirect_account_submit
      %a.modal-action.modal-close.waves-effect.waves-green.btn.btn-flat{:href => "#!"} Annuler

Update 2020 edit redirect address text

.modal-content
  %h4 Ajouter une nouvelle adresse de redirection
  %p Ajouter ici une nouvelle adresse mail vers laquelle seront transférés les emails envoyés sur tes adresses @gadz.org.
  %p
    Nous de conseillons d'
    %b>éviter
    %span
      au maximum les adresses
    %b LaPoste.net, Free, Yahoo,
    Microsoft (hotmail.com et live.com) et dbmail
    qui refusent régulierement les mails de la communauté ;

    %p
    %b LaPoste.net et Free
    ont tendance à refuser quasiment 10% des mails transférés par Gadz.org.

  =form_for  [user,new_era], :remote=>true  do |f|
    .input-field.s8{style: "margin-bottom: 0px;"}
      =f.email_field :redirect, required: "required", class: "validate"
      =label_tag(:redirect, "Entre ici la nouvelle adresse. Un code de vérification y sera envoyé","data-error"=>"Cette adresse n'est pas au bon format")

      =f.submit 'Ajouter cette adresse',:class => "waves-effect waves-light btn", id: :new_email_redirect_account_submit
      %a.modal-action.modal-close.waves-effect.waves-green.btn.btn-flat{:href => "#!"} Annuler


= resource_form(@asset, :html =>  {:multipart => true}) do |f|
  = content do
    = f.input(:upload, :label => 'File')
    = f.hidden_field(:upload_cache)
    = f.input(:name)
    = f.input(:tag_summary, :label => 'Tags')
    - if @asset_group
      %p This file will be added to the '#{@asset_group.name}' album
      = f.hidden_field(:asset_group_id, :value => @asset_group.id)
    - else
      = f.input(:asset_group_id, :collection => AssetAlbum.all, :label => 'Album', :include_blank => false)

  = footer do
    = f.submit 'Save'

Tidy up the asset form.

= resource_form(@asset, :html =>  {:multipart => true}) do |f|
  = content do
    = f.fieldset(:class => 'primary') do
      = f.input(:upload, :label => 'File')
      = f.hidden_field(:upload_cache)
      = f.input(:name)

    = f.fieldset('Organise') do
      = f.input(:tag_summary, :label => 'Tags')
      - if @asset_group
        %p This file will be added to the '#{@asset_group.name}' album
        = f.hidden_field(:asset_group_id, :value => @asset_group.id)
      - else
        = f.input(:asset_group_id, :collection => AssetAlbum.all, :label => 'Album', :include_blank => false)

  = footer do
    = save_button


%nav.tab-bar.show-for-medium-down
  %section.left
    %a.left-off-canvas-toggle.menu-icon
      %img{src: "/assets/menu/btn-menu-mobile.png"}

  %section.left
    .ofn-logo
      %a{href: main_app.root_path}
        %img{src: ContentConfig.logo_mobile.url, srcset: ContentConfig.logo_mobile_svg.url, width: "75", height: "26"}

  %section.right{"ng-cloak" => true}
    %span.cart-span{"ng-class" => "{ dirty: Cart.dirty || Cart.empty(), 'pure-dirty': Cart.dirty }"}
      %a.icon{ng: {click: 'toggleCartSidebar()'}}
        %span
          = t '.cart'
        %span.count
          %img{ src: image_path("menu/icn-cart.svg") }
          %span
            {{ Cart.total_item_count() }}

    %a{href: main_app.shop_path}
      {{ CurrentHub.hub.name }}

Use image_tag helper with relative paths when loading static images in /app/assets/images folder

%nav.tab-bar.show-for-medium-down
  %section.left
    %a.left-off-canvas-toggle.menu-icon
      = image_tag "menu/btn-menu-mobile.png"

  %section.left
    .ofn-logo
      %a{href: main_app.root_path}
        %img{src: ContentConfig.logo_mobile.url, srcset: ContentConfig.logo_mobile_svg.url, width: "75", height: "26"}

  %section.right{"ng-cloak" => true}
    %span.cart-span{"ng-class" => "{ dirty: Cart.dirty || Cart.empty(), 'pure-dirty': Cart.dirty }"}
      %a.icon{ng: {click: 'toggleCartSidebar()'}}
        %span
          = t '.cart'
        %span.count
          = image_tag "menu/icn-cart.svg"
          %span
            {{ Cart.total_item_count() }}

    %a{href: main_app.shop_path}
      {{ CurrentHub.hub.name }}


%h1= @discussion.display_title

- if @discussion.proposal
  %div
  - if can? :read, @discussion.proposal
    This discussion has an associated proposal. #{link_to "View Proposal Details here", proposal_path(@discussion.proposal)}.
  - elsif @discussion.proposal.status = "Submitted"
    This discussion has an associated proposal but it has not been approved yet.
- if can? :close, @discussion
  .admin_action
    = link_to "Close this discussion", close_discussion_path(@discussion), method: :put, data: { confirm: "This will prevent future comments and proposals based on this discussion. Continue?" }
%hr

%h3 Comments about this discussion:
= render partial: "start_of_discussion", locals: { discussion: @discussion }

- @discussion.comments.each do |comment|
  = render :partial => "/comments/show", :object => comment
- if can? :create, @comment
  = render :partial => "/comments/form", :object => @comment

- unless @discussion.proposal
  .admin_action
    Is this discussion ready to be made into a proposal?
    = link_to "Create a proposal from this discussion", "#", class: "js--toggle", data: { toggle: ".proposal_new"}

  .proposal_new.is--hidden
    - @committee = @discussion.committee
    - @proposal = Proposal.new(discussion: @discussion)
    - @revision = Revision.new
    - @proposal_owner = @discussion.owner
    = render partial: "proposals/form"

Create proposal from discussion only if allowed

%h1= @discussion.display_title

- if @discussion.proposal
  %div
  - if can? :read, @discussion.proposal
    This discussion has an associated proposal. #{link_to "View Proposal Details here", proposal_path(@discussion.proposal)}.
  - elsif @discussion.proposal.status = "Submitted"
    This discussion has an associated proposal but it has not been approved yet.
- if can? :close, @discussion
  .admin_action
    = link_to "Close this discussion", close_discussion_path(@discussion), method: :put, data: { confirm: "This will prevent future comments and proposals based on this discussion. Continue?" }
%hr

%h3 Comments about this discussion:
= render partial: "start_of_discussion", locals: { discussion: @discussion }

- @discussion.comments.each do |comment|
  = render :partial => "/comments/show", :object => comment
- if can? :create, @comment
  = render :partial => "/comments/form", :object => @comment

- unless @discussion.proposal
  - if can? :create_proposal, @committee
    .admin_action
      Is this discussion ready to be made into a proposal?
      = link_to "Create a proposal from this discussion", "#", class: "js--toggle", data: % toggle: ".proposal_new"

  .proposal_new.is--hidden
    - @committee = @discussion.committee
    - @proposal = Proposal.new(discussion: @discussion)
    - @revision = Revision.new
    - @proposal_owner = @discussion.owner
    = render partial: "proposals/form"


.center
  - content_for :title do
    = @project.name.titleize

  %h2
    = avatar(User.find(@project.user_id).email)
    = @project.name.titleize.to_s + " /  " + File.basename(@imageurl).to_s
  = image_tag @imageurl.gsub("public","")

  %p
    = link_to "View file history", File.join(File.basename(@imageurl).to_s, 'history')
  %br

  %p
  Make changes to this file!
  = form_tag file_update_project_path(@project), multipart: true do
    = file_field_tag "file"
    = hidden_field_tag 'image_name', File.basename(@imageurl)
    = submit_tag

  #comments
    - @comments.each do |comment|
      - if comment.user_id == @project.user_id
        = render 'comments/comment_author', :comment => comment
      - elsif logged_in? and comment.user_id == current_user.id
        = render 'comments/comment_current', :comment => comment
      - else
        = render 'comments/comment_normal'
    = render 'comments/new'

    .comment-body
      = form_for Comment.new do |f|
        = hidden_field_tag 'polycomment_type', 'file'
        = hidden_field_tag 'polycomment_id',  File.basename(@imageurl).to_s
        .comment_field
          = f.text_field :body, :placeholder => 'Add your comment...'
        .submit
          = f.submit

Add link to edit image in the view

.center
  - content_for :title do
    = @project.name.titleize

  %h2
    = avatar(User.find(@project.user_id).email)
    = @project.name.titleize.to_s + " /  " + File.basename(@imageurl).to_s
  = image_tag @imageurl.gsub("public","")

  %p
    = link_to "View file history", File.join(File.basename(@imageurl).to_s, 'history')
    = link_to "Edit", File.join(File.basename(@imageurl).to_s, 'edit')
  %br

  %p
  Make changes to this file!
  = form_tag file_update_project_path(@project), multipart: true do
    = file_field_tag "file"
    = hidden_field_tag 'image_name', File.basename(@imageurl)
    = submit_tag

  #comments
    - @comments.each do |comment|
      - if comment.user_id == @project.user_id
        = render 'comments/comment_author', :comment => comment
      - elsif logged_in? and comment.user_id == current_user.id
        = render 'comments/comment_current', :comment => comment
      - else
        = render 'comments/comment_normal'
    = render 'comments/new'

    .comment-body
      = form_for Comment.new do |f|
        = hidden_field_tag 'polycomment_type', 'file'
        = hidden_field_tag 'polycomment_id',  File.basename(@imageurl).to_s
        .comment_field
          = f.text_field :body, :placeholder => 'Add your comment...'
        .submit
          = f.submit


%p Hello #{@resource.email}!
%p Someone has requested a link to change your password, and you can do this through the link below.
%p link_to "Change my password", edit_password_url(@resource, :reset_password_token => @token)
%p If you didn't request this, please ignore this email.
%p Your password won't change until you access the link above and create a new one.

Fix url in reset password mailer

%p Hello #{@resource.email}!
%p Someone has requested a link to change your password, and you can do this through the link below.
%p= link_to "Change my password", edit_password_url(@resource, :reset_password_token => @token)
%p If you didn't request this, please ignore this email.
%p Your password won't change until you access the link above and create a new one.


- content_for :page_title do
  = t('admin.standing_orders.standing_orders')

- content_for :app_wrapper_attrs do
  = "ng-app='admin.standingOrders'"

- content_for :page_actions do
  %li
    %a.button.icon-plus#new-standing-order{ href: "javascript:void(0)", "new-standing-order-dialog" => true }
      = t('admin.standing_orders.new')

= admin_inject_column_preferences module: 'admin.standingOrders'
= render 'data'
= render 'order_update_issues_dialog'

%div.margin-bottom-50{ ng: { controller: 'StandingOrdersController' } }
  %save-bar{ dirty: "false", persist: "false" }
  = render 'filters'
  = render 'controls'
  = render 'table'
  = render 'loading_flash'
  = render 'no_results'

Add orders sub-menu to standing-order index page

- content_for :page_title do
  = t('admin.standing_orders.standing_orders')

- content_for :app_wrapper_attrs do
  = "ng-app='admin.standingOrders'"

- content_for :page_actions do
  %li
    %a.button.icon-plus#new-standing-order{ href: "javascript:void(0)", "new-standing-order-dialog" => true }
      = t('admin.standing_orders.new')

= render :partial => 'spree/admin/shared/order_sub_menu'

= admin_inject_column_preferences module: 'admin.standingOrders'
= render 'data'
= render 'order_update_issues_dialog'

%div.margin-bottom-50{ ng: { controller: 'StandingOrdersController' } }
  %save-bar{ dirty: "false", persist: "false" }
  = render 'filters'
  = render 'controls'
  = render 'table'
  = render 'loading_flash'
  = render 'no_results'


%h1= t ".title", group: @group.name
%section.threads
  %ul.tabs.styled-tabs
    %li= link_to t(".issue_threads"), "#issue-threads"
    %li= link_to t(".general_threads"), "#general-threads"
  .panes
    .pane
      %p= t ".issue_threads_description", group_name: @group.name
      %p= t ".issue_threads_addition_description"
      %ul.threads
        = render_threads_list @issue_threads
      = will_paginate @issue_threads, param_name: "issue_threads_page", params: {anchor: "issue-threads"}
    .pane
      %p= t ".general_threads_description"
      %nav
        %ul
          %li= link_to t(".new_group_thread"), {action: :new}, class: "btn-green"
      %ul.threads
        = render_threads_list @general_threads
      = will_paginate @general_threads, param_name: "general_threads_page", params: {anchor: "general-threads"}

Use the thread-list styling on group pages to match main thread listing.

%h1= t ".title", group: @group.name
%section.threads
  %ul.tabs.styled-tabs
    %li= link_to t(".issue_threads"), "#issue-threads"
    %li= link_to t(".general_threads"), "#general-threads"
  .panes
    .pane
      %p= t ".issue_threads_description", group_name: @group.name
      %p= t ".issue_threads_addition_description"
      %ul.thread-list
        = render_threads_list @issue_threads
      = will_paginate @issue_threads, param_name: "issue_threads_page", params: {anchor: "issue-threads"}
    .pane
      %p= t ".general_threads_description"
      %nav
        %ul
          %li= link_to t(".new_group_thread"), {action: :new}, class: "btn-green"
      %ul.thread-list
        = render_threads_list @general_threads
      = will_paginate @general_threads, param_name: "general_threads_page", params: {anchor: "general-threads"}


%ul.right.large-2.columns
  %li.has-dropdown
    = link_to "Admin", patients_path
    %ul.dropdown
      - if current_user_is_super_admin?
        %li
          = link_to "Manage Event Types", event_types_path
        %li
          = link_to "Manage Drugs", drugs_path
        %li
          = link_to "Manage Modalities", modality_codes_path
        %li
          = link_to "Manage Bag Types", bag_types_path

      - if current_user_is_admin?
        %li
          = link_to 'Approve users', unapproved_admin_users_path
        %li
          = link_to 'Reactivate users', inactive_admin_users_path

Add manage doctors nav item

%ul.right.large-2.columns
  %li.has-dropdown
    = link_to "Admin", patients_path
    %ul.dropdown
      - if current_user_is_super_admin?
        %li
          = link_to "Manage Event Types", event_types_path
        %li
          = link_to "Manage Drugs", drugs_path
        %li
          = link_to "Manage Modalities", modality_codes_path
        %li
          = link_to "Manage Bag Types", bag_types_path
        %li
          = link_to "Manage Doctors", doctors_path

      - if current_user_is_admin?
        %li
          = link_to 'Approve users', unapproved_admin_users_path
        %li
          = link_to 'Reactivate users', inactive_admin_users_path


.panel.panel-default
  = render 'layouts/wizard_steps'
  - if @branches.empty?
    %h3 No branches found! None. Zero. Zilch. Nada.
    We were unable to find any branches.
    Please make sure you have selected a repository first.
  - else
    %h3 Select branches from '#{@project_wizard.repo_name}':
    .panel-body
      .list-group
        = simple_form_for @project_wizard, as: '',
          url: project_wizard_path do |f|
          = f.input :branch_names, as: :check_boxes,
            collection: @branches.map(&:branch_name),
            checked: @project_wizard.branch_names | ["master"]
          = f.submit "Next", class: 'btn btn-primary'

Move 'next' button to right in 'select branches'

.panel.panel-default
  = render 'layouts/wizard_steps'
  - if @branches.empty?
    %h3 No branches found! None. Zero. Zilch. Nada.
    We were unable to find any branches.
    Please make sure you have selected a repository first.
  - else
    %h3 Select branches from '#{@project_wizard.repo_name}':
    .panel-body
      .list-group
        = simple_form_for @project_wizard, as: '',
          url: project_wizard_path do |f|
          = f.input :branch_names, as: :check_boxes,
            collection: @branches.map(&:branch_name),
            checked: @project_wizard.branch_names | ["master"]
          = f.submit "Next", class: 'btn btn-primary pull-right btn-lg w-lg'


- content_for :sidebar do
  #new-asset{:style => "display: none;"}= render "form", multiple: true
  .sidebar
    .content
      %h2 Asset Library
      = link_to "Upload New", '#', class: 'btn btn-info btn-block', data: {'modal-target' => '#new-asset', 'modal-title' => 'Upload Assets'}

    %h4 File Types
    %nav
      %ul
        %li.active
          = link_to('#', data: {type: ''}) do
            All Assets
            %span.count= @counts[:all]

        %li
          = link_to('#images', data: {type: 'images'}) do
            Images
            %span.count= @counts[:images]

        %li
          = link_to('#documents', data: {type: 'documents'}) do
            Documents
            %span.count= @counts[:documents]

        %li
          = link_to('#videos', data: {type: 'videos'}) do
            Videos
            %span.count= @counts[:videos]

Remove counts from asset sidebar

- content_for :sidebar do
  #new-asset{:style => "display: none;"}= render "form", multiple: true
  .sidebar
    .content
      %h2 Asset Library
      = link_to "Upload New", '#', class: 'btn btn-info btn-block', data: {'modal-target' => '#new-asset', 'modal-title' => 'Upload Assets'}

    %h4 File Types
    %nav
      %ul
        %li.active
          = link_to('#', data: {type: ''}) do
            All Assets

        %li
          = link_to('#images', data: {type: 'images'}) do
            Images

        %li
          = link_to('#documents', data: {type: 'documents'}) do
            Documents

        %li
          = link_to('#videos', data: {type: 'videos'}) do
            Videos


.container-fluid
  .row
    = render partial: 'chart', collection: @models, as: 'model', locals: { limit: 30 }

Add 'DataMapper unsupported' message to dashboard

-if defined?(DataMapper)
  .container
    .row
      .jumbotron
        %h2
          Sorry, the default dashboard doesn't support DataMapper
        %p
          Please create a custom dashboard view in:
        %code
          app/views/upmin/dashboard/index.html.[haml|erb|etc]
-else
  .container-fluid
    .row
      = render partial: 'chart', collection: @models, as: 'model', locals: { limit: 30 }


%h2 Left Column h2
%p Generally this lef-colum should be used for sub-navigation purposes
%ul
  %li
    %a Link 1
  %li
    %a Link 2
  %li
    %a Link 3
  %li
    %a Link 4

Add examples of navigation to leftcol partial

%h2 Left Column h2
%p Generally this left-colum should be used for sub-navigation purposes
%ul.icons-ul
  %li
    %i.icon-li.icon-chevron-sign-right
    %a{:href => ""}
      Link 1
  %li
    %i.icon-li.icon-chevron-sign-right
    %a{:href => ""}
      Link 2
  %li
    %i.icon-li.icon-chevron-sign-right
    %a{:href => ""}
      Link 3
  %li
    %i.icon-li.icon-chevron-sign-right
    %a{:href => ""}
      Link 4

%br
.div
  %ul.nav.nav-list
    %li.active
      %a{:href => "#"}
        %i.icon-fixed-width.icon-home
        Home
    %li
      %a{:href => "#"}
        %i.icon-fixed-width.icon-book
        Library
    %li
      %a{:href => "#"}
        %i.icon-fixed-width.icon-pencil
        Applications
    %li
      %a{:href => "#"}
        %i.icon-fixed-width.icon-cogs
        Settings


= link_to 'Add Student', new_rites_portal_student_path(:clazz_id => clazz.id)
%table
  %tr
    %td
      Actions
    %td
      Student name
    %td
      Student login
    %td
      Grade level
  - clazz.students.uniq.sort{|a,b| a.user.name <=> b.user.name}.each do |student|
    %tr
      %td
        Remove | Edit
      %td
        = student.user.name
      %td
        = student.user.login
      %td
        = student.grade_level ? student.grade_level.name : "unknown"

Fix the class student list partial.

= link_to 'Add Student', new_rites_portal_student_path(:clazz_id => clazz.id)
%table
  %tr
    %td
      Actions
    %td
      Student name
    %td
      Student login
    %td
      Grade level
  - clazz.students.compact.uniq.sort{|a,b| (a.user ? [a.first_name, a.last_name] : ["",""]) <=> (b.user ? [b.first_name, b.last_name] : ["",""])}.each do |student|
    %tr
      %td
        Remove | Edit
      %td
        = student.user.name
      %td
        = student.user.login
      %td
        = student.grade_level ? student.grade_level.name : "unknown"


- if current_user
  - if co.pending? || co.proposed?
    %ul#nav
      %li.navitem= link_to 'Checklist', checklist_path
      %li.navitem= link_to 'Members', members_path
      %li.navitem= link_to 'Directors', directors_path
      %li.navitem= link_to 'Rules', constitution_path
      %li.navitem= link_to 'Registration details', edit_registration_form_path
  -else
    %ul#nav
      %li.navitem= link_to 'Dashboard', root_path
      %li.navitem= link_to 'Proposals', proposals_path
      %li.navitem= link_to 'Meetings', meetings_path
      %li.navitem= link_to 'Members', members_path
      %li.navitem= link_to 'Directors', directors_path
      %li.navitem= link_to 'Rules', constitution_path
      %li.navitem= link_to 'Shares', shares_path
      - if can?(:create, BoardResolution)
        %li.navitem= link_to 'Board', board_path

Add 'registration documents' link to pending menu bar.

- if current_user
  - if co.pending? || co.proposed?
    %ul#nav
      %li.navitem= link_to 'Checklist', checklist_path
      %li.navitem= link_to 'Members', members_path
      %li.navitem= link_to 'Directors', directors_path
      %li.navitem= link_to 'Rules', constitution_path
      %li.navitem= link_to 'Registration details', edit_registration_form_path
      %li.navitem= link_to 'Registration documents', documents_path
  -else
    %ul#nav
      %li.navitem= link_to 'Dashboard', root_path
      %li.navitem= link_to 'Proposals', proposals_path
      %li.navitem= link_to 'Meetings', meetings_path
      %li.navitem= link_to 'Members', members_path
      %li.navitem= link_to 'Directors', directors_path
      %li.navitem= link_to 'Rules', constitution_path
      %li.navitem= link_to 'Shares', shares_path
      - if can?(:create, BoardResolution)
        %li.navitem= link_to 'Board', board_path


!= @conference.schedule_html_intro
%h2= t '.schedule_index'
%ul
  - @conference.days.each_with_index do |day, index|
    %li
      - if @conference.days.length > 1
        - label = t('.day', index: index + 1, label: l(day.date))
      - else
        - label = t('.schedule', label: l(day.date))
      = link_to label, public_schedule_path(day: index)
      (#{link_to "PDF", public_schedule_path(day: index, format: :pdf)})
  %li= link_to t('.speakers'), public_speakers_path
  %li= link_to t('.events'), public_events_path
  %li= link_to "iCalendar", public_schedule_index_path(format: :ics)
  %li= link_to "xCal", public_schedule_index_path(format: :xcal)
  %li= link_to "XML", public_schedule_index_path(format: :xml)
  %li= link_to("JSON", public_schedule_index_path(format: :json)) + " (" + link_to(t('.speakers'), public_speakers_path(format: :json)) + ")"

Fix day number on links from schedule index

!= @conference.schedule_html_intro
%h2= t '.schedule_index'
%ul
  - @conference.days.each_with_index do |day, index|
    %li
      - if @conference.days.length > 1
        - label = t('.day', index: index + 1, label: l(day.date))
      - else
        - label = t('.schedule', label: l(day.date))
      = link_to label, public_schedule_path(day: index + 1)
      (#{link_to "PDF", public_schedule_path(day: index + 1, format: :pdf)})
  %li= link_to t('.speakers'), public_speakers_path
  %li= link_to t('.events'), public_events_path
  %li= link_to "iCalendar", public_schedule_index_path(format: :ics)
  %li= link_to "xCal", public_schedule_index_path(format: :xcal)
  %li= link_to "XML", public_schedule_index_path(format: :xml)
  %li= link_to("JSON", public_schedule_index_path(format: :json)) + " (" + link_to(t('.speakers'), public_speakers_path(format: :json)) + ")"


#surveyor
  - unless (types = flash.keys.select{|k| [:notice, :error, :warning].include?(k)}).blank?
    .surveyor_flash
      = flash_messages(types)
      .close
  = semantic_form_for(@response_set, :as => :r, :url => surveyor.update_my_survey_path(current_section: @section.id), :html => {:method => :put, :id => "survey_form", :class => @survey.custom_class}) do |f|

    = hidden_field_tag :surveyor_javascript_enabled, false

    = render 'partials/section_menu' # unless @sections.size < 3
    .survey_title= @survey.translation(I18n.locale)[:title]
    .previous_section= previous_section
    = render 'partials/dependents' unless @dependents.empty?
    - if false #@response_set.no_responses_for_section?(@section) # cache if response_set has no responses for current section
      = cache("section_#{@section.id}"){ render "/partials/section", :f => f }
    - else # no cache
      = render "/partials/section", :f => f
    .next_section= next_section
  %br

:javascript
  $(document).ready(function() {
    $("input#surveyor_javascript_enabled").val(true);
  });

Update how flash messages are handled for Rails 4.1

#surveyor
  - unless (types = flash.keys.select{|k| %w(notice, error, warning).include?(k)}).blank?
    .surveyor_flash
      = flash_messages(types)
      .close
  = semantic_form_for(@response_set, :as => :r, :url => surveyor.update_my_survey_path(current_section: @section.id), :html => {:method => :put, :id => "survey_form", :class => @survey.custom_class}) do |f|

    = hidden_field_tag :surveyor_javascript_enabled, false

    = render 'partials/section_menu' # unless @sections.size < 3
    .survey_title= @survey.translation(I18n.locale)[:title]
    .previous_section= previous_section
    = render 'partials/dependents' unless @dependents.empty?
    - if false #@response_set.no_responses_for_section?(@section) # cache if response_set has no responses for current section
      = cache("section_#{@section.id}"){ render "/partials/section", :f => f }
    - else # no cache
      = render "/partials/section", :f => f
    .next_section= next_section
  %br

:javascript
  $(document).ready(function() {
    $("input#surveyor_javascript_enabled").val(true);
  });


- content_for :header do
  #{@team.display_name}

- content_for :subheading do
  #{@team.division.name} - #{@solved_challenges.size} solved #{pluralize(@solved_challenges.size, 'challenge')}

= render partial: 'team_summary'

Fix solved challenge count being duplicated in the team header

- content_for :header do
  #{@team.display_name}

- content_for :subheading do
  #{@team.division.name} - #{pluralize(@solved_challenges.size, 'solved challenge')}

= render partial: 'team_summary'


.table-responsive
  %table.table.projects
    %thead
      %tr
        %th #
        %th GitHub
        %th Origin
        %th Date added
        %th Language
        %th Builds
        %th
        %th
    %tbody
      - projects.each do |project|
        - if project.default_branch
          %tr{:class => created_at_classes(project)}
            %td= link_to(project.id, admin_project_path(project.id))
            %td= link_to(project.name, project.source_code_url, :target => '_blank', :class => 'external')
            %td= project.origin
            %td= project.created_at.strftime('%Y-%m-%d')
            %td= link_to project.language || '-', :language => project.language
            %td= link_to icon(:signal), admin_builds_path(:service => project.service_name, :user => project.user_name, :repo => project.repo_name)
            %td.text-right
              - if project.badge_generated?
                - if project.badge_in_readme?
                  %span.text-success= icon(:check)
                = link_to_project project, image_tag(BadgeMarkup.new(project, project.default_branch).image_path(:svg))
            %td.text-right
              = link_to icon(:refresh), project_rebuild_path(project), :method => :post

Add project's docs url to admin

.table-responsive
  %table.table.projects
    %thead
      %tr
        %th #
        %th GitHub
        %th Origin
        %th Date added
        %th Language
        %th Builds
        %th Docs
        %th
        %th
    %tbody
      - projects.each do |project|
        - if project.default_branch
          %tr{:class => created_at_classes(project)}
            %td= link_to(project.id, admin_project_path(project.id))
            %td= link_to(project.name, project.source_code_url, :target => '_blank', :class => 'external')
            %td= project.origin
            %td= project.created_at.strftime('%Y-%m-%d')
            %td= link_to project.language || '-', :language => project.language
            %td= link_to icon(:signal), admin_builds_path(:service => project.service_name, :user => project.user_name, :repo => project.repo_name)
            %td
              - if project.documentation_url
                = link_to icon(:globe), project.documentation_url, :target => '_blank'
            %td.text-right
              - if project.badge_generated?
                - if project.badge_in_readme?
                  %span.text-success= icon(:check)
                = link_to_project project, image_tag(BadgeMarkup.new(project, project.default_branch).image_path(:svg))
            %td.text-right
              = link_to icon(:refresh), project_rebuild_path(project), :method => :post


%tr{id: dom_id(runner)}
  %td
    - if runner.shared?
      %span.label.label-success shared
    - else
      %span.label.label-info specific
    - unless runner.active?
      %span.label.label-danger paused

  %td
    = link_to admin_runner_path(runner) do
      = runner.short_sha
  %td
    = runner.description
  %td
    - if runner.shared?
      = '-'
    - else
      = runner.projects.count(:all)
  %td
    #{runner.builds.count(:all)}
  %td
    - runner.tag_list.each do |tag|
      %span.label.label-primary
        = tag
  %td
    - if runner.contacted_at
      #{time_ago_in_words(runner.contacted_at)} ago
    - else
      Never
  %td
    .pull-right
      = link_to 'Edit', admin_runner_path(runner), class: 'btn btn-sm'

      - if runner.active?
        = link_to 'Pause', [:pause, :admin, runner], data: { confirm: "Are you sure?" }, method: :get, class: 'btn btn-danger btn-sm'
      - else
        = link_to 'Resume', [:resume, :admin, runner], method: :get, class: 'btn btn-success btn-sm'
      = link_to 'Remove', [:admin, runner], data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-danger btn-sm'

Use abbrevation in runners table in admin area

%tr{id: dom_id(runner)}
  %td
    - if runner.shared?
      %span.label.label-success shared
    - else
      %span.label.label-info specific
    - unless runner.active?
      %span.label.label-danger paused

  %td
    = link_to admin_runner_path(runner) do
      = runner.short_sha
  %td
    = runner.description
  %td
    - if runner.shared?
      n/a
    - else
      = runner.projects.count(:all)
  %td
    #{runner.builds.count(:all)}
  %td
    - runner.tag_list.each do |tag|
      %span.label.label-primary
        = tag
  %td
    - if runner.contacted_at
      #{time_ago_in_words(runner.contacted_at)} ago
    - else
      Never
  %td
    .pull-right
      = link_to 'Edit', admin_runner_path(runner), class: 'btn btn-sm'

      - if runner.active?
        = link_to 'Pause', [:pause, :admin, runner], data: { confirm: "Are you sure?" }, method: :get, class: 'btn btn-danger btn-sm'
      - else
        = link_to 'Resume', [:resume, :admin, runner], method: :get, class: 'btn btn-success btn-sm'
      = link_to 'Remove', [:admin, runner], data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-danger btn-sm'


- provide(:title, '近日開催の道場まとめ')
- provide(:desc,  '開催される道場情報をまとめています。')
- provide(:url,   @url)

%section.cover
  = image_tag "events_cover.png"

%section#events.text-center
  %br
  %h1 📅 近日開催の道場 (β版)
  %br
  %p{style: "margin: 0 30px 40px 0px;"}
    ☯開催予定のイベントをチェックしましょう! ✅
    %br
    (Facebook イベントにも
    %a{href: "https://github.com/coderdojo-japan/coderdojo.jp/issues/393"}<> 今後対応する予定
    です)
  = render partial: 'upcoming_events', locals: { upcoming_events: @upcoming_events }

%br
%br

Add links to Issue/PR in GitHub from /events page

- provide(:title, '近日開催の道場まとめ')
- provide(:desc,  '開催される道場情報をまとめています。')
- provide(:url,   @url)

%section.cover
  = image_tag "events_cover.png"

%section#events.text-center
  %br
  %h1 📅 近日開催の道場 (β版)
  %br
  %p{style: "margin: 0 30px 40px 0px;"}
    ☯開催予定のイベントをチェックしましょう! ✅
    %br
    (Facebook イベントにも
    %a{href: "https://github.com/coderdojo-japan/coderdojo.jp/issues/393"}<> 今後対応する予定
    です)
  = render partial: 'upcoming_events', locals: { upcoming_events: @upcoming_events }

%section#dojos.dojos.text-center
  %br
  %h3{style: "margin-top: 60px; font-weight: bold;"} 🛠 関連リンク
  %ul{:style => "list-style: none; margin-left: -40px; margin-bottom: 40px;"}
    %li
      %a{:href => "https://github.com/coderdojo-japan/coderdojo.jp/issues/258"} 直近の CoderDojo 開催情報を表示したい #258
    %li
      %a{:href => "https://github.com/coderdojo-japan/coderdojo.jp/issues/375"} イベント履歴収集スクリプトの改修 #375
    %li
      %a{:href => "https://github.com/coderdojo-japan/coderdojo.jp/issues/393"} Facebook のイベント履歴収集を自動化したい #393
  %br

%br
%br


%p
  - if movie.release_date.present?
    %span.label.label-info= movie.release_date

  - if movie.budget.present?
    %span.label.label-info= movie.budget

  - if movie.runtime.present?
    %span.label.label-info #{movie.runtime} min

  - if movie.vote_average.present?
    %span.label.label-info
      %i.fa.fa-star
      = movie.vote_average

- if movie.genres.present?
  %p.text-muted= movie.genres.map(&:name).join(' | ')

- if movie.overview.present?
  %p.text-justify= movie.overview

- if movie.belongs_to_collection
  %p.text-muted= movie.belongs_to_collection.name

.row
  .col-md-6
    %h2 Cast

    .table-responsive
      %table.table.table-striped.table-condensed
        %tbody
          - movie.cast.each do |cast|
            %tr
              %td= cast.character
              %td= link_to cast.name, person_path(cast.id)

  .col-md-6
    %h2 Crew

    .table-responsive
      %table.table.table-striped.table-condensed
        %tbody
          - movie.crew.each do |member|
            %tr
              %td= member.job
              %td= member.name

Add a link for a crew member profile

%p
  - if movie.release_date.present?
    %span.label.label-info= movie.release_date

  - if movie.budget.present?
    %span.label.label-info= movie.budget

  - if movie.runtime.present?
    %span.label.label-info #{movie.runtime} min

  - if movie.vote_average.present?
    %span.label.label-info
      %i.fa.fa-star
      = movie.vote_average

- if movie.genres.present?
  %p.text-muted= movie.genres.map(&:name).join(' | ')

- if movie.overview.present?
  %p.text-justify= movie.overview

- if movie.belongs_to_collection
  %p.text-muted= movie.belongs_to_collection.name

.row
  .col-md-6
    %h2 Cast

    .table-responsive
      %table.table.table-striped.table-condensed
        %tbody
          - movie.cast.each do |member|
            %tr
              %td= member.character
              %td= link_to member.name, person_path(member.id)

  .col-md-6
    %h2 Crew

    .table-responsive
      %table.table.table-striped.table-condensed
        %tbody
          - movie.crew.each do |member|
            %tr
              %td= member.job
              %td= link_to member.name, person_path(member.id)


= format_field("Cost", format_as_currency(@asset.purchase_cost) )
= format_field("Purchase Date", format_as_date(@asset.purchase_date) )
= format_field("Purchased New?", format_as_boolean(@asset.purchased_new) )
= format_field("Vendor", link_to(@asset.vendor, vendor_path(@asset.vendor))) unless @asset.vendor.nil?
= format_field("Funding Type", @asset.fta_funding_type)

= render 'grant_purchases'

= format_field("Expected Useful Life", @asset.expected_useful_life )
= format_field("Expected Useful Miles", format_as_integer(@asset.expected_useful_miles) )
= format_field("Title Number", @asset.title_number )
= format_field("Title Owner", @asset.title_owner.name )

Fix purchase layout for vehicles

= format_field("Cost", format_as_currency(@asset.purchase_cost) )
= format_field("Purchase Date", format_as_date(@asset.purchase_date) )
= format_field("Purchased New?", format_as_boolean(@asset.purchased_new) )
= format_field("Vendor", link_to(@asset.vendor, vendor_path(@asset.vendor))) unless @asset.vendor.nil?
= format_field("Funding Type", @asset.fta_funding_type)

= render 'grant_purchases'

= format_field("Expected Useful Life", "#{format_as_integer(@asset.expected_useful_life / 12)} yrs" )
= format_field("Expected Useful Miles", format_as_integer(@asset.expected_useful_miles) )
= format_field("Title Number", @asset.title_number )
= format_field("Title Owner", @asset.title_owner.name )


- if can? :update, @org
  .btn-group.pull-right.panel-action
    %button.btn.btn-primary.btn-sm.dropdown-toggle{:data => {:toggle => 'dropdown'}}
      I want to
      %span.caret
    %ul.dropdown-menu{:role => 'menu'}
      %li
        = link_to edit_organization_path(@org) do
          %i.fa.fa-edit.fa-fw
          = " Update this organization"
      - if @org.type_of? :grantee
        %li.divider
        %li
          = link_to edit_budget_organization_path(@org) do
            %i.fa.fa-usd.fa-fw
            = " Update the budget"

Allow transit agencies to edit their budget

- if can? :update, @org or can? :update, Budget
  .btn-group.pull-right.panel-action
    %button.btn.btn-primary.btn-sm.dropdown-toggle{:data => {:toggle => 'dropdown'}}
      I want to
      %span.caret
    %ul.dropdown-menu{:role => 'menu'}
      - if can? :update, @org
        %li
          = link_to edit_organization_path(@org) do
            %i.fa.fa-edit.fa-fw
            = " Update this organization"
      - if @org.type_of? :grantee and can? :update, Budget
        %li.divider
        %li
          = link_to edit_budget_organization_path(@org) do
            %i.fa.fa-usd.fa-fw
            = " Update the budget"


- if offering.runnable
  - if defined? is_teacher
    = render :partial => 'shared/offering_for_teacher', :locals => {:offering => offering}
  - else
    = render :partial => 'shared/offering_for_student', :locals => {:offering => offering}
- else
  = "No runnable for this offering: #{offering.name}"

Use @portal_teacher instead of is_teacher

- if offering.runnable
  - if defined? @portal_teacher
    = render :partial => 'shared/offering_for_teacher', :locals => {:offering => offering}
  - else
    = render :partial => 'shared/offering_for_student', :locals => {:offering => offering}
- else
  = "No runnable for this offering: #{offering.name}"


- if signed_in?
  .row
    .col-md-12
      %ul.nav.nav-tabs.pull-right#global-actions
        %li.nav-item
          = link_to member_gardens_path(member_slug: current_member.slug), class: 'nav-link' do
            = garden_icon
            = t('links.my_gardens')

        %li.nav-item
          = link_to new_planting_path, class: 'nav-link' do
            = planting_icon
            = t('plantings.plant')

        %li.nav-item
          = link_to new_harvest_path, class: 'nav-link' do
            = harvest_icon
            = t('harvests.harvest')

        %li.nav-item
          = link_to new_seed_path, class: 'nav-link' do
            = seed_icon
            = t('buttons.save_seeds')

        %li.nav-item
          = link_to new_post_path, class: 'nav-link' do
            = blog_icon
            = t 'posts.write_blog'

Comment out global actions until it is prettier

-# - if signed_in?
-#   .row
-#     .col-md-12
-#       .btn-group
-#         = link_to member_gardens_path(member_slug: current_member.slug),
-#           class: 'btn btn-default' do
-#           = garden_icon
-#           -# = t('.my_gardens')
-#         = link_to new_planting_path,
-#           class: 'btn btn-default' do
-#           = planting_icon
-#           -# = t('plantings.plant')

-#         = link_to new_harvest_path,
-#           class: 'btn btn-default' do
-#           = harvest_icon
-#           -# = t('harvests.harvest')

-#         = link_to new_seed_path,
-#           class: 'btn btn-default' do
-#           = seed_icon
-#           -# = t('buttons.save_seeds')

-#         = link_to new_post_path,
-#           class: 'btn btn-default' do
-#           = blog_icon
-#           -# = t 'posts.write_blog'


%table.char
  %thead
    %tr.header.line
      %td{:colspan => 3}
        = haml :_char_header
  %tbody.skills
    %tr
      %td.specialized{:colspan => 3} Specialized Skills
    - @character['skills'].select { |key,value| value['training'] == "Specialized"}.sort.each do |skill|
      %tr
        %td.skill_icon
          %img{:src => image_path("skills/#{skill[1]["name"]}.png")}
        %td.skill_name= skill[1]["name"].split("_").map(&:capitalize).join(" ")
        %td.skill_base.right= skill[1]["base"]
    %tr
      %td.trained{:colspan => 3} Trained Skills
    - @character['skills'].select { |key,value| value['training'] == "Trained"}.sort.each do |skill|
      %tr
        %td.skill_icon
          %img{:src => image_path("skills/#{skill[1]["name"]}.png")}
        %td.skill_name= skill[1]["name"].split("_").map(&:capitalize).join(" ")
        %td.skill_base.right= skill[1]["base"]

Add tooltip next to spec/trained skills with info

%table.char
  %thead
    %tr.header.line
      %td{:colspan => 3}
        = haml :_char_header
  %tbody.skills
    %tr
      %td.specialized{:colspan => 2} Specialized Skills
      %td.right
        %abbr{:title => "Base. Does not include augmentations or auras."}
          ?
    - @character['skills'].select { |key,value| value['training'] == "Specialized"}.sort.each do |skill|
      %tr
        %td.skill_icon
          %img{:src => image_path("skills/#{skill[1]["name"]}.png")}
        %td.skill_name= skill[1]["name"].split("_").map(&:capitalize).join(" ")
        %td.skill_base.right= skill[1]["base"]
    %tr
      %td.trained{:colspan => 2} Trained Skills
      %td.right
        %abbr{:title => "Base. Does not include augmentations or auras."}
          ?
    - @character['skills'].select { |key,value| value['training'] == "Trained"}.sort.each do |skill|
      %tr
        %td.skill_icon
          %img{:src => image_path("skills/#{skill[1]["name"]}.png")}
        %td.skill_name= skill[1]["name"].split("_").map(&:capitalize).join(" ")
        %td.skill_base.right= skill[1]["base"]


.action_menu
  .action_menu_header
    .action_menu_header_left
      = form_tag url_for(:action => "index", :page => session[:page] || 1 ), :method => 'get' do
        = content_tag :label do
          = text_field_tag :search, params[:search], :size => 20
        %input{ :type => "submit", :value => "Search"}
        - if defined? extra_collection_search_fields
          %p= extra_collection_search_fields
      - if collection
        %p= page_entries_info collection, :model => collection_class.display_name
      %p.paginator
        = will_paginate collection
    .action_menu_header_right
      %ul.menu
        - if policy(@projects).create?
          %li= link_to "create #{collection_class.display_name}", :controller => collection_class.name.underscore.pluralize, :action => :new
        %li= toggle_all "#{collection_class.display_name} descriptions"

Allow create link for non-project items in shared menu.

.action_menu
  .action_menu_header
    .action_menu_header_left
      = form_tag url_for(:action => "index", :page => session[:page] || 1 ), :method => 'get' do
        = content_tag :label do
          = text_field_tag :search, params[:search], :size => 20
        %input{ :type => "submit", :value => "Search"}
        - if defined? extra_collection_search_fields
          %p= extra_collection_search_fields
      - if collection
        %p= page_entries_info collection, :model => collection_class.display_name
      %p.paginator
        = will_paginate collection
    .action_menu_header_right
      %ul.menu
        - if @projects && policy(@projects).create?
          %li= link_to "create #{collection_class.display_name}", :controller => collection_class.name.underscore.pluralize, :action => :new
        - elsif @clients || @licenses || @reports
          %li= link_to "create #{collection_class.display_name}", :controller => collection_class.name.underscore.pluralize, :action => :new
        %li= toggle_all "#{collection_class.display_name} descriptions"


- if signed_in?
  .global-actions
    .btn-group
      = link_to gardens_by_owner_path(owner: current_member.slug), class: 'btn btn-default' do
        = t('links.my_gardens')

    .btn-group
      = link_to new_planting_path, class: 'btn btn-default' do
        = t('buttons.plant')
      = link_to new_harvest_path, class: 'btn btn-default' do
        = t('buttons.harvest')
      = link_to new_seed_path, class: 'btn btn-default' do
        = t('buttons.save_seeds')

    .btn-group
      = link_to t('buttons.write_blog_post'), new_post_path, class: 'btn btn-default'

- content_for(:attributions) do
  seed by Template from the Noun Project

Use same t() for the button for writing blog posts

- if signed_in?
  .global-actions
    .btn-group
      = link_to gardens_by_owner_path(owner: current_member.slug), class: 'btn btn-default' do
        = t('links.my_gardens')

    .btn-group
      = link_to new_planting_path, class: 'btn btn-default' do
        = t('buttons.plant')
      = link_to new_harvest_path, class: 'btn btn-default' do
        = t('buttons.harvest')
      = link_to new_seed_path, class: 'btn btn-default' do
        = t('buttons.save_seeds')

    .btn-group
      = link_to t('posts.write_blog_post'), new_post_path, class: 'btn btn-default'

- content_for(:attributions) do
  seed by Template from the Noun Project


!!! 5
!!!

%html
  %head
    / jQuery
    %script{ :src => "lib/jquery/js/jquery.min.js" }

    / Bootstrap
    %script{ :src => "lib/bootstrap/js/bootstrap.min.js" }
    %link{ :href => "lib/bootstrap/css/bootstrap.min.css", :rel => "stylesheet", :type => "text/css" }

    / App
    %script{ :src => "javascripts/app.js", :defer => true }
    %link{ :href => "stylesheets/screen.css", :rel => "stylesheet", :type => "text/css" }
    %title Versionator
  %body
    %nav
      .navbar.navbar-fixed-top
        .navbar-inner
          .container
            =link_to "#{image("nav-index")} Versionator", '/', :class => "brand"

            %ul.nav
              %li= link_to("#{image("nav-installations")} Installations", '/')

            %ul.nav.pull-right
              %li.about= link_to("#{image("nav-about")} About", '/about')

    #content.container-fluid
      = yield

Move JS to the bottom of the page

!!! 5
!!!

%html
  %head
    %link{ :href => "lib/bootstrap/css/bootstrap.min.css", :rel => "stylesheet", :type => "text/css" }
    %link{ :href => "stylesheets/screen.css", :rel => "stylesheet", :type => "text/css" }
    %title Versionator
  %body
    %nav
      .navbar.navbar-fixed-top
        .navbar-inner
          .container
            =link_to "#{image("nav-index")} Versionator", '/', :class => "brand"

            %ul.nav
              %li= link_to("#{image("nav-installations")} Installations", '/')

            %ul.nav.pull-right
              %li.about= link_to("#{image("nav-about")} About", '/about')

    #content.container-fluid
      = yield

    %script{ :src => "lib/jquery/js/jquery.min.js" }
    %script{ :src => "lib/bootstrap/js/bootstrap.min.js" }
    %script{ :src => "javascripts/app.js", :defer => true }


%h1= t ".title", group: @group.name
%nav
  %ul
    %li= link_to t(".new_group_thread"), {action: :new}, class: "btn-green"
%section.threads
  %ul.tabs.styled-tabs
    %li= link_to t(".issue_threads"), "#issue-threads"
    %li= link_to t(".general_threads"), "#general-threads"
  .panes
    .pane
      %p= t ".issue_threads_description", group_name: @group.name
      %ul.thread-list
        = render_threads_list @issue_threads
      = will_paginate @issue_threads, param_name: "issue_threads_page", params: {anchor: "issue-threads"}
    .pane
      %p= t ".general_threads_description"
      %ul.thread-list
        = render_threads_list @general_threads
      = will_paginate @general_threads, param_name: "general_threads_page", params: {anchor: "general-threads"}

Apply different classes to group threads index, seems to be duplicates.

%h1= t ".title", group: @group.name
%nav
  %ul
    %li= link_to t(".new_group_thread"), {action: :new}, class: "btn-green"
%section.threads
  %ul.tabs.styled-tabs
    %li= link_to t(".issue_threads"), "#issue-threads"
    %li= link_to t(".general_threads"), "#general-threads"
  .panes
    .pane
      %p= t ".issue_threads_description", group_name: @group.name
      %ul.threads
        = render_threads_list @issue_threads
      = will_paginate @issue_threads, param_name: "issue_threads_page", params: {anchor: "issue-threads"}
    .pane
      %p= t ".general_threads_description"
      %ul.threads
        = render_threads_list @general_threads
      = will_paginate @general_threads, param_name: "general_threads_page", params: {anchor: "general-threads"}


.panel.panel-default
  .panel-heading
    = t('.update_title')
  .panel-body
    #processing
      = icon('fa-lg fa-gear fa-spin')
      = t('.updating')
    #finished{style: "display: none"}
      = icon('fa-lg fa-check')
      = t('.update_finish')
      %p= link_to t('misc.information.page_title'), misc_information_path
    #failed{style: "display: none"}
      = icon('fa-lg fa-fail')
      = t('.failed')
      %p= link_to t('misc.information.page_title'), misc_information_path

:javascript
  var CURRENT_PID = "#{@current_pid}";

  function ping() {
    setTimeout(function(){
      jQuery.ajax({
        url: "#{misc_upgrading_status_path}",
        type: "GET",
        data: { old_pid: CURRENT_PID }
      })
      .fail(ping)
      .done(function(status){
        switch(status) {
        case "updating":
          ping();
          break;
        case "failed":
          jQuery('#processing').hide();
          jQuery('#failed').show();
          break;
        case "finished":
          jQuery('#processing').hide();
          jQuery('#finished').show();
          break;
        }
      });
    }, 3000);
  }
  ping();

Fix failed icon to be sure

.panel.panel-default
  .panel-heading
    = t('.update_title')
  .panel-body
    #processing
      = icon('fa-lg fa-gear fa-spin')
      = t('.updating')
    #finished{style: "display: none"}
      = icon('fa-lg fa-check')
      = t('.update_finish')
      %p= link_to t('misc.information.page_title'), misc_information_path
    #failed{style: "display: none"}
      = icon('fa-lg fa-exclamation-circle')
      = t('.failed')
      %p= link_to t('misc.information.page_title'), misc_information_path

:javascript
  var CURRENT_PID = "#{@current_pid}";

  function ping() {
    setTimeout(function(){
      jQuery.ajax({
        url: "#{misc_upgrading_status_path}",
        type: "GET",
        data: { old_pid: CURRENT_PID }
      })
      .fail(ping)
      .done(function(status){
        switch(status) {
        case "updating":
          ping();
          break;
        case "failed":
          jQuery('#processing').hide();
          jQuery('#failed').show();
          break;
        case "finished":
          jQuery('#processing').hide();
          jQuery('#finished').show();
          break;
        }
      });
    }, 3000);
  }
  ping();


#node-share.btn-group.dropdown
  %button.dropdown-toggle.btn{:'data-toggle' => 'dropdown'}
    %i.icon-share

  %ul.dropdown-menu{role: 'menu'}
    %li
      =link_to "//twitter.com/share?" + { related: 'wheelmap,sozialhelden', hashtags: 'wheelmap', lang: I18n.locale, text: t('nodes.show.share.text', name: node_share.name), dnt: true , url: node_url(node_share)}.to_query, :'data-toggle' => 'share', :'data-name' => 'twitter', target: '_blank' do
        = fa_icon('twitter fixed-width', text: t('nodes.show.share.twitter'))
    %li
      =link_to "//www.facebook.com/sharer/sharer.php?s=100&p[url]=#{node_url(node_share)}", :'data-toggle' => 'share', :'data-name' => 'facebook', target: '_blank' do
        =fa_icon('facebook fixed-width', text: t('nodes.show.share.facebook'))
    %li
      =mailme_to(nil, body: t('nodes.show.share.text', name: node_share.name) + " (#{node_url(node_share)})") do
        =fa_icon('envelope-alt fixed-width', text: t('nodes.show.share.email'))

Use native mail_to method in view template

#node-share.btn-group.dropdown
  %button.dropdown-toggle.btn{:'data-toggle' => 'dropdown'}
    %i.icon-share

  %ul.dropdown-menu{role: 'menu'}
    %li
      =link_to "//twitter.com/share?" + { related: 'wheelmap,sozialhelden', hashtags: 'wheelmap', lang: I18n.locale, text: t('nodes.show.share.text', name: node_share.name), dnt: true , url: node_url(node_share)}.to_query, :'data-toggle' => 'share', :'data-name' => 'twitter', target: '_blank' do
        = fa_icon('twitter fixed-width', text: t('nodes.show.share.twitter'))
    %li
      =link_to "//www.facebook.com/sharer/sharer.php?s=100&p[url]=#{node_url(node_share)}", :'data-toggle' => 'share', :'data-name' => 'facebook', target: '_blank' do
        =fa_icon('facebook fixed-width', text: t('nodes.show.share.facebook'))
    %li
      =mail_to(nil, body: t('nodes.show.share.text', name: node_share.name) + " (#{node_url(node_share)})") do
        =fa_icon('envelope-alt fixed-width', text: t('nodes.show.share.email'))


%h2 Choose your organisation
%p What kind of organisation do you want to create?
%ul.organisations
  %li= link_to("Association", new_association_path)
  %li= link_to("Company", new_company_path)
  %li= link_to("Co-operative", new_coop_path)

Move Co-operative to top of list of org types on new org page.

%h2 Choose your organisation
%p What kind of organisation do you want to create?
%ul.organisations
  %li= link_to("Co-operative", new_coop_path)
  %li= link_to("Association", new_association_path)
  %li= link_to("Company", new_company_path)


- content_for :title, "Inbox"
- content_for :breadcrumbs do
  %li.breadcrumb-item.active= link_to 'Messages', notifications_path

- if @notifications.empty?
  .alert.alert-success{role: "alert"} You have no messages.
- else
  = paginate @notifications

  - @notifications.each do |n|
    .card.message
      .card-body
        .row
          .col-6.col-md-9
            %h3= link_to  n.subject, notification_path(n)
            %p
              - if n.read
                = icon 'far', 'envelope-open'
              - else
                = icon 'far', 'envelope'
                %strong unread
              = n.created_at
          .col-6.col-md-3.text-right
            = link_to n.sender do
              %h3
                = render 'members/tiny', member: n.sender
                = n.sender
            = render 'members/follow_buttons', member: n.sender
      .card-footer
        = link_to 'Read', n, class: 'btn btn-primary'
        = link_to 'Reply', reply_link(n), class: 'btn btn-secondary'
        = link_to n, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-default btn-danger btn-xs' do
          = delete_icon
          = t('buttons.delete')
  = paginate @notifications

Comment out member avatar until we work out why it's breaking

- content_for :title, "Inbox"
- content_for :breadcrumbs do
  %li.breadcrumb-item.active= link_to 'Messages', notifications_path

- if @notifications.empty?
  .alert.alert-success{role: "alert"} You have no messages.
- else
  = paginate @notifications

  - @notifications.each do |n|
    .card.message
      .card-body
        .row
          .col-6.col-md-9
            %h3= link_to  n.subject, notification_path(n)
            %p
              - if n.read
                = icon 'far', 'envelope-open'
              - else
                = icon 'far', 'envelope'
                %strong unread
              = n.created_at
          .col-6.col-md-3.text-right
            = link_to n.sender do
              %h3
                /= render 'members/tiny', member: n.sender
                = n.sender
            = render 'members/follow_buttons', member: n.sender
      .card-footer
        = link_to 'Read', n, class: 'btn btn-primary'
        = link_to 'Reply', reply_link(n), class: 'btn btn-secondary'
        = link_to n, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-default btn-danger btn-xs' do
          = delete_icon
          = t('buttons.delete')
  = paginate @notifications


- content_for :page_title do
  = AppConfig.settings.pod_name + " - " + t("two_factor_auth.title")

.container#twofa
  .text-center
    .logos-asterisk
    %h1
      = t("two_factor_auth.title")

  = form_for resource, as: resource_name,
                         url: session_path(resource_name),
                         html: {class: "block-form"},
                         method: :post do |f|
    %fieldset
      %label.sr-only#otp-label{for: "otp_attempt"}
        = t("two_factor_auth.input_token.label")
      %i.entypo-lock
      = f.text_field :otp_attempt,
      type: :text,
      placeholder: t("two_factor_auth.input_token.placeholder"),
      required: true,
      autofocus: true,
      class: "input-block-level form-control"
      %p= t "two_factor_auth.recovery.reminder"

    .actions
      = f.button t("devise.sessions.new.sign_in"),
      type: :submit,
      class: "btn btn-large btn-block btn-primary"

  .text-center
    - if display_password_reset_link?
      = link_to t("devise.shared.links.forgot_your_password"),
        new_password_path(resource_name), id: "forgot_password_link"
      %br
    - if display_registration_link?
      = link_to t("devise.shared.links.sign_up"), new_registration_path(resource_name)

Remove password reset and sign up link below two factor form


- if groups.any?
  - groups.each_with_index do |group, i|
    = render "shared/groups/group", group: group

Add ul to wrap project list

- if groups.any?
  %ul.content-list
    - groups.each_with_index do |group, i|
      = render "shared/groups/group", group: group


.navbar.navbar-fixed-top
  .navbar-inner
    .container
      %a.brand{href: "/"} Water
      .nav-collapse
        %ul.nav
          %li.divider-vertical
          %li
            = link_to "Labs", labs_path(current_role_name)
          %li.divider-vertical
          %li
            %a{:href =>"#"} Stuff
        %ul.nav.pull-right
          %li.dropdown{:id => "Options"}
            %a.dropdown-toggle{:"data-toggle" => "dropdown", :href => "#Options"}
              Options
              %b.caret
            %ul.dropdown-menu
              %li
                %a{:href => "#"} Settings
              %li.divider
              %li
                %a{:href => "#"} Log out

Remove path helpers that are broken by absence of role

.navbar.navbar-fixed-top
  .navbar-inner
    .container
      %a.brand{href: "/"} Water
      .nav-collapse
        %ul.nav
          %li.divider-vertical
          %li
            = link_to "Labs", "#"
          %li.divider-vertical
          %li
            %a{:href =>"#"} Stuff
        %ul.nav.pull-right
          %li.dropdown{:id => "Options"}
            %a.dropdown-toggle{:"data-toggle" => "dropdown", :href => "#Options"}
              Options
              %b.caret
            %ul.dropdown-menu
              %li
                %a{:href => "#"} Settings
              %li.divider
              %li
                %a{:href => "#"} Log out


%h2= "#{t(:client)}: #{@client}"

%ul.pills
  %li= link_to 'View Contacts', client_contacts_path(@client)
  - if admin?
    %li= link_to t(:all_clients), clients_path
    %li= link_to 'Edit Client', edit_client_path
    %li= link_to 'New Project', new_project_path(:client => @client)

= render :partial => "completed_projects"

- unless current_user.client
  = render :partial => "shared/files_and_comments", :locals => {:items => @client.files_and_comments.reverse, :id => 'client'}

Fix client edit path on completed tab

%h2= "#{t(:client)}: #{@client}"

%ul.pills
  %li= link_to 'View Contacts', client_contacts_path(@client)
  - if admin?
    %li= link_to t(:all_clients), clients_path
    %li= link_to 'Edit Client', edit_client_path(@client)
    %li= link_to 'New Project', new_project_path(:client => @client)

= render :partial => "completed_projects"

- unless current_user.client
  = render :partial => "shared/files_and_comments", :locals => {:items => @client.files_and_comments.reverse, :id => 'client'}


%li{class: "todo todo-#{todo.done? ? 'done' : 'pending'}", id: dom_id(todo) }
  .todo-item.todo-block
    = image_tag avatar_icon(todo.author_email, 40), class: 'avatar s40', alt:''

    .todo-title.title
      %span.author-name
        - if todo.author
          = link_to_author(todo)
        - else
          (removed)
      %span.todo-label
        = todo_action_name(todo)
        = todo_target_link(todo)

      · #{time_ago_with_tooltip(todo.created_at)}

    - if todo.pending?
      .todo-actions.pull-right
        = link_to [:dashboard, todo], method: :delete, class: 'btn btn-loading done-todo' do
          Done
          = icon('spinner spin')

    .todo-body
      .todo-note
        .md
          = event_note(todo.body, project: todo.project)

Fix error 500 when target is nil on todo list

%li{class: "todo todo-#{todo.done? ? 'done' : 'pending'}", id: dom_id(todo) }
  .todo-item.todo-block
    = image_tag avatar_icon(todo.author_email, 40), class: 'avatar s40', alt:''

    .todo-title.title
      %span.author-name
        - if todo.author
          = link_to_author(todo)
        - else
          (removed)
      %span.todo-label
        = todo_action_name(todo)
        - if todo.target
          = todo_target_link(todo)
        - else
          (removed)

      · #{time_ago_with_tooltip(todo.created_at)}

    - if todo.pending?
      .todo-actions.pull-right
        = link_to [:dashboard, todo], method: :delete, class: 'btn btn-loading done-todo' do
          Done
          = icon('spinner spin')

    .todo-body
      .todo-note
        .md
          = event_note(todo.body, project: todo.project)


%h4 Fragments of Val'anyr
%table.list
  %thead
    %tr
      %th Member
      %th Progress
  %tbody
    - fragment_progress.each do |member_id,count|
      %tr{ :class => cycle('even', 'odd') }
        %td= link_to_member(Member.find(member_id))
        %td.note
          = progress_bar(:width => count.to_f/30.00, :container_width => 80, :color => "#FF8000")
          %span.progress= count

Add a link to the Fragment item page in the progress box

%h4= link_to_item_with_stats(Item.find_by_name("Fragment of Val'anyr")) + " Progress"
%table.list
  %thead
    %tr
      %th Member
      %th Progress
  %tbody
    - fragment_progress.each do |member_id,count|
      %tr{ :class => cycle('even', 'odd') }
        %td= link_to_member(Member.find(member_id))
        %td.note
          = progress_bar(:width => count.to_f/30.00, :container_width => 80, :color => "#FF8000")
          %span.progress= count


%h3 Contact

%div
  Site by Tomasz Wegrzanowski (taw).
  You can contact me by
  %a{href: "mailto:Tomasz.Wegrzanowski@gmail.com"} email
  ,
  %a{href: "http://twitter.com/t_a_w"} twitter
  , or by my account on basically every social site imaginable.

%div
  I invite you to check out my
  %a{href: "http://t-a-w.blogspot.com/"}
    blog
  and
  %a{href: "https://www.youtube.com/channel/UCDlHQYTFt5yXxWXwJ8QlhlQ"}
    youtube channel
  but they're more about programming and video games than Magic: the Gathering.

%div
  Special thanks to Anthony Low for help with testing and to
  %a{href: "http://mtgjson.com/"} mtgjson
  for primary source of data used.

%div
  Code is all on
  %a{href: "https://github.com/taw/magic-search-engine"} github
  \.
  If you want API access I'd recommend getting code from there instead of hammering the poor servers.

%div
  Card text and pictures are all copyright Wizards of the Coast.

Fix excess whitespace on contact page

%h3 Contact

%div
  Site by Tomasz Wegrzanowski (taw).
  You can contact me by
  = succeed "," do
    %a{href: "mailto:Tomasz.Wegrzanowski@gmail.com"} email
  = succeed "," do
    %a{href: "http://twitter.com/t_a_w"} twitter
  or by my account on basically every social site imaginable.

%div
  I invite you to check out my
  %a{href: "http://t-a-w.blogspot.com/"}
    blog
  and
  %a{href: "https://www.youtube.com/channel/UCDlHQYTFt5yXxWXwJ8QlhlQ"}
    youtube channel
  but they're more about programming and video games than Magic: the Gathering.

%div
  Special thanks to Anthony Low for help with testing and to
  %a{href: "http://mtgjson.com/"} mtgjson
  for primary source of data used.

%div
  Code is all on
  = succeed "." do
    %a{href: "https://github.com/taw/magic-search-engine"} github
  If you want API access I'd recommend getting code from there instead of hammering the poor servers.

%div
  Card text and pictures are all copyright Wizards of the Coast.


%p The URL for your character's image is:

%input{ type: :text, readonly: true, size: 75, value: @url }

%p
  This image will update periodically, so it should never be more than
  three hours behind your character's Armory information, but its URL
  will never change. Here's what your character's image looks like:

%p
  %img{ src: @url }

%p
  You can copy and paste the following BBCode snippet to link your
  character's image to its Armory profile in a forum post or signature:

%p
  %textarea{ readonly: true, cols: 120, rows: 3 }= @bbcode

Increase size of readonly output text areas

%p The URL for your character's image is:

%input{ type: :text, readonly: true, size: 100, value: @url }

%p
  This image will update periodically, so it should never be more than
  three hours behind your character's Armory information, but its URL
  will never change. Here's what your character's image looks like:

%p
  %img{ src: @url }

%p
  You can copy and paste the following BBCode snippet to link your
  character's image to its Armory profile in a forum post or signature:

%p
  %textarea{ readonly: true, cols: 150, rows: 3 }= @bbcode