.lmo-blank
  %loading{ng-if: "loadExecuting"}
  .revision-history-modal{ng-if: "!loadExecuting"}
    .modal-header
      %modal_header_cancel_button
      %h1.lmo-h1{translate: "{{header}}"}
    .modal-body.revision-history-modal__body
      %h2.lmo-h2{ng-if: "commentRevision()"} {{model.authorName()}}
      .lmo-wrap{ng-repeat: "version in model.versions() | orderBy: '-createdAt' track by version.id", id: "version-{{version.id}}"}
        .revision-history-modal__revision
          %h2.lmo-h2{ng-if: "discussionRevision()", translate: "{{threadTitle(version)}}"}
          .revision-history-modal__thread-details
            %span{ng-if: "commentRevision()", translate: "revision_history_modal.posted"}
            %span{ng-if: "discussionRevision()", translate: "{{threadDetails(version)}}", translate-value-name: "{{version.authorOrEditorName()}}"}
            %span> {{versionCreatedAt(version.createdAt)}}
            %span{ng-if: "version.isCurrent(version)"}> (current)
          .revision-history-modal__revision-body.lmo-markdown-wrapper{marked: "revisionBody(version)"}

    .modal-footer
      %button.revision-history-modal__close{type: "button", translate: "common.action.close", ng-click: "$close()"}

Move loading wrapper so it only encloses modal body

.revision-history-modal
  .modal-header
    %modal_header_cancel_button
    %h1.lmo-h1{translate: "{{header}}"}
  %loading{ng-if: "loadExecuting"}
  .modal-body.revision-history-modal__body{ng-if: "!loadExecuting"}
    %h2.lmo-h2{ng-if: "commentRevision()"} {{model.authorName()}}
    .lmo-wrap{ng-repeat: "version in model.versions() | orderBy: '-createdAt' track by version.id", id: "version-{{version.id}}"}
      .revision-history-modal__revision
        %h2.lmo-h2{ng-if: "discussionRevision()", translate: "{{threadTitle(version)}}"}
        .revision-history-modal__thread-details
          %span{ng-if: "commentRevision()", translate: "revision_history_modal.posted"}
          %span{ng-if: "discussionRevision()", translate: "{{threadDetails(version)}}", translate-value-name: "{{version.authorOrEditorName()}}"}
          %span> {{versionCreatedAt(version.createdAt)}}
          %span{ng-if: "version.isCurrent(version)"}> (current)
        .revision-history-modal__revision-body.lmo-markdown-wrapper{marked: "revisionBody(version)"}

  .modal-footer
    %button.revision-history-modal__close{type: "button", translate: "common.action.close", ng-click: "$close()"}


.js-config.is-hidden
  = render 'layouts/core/inline_js/fonts_async'
  = render 'layouts/core/inline_js/fs_init'
  = render 'layouts/core/inline_js/google_analytics' if Rails.env.production?
  = render 'layouts/core/inline_js/base_js_async'
  = yield :scripts

  = js_configuration
  - if defined?($JS_VARS)
    :javascript
      #{js_hash($JS_VARS)}

  :javascript
    (function(w,c){
      if (w.lp.ads && c) {
        w.lp.ads.networkCode=c
      }
    }(window,lp.getCookie('lpNetworkCode')));

Add support for setting network code via query string

.js-config.is-hidden
  = render 'layouts/core/inline_js/fonts_async'
  = render 'layouts/core/inline_js/fs_init'
  = render 'layouts/core/inline_js/google_analytics' if Rails.env.production?
  = render 'layouts/core/inline_js/base_js_async'
  = yield :scripts

  = js_configuration
  - if defined?($JS_VARS)
    :javascript
      #{js_hash($JS_VARS)}

  :javascript
    (function(w,c){
      if (w.lp.ads && c) {
        w.lp.ads.networkCode=c.length?c.pop():c
      }
    }(window,lp.getCookie('lpNetworkCode') || window.location.search.match(/lpNetworkCode=([0-9]{4,8})/) ));


.section-header.surveys__admin-header.surveys__admin-header--assignment
  .container
    %div
      %h1 Survey Assignment
    .surveys__admin-header__action
      = link_to "New Question Group",  new_survey_assignment_path, :class => 'button button--no-margin border'

Update new Survey Assignment button text

.section-header.surveys__admin-header.surveys__admin-header--assignment
  .container
    %div
      %h1 Survey Assignment
    .surveys__admin-header__action
      = link_to "New Survey Assignment",  new_survey_assignment_path, :class => 'button button--no-margin border'


#loading-screen
  .message.flash-error{style: 'display: none;'}
  .message.flash-notice.loading
    Loading profile for
    %em.username{id: 'user-missing-portfolio', data: {github_username: @github_username}}= @github_username
    %span.e1 .
    %span.e2 .
    %span.e3 .

Use the term Portfolio over Profile

#loading-screen
  .message.flash-error{style: 'display: none;'}
  .message.flash-notice.loading
    Loading portfolio for
    %em.username{id: 'user-missing-portfolio', data: {github_username: @github_username}}= @github_username
    %span.e1 .
    %span.e2 .
    %span.e3 .


- 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}. Pour l’activer, je vous invite à cliquer 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 account activation link more visible in the admin email

- 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, je vous invite à cliquer 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 }


!!!
%html
  %head
    %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
    %meta{:name => "viewport", :content => "width=device-width, initial-scale=1"}/
    %title Cutouts · File articles you love
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags
  %body
    %h1.text-center Cutouts
    - if user_signed_in?
      %h1 @#{current_user.username} #{link_to(fa_icon("gear"), edit_user_registration_path)} #{link_to("Logout", destroy_user_session_path, method: :delete, style: "float: right;")}

      %hr{:style => "border-color: grey;"}

    - if notice
      %p.alert.alert-success= notice
    - if alert
      %p.alert.alert-danger= alert
    = yield

Add home button to top bar alongside username

!!!
%html
  %head
    %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
    %meta{:name => "viewport", :content => "width=device-width, initial-scale=1"}/
    %title Cutouts · File articles you love
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags
  %body
    %h1.text-center Cutouts
    - if user_signed_in?
      %h1 @#{current_user.username} #{link_to(fa_icon("gear"), edit_user_registration_path)} #{link_to(fa_icon("home"), root_path)} #{link_to("Logout", destroy_user_session_path, method: :delete, style: "float: right;")}

      %hr{:style => "border-color: grey;"}

    - if notice
      %p.alert.alert-success= notice
    - if alert
      %p.alert.alert-danger= alert
    = yield


!!! 5
%html{ lang: "en", prefix: "og: http://ogp.me/ns#" }
  = yield :scripts
  = javascript_include_tag "application"
  = yield :script
  = render partial: "layouts/meta"
  %body
    = render partial: "layouts/header"

    .container#maincontainer
      .row
        .col-md-12
          - if content_for?(:title)
            %h1#title
              = yield(:title)
              - if content_for?(:subtitle)
                %small= yield(:subtitle)

          - if content_for?(:buttonbar)
            .btn-group.layout-actions= yield(:buttonbar)
          = render partial: "shared/flash_messages", flash: flash
          = yield

    %footer
      = render partial: "layouts/footer"
    /
      Javascripts
      \==================================================
    / Placed at the end of the document so the pages load faster
    = javascript_include_tag "application"
    != Rails.application.config.analytics_code

Remove duplicate scripts yield in layout

!!! 5
%html{ lang: "en", prefix: "og: http://ogp.me/ns#" }
  = yield :scripts
  = render partial: "layouts/meta"
  %body
    = render partial: "layouts/header"

    .container#maincontainer
      .row
        .col-md-12
          - if content_for?(:title)
            %h1#title
              = yield(:title)
              - if content_for?(:subtitle)
                %small= yield(:subtitle)

          - if content_for?(:buttonbar)
            .btn-group.layout-actions= yield(:buttonbar)
          = render partial: "shared/flash_messages", flash: flash
          = yield

    %footer
      = render partial: "layouts/footer"
    /
      Javascripts
      \==================================================
    / Placed at the end of the document so the pages load faster
    = javascript_include_tag "application"
    != Rails.application.config.analytics_code


- classes = [match.league.slug]
- classes << 'live' if match.stream_url
- classes << 'games' if match.vod_urls.any?
- classes << 'spoiler' if match.spoiler?
- classes.push(match.team_1.acronym, match.team_2.acronym) if match.team?
- classes.push(match.player_1.name, match.player_2.name) if match.single?

.match.clearfix{class: classes.join(' '), data: { stream_url: match.stream_url }}
  .data.league-name= match.league.name
  .data.vs<
    - if match.team?
      = match.team_1.acronym
      %span.logo{class: match.team_1.slug}>
      %span.middle< v
      %span.logo{class: match.team_2.slug}>
      = match.team_2.acronym
    - if match.single?
      = match.player_1.name
      %span.middle< v
      = match.player_2.name
  .data.time{data: { value: match.rtime.iso8601 }}
  - if match.stream_url
    %a.data.live-banner{href: match.stream_url, target: '_blank'} WATCH LIVE NOW ➔
  - if match.vod_urls.any?
    != partial('vods', { vod_urls: match.vod_urls })

Remove whitespace around player names as well

- classes = [match.league.slug]
- classes << 'live' if match.stream_url
- classes << 'games' if match.vod_urls.any?
- classes << 'spoiler' if match.spoiler?
- classes.push(match.team_1.acronym, match.team_2.acronym) if match.team?
- classes.push(match.player_1.name, match.player_2.name) if match.single?

.match.clearfix{class: classes.join(' '), data: { stream_url: match.stream_url }}
  .data.league-name= match.league.name
  .data.vs<
    - if match.team?
      = match.team_1.acronym
      %span.logo{class: match.team_1.slug}>
      %span.middle< v
      %span.logo{class: match.team_2.slug}>
      = match.team_2.acronym
    - if match.single?
      = match.player_1.name
      %span.middle> v
      = match.player_2.name
  .data.time{data: { value: match.rtime.iso8601 }}
  - if match.stream_url
    %a.data.live-banner{href: match.stream_url, target: '_blank'} WATCH LIVE NOW ➔
  - if match.vod_urls.any?
    != partial('vods', { vod_urls: match.vod_urls })


- provide :title, "Listing Tasks"

%table
  %tr
    %th User
    %th Client
    %th Name
    %th Notes
    %th Status
    %th Complexity
    %th Priority
    %th Due date
    %th Rate
    %th{colspan: 3} Actions

  - @tasks.each do |task|
    - @current_class = task
    %tr
      %td= task.user
      %td= task.client
      %td= task.name
      %td= task.notes
      %td= human_status task
      %td= human_complexity task
      %td= task.priority
      %td= task.due_date
      %td= task.rate
      = render 'common/index_links'

%br

= link_to 'New Task', new_task_path

Remove Notes Field From Task Index

- provide :title, "Listing Tasks"

%table
  %tr
    %th User
    %th Client
    %th Name
    %th Status
    %th Complexity
    %th Priority
    %th Due date
    %th Rate
    %th{colspan: 3} Actions

  - @tasks.each do |task|
    - @current_class = task
    %tr
      %td= task.user
      %td= task.client
      %td= task.name
      %td= human_status task
      %td= human_complexity task
      %td= task.priority
      %td= task.due_date
      %td= task.rate
      = render 'common/index_links'

%br

= link_to 'New Task', new_task_path


:javascript
  function prepareTextField(e, msg) {
    if (e) {
      if (e.value == msg) {
        e.value = '';
      }
    }
  }

  function revertTextField(e, msg) {
    if (e)
      if (e.value == '') {
        e.value = msg;
      }
  }

%h3 New Comment
= form_for topic_comment.to_sym do |f|
  %table
    %tr
      %td{ :style => 'width: 80%;' }
        = f.text_area :content, :style => 'width: 100%; height: 50px;', :value => new_comment_content, :onfocus => "prepareTextField(this, \"#{new_comment_content}\");", :onblur => 'revertTextField(this, \"#{new_comment_content}\");'
        = f.hidden_field user.foreign_key.to_sym, { :value => "" }
    %tr
      %td{ :style => 'text-align: right;' }
        = submit_tag "Save", :disable_with => "Please wait..."

Make msg a global javascript var just for that page and pre-populate it.

:javascript
  msg = "#{new_comment_content}"
  function prepareTextField(e) {
    if (e) {
      if (e.value == msg) {
        e.value = '';
      }
    }
  }

  function revertTextField(e) {
    if (e)
      if (e.value == '') {
        e.value = msg;
      }
  }

%h3 New Comment
= form_for topic_comment.to_sym do |f|
  %table
    %tr
      %td{ :style => 'width: 80%;' }
        = f.text_area :content, :style => 'width: 100%; height: 50px;', :value => new_comment_content, :onfocus => "prepareTextField(this);", :onblur => "revertTextField(this);"
        = f.hidden_field user.foreign_key.to_sym, { :value => instance_variable_get(:"@#{user}").id }
    %tr
      %td{ :style => 'text-align: right;' }
        = submit_tag "Save", :disable_with => "Please wait..."


= page_header title: 'Edit Profile'

= widget_box class: 'nopadding', title: 'Your Profile', icon: 'user' do
  = simple_form_for resource, as: resource_name, url: adminsimple.registration_path, remote: true, html: { method: :put, class: 'form-horizontal' } do |f|
    .form-inputs
      = f.input :email, autofocus: true
      = f.input :password, hint: "(leave blank if you don't want to change it)", input_html: { autocomplete: 'off' }
      = f.input :password_confirmation, input_html: { autocomplete: 'off' }
      = f.input :current_password, hint: "(we need your current password to confirm your changes)", input_html: { autocomplete: 'off' }

    .form-actions
      = f.button :submit, 'Update'

Remove padding on registration form

= page_header title: 'Edit Profile'

= widget_box title: 'Your Profile', icon: 'user' do
  = simple_form_for resource, as: resource_name, url: adminsimple.registration_path, remote: true, html: { method: :put, class: 'form-horizontal' } do |f|
    .form-inputs
      = f.input :email, autofocus: true
      = f.input :password, hint: "(leave blank if you don't want to change it)", input_html: { autocomplete: 'off' }
      = f.input :password_confirmation, input_html: { autocomplete: 'off' }
      = f.input :current_password, hint: "(we need your current password to confirm your changes)", input_html: { autocomplete: 'off' }

    .form-actions
      = f.button :submit, 'Update'


.card--single.card--media-container.js-card.js-double-image-card
  - properties[:cards].each do |card|

    - if card.resized_image_url
      = render 'components/cards/image_card', properties: properties

    - if card.resized_video_url
      = render 'components/cards/video_card', properties: properties

Update double link card properties

.card--single.card--media-container.js-card.js-double-image-card
  - properties[:cards].each do |card|

    - if card.resized_image_url
      = render 'components/cards/image_card', properties: card

    - if card.resized_video_url
      = render 'components/cards/video_card', properties: card


%h2 Co-ops

%h3 Co-ops awaiting registration
%ul.proposed_coops
  - @proposed_coops.each do |coop|
    = content_tag_for(:li, coop) do
      %h4= coop.name
      = button_to("Approve registration", found_admin_coop_path(coop), :method => :put)
      %br.clear

%h3 Co-ops in the draft stage
%ul.pending_coops
  - @pending_coops.each do |coop|
    = content_tag_for(:li, coop) do
      %h4= coop.name

%h3 Active co-ops
%ul.active_coops
  - @active_coops.each do |coop|
    = content_tag_for(:li, coop) do
      %h4= coop.name

Improve admin co-ops index page.

%h2 Co-ops

%h3 Co-ops awaiting registration
%ul.proposed_coops
  - @proposed_coops.each do |coop|
    = content_tag_for(:li, coop) do
      %h4
        = coop.name
        (
        = coop.domain(:only_host => true)
        )
      %p
        %strong Founder:
        = coop.members.first.name
        \<
        = link_to(coop.members.first.email, "mailto:#{coop.members.first.email}")
        \>
      %p
        %strong Registered Office Address:
        = coop.registered_office_address
      %p
        %strong Objects:
        = coop.objectives
      %p TODO: Full organisation and registration form data here.
      = button_to("Approve registration", found_admin_coop_path(coop), :method => :put)
      %br.clear

%h3 Co-ops in the draft stage
%ul.pending_coops
  - @pending_coops.each do |coop|
    = content_tag_for(:li, coop) do
      %h4
        = coop.name
        (
        = coop.domain(:only_host => true)
        )

%h3 Active co-ops
%ul.active_coops
  - @active_coops.each do |coop|
    = content_tag_for(:li, coop) do
      %h4
        = coop.name
        (
        = coop.domain(:only_host => true)
        )


.customers-recent
  - caption = capture do
    = icon :calendar
    Displaying
    %strong= customers.count
    recent customers
  = render 'table', customers: customers, caption: caption

Use placeholder for recent customers

.customers-recent

  = collection_placeholder customers, message: 'No customers yet' do

    - caption = capture do
      = icon :calendar
      Displaying
      %strong= customers.count
      recent customers

    = render 'table', customers: customers, caption: caption


%main.row
  .cell.well.well--l

    - #TODO(Olivier): Display tags sorted alphabetically in sections
    %h1 Tags
    - unless @ordered_tags.empty?
      %ul.columns.columns--s--2.columns--m--4.columns--l--5.list
        - @ordered_tags[0..@ordered_tags.length/2].each do |tag|
          %li.list-item.mbxs
            = link_to tag, tag, class: 'label label--link'
            %span.tsm= tag.articles.count
        - @ordered_tags[@ordered_tags.length/2..@ordered_tags.length].each do |tag|
          %li.list-item.mbxs
            = link_to tag, tag, class: 'label label--link'
            %span.tsm= tag.articles.count

Reduce Tags Index responsive Column count

%main.row
  .cell.cell--s.well.well--l

    - #TODO(Olivier): Display tags sorted alphabetically in sections
    %h1 Tags
    - unless @ordered_tags.empty?
      %ul.columns.columns--s--2.columns--m--4.list
        - @ordered_tags[0..@ordered_tags.length/2].each do |tag|
          %li.list-item.mbxs
            = link_to tag, tag, class: 'label label--link'
            %span.tsm= tag.articles.count
        - @ordered_tags[@ordered_tags.length/2..@ordered_tags.length].each do |tag|
          %li.list-item.mbxs
            = link_to tag, tag, class: 'label label--link'
            %span.tsm= tag.articles.count


%h1= @page_title = t('proofs.new.title', klass: klass, resource: resource)
= simple_form_for resource, url: form_url_chain do |f|
  #prover-list
    = f.input :prover_ids, label: t('proofs.new.provers.label'), collection: ontology.current_version.provers, as: :check_boxes, hint: t('proofs.new.provers.none_is_default')
    .col-lg-2
    .col-lg-10.buttons
      = link_to t('proofs.new.select_all_provers'), '#', class: 'btn btn-xs btn-default select-all'
      = link_to t('proofs.new.select_no_provers'), '#', class: 'btn btn-xs btn-default select-none'
  = f.input :timeout, label: t('proofs.new.timeout.label'), collection: Proof::TIMEOUT_RANGE, label_method: ->(value) { proof_timeout_label(value) }, hint: t('proofs.new.timeout.hint'), input_html: {class: 'timeout'}, include_blank: t('proofs.new.timeout.default')
  = f.button :submit, t('proofs.new.send'), class: 'btn btn-primary'

Use display name in the view.

%h1= @page_title = t('proofs.new.title', klass: klass, resource: resource)
= simple_form_for resource, url: form_url_chain do |f|
  #prover-list
    = f.input :prover_ids, label: t('proofs.new.provers.label'), collection: ontology.current_version.provers, label_method: :to_s, as: :check_boxes, hint: t('proofs.new.provers.none_is_default')
    .col-lg-2
    .col-lg-10.buttons
      = link_to t('proofs.new.select_all_provers'), '#', class: 'btn btn-xs btn-default select-all'
      = link_to t('proofs.new.select_no_provers'), '#', class: 'btn btn-xs btn-default select-none'
  = f.input :timeout, label: t('proofs.new.timeout.label'), collection: Proof::TIMEOUT_RANGE, label_method: ->(value) { proof_timeout_label(value) }, hint: t('proofs.new.timeout.hint'), input_html: {class: 'timeout'}, include_blank: t('proofs.new.timeout.default')
  = f.button :submit, t('proofs.new.send'), class: 'btn btn-primary'


- provide :title, @user.name

.container#profile-page
  %table.table
    %tr
      %td
        %h1
          = gravatar_for @user, size: 100
          = @user.name
  .row-fluid
    .span6
      %h3 Scites (#{@user.scites_count})
      %ul.nav.nav-tabs
        %li{ class: @scite_order == :scited ? 'active' : '' }
          = link_to "Sort by Scite Date", url_for(params.merge(scite_order: :scited))
        %li{ class: @scite_order == :published ? 'active' : '' }
          = link_to "Sort by Publication Date", url_for(params.merge(scite_order: :published))

      = render partial: "papers/paper", collection: @scited_papers, locals: { showabs: false }
      = will_paginate @scited_papers, param_name: 'scite_page'
    .span6
      %h3 Comments (#{@user.comments_count})
      = render @comments
      = will_paginate @comments, param_name: 'comment_page'

Add profile messages for when no scites/comments

- provide :title, @user.name

.container#profile-page
  %table.table
    %tr
      %td
        %h1
          = gravatar_for @user, size: 100
          = @user.name
  .row-fluid
    .span6
      %h3 Scites (#{@user.scites_count})
      - if @scited_papers.length == 0
        %p No papers scited.
      - else
        %ul.nav.nav-tabs
          %li{ class: @scite_order == :scited ? 'active' : '' }
            = link_to "Sort by Scite Date", url_for(params.merge(scite_order: :scited))
          %li{ class: @scite_order == :published ? 'active' : '' }
            = link_to "Sort by Publication Date", url_for(params.merge(scite_order: :published))
          = render partial: "papers/paper", collection: @scited_papers, locals: { showabs: false }
        = will_paginate @scited_papers, param_name: 'scite_page'
    .span6
      %h3 Comments (#{@user.comments_count})
      - if @user.comments_count == 0
        %p No comments posted.
      - else
        = render @comments
        = will_paginate @comments, param_name: 'comment_page'


%h2
  Other servers
#other_servers_options
  = link_to "Add more...", resource(:servers, :new)
  %a#filter{ :href => "#" }
    Filter
  #server_filter_box{ :style => "display: none" }
    %span
      Show only
    %span{ :style => "float: right" }
      = form(:action => 'javascript:void(0)') do
        = select(:role_filter, :collection => (Role.all.map {|r| [r.id, r.name.pluralize]}))

%script{ :type => "text/javascript" }
  $(function() {
  $("#filter").click(function() {
  $("#server_filter_box").toggle("blind");
  });
  });

%ul.connected-sortable
  - unless other_servers.nil?
    = partial :server, :with => other_servers, :as => :server

Fix a reference to a class that should have been namespaced in previous commit f04d0c2

%h2
  Other servers
#other_servers_options
  = link_to "Add more...", resource(:servers, :new)
  %a#filter{ :href => "#" }
    Filter
  #server_filter_box{ :style => "display: none" }
    %span
      Show only
    %span{ :style => "float: right" }
      = form(:action => 'javascript:void(0)') do
        = select(:role_filter, :collection => (Locomotive::Role.all.map {|r| [r.id, r.name.pluralize]}))

%script{ :type => "text/javascript" }
  $(function() {
  $("#filter").click(function() {
  $("#server_filter_box").toggle("blind");
  });
  });

%ul.connected-sortable
  - unless other_servers.nil?
    = partial :server, :with => other_servers, :as => :server


.alert.alert-warning
  %i.fa.fa-bell-o.fa-lg.pull-left
  Missing documentation. Help out by providing a code snippet.

Add Perl environment variable example

%pre
  :preserve
    # Use my secret value
    my $my_secret_value = $ENV{'MORPH_MYSECRET'};


!!!
%html
  %head
    %title
      One Click Organisations
    = css_include_tag :one_click
  %body
    %div.control_bar
      - if current_user
        =link_to 'profile', url(:controller => :members, :action => :edit, :id => current_user.id)
        |
        =link_to 'logout', url('logout')
    %div#doc
      %div#hd
        %h1.header One Click Organisations

      %div#bd
        - if current_user
          %ul#nav
            %li#navitem= link_to 'My Control Centre', url(:controller => :one_click, :action => :control_centre)
            %li#navitem= link_to 'My Member Page', url(:controller => :members, :action => :show, :id => current_user.id)
            %li#navitem= link_to 'Timeline', url(:controller => :one_click, :action => :timeline)
            %li#navitem= link_to 'Members', url(:controller => :members)
            %li#navitem= link_to 'Constitution', url('constitution')

        %div#notice
          = h(message[:notice])
        %div#error
          = h(message[:error])

        = catch_content :for_layout
      %div.footer
        = "One Click Organisations - version 0.1 - running on merb #{Merb::VERSION}"

Change secondary nav to include current user's name, and 'my settings' instead of 'profile'.

!!!
%html
  %head
    %title
      One Click Organisations
    = css_include_tag :one_click
  %body
    %div.control_bar
      - if current_user
        = h current_user.name
        |
        =link_to 'my settings', url(:controller => :members, :action => :edit, :id => current_user.id)
        |
        =link_to 'logout', url('logout')
    %div#doc
      %div#hd
        %h1.header One Click Organisations

      %div#bd
        - if current_user
          %ul#nav
            %li#navitem= link_to 'My Control Centre', url(:controller => :one_click, :action => :control_centre)
            %li#navitem= link_to 'My Member Page', url(:controller => :members, :action => :show, :id => current_user.id)
            %li#navitem= link_to 'Timeline', url(:controller => :one_click, :action => :timeline)
            %li#navitem= link_to 'Members', url(:controller => :members)
            %li#navitem= link_to 'Constitution', url('constitution')

        %div#notice
          = h(message[:notice])
        %div#error
          = h(message[:error])

        = catch_content :for_layout
      %div.footer
        = "One Click Organisations - version 0.1 - running on merb #{Merb::VERSION}"


%article{:class => 'content vcard'}
  %h2
    = link_to user.name, user, :class => 'fn url'
  %figure.image
    = avatar_url(user)
  - unless user.account && user.account.active_for_authentication?
    %p
      Compte fermé
  - if user.homesite
    %p
      Site personnel : #{link_to user.homesite, user.homesite, :class => 'url'}
  - if user.jabber_id
    %p
      Jabber ID : #{link_to 'xmpp:' + user.jabber_id, 'xmpp:' + user.jabber_id, :class => 'url'}

Add the 'me' class on user links for SEO

%article{:class => 'content vcard'}
  %h2
    = link_to user.name, user, :class => 'fn url'
  %figure.image
    = avatar_url(user)
  - unless user.account && user.account.active_for_authentication?
    %p
      Compte fermé
  - if user.homesite
    %p
      Site personnel : #{link_to user.homesite, user.homesite, :class => 'url me'}
  - if user.jabber_id
    %p
      Jabber ID : #{link_to 'xmpp:' + user.jabber_id, 'xmpp:' + user.jabber_id, :class => 'url'}


!!! 5
%html
  %head
    %title Incident Locator
    = stylesheet_link_tag    "application", :media => "all"
    = javascript_include_tag "application"
    = csrf_meta_tags

  %body
    = yield

Add language and encodings in main layout

!!! 5
%html{ html_attrs('en-US') }
  %head
    %title Incident Locator
    %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type" }
    = stylesheet_link_tag    "application", :media => "all"
    = javascript_include_tag "application"
    = csrf_meta_tags

  %body
    = yield


.visualization-graph
  = render 'partials/item_header', item: @visualization, edit: true
  .visualization-graph-container
    = render 'partials/item_graph_menu_navigation'
    = render 'partials/item_graph_menu_actions', edit: true
    = render 'partials/item_graph_panel_configuration'
    = render 'partials/item_share_panel', item: @visualization
    .visualization-graph-component
    = render 'partials/item_graph_info', edit: true
= render 'partials/item_table_edit'
= render 'partials/item_table_description_modal'
= render 'partials/item_table_image_modal'
= render 'partials/item_table_add_column_nodes_modal'
= render 'partials/item_table_add_column_relations_modal'
= render 'partials/item_delete_modal', item: @visualization
= render 'partials/item_delete_node_modal'
= render 'partials/item_delete_relation_modal'
= render 'partials/network_analysis_modal'

Add svg to visualization edit template

.visualization-graph
  = render 'partials/item_header', item: @visualization, edit: true
  .visualization-graph-container
    = render 'partials/item_graph_menu_navigation'
    = render 'partials/item_graph_menu_actions', edit: true
    = render 'partials/item_graph_panel_configuration'
    = render 'partials/item_share_panel', item: @visualization
    .visualization-graph-component
      %svg
    = render 'partials/item_graph_info', edit: true
= render 'partials/item_table_edit'
= render 'partials/item_table_description_modal'
= render 'partials/item_table_image_modal'
= render 'partials/item_table_add_column_nodes_modal'
= render 'partials/item_table_add_column_relations_modal'
= render 'partials/item_delete_modal', item: @visualization
= render 'partials/item_delete_node_modal'
= render 'partials/item_delete_relation_modal'
= render 'partials/network_analysis_modal'


%ul#notes-list.notes.main-notes-list.timeline
  = render "projects/notes/notes"
%ul.notes.notes-form.timeline
  %li.timeline-entry
    .flash-container.timeline-content

    - if can? current_user, :create_note, @project
      .timeline-icon.hidden-xs.hidden-sm
        %a.author_link{ href: user_path(current_user) }
          = image_tag avatar_icon(current_user), alt: current_user.to_reference, class: 'avatar s40'
      .timeline-content.timeline-content-form
        = render "projects/notes/form", view: diff_view
    - else
      .disabled-comment.text-center
        .disabled-comment-text.inline
          Please
          = link_to "register", new_session_path(:user, redirect_to_referer: 'yes')
          or
          = link_to "login", new_session_path(:user, redirect_to_referer: 'yes')
          to post a comment

:javascript
  var notes = new Notes("#{namespace_project_notes_path(namespace_id: @project.namespace, target_id: @noteable.id, target_type: @noteable.class.name.underscore)}", #{@notes.map(&:id).to_json}, #{Time.now.to_i}, "#{diff_view}")

Change "Please register or login" to "Please sign up or sign in"

%ul#notes-list.notes.main-notes-list.timeline
  = render "projects/notes/notes"
%ul.notes.notes-form.timeline
  %li.timeline-entry
    .flash-container.timeline-content

    - if can? current_user, :create_note, @project
      .timeline-icon.hidden-xs.hidden-sm
        %a.author_link{ href: user_path(current_user) }
          = image_tag avatar_icon(current_user), alt: current_user.to_reference, class: 'avatar s40'
      .timeline-content.timeline-content-form
        = render "projects/notes/form", view: diff_view
    - else
      .disabled-comment.text-center
        .disabled-comment-text.inline
          Please
          = link_to "sign up", new_session_path(:user, redirect_to_referer: 'yes')
          or
          = link_to "sign in", new_session_path(:user, redirect_to_referer: 'yes')
          to post a comment

:javascript
  var notes = new Notes("#{namespace_project_notes_path(namespace_id: @project.namespace, target_id: @noteable.id, target_type: @noteable.class.name.underscore)}", #{@notes.map(&:id).to_json}, #{Time.now.to_i}, "#{diff_view}")


- assigned_successful_clazzes = summary_data.select{|item| item[1].length > 0}
- already_assigned_clazzes = summary_data.select{|item| item[2].length > 0}
- if assigned_successful_clazzes.length > 0
  .assign_class_header
    Assigned successfully
    .assigned_classes_container.webkit_scrollbars
      %ul
        - assigned_successful_clazzes.each do|summary_item|
          %li
            .class_name
              = summary_item[0]
            .assign_material_list
              = summary_item[1].join(', ')
- if already_assigned_clazzes.length > 0
  .assign_class_header
    Previously Assigned - not re-assigned
    .assigned_classes_container.webkit_scrollbars
      %ul
        - already_assigned_clazzes.each do|summary_item|
          %li{:style=>"padding-top:8px;"}
            .class_name
              = summary_item[0]
            .assign_material_list
              = summary_item[2].join(', ')
%br
%table{:style=>"width:100%"}
  %tr
    %td{:style=>"text-align: center;"}
      = link_to "OK", "#",:href=>"javascript: void(0);",:onclick=>"close_popup()",:class=>"button"
%div{:style=>"clear:both"}

Change wording on assignment confirmation box

- assigned_successful_clazzes = summary_data.select{|item| item[1].length > 0}
- already_assigned_clazzes = summary_data.select{|item| item[2].length > 0}
- if assigned_successful_clazzes.length > 0
  .assign_class_header
    Assigned successfully
    .assigned_classes_container.webkit_scrollbars
      %ul
        - assigned_successful_clazzes.each do|summary_item|
          %li
            .class_name
              = summary_item[0]
            .assign_material_list
              = summary_item[1].join(', ')
- if already_assigned_clazzes.length > 0
  .assign_class_header
    Please note that some of the activities were already assigned and were not re-assigned.
    = link_to "More Information","javascript:void(0)",:onclick=>"$('prev_assigned_classes_div').toggle();setPopupHeight()"
    .assigned_classes_container.webkit_scrollbars{:id=>"prev_assigned_classes_div",:style=>"display:none"}
      %ul
        - already_assigned_clazzes.each do|summary_item|
          %li{:style=>"padding-top:8px;"}
            .class_name
              = summary_item[0]
            .assign_material_list
              = summary_item[2].join(', ')
%br
%table{:style=>"width:100%"}
  %tr
    %td{:style=>"text-align: center;"}
      = link_to "OK", "#",:href=>"javascript: void(0);",:onclick=>"close_popup()",:class=>"button"
%div{:style=>"clear:both"}


- link_text = link_button("preview.png", resource_page, :title => "View the Resource Page: '#{resource_page.name}'.")
- link_text += name_for_component(resource_page, :hide_componenent_name => true)

= accordion_for(resource_page, link_text, :resource_page) do
  %div.action_menu
    %div.action_menu_header_left
      %span.author
        = resource_page.user.name
    %div.action_menu_header_right
      %ul.menu
        - if (resource_page.changeable?(current_user))
          %li.menu=link_to 'edit', edit_resource_page_url(resource_page)
          %li.menu=link_to 'delete', resource_page, :class => 'delete', :confirm => "Are you sure you want to delete Resource Page #{resource_page.id}", :method => :delete
  %div{:id => dom_id_for(resource_page, :details), :class => 'tiny'}
    %p=resource_page.description
    %p
      %i= updated_time_text(resource_page)
    %p
      %i
        Used in: #{resource_page.offerings.length} classes.

Add more info to ResourcePage accordion

- link_text = link_button("preview.png", resource_page, :title => "View the Resource Page: '#{resource_page.name}'.")
- link_text += name_for_component(resource_page, :hide_componenent_name => true)

= accordion_for(resource_page, link_text, :resource_page) do
  %div.action_menu
    %div.action_menu_header_left
      %span.author
        = resource_page.user.name
    %div.action_menu_header_right
      %ul.menu
        - if (resource_page.changeable?(current_user))
          %li.menu= link_to 'view', resource_page
          %li.menu= link_to 'edit', edit_resource_page_url(resource_page)
          %li.menu= link_to 'delete', resource_page, :class => 'delete', :confirm => "Are you sure you want to delete Resource Page #{resource_page.id}", :method => :delete
  %div{:id => dom_id_for(resource_page, :details), :class => 'tiny'}
    %p= resource_page.description
    %p= pluralize(resource_page.attached_files.size, "attachment")
    %p
      %i= updated_time_text(resource_page)
    %p
      %i
        Used in: #{resource_page.offerings.length} classes.


%div#permission_form_form
  %h4
    New permission form:
  = form_for :portal_permission, :action => :create do |f|
    %table
      %tr
        %td Project:
        %td= select_tag 'portal_permission[project_id]', options_from_collection_for_select(projects, "id", "name", selected: params[:project_id]), prompt: "Select project..."
        %td
      %tr
        %td Name:
        %td= f.text_field :name
        %td
      %tr
        %td Url:
        %td= f.text_field :url
        %td=f.submit "Create"
      %tr
        %td#permission_form_list{:colspan => 3}
          %div
            - permission_forms.each do |perm|
              %span.existing_permission
                %span.name= perm.fullname
                %span.url
                  - if perm.url
                    %a{:href => perm.url, :target => "_blank"}="(link)"
                %span.delete
                  =link_to "✖",
                    remove_form_admin_permission_form_path(perm),
                    :confirm => "Delete Permission Form?"

Add warning that deleting permission form removes access to student data

%div#permission_form_form
  %h4
    New permission form:
  = form_for :portal_permission, :action => :create do |f|
    %table
      %tr
        %td Project:
        %td= select_tag 'portal_permission[project_id]', options_from_collection_for_select(projects, "id", "name", selected: params[:project_id]), prompt: "Select project..."
        %td
      %tr
        %td Name:
        %td= f.text_field :name
        %td
      %tr
        %td Url:
        %td= f.text_field :url
        %td=f.submit "Create"
      %tr
        %td#permission_form_list{:colspan => 3}
          %div
            - permission_forms.each do |perm|
              %span.existing_permission
                %span.name= perm.fullname
                %span.url
                  - if perm.url
                    %a{:href => perm.url, :target => "_blank"}="(link)"
                %span.delete
                  =link_to "✖",
                    remove_form_admin_permission_form_path(perm),
                    :confirm => raw("Delete Permission Form?

WARNING: All related student permissions will be removed and researchers will no longer be able to view the students' data in reports if you delete this form.")


.l-panel-content.l-panel-content--form
  .l-constrained
    %h1 Hippo Importer
.l-panel-content
  .l-constrained
    %h3 Created/Updated records
    - PagePresenter.collect(Array(@records)).each do |record|
      %p
        = link_to record.label, record.preview_url, class: 'menu__action', id: 'preview', target: '_blank'

    = form_for(@hippo_importer_form, url: hippo_path, method: :post, html: { multipart: true, class: 'form form--vertical' }, label_col: "form__label-heading") do |form|
      = form.label :site
      = form.select :site, %w(en cy)

      = form.label :migration_type
      = form.select :migration_type, Cms::HippoImporter::Base.migration_types, selected: 'article'

      = form.label :hippo_file
      = form.file_field :hippo_file

      = form.label :slugs
      = form.text_area :slugs, rows: 10

      = form.submit 'Migrate pages'

Add the records size of articles migrated

.l-panel-content.l-panel-content--form
  .l-constrained
    %h1 Hippo Importer
.l-panel-content
  .l-constrained
    - if @records.present?
      %h3= "#{@records.size} Created/Updated records"
      - PagePresenter.collect(@records).each do |record|
        %p
          = link_to record.label, record.preview_url, class: 'menu__action', id: 'preview', target: '_blank'

    = form_for(@hippo_importer_form, url: hippo_path, method: :post, html: { multipart: true, class: 'form form--vertical' }, label_col: "form__label-heading") do |form|
      = form.label :site
      = form.select :site, %w(en cy)

      = form.label :migration_type
      = form.select :migration_type, Cms::HippoImporter::Base.migration_types, selected: 'article'

      = form.label :hippo_file
      = form.file_field :hippo_file

      = form.label :slugs
      = form.text_area :slugs, rows: 10

      = form.submit 'Migrate pages'


%h1 Hear's My Order
%ul
  %li= link_to "Home", root_path
  - if current_user
    %li=link_to "Sign Out", destroy_user_session_path, method: :delete
    %li=link_to "Restaurants", restaurants_path
  - if current_employee
    %li=link_to "Sign Out", destroy_employee_session_path, method: :delete
    %li=link_to "Your Restaurant", restaurant_path(current_employee.restaurant)
  - unless current_user || current_employee
    %li=link_to "Register", new_user_registration_path
    %li=link_to "User Sign In", new_user_session_path
    %li=link_to "Register As Employee", new_employee_registration_path
    %li=link_to "Employee Sign In", new_employee_session_path

Fix Else/elsif users sign in statement

%h1 Hear's My Order
%ul
  %li= link_to "Home", root_path
  - if current_user
    %li=link_to "Sign Out", destroy_user_session_path, method: :delete
    %li=link_to "Restaurants", restaurants_path
  - elsif current_employee
    %li=link_to "Sign Out", destroy_employee_session_path, method: :delete
    %li=link_to "Your Restaurant", restaurant_path(current_employee.restaurant)
  - else current_user || current_employee
    %li=link_to "Register", new_user_registration_path
    %li=link_to "User Sign In", new_user_session_path
    %li=link_to "Register As Employee", new_employee_registration_path
    %li=link_to "Employee Sign In", new_employee_session_path


%li
  = link_to project_file.url do
    - case Mime::Type.lookup(project_file.filetype).try(:symbol)
    - when :png, :jpeg, :gif
      %i.fa.fa-file-image-o
    - when :pdf
      %i.fa.fa-file-pdf-o
    - when :zip
      %i.fa.fa-file-zip-o
    - when :text
      %i.fa.fa-file-text-o
    - else
      %i.fa.fa-file-o
    = project_file.filename
  %small (#{number_to_human_size project_file.filesize})

  - if can? :delete, project_file
    .pull-right
      = link_to "×".html_safe, [project_file.project.brand, project_file.project, project_file], method: "delete", "data-confirm" => "Are you sure?"

Make it possible to delete ProjectFiles

%li
  = link_to project_file.url do
    - case Mime::Type.lookup(project_file.filetype).try(:symbol)
    - when :png, :jpeg, :gif
      %i.fa.fa-file-image-o
    - when :pdf
      %i.fa.fa-file-pdf-o
    - when :zip
      %i.fa.fa-file-zip-o
    - when :text
      %i.fa.fa-file-text-o
    - else
      %i.fa.fa-file-o
    = project_file.filename
  %small (#{number_to_human_size project_file.filesize})

  - if can? :delete, project_file
    .pull-right
      = link_to "×".html_safe, [project_file.project.brand, project_file.project, project_file], "data-method" => "delete", "data-confirm" => "Are you sure?"


%h1
  = @current_organisation.name
  Directors

%table.members
  %tr
    %th Name
    %th Address
    %th Date directorship assumed
    %th Date directorship vacated
    %th Office held
    %th Date office assumed
    %th Date office vacated
  - for director in @directors
    %tr
      %td= director.name
      %td= simple_format(director.address)
      - if directorship = director.directorships.most_recent
        %td= directorship.elected_on.to_s(:long)
        %td= directorship.ended_on ? directorship.ended_on.to_s(:long) : ""
      - else
        %td
        %td
      - if officership = director.officerships.most_recent
        %td= officership.office.title
        %td= officership.elected_on.to_s(:long)
        %td= officership.ended_on ? officership.ended_on.to_s(:long) : ""
      - else
        %td
        %td
        %td

Fix that Directors PDF would error if elected_on was missing.

%h1
  = @current_organisation.name
  Directors

%table.members
  %tr
    %th Name
    %th Address
    %th Date directorship assumed
    %th Date directorship vacated
    %th Office held
    %th Date office assumed
    %th Date office vacated
  - for director in @directors
    %tr
      %td= director.name
      %td= simple_format(director.address)
      - if directorship = director.directorships.most_recent
        %td= directorship.elected_on ? directorship.elected_on.to_s(:long) : ""
        %td= directorship.ended_on ? directorship.ended_on.to_s(:long) : ""
      - else
        %td
        %td
      - if officership = director.officerships.most_recent
        %td= officership.office.title
        %td= officership.elected_on.to_s(:long)
        %td= officership.ended_on ? officership.ended_on.to_s(:long) : ""
      - else
        %td
        %td
        %td


- if @import
  = hidden_field_tag :import, 'true'
.body
  - ids = []
  .nested-wrap{:'data-name' => 'translations'}
    %table.table{:cellpadding => "0", :cellspacing => "0"}
      %thead
        %tr
          %th.code_header= t('key', :scope => 'admin.releaf_translations')
          - locales.each do |locale|
            %th.language_header{"data-locale" => locale}
              %span.name= locale
          %th.delete_header
      %tbody#variables.list
        - @collection.each_with_index do |translation, index|
          - ids << translation.id
          %tr.item{ id: "translation_#{translation.id}", data: { name: :translations, index: index } }
            %td.translation_name.codeColumn{title: translation.key}
              .wrap
                %input{:type=>"text",   :name=>"translations[][key]", :value => translation.key }
            - locales.each_with_index do |locale, j|
              %td.translationCell{data: {locale: locale}}
                %input{:type=>"text", :name=>"translations[][localizations][#{locale}]", :value => localization(translation, locale) }
            %td.delete_column
              %button.button.danger.only-icon.remove-nested-item{:type => 'button',  :title => t('Remove item', :scope => 'admin.releaf_translations')}
                %i.fa.fa-times
  = hidden_field_tag :existing_translations, ids.join(",")

Fix formatting and translation localization scopes

- if @import
  = hidden_field_tag :import, "true"
.body
  - attributes_scope = "activerecord.attributes.#{resource_class.name.underscore}"
  - ids = []
  .nested-wrap{"data-name" => "translations"}
    %table.table
      %thead
        %tr
          %th.code_header= t("key", scope: attributes_scope)
          - locales.each do |locale|
            %th.language_header{"data-locale" => locale}
              %span.name= t(locale, scope: attributes_scope)
          %th.delete_header
      %tbody#variables.list
        - @collection.each_with_index do |translation, index|
          - ids << translation.id
          %tr.item{ id: "translation_#{translation.id}", data: { name: :translations, index: index } }
            %td.translation_name.codeColumn{title: translation.key}
              .wrap
                %input{type: "text", name: "translations[][key]", value: translation.key }
            - locales.each_with_index do |locale, j|
              %td.translationCell{data: {locale: locale}}
                %input{type: "text", name: "translations[][localizations][#{locale}]", value: localization(translation, locale) }
            %td.delete_column
              %button.button.danger.only-icon.remove-nested-item{type: "button", title: t("Remove item", scope: controller_scope_name)}
                %i.fa.fa-times
  = hidden_field_tag :existing_translations, ids.join(",")


.columns.small-12.medium-6.medium-offset-3
  = render 'show_basic'
  .row
    = link_to 'Request Another Inspection', inspections_new_express_path

Add link to homepage from confirmation page (staff-facing only)

.columns.small-12.medium-6.medium-offset-3
  = render 'show_basic'
  .row
    = link_to 'Request Another Inspection', inspections_new_express_path
  .row
    = link_to 'Return to Homepage', root_path


- title @news.title

- content_for :chat do
  #main_board
    = render 'board'

= article_for @news do |c|
  - c.title = capture do
    = render :partial => 'short'
  - c.meta  = news_posted_by(@news)
  - c.image = link_to(image_tag(@news.section.image.url, :alt => @news.section.title), @news.section)
  - c.body  = capture do
    #first_part
      - @news.paragraphs.in_first_part.each do |paragraph|
        = render 'redaction/paragraphs/paragraph', :paragraph => paragraph
    - @news.links.each do |link|
      = render 'redaction/links/link', :link => link
    %p.new_link{'data-url' => redaction_news_new_link_path(:news_id => @news.id)}
      %button Ajouter un lien
    #second_part
      - @news.paragraphs.in_second_part.each do |paragraph|
        = render 'redaction/paragraphs/paragraph', :paragraph => paragraph

= button_to "Soumettre la dépêche", submit_redaction_news_url(@news)
- if current_user.amr?
  = button_to "Supprimer tous les locks", clear_locks_moderation_news_url(@news), :class => 'ajax'

Fix another bug on URL generation

- title @news.title

- content_for :chat do
  #main_board
    = render 'board'

= article_for @news do |c|
  - c.title = capture do
    = render :partial => 'short'
  - c.meta  = news_posted_by(@news)
  - c.image = link_to(image_tag(@news.section.image.url, :alt => @news.section.title), @news.section)
  - c.body  = capture do
    #first_part
      - @news.paragraphs.in_first_part.each do |paragraph|
        = render 'redaction/paragraphs/paragraph', :paragraph => paragraph
    - @news.links.each do |link|
      = render 'redaction/links/link', :link => link
    %p.new_link{'data-url' => new_redaction_news_link_path(:news_id => @news.id)}
      %button Ajouter un lien
    #second_part
      - @news.paragraphs.in_second_part.each do |paragraph|
        = render 'redaction/paragraphs/paragraph', :paragraph => paragraph

= button_to "Soumettre la dépêche", submit_redaction_news_path(@news)
- if current_user.amr?
  = button_to "Supprimer tous les locks", clear_locks_moderation_news_path(@news), :class => 'ajax'


- head = login? ? current_user.code : DEFAULT_HEADER
%div{"data-context" => "a#default", "data-hash" => "crumbs", "data-id" => "menu", "data-role" => "panel"}
  #main{"data-role" => "page"}
    %div{"data-role" => "header", "data-theme" => "b", "data-backbtn"=>"false"}
      %h1= head
    %div{"data-role" => "content"}
      %ul{"data-role" => "listview", "data-theme" => "g"}
        %li
          %a{"data-panel" => "main", :href => "/mindapp"} Home
        = render "/mindapp/menu_mm"
        - if login?
          %li
            %a{:href=>"/mindapp/pending", "data-rel"=>"dialog", "data-panel" => "main"} Pending Tasks
          %li
            %a{"data-panel" => "main", :href => logout_path, "data-ajax"=>"false"} Sign Out
        - else
          %li
            %a{:href=>new_session_path, "data-rel"=>"dialog", "data-panel" => "main"} Sign In
          %li
            %a{:href=>new_identity_path, "data-rel"=>"dialog", "data-panel" => "main"} Sign Up
        %li
          = link_to "Refresh", "#", :onclick=>"window.location.replace('/')"

Create new branch to keep work of bug fixed heroku error from update_attribute on class

- head = login? ? current_user.code : DEFAULT_HEADER
%div{"data-context" => "a#default", "data-hash" => "crumbs", "data-id" => "menu", "data-role" => "panel"}
  #main{"data-role" => "page"}
    %div{"data-role" => "header", "data-theme" => "b", "data-backbtn"=>"false"}
      %h1= head
    %div{"data-role" => "content"}
      %ul{"data-role" => "listview", "data-theme" => "g"}
        %li
          %a{"data-panel" => "main", :href => "/mindapp"} Home
        = render :partial => "mindapp/menu_mm"
        - if login?
          %li
            %a{:href=>"/mindapp/pending", "data-rel"=>"dialog", "data-panel" => "main"} Pending Tasks
          %li
            %a{"data-panel" => "main", :href => logout_path, "data-ajax"=>"false"} Sign Out
        - else
          %li
            %a{:href=>new_session_path, "data-rel"=>"dialog", "data-panel" => "main"} Sign In
          %li
            %a{:href=>new_identity_path, "data-rel"=>"dialog", "data-panel" => "main"} Sign Up
        %li
          = link_to "Refresh", "#", :onclick=>"window.location.replace('/')"


.l-nav-secondary
  .l-constrained
    .nav-secondary
      .nav-secondary__item.nav-secondary__item--right

Use ul and li tags for nav-secondary

.l-nav-secondary
  .l-constrained
    %ul.nav-secondary
      %li.nav-secondary__item.nav-secondary__item--right


.span4
  %section
    %header
      %h2= t :settings
    %ul.content.nav
      %li
        = link_to t(:my_profile), user_path(@user)
      %li
        = link_to t(:my_favorites), '#' #user_favorites_path(@user)
      %li
        %a= t :my_applications
  - if @user.developer?
    %section
      %header
        %h2= t :developer
      %ul.content.nav
        = link_to t(:my_canteens), user_canteens_path(@user)

Remove my application link from profile navigation.

.span4
  %section
    %header
      %h2= t :settings
    %ul.content.nav
      %li
        = link_to t(:my_profile), user_path(@user)
      %li
        = link_to t(:my_favorites), '#' #user_favorites_path(@user)
  - if @user.developer?
    %section
      %header
        %h2= t :developer
      %ul.content.nav
        = link_to t(:my_canteens), user_canteens_path(@user)


.panel.panel-default
  .notes{ data: { discussion_id: discussion.id } }
    %ul.notes.timeline
      = render partial: "projects/notes/note", collection: discussion.notes, as: :note
  = link_to_reply_discussion(discussion)

Fix reply button on commit discussions

.panel.panel-default
  .notes{ data: { discussion_id: discussion.id } }
    %ul.notes.timeline
      = render partial: "projects/notes/note", collection: discussion.notes, as: :note

  .discussion-reply-holder
    = link_to_reply_discussion(discussion)


%ul
  = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
    = link_to group_path(@group), title: "Home" do
      Activity
  = nav_link(path: 'groups#milestones') do
    = link_to group_milestones_path(@group) do
      Milestones
  = nav_link(path: 'groups#issues') do
    = link_to issues_group_path(@group) do
      Issues
      - if current_user
        %span.count= current_user.assigned_issues.opened.of_group(@group).count
  = nav_link(path: 'groups#merge_requests') do
    = link_to merge_requests_group_path(@group) do
      Merge Requests
      - if current_user
        %span.count= current_user.cared_merge_requests.opened.of_group(@group).count
  = nav_link(path: 'groups#members') do
    = link_to "Members", members_group_path(@group)

  - if can?(current_user, :manage_group, @group)
    = nav_link(path: 'groups#edit') do
      = link_to edit_group_path(@group), class: "tab " do
        Settings

Use correct controller name, namespacing ignored.

%ul
  = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
    = link_to group_path(@group), title: "Home" do
      Activity
  = nav_link(path: 'milestones#index') do
    = link_to group_milestones_path(@group) do
      Milestones
  = nav_link(path: 'groups#issues') do
    = link_to issues_group_path(@group) do
      Issues
      - if current_user
        %span.count= current_user.assigned_issues.opened.of_group(@group).count
  = nav_link(path: 'groups#merge_requests') do
    = link_to merge_requests_group_path(@group) do
      Merge Requests
      - if current_user
        %span.count= current_user.cared_merge_requests.opened.of_group(@group).count
  = nav_link(path: 'groups#members') do
    = link_to "Members", members_group_path(@group)

  - if can?(current_user, :manage_group, @group)
    = nav_link(path: 'groups#edit') do
      = link_to edit_group_path(@group), class: "tab " do
        Settings


- if @pages.respond_to?(:total_pages)
  - content_for(:rel_next_prev_link_tags) { rel_next_prev_link_tags(@pages) }
  - content_for(:canonical_tag) do
    %link{rel: :canonical, href: url_for(all: true, only_path: false)}
- breadcrumb :post, @post
- set_meta_tags title: @post.title, description: @post.body, og: @post.to_og_params, article: @post.to_article_params

%article
  %h1= @post.title
  = raw render_markdown(@pages.map(&:body).join)

  - if @pages.respond_to?(:total_pages) && @pages.total_pages > 1
    %nav.pagination
      = paginate @pages, theme: :post

  = render partial: 'banner', locals: {position: :press_article_bottom}

  %aside
    = render partial: 'sns_share', locals: {title: @post.title, url: post_url(@post), twitter_account: current_site.twitter_account, caption: current_site.sns_share_caption}

    = render partial: 'short_collection', locals: {posts: @post.related_posts}

Add link to next/previous post

- if @pages.respond_to?(:total_pages)
  - content_for(:rel_next_prev_link_tags) { rel_next_prev_link_tags(@pages) }
  - content_for(:canonical_tag) do
    %link{rel: :canonical, href: url_for(all: true, only_path: false)}
- breadcrumb :post, @post
- set_meta_tags title: @post.title, description: @post.body, og: @post.to_og_params, article: @post.to_article_params

%article
  %h1= @post.title
  = raw render_markdown(@pages.map(&:body).join)

  - if @pages.respond_to?(:total_pages) && @pages.total_pages > 1
    %nav.pagination
      = paginate @pages, theme: :post

  = render partial: 'banner', locals: {position: :press_article_bottom}

  %aside
    = render partial: 'sns_share', locals: {title: @post.title, url: post_url(@post), twitter_account: current_site.twitter_account, caption: current_site.sns_share_caption}

    = render partial: 'short_collection', locals: {posts: @post.related_posts}

    - if @post.next_post.present?
      = link_to @post.next_post
    - if @post.previous_post.present?
      = link_to @post.previous_post


%h1
  @#{current_user.username} #{link_to("Logout", destroy_user_session_path, method: :delete, style: "float: right;")}

%hr{:style => "border-color: grey;"}

.col-md-6
  = render :partial => "shared/article_entry_form"

.col-md-6
  %h3 All the articles you have added:

  - @allArticles.each do |article|
    = render "shared/article_single", :object => article

Add link to the settings page

%h1
  @#{current_user.username} #{link_to(fa_icon("gear"), edit_user_registration_path)} #{link_to("Logout", destroy_user_session_path, method: :delete, style: "float: right;")}

%hr{:style => "border-color: grey;"}

.col-md-6
  = render :partial => "shared/article_entry_form"

.col-md-6
  %h3 All the articles you have added:

  - @allArticles.each do |article|
    = render "shared/article_single", :object => article


%html
  %head
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    =# stylesheet_link_tag 'mailers/mailer'
    -# Include CSS inline
    %style= File.read(Rails.root.join('app/assets/stylesheets/mailers/mailer.css'))
  %body(leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0")
    %center
      %table(cellpadding="0" cellspacing="0" border="0" width="100%")
        %tbody
          %tr
            %td.header
              = link_to image_tag(asset_url('logo.png'), :alt => "Errbit"), root_url

          = yield

          %tr
            %td.footer
              Your loyal servant,
              = link_to 'Errbit', root_url

Revert "use asset_url instead of asset_path + kludge"

%html
  %head
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    =# stylesheet_link_tag 'mailers/mailer'
    -# Include CSS inline
    %style= File.read(Rails.root.join('app/assets/stylesheets/mailers/mailer.css'))
  %body(leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0")
    %center
      %table(cellpadding="0" cellspacing="0" border="0" width="100%")
        %tbody
          %tr
            %td.header
              = link_to image_tag(URI.join(root_url, asset_path('logo.png')).to_s, :alt => "Errbit"), root_url

          = yield

          %tr
            %td.footer
              Your loyal servant,
              = link_to 'Errbit', root_url


- truncate ||= false
=image_tag(Gravatar.new(member.email).image_url( options = { :size => defined?(size) ?  size : 150, :default => :identicon }), :alt => '', :class => 'img-rounded' )
%h4= link_to(truncate ? shorten(member.to_s, 30) : member, member_path(member))

Make user pictures into clickable links.

- truncate ||= false
= link_to                                      |
  image_tag(                                   |
    Gravatar.new(member.email).image_url(      |
      options = {                              |
        :size => defined?(size) ?  size : 150, |
        :default => :identicon }),             |
    :alt => '',                                |
    :class => 'img-rounded' ),                 |
  member_path(member)
%h4= link_to(truncate ? shorten(member.to_s, 30) : member, member_path(member))


= table.column :locale, sortable: true
= table.column :parent, sortable: true
= table.column :name, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column :short_description, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column :long_description, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column :link_footer_column, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column :links_count, sortable: true
= table.timestamps

Use correct column type for association.

= table.column :locale, sortable: true
= table.association :parent, sortable: true
= table.column :name, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column :short_description, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column :long_description, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column :link_footer_column, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column :links_count, sortable: true
= table.timestamps


- title = local_assigns.fetch(:title, 'Assign labels')
- show_create = local_assigns.fetch(:show_create, true)
- show_footer = local_assigns.fetch(:show_footer, true)
- filter_placeholder = local_assigns.fetch(:filter_placeholder, 'Search labels')
- show_boards_content = local_assigns.fetch(:show_boards_content, false)
.dropdown-page-one
  = dropdown_title(title)
  - if show_boards_content
    .issue-board-dropdown-content
      %p
        Add a list to issue boards by selecting a label below. The list will automatically be populated with issues that have that label. To create a list for a label that doesn't exist yet, simply create the label below.
  = dropdown_filter(filter_placeholder)
  = dropdown_content
  - if @project && show_footer
    = dropdown_footer do
      %ul.dropdown-footer-list
        - if can?(current_user, :admin_label, @project)
          %li
            %a.dropdown-toggle-page{href: "#"}
              Create new
        %li
          = link_to namespace_project_labels_path(@project.namespace, @project), :"data-is-link" => true do
            - if show_create && @project && can?(current_user, :admin_label, @project)
              Manage labels
            - else
              View labels
  = dropdown_loading

Create new label link text change

- title = local_assigns.fetch(:title, 'Assign labels')
- show_create = local_assigns.fetch(:show_create, true)
- show_footer = local_assigns.fetch(:show_footer, true)
- filter_placeholder = local_assigns.fetch(:filter_placeholder, 'Search labels')
- show_boards_content = local_assigns.fetch(:show_boards_content, false)
.dropdown-page-one
  = dropdown_title(title)
  - if show_boards_content
    .issue-board-dropdown-content
      %p
        Add a list to issue boards by selecting a label below. The list will automatically be populated with issues that have that label. To create a list for a label that doesn't exist yet, simply create the label below.
  = dropdown_filter(filter_placeholder)
  = dropdown_content
  - if @project && show_footer
    = dropdown_footer do
      %ul.dropdown-footer-list
        - if can?(current_user, :admin_label, @project)
          %li
            %a.dropdown-toggle-page{href: "#"}
              Create new label
        %li
          = link_to namespace_project_labels_path(@project.namespace, @project), :"data-is-link" => true do
            - if show_create && @project && can?(current_user, :admin_label, @project)
              Manage labels
            - else
              View labels
  = dropdown_loading


%nav.navbar.navbar-expand-lg.navbar-light.fixed{:style => 'background-color: #ffad33;'}
  %a.navbar-brand{:href => '#', :style => 'color: white'} UFoods
  %span.navbar-toggler-icon
  #navbarSupportedContent.collapse.navbar-collapse
    %ul#links.navbar-nav.mr-auto
      %li.nav-item
        = link_to 'Home', root_path, class: 'nav-link'
      - if current_user
        %li.navbar-text
          Logged in as: #{current_user.email}
          - if @cart
            Cart:
            = @cart.total_unique_items
            - if @cart.shopping_cart_items.any?
              %li.nav-item
                = link_to 'Show cart' , cart_path(@cart, restaurant_id: @restaurant.id), class: 'nav-link'
          %li.nav-item
            = link_to 'Sign Out', destroy_user_session_path, method: :delete, class: 'nav-link'
      - else
        %li.nav-item
          = link_to 'Sign Up', new_user_registration_path, class: 'nav-link'
        %li.nav-item
          = link_to 'Sign in', new_user_session_path, class: 'nav-link'

Add home link to UFoods logo

%nav.navbar.navbar-expand-lg.navbar-light.fixed{:style => 'background-color: #ffad33;'}
  = link_to 'UFoods', root_path, class: 'navbar-brand'
  %span.navbar-toggler-icon
  #navbarSupportedContent.collapse.navbar-collapse
    %ul#links.navbar-nav.mr-auto
      -# %li.nav-item
      -#   = link_to 'Home', root_path, class: 'nav-link'
      - if current_user
        %li.navbar-text
          Logged in as: #{current_user.email}
          - if @cart
            Cart:
            = @cart.total_unique_items
            - if @cart.shopping_cart_items.any?
              %li.nav-item
                = link_to 'Show cart' , cart_path(@cart, restaurant_id: @restaurant.id), class: 'nav-link'
          %li.nav-item
            = link_to 'Sign Out', destroy_user_session_path, method: :delete, class: 'nav-link'
      - else
        %li.nav-item
          = link_to 'Sign Up', new_user_registration_path, class: 'nav-link'
        %li.nav-item
          = link_to 'Sign in', new_user_session_path, class: 'nav-link'


= render layout: 'projects/protected_branches/shared/protected_branch', locals: { protected_branch: protected_branch } do
  = render partial: 'projects/protected_branches/update_protected_branch', locals: { protected_branch: protected_branch }

Resolve CE/EE diffs in protected branches

= render layout: 'projects/protected_branches/shared/protected_branch', locals: { protected_branch: protected_branch } do
  = render_if_exists 'projects/protected_branches/update_protected_branch', protected_branch: protected_branch


.container-fluid#wheelmap
  .support-form
    %h1=t('community_support_form.new.form.title')
    %p=t('community_support_form.new.form.header_text_html')
    %ul
      %li=t('community_support_form.new.form.questions.a')
      %li=t('community_support_form.new.form.questions.b')
      %li=t('community_support_form.new.form.questions.c')
    %h5=t('community_support_form.new.form.note')
    = semantic_form_for(@support_request, :url => community_support_index_path ) do |f|
      = f.input :name
      = f.input :email, hint: ""
      = f.input :message, as: :text , label: I18n.t('community_support_form.new.form.describe')
      = f.action :submit, as: :button, label: I18n.t('community_support_form.new.form.submit_button')

- content_for :javascript do
  = javascript_include_tag "jquery"
  = javascript_include_tag "bootstrap"
  = javascript_include_tag "bootstrap-select"
  %script
    $(document).ready(function () { $('.selectpicker').selectpicker(); });

Remove unnecessary id on elem

.container-fluid
  .support-form
    %h1=t('community_support_form.new.form.title')
    %p=t('community_support_form.new.form.header_text_html')
    %ul
      %li=t('community_support_form.new.form.questions.a')
      %li=t('community_support_form.new.form.questions.b')
      %li=t('community_support_form.new.form.questions.c')
    %h5=t('community_support_form.new.form.note')
    = semantic_form_for(@support_request, :url => community_support_index_path ) do |f|
      = f.input :name
      = f.input :email, hint: ""
      = f.input :message, as: :text , label: I18n.t('community_support_form.new.form.describe')
      = f.action :submit, as: :button, label: I18n.t('community_support_form.new.form.submit_button')

- content_for :javascript do
  = javascript_include_tag "jquery"
  = javascript_include_tag "bootstrap"
  = javascript_include_tag "bootstrap-select"
  %script
    $(document).ready(function () { $('.selectpicker').selectpicker(); });


.project_clone_panel
  .row
    .span8
      .form-horizontal= render "shared/clone_panel"
    .span3.pull-right
      .pull-right
        - unless @project.empty_repo?
          - if can? current_user, :download_code, @project
            = link_to archive_project_repository_path(@project), class: "btn grouped" do
              %i.icon-download-alt
              Download

            = link_to tags_project_repository_path(@project), class: "btn grouped only-wide", title: 'Git Tags' do
              %i.icon-tags

            .dropdown.pull-right
              %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
                %i.icon-plus
                Add new
                %b.caret
              %ul.dropdown-menu
                - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)
                  %li
                    = link_to new_project_merge_request_path(@project), title: "New Merge Request" do
                      Merge Request
                - if @project.issues_enabled && can?(current_user, :write_issue, @project)
                  %li
                    = link_to url_for_new_issue, title: "New Issue" do
                      Issue
                - if @project.snippets_enabled && can?(current_user, :write_snippet, @project)
                  %li
                    = link_to new_project_snippet_path(@project), title: "New Snippet" do
                      Snippet

Add link to quickly add new team member from project panel

.project_clone_panel
  .row
    .span8
      .form-horizontal= render "shared/clone_panel"
    .span3.pull-right
      .pull-right
        - unless @project.empty_repo?
          - if can? current_user, :download_code, @project
            = link_to archive_project_repository_path(@project), class: "btn grouped" do
              %i.icon-download-alt
              Download

            = link_to tags_project_repository_path(@project), class: "btn grouped only-wide", title: 'Git Tags' do
              %i.icon-tags

            .dropdown.pull-right
              %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
                %i.icon-plus
                Add new
                %b.caret
              %ul.dropdown-menu
                - if @project.issues_enabled && can?(current_user, :write_issue, @project)
                  %li
                    = link_to url_for_new_issue, title: "New Issue" do
                      Issue
                - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)
                  %li
                    = link_to new_project_merge_request_path(@project), title: "New Merge Request" do
                      Merge Request
                - if @project.snippets_enabled && can?(current_user, :write_snippet, @project)
                  %li
                    = link_to new_project_snippet_path(@project), title: "New Snippet" do
                      Snippet
                - if @project.issues_enabled && can?(current_user, :admin_team_member, @project)
                  %li.divider
                  %li
                    = link_to new_project_team_member_path(@project), title: "New Team member" do
                      Team member


%h1 New comment

= render 'form'

= link_to campaign_game_path(campaign, game), class: 'btn btn-default' do
  %span.glyphicon.glyphicon-chevron-left

  Back

Modify back button in comment new show to have buttons for post and idea

%h1 New comment

= render 'form'

- if subject.is_a? Post
  = link_to campaign_game_path(campaign, game), class: 'btn btn-default' do
    %span.glyphicon.glyphicon-chevron-left

    Back
- elsif subject.is_a? Idea
  = link_to campaign_idea_path(campaign, subject), class: 'btn btn-default' do
    %span.glyphicon.glyphicon-chevron-left

    Back


%h2 Quick Stats
#bagel-owner
  %p= "Bagel Owner: #{@report.current_bagel_owner_name}"
#best-team
  %p= "Best Team: #{@report.best_team_player_names}"

%h2 Bagels Received Between Active Players
%p The higher the percentage, the more a player has received the bagel; losers.
= pie_chart @report.players_grouped_by_bagel_ownage

%h2 Bagels Received by Month
%p Do we give out more bagels in the summer? (Hint: you can't answer the question with this chart)
= line_chart @report.bagels_given_over_time

Use ul for quick stats.

%h2 Quick Stats
%ul
  %li#bagel-owner= "Bagel Owner: #{@report.current_bagel_owner_name}"
  %li#best-team= "Best Team: #{@report.best_team_player_names}"

%h2 Bagels Received Between Active Players
%p The higher the percentage, the more a player has received the bagel; losers.
= pie_chart @report.players_grouped_by_bagel_ownage

%h2 Bagels Received by Month
%p Do we give out more bagels in the summer? (Hint: you can't answer the question with this chart)
= line_chart @report.bagels_given_over_time


%h1= t("events.title")
%h3= t("events.description")

.row
  .col-sm-12.col-md-6
    .map
    .js-pins
      - @events.each do |event|
        = link_to "", event, class: "pin", data: { latitude: event.latitude, longitude: event.longitude }
    %br
    - if @events.empty?
      %h4
        %i
          There are no upcoming events, why not #{link_to "host an event", new_event_path}
  .col-sm-12.col-md-6
    - @events.each do |event|
      .event
        %h2
          = link_to event.organiser, event
          - if event.current_user_is_owner(current_user)
            %small= link_to "edit", edit_event_path(event)
        %h3
          %small
            = event.location
            \/ #{event.formatted_date}

Change layout when no events exist

%h1= t("events.title")
%h3= t("events.description")

- if @events.empty?
  %h4
    %i
      = t("events.index.no_upcoming_events")
      = link_to t("events.index.host_an_event"), new_event_path
- else
  .row
    .col-sm-12.col-md-6
      .map
      .js-pins
        - @events.each do |event|
          = link_to "", event, class: "pin", data: { latitude: event.latitude, longitude: event.longitude }
      %br
    .col-sm-12.col-md-6
      - @events.each do |event|
        .event
          %h2
            = link_to event.organiser, event
            - if event.current_user_is_owner(current_user)
              %small= link_to "edit", edit_event_path(event)
          %h3
            %small
              = event.location
              \/ #{event.formatted_date}


.row
  .col-md-12{:style => 'height:200px;overflow-y:auto;'}
    = render :partial => 'funding_requests_table', :locals => {:ali => @activity_line_item, :popup => true}

.row
  .col-md-12
    %fieldset
      %legend Add Funding Request
      = simple_form_for([@project, @activity_line_item, FundingRequest.new],
          :wrapper => :vertical_form,
          :wrapper_mappings => {:check_boxes => :vertical_radio_and_checkboxes, :radio_buttons => :vertical_radio_and_checkboxes, :file => :vertical_file_input, :boolean => :vertical_boolean}) do |f|
        = f.input :funding_amount_id, :collection => @available_funds, :label => 'Fund', :label_method => 'name', :required => true
        = f.input :amount, :required => true, :number => true, :range => [1000, 1000000]
        = f.submit "Add Funding Request", :class => 'btn btn-primary'

Add conditional logic to help user determine if they can add funding requests to an ALI

.row
  .col-md-12{:style => 'height:200px;overflow-y:auto;'}
    = render :partial => 'funding_requests_table', :locals => {:ali => @activity_line_item, :popup => true}

.row
  .col-md-12
    %fieldset
      %legend Add Funding Request
      - if @activity_line_item.anticipated_cost == 0
        %p
          There are no costs associated with this ALI. Click "#{link_to('Here', edit_cost_capital_project_activity_line_item_path(@project, @activity_line_item))}" to set the expected cost of this ALI.
      - elsif @activity_line_item.difference <= 0
        %p
          This ALI is fully funded. No more funding requests can be added.
      - elsif get_remaining_budget(@project.organization, @activity_line_item.fy_year) < 1
        %p
          The budget for "#{@activity_line_item.fiscal_year}" has been exceeded. No more funding requests can be added for this fiscal year.
      -else
        = simple_form_for([@project, @activity_line_item, FundingRequest.new],
            :wrapper => :vertical_form,
            :wrapper_mappings => {:check_boxes => :vertical_radio_and_checkboxes, :radio_buttons => :vertical_radio_and_checkboxes, :file => :vertical_file_input, :boolean => :vertical_boolean}) do |f|
          = f.input :funding_amount_id, :collection => @available_funds, :label => 'Fund', :label_method => 'name', :required => true
          = f.input :amount, :required => true, :number => true, :range => [1000, 1000000]
          = f.submit "Add Funding Request", :class => 'btn btn-primary'


= form.label :name
= form.text_field :name

Add new Item fields to its form

= form.label :name
= form.text_field :name

= form.label :wow_id, "WoW ID"
= form.text_field :wow_id, :class => 'small'

= form.label :color
= form.text_field :color, :class => 'small'

= form.label :icon
= form.text_field :icon

= form.label :slot
= form.text_field :slot

= form.label :level
= form.text_field :level, :class => 'small'


.content_wrapper
  %p
    Draw! is an online pixel art editor that lets you draw little 16x16 animations using only 16 colors.
  %p
    Follow updates
    %a{:href => "http://twitter.com/drawbang"} @drawbang
    and read the blog at
    = succeed '.' do
      %a{:href => "http://blog.drawbang.com"} http://blog.drawbang.com
  %p
    This app makes use of
    = succeed '.' do
      %a{:href => "http://github.com/potomak/jquery-pixel"} Pixel library
    %br
    It's released under the MIT license and you can fork it at
    = succeed '.' do
      %a{:href => "http://github.com/potomak/drawbang"} http://github.com/potomak/drawbang

  %h3 Credits
  %p
    Programming:
    %a{:href => "http://twitter.com/johnnyaboh"} Giovanni Cappellotto
    %br
    Design:
    %a{:href => "http://twitter.com/pinakes"} Francesco Fraioli
  %h4 Old contributors
  %p
    Design:
    %a{:href => "http://twitter.com/amphigoryglory"} Ashley Farrand

  %h3 Info about app
  %p
    Version: #{DRAW_VERSION}
  %p
    %a{:href => "/privacy"} Privacy Policy
    %br
    %a{:href => "/tos"} Terms of Service

Add link to Q&A page

.content_wrapper
  %p
    Draw! is an online pixel art editor that lets you draw little 16x16 animations using only 16 colors.
  %p
    Follow updates
    %a{:href => "http://twitter.com/drawbang"} @drawbang
    and read the blog at
    = succeed '.' do
      %a{:href => "http://blog.drawbang.com"} http://blog.drawbang.com

  %p
    Feel free to ask any question at
    %a{:href => "http://drawbang.com/faq"}

  %p
    This app makes use of
    = succeed '.' do
      %a{:href => "http://github.com/potomak/jquery-pixel"} Pixel library
    %br
    It's released under the MIT license and you can fork it at
    = succeed '.' do
      %a{:href => "http://github.com/potomak/drawbang"} http://github.com/potomak/drawbang

  %h3 Credits
  %p
    Programming:
    %a{:href => "http://twitter.com/johnnyaboh"} Giovanni Cappellotto
    %br
    Design:
    %a{:href => "http://twitter.com/pinakes"} Francesco Fraioli
  %h4 Old contributors
  %p
    Design:
    %a{:href => "http://twitter.com/amphigoryglory"} Ashley Farrand

  %h3 Info about app
  %p
    Version: #{DRAW_VERSION}
  %p
    %a{:href => "/privacy"} Privacy Policy
    %br
    %a{:href => "/tos"} Terms of Service


-# See config/browser.rb
- if !browser.modern?
  #outdated-browser-banner
    .container
      Attention, votre navigateur (#{browser.name} #{browser.version}) est trop ancien pour utiliser demarches-simplifiees.fr : certaines parties du site ne fonctionneront pas correctement. Nous vous recommendons fortement de
      %a{ href: "https://browser-update.org/fr/update.html", target: "_blank" }mettre à jour votre navigateur
      %span<>
        \.

Use a proper HAML comment

/ See config/browser.rb
- if !browser.modern?
  #outdated-browser-banner
    .container
      Attention, votre navigateur (#{browser.name} #{browser.version}) est trop ancien pour utiliser demarches-simplifiees.fr : certaines parties du site ne fonctionneront pas correctement. Nous vous recommendons fortement de
      %a{ href: "https://browser-update.org/fr/update.html", target: "_blank" }mettre à jour votre navigateur
      %span<>
        \.


%h4="Edit #{@project_id}"
.content
  %form{action: @post_target, method: "post"}
    %input{type:"hidden", name:"id", value:@project[:id]}
    %label{:for => "name"} Name
    %input{type:"text", name:"name", value:@project[:name]}
    %label Indentifier
    %input{type:"text", name:"identifier", disabled:@disable_identifier, value:@project[:identifier]}
    %label Description
    %textarea.span8{name:"description"}=@project[:description]
    %label Tab Configuration
    %input{type:"text", name:"tab_spec", value:@project[:tab_spec]}
    .row
      %a.btn{href: "/projects"}="Cancel"
      %input.btn.btn-primary{type: "submit", value:"Save"}

Increase the size of the tab_spec field

%h4="Edit #{@project_id}"
.content
  %form{action: @post_target, method: "post"}
    %input{type:"hidden", name:"id", value:@project[:id]}
    %label{:for => "name"} Name
    %input{type:"text", name:"name", value:@project[:name]}
    %label Indentifier
    %input{type:"text", name:"identifier", disabled:@disable_identifier, value:@project[:identifier]}
    %label Description
    %textarea.span8{name:"description"}=@project[:description]
    %label Tab Configuration
    %input.span8{type:"text", name:"tab_spec", value:@project[:tab_spec]}
    .row
      %a.btn{href: "/projects"}="Cancel"
      %input.btn.btn-primary{type: "submit", value:"Save"}


= simple_nested_form_for(@task) do |f|
  = f.error_notification
  %fieldset
    %legend= content_for?(:title) ? yield(:title) : "Untitled"
    .form_inputs
      = f.association :user
      = f.association :client
      = f.input :name
      = f.input :description
      = f.input :notes
      = f.input :due_date, as: :string, input_html: { type: 'date' }
      = f.input :rate
      %fieldset
        %legend Work Log
        = f.simple_fields_for :work_logs do |wl_form|
          %h4 Entry
          = wl_form.input :_destroy, as: :boolean, label: "Delete this item?" unless wl_form.object.id.nil?
          = wl_form.input :start_date, as: :string, input_html: { type: "date" }
          = wl_form.input :start_time, as: :string, input_html: { type: "time" }
          = wl_form.input :end_date, as: :string, input_html: { type: "date" }
          = wl_form.input :end_time, as: :string, input_html: { type: "time" }
          = wl_form.link_to_remove "Remove this Work Log"
          %hr/
        = f.link_to_add "Add Work Log", :work_logs
    .form-actions
      = f.button :submit

Add Complexity Field to Task Forms

= simple_nested_form_for(@task) do |f|
  = f.error_notification
  %fieldset
    %legend= content_for?(:title) ? yield(:title) : "Untitled"
    .form_inputs
      = f.association :user
      = f.association :client
      = f.input :name
      = f.input :complexity, collection: Hash["Not Estimated" => 0, Easy: 1, Medium: 3, Hard: 5]
      = f.input :description
      = f.input :notes
      = f.input :due_date, as: :string, input_html: { type: 'date' }
      = f.input :rate
      %fieldset
        %legend Work Log
        = f.simple_fields_for :work_logs do |wl_form|
          %h4 Entry
          = wl_form.input :_destroy, as: :boolean, label: "Delete this item?" unless wl_form.object.id.nil?
          = wl_form.input :start_date, as: :string, input_html: { type: "date" }
          = wl_form.input :start_time, as: :string, input_html: { type: "time" }
          = wl_form.input :end_date, as: :string, input_html: { type: "date" }
          = wl_form.input :end_time, as: :string, input_html: { type: "time" }
          = wl_form.link_to_remove "Remove this Work Log"
          %hr/
        = f.link_to_add "Add Work Log", :work_logs
    .form-actions
      = f.button :submit


- clazz = teacher_clazz.clazz

%li
  %div.class_list_element
    %table
      %tr
        %td.class_list_element_container
          %table{:cellpadding => "0", :cellspacing => "0", :border => "0"}
            %tr
              %td{:style=>"width:50px;"}
                %input{:type => "checkbox", :id => "teacher_clazz[#{teacher_clazz.id}]", :name => "teacher_clazz[]", :value => teacher_clazz.id, :checked => active_selected}
                %input{:type => "hidden", :id => "teacher_clazz_position[#{teacher_clazz.id}]", :name => "teacher_clazz_position[]", :value => teacher_clazz.id}
              %td{:style=>"width:350px;"}
                %label{:for => "teacher_clazz[#{teacher_clazz.id}]"} #{clazz.name}
              %td
                %a{ :id => "message",:href => "javascript:void(0)", :onclick => "showCopyClassPopup(#{clazz.id}, \"#{url_encode clazz.name}\", \"#{url_encode clazz.class_word}\", \"#{url_encode teacher_clazz.clazz.description}\")" } Copy Class

Fix for long length of class names.

- clazz = teacher_clazz.clazz

%li
  %div.class_list_element
    %table
      %tr
        %td.class_list_element_container
          %table{:cellpadding => "0", :cellspacing => "0", :border => "0"}
            %tr
              %td{:style=>"width:50px;"}
                %input{:type => "checkbox", :id => "teacher_clazz[#{teacher_clazz.id}]", :name => "teacher_clazz[]", :value => teacher_clazz.id, :checked => active_selected}
                %input{:type => "hidden", :id => "teacher_clazz_position[#{teacher_clazz.id}]", :name => "teacher_clazz_position[]", :value => teacher_clazz.id}
              %td{:style=>"width:350px;"}
                - clazz_name = (clazz.name.length > 20)? clazz.name[0,20]+"..." : clazz.name
                %label{:for => "teacher_clazz[#{teacher_clazz.id}]", :title=> clazz.name} #{clazz_name}
              %td
                %a{ :id => "message",:href => "javascript:void(0)", :onclick => "showCopyClassPopup(#{clazz.id}, \"#{url_encode clazz.name}\", \"#{url_encode clazz.class_word}\", \"#{url_encode teacher_clazz.clazz.description}\")" } Copy Class


.page-header
  %h1 Recent emails
= paginated_section @emails do
  %ul.nav.nav-pills
    %li{class: ("active" if @delivered.nil?)}
      = link_to "All", emails_path
    %li{class: ("active" if @delivered == true)}
      = link_to "Delivered", emails_path(:delivered => true)
    %li{class: ("active" if @delivered == false)}
      = link_to "Not delivered", emails_path(:delivered => false)

  %table.table.table-striped
    %thead
      %tr
        %th To
        %th Received
    %tbody(data-provides="rowlink")
      - @emails.each do |email|
        %tr{class: delivered_class(email)}
          %td= link_to truncate(email.to_as_string, length: 50), email_path(email), :class => "rowlink"
          %td
            = time_ago_in_words(email.created_at)
            ago

Change table heading to be consistent

.page-header
  %h1 Recent emails
= paginated_section @emails do
  %ul.nav.nav-pills
    %li{class: ("active" if @delivered.nil?)}
      = link_to "All", emails_path
    %li{class: ("active" if @delivered == true)}
      = link_to "Delivered", emails_path(:delivered => true)
    %li{class: ("active" if @delivered == false)}
      = link_to "Not delivered", emails_path(:delivered => false)

  %table.table.table-striped
    %thead
      %tr
        %th To
        %th Created
    %tbody(data-provides="rowlink")
      - @emails.each do |email|
        %tr{class: delivered_class(email)}
          %td= link_to truncate(email.to_as_string, length: 50), email_path(email), :class => "rowlink"
          %td
            = time_ago_in_words(email.created_at)
            ago


.row
  .span4
    %a{:href => hero.html_url, :title => hero.name}
      = image_tag(hero.avatar_url, :alt => hero.login, :class => 'hero-shot')
  .span12
    %h1= hero.login
    .language.rank-block
      %span.descriptor= link_to(hero.location, "https://github.com/search?type=Users&language=&q=location%3A#{hero.location.gsub(/\s/, '%2B')}&repo=&langOverride=&x=0&y=0&start_value=1", :target => '_blank')

.row
  .span16.bio
    - if hero.bio.present? && hero.bio.to_s != 'null'
      %p= hero.bio.html_safe
    %p= hero.auto_bio.html_safe

.row
  .span16.vote
    - unless current_hero.present?
      %a{:href => '/heroes/auth/github', :class => 'btn success large primary popup', 'data-height' => '400', 'data-width' => '600'}
        Login with GitHub to Vote!
    - else
      = render :partial => 'vote_buttons', :locals => { :hero => @hero }

Check if location is present

.row
  .span4
    %a{:href => hero.html_url, :title => hero.name}
      = image_tag(hero.avatar_url, :alt => hero.login, :class => 'hero-shot')
  .span12
    %h1= hero.login
    .language.rank-block
      - if hero.location.present?
        %span.descriptor= link_to(hero.location, "https://github.com/search?type=Users&language=&q=location%3A#{hero.location.gsub(/\s/, '%2B')}&repo=&langOverride=&x=0&y=0&start_value=1", :target => '_blank')

.row
  .span16.bio
    - if hero.bio.present? && hero.bio.to_s != 'null'
      %p= hero.bio.html_safe
    %p= hero.auto_bio.html_safe

.row
  .span16.vote
    - unless current_hero.present?
      %a{:href => '/heroes/auth/github', :class => 'btn success large primary popup', 'data-height' => '400', 'data-width' => '600'}
        Login with GitHub to Vote!
    - else
      = render :partial => 'vote_buttons', :locals => { :hero => @hero }


!!! 5
%html
	%head
		%meta{:charset => "utf-8"}
		%title= "Stumpwise | Simply Powerful Campaigns"
		=stylesheet_link_tag 'marketing.css'
		=javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'
		=javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js'
		=javascript_include_tag 'jrails.js'
		=yield :head
	=yield

Clear out partial encryption errors.

!!! 5
%html
	%head
		%meta{:charset => "utf-8"}
		%title= "Stumpwise | Simply Powerful Campaigns"
		=stylesheet_link_tag 'marketing.css'
		=yield :head
	=yield


- content_for(:subject_title, subject_title)

%h1= subject_title

%ol.video-list{ start: pages.values.first.metadata.number }
  - pages.each do |page, page_data|
    %li
      = link_to "/#{subject_url}/#{page_data.metadata.url}" do
        = image_tag "http://img.youtube.com/vi/#{page_data.video_url}/0.jpg", {alt: "#{page_data.metadata.page_title} video thumbnail" }
        %small.nice-number= page_data.metadata.number
        %strong= page_data.metadata.page_title

Make video number optional in subject pages

- content_for(:subject_title, subject_title)

%h1= subject_title

%ol.video-list{ start: pages.values.first.metadata.number }
  - pages.each do |page, page_data|
    %li
      = link_to "/#{subject_url}/#{page_data.metadata.url}" do
        = image_tag "http://img.youtube.com/vi/#{page_data.video_url}/0.jpg", {alt: "#{page_data.metadata.page_title} video thumbnail" }
        - if page_data.metadata.number
          %small.nice-number= page_data.metadata.number
        %strong= page_data.metadata.page_title


- sub_header('Categories')
- ancestor_category_links(@product_category)
- sub_header(@product_category.name)

- filter_nav(:product_category, 'All')
- filter_nav(:product_category, 'Published', 'published')
- filter_nav(:product_category, 'Unpublished', 'unpublished')

- sort_nav(:product_category, 'Name')
- sort_nav(:product_category, 'Created', 'created_at')
- sort_nav(:product_category, 'Updated', 'updated_at')

= form_tag(path(:position, :products), :method => :put) do
  = content do
    = render :partial => 'islay_shop/admin/products/table'

  = footer do

    .default-controls
      = new_button('Product', :product, :to => @product_category)
      = edit_button(@product_category)
      = delete_button(@product_category)

    .selection-controls
      = position_buttons

Add a link to the categories breadcrumb

- sub_header(link_to('Catalogue', path(:product_categories)))
- ancestor_category_links(@product_category)
- sub_header(@product_category.name)

- filter_nav(:product_category, 'All')
- filter_nav(:product_category, 'Published', 'published')
- filter_nav(:product_category, 'Unpublished', 'unpublished')

- sort_nav(:product_category, 'Name')
- sort_nav(:product_category, 'Created', 'created_at')
- sort_nav(:product_category, 'Updated', 'updated_at')

= form_tag(path(:position, :products), :method => :put) do
  = content do
    = render :partial => 'islay_shop/admin/products/table'

  = footer do

    .default-controls
      = new_button('Product', :product, :to => @product_category)
      = edit_button(@product_category)
      = delete_button(@product_category)

    .selection-controls
      = position_buttons


= f.field_container :primary_taxon_id do
  = f.label :primary_taxon_id, t(:product_category)
  %br
  = f.collection_select(:primary_taxon_id, Spree::Taxon.all, :id, :name, {:include_blank => true}, {:class => "select2 fullwidth"})
  = f.error_message_on :primary_taxon_id

Add asterix to product category on new product form

= f.field_container :primary_taxon_id do
  = f.label :primary_taxon_id, t(:product_category)
  *
  %br
  = f.collection_select(:primary_taxon_id, Spree::Taxon.all, :id, :name, {:include_blank => true}, {:class => "select2 fullwidth"})
  = f.error_message_on :primary_taxon_id


%li.nav-link= link_to "Overview", overview_smart_path(current_page.path),
  class: "scroll-on-page-link"
%li.nav-link= link_to "The Lessons", "/lessons"
%li.nav-link= link_to "Training", "/training"
%li.nav-link= link_to "Purchase", "/purchase"

Add Downloads link to nav header.

%li.nav-link= link_to "Overview", overview_smart_path(current_page.path),
  class: "scroll-on-page-link"
%li.nav-link= link_to "The Lessons", "/lessons"
%li.nav-link= link_to "Training", "/training"
%li.nav-link= link_to "Downloads", "/downloads"
%li.nav-link= link_to "Purchase", "/purchase"


!!! 5
%html
  %head
    %title= App::NAME
    %meta(charset='utf-8')
  %body
    #header
      %h1= App::NAME

    #footer
      %address
        = App::NAME
        @@VERSION@@
        —
        Copyright © 2011
        %a(href='http://whileimautomaton.net/') Kana Natsuno
        (
        %a(href='http://twitter.com/kana1')> @kana1
        )
        —
        %a(href='#{App::GITHUB_REPOS_URI}')
        Watch changes
        —
        %a(href='#{App::GITHUB_REPOS_URI}/issues')
        Report issues

-# __END__

Add example links in the home page

!!! 5
%html
  %head
    %title= App::NAME
    %meta(charset='utf-8')
  %body
    #header
      %h1= App::NAME

    #content
      %h2 Examples
      %ul
        %li
          %a(href='/github/kana/vim-arpeggio/master/doc/arpeggio.txt.html')
            kana/vim-arpeggio/master/doc/arpeggio.txt
        %li
          %a(href='/github/kana/vim-textobj-user/master/doc/textobj-user.txt.html')
            kana/vim-textobj-user/master/doc/textobj-user.txt
        %li
          \...

    #footer
      %address
        = App::NAME
        @@VERSION@@
        —
        Copyright © 2011
        %a(href='http://whileimautomaton.net/') Kana Natsuno
        (
        %a(href='http://twitter.com/kana1')> @kana1
        )
        —
        %a(href='#{App::GITHUB_REPOS_URI}')
        Watch changes
        —
        %a(href='#{App::GITHUB_REPOS_URI}/issues')
        Report issues

-# __END__