p Olá #{@notification.user.name},

p
  | Sua conta na Juntos.com.vc já está desativada. Caso sinta saudades, você pode reativar a sua conta a qualquer momento, basta #{link_to('clicar aqui', reactivate_user_url(@notification.user, token: @notification.user.reactivate_token))} e voltar a apoiar ou realizar projetos incríveis.

p
  | Qualquer dúvida você pode entrar em contato conosco respondendo a esta mensagem ou através do e-mail #{mail_to CatarseSettings[:email_contact]}

p Um abraço,
p Juntos.com.vc

Update `user deactivate` email template

p Olá #{@notification.user.name},

p
  | Sua conta na Juntos.com.vc já está desativada. Caso queira, você pode reativar a sua conta a qualquer momento, basta #{link_to('clicar aqui', reactivate_user_url(@notification.user, token: @notification.user.reactivate_token))} e voltar a apoiar ou realizar projetos em nossa plataforma.

p
  | Qualquer dúvida você pode entrar em contato conosco respondendo a esta mensagem ou através do e-mail #{mail_to CatarseSettings[:email_contact]}

p
 | Um abraço,
 br
 | Equipe #{CatarseSettings[:company_name]}


h4= @dataset.area

.attributes
  .static.tab
    h5 Static

    .non-editable
      strong.key Base dataset
      span.val= @dataset.atlas_dataset.base_dataset

    .non-editable
      strong.key Analysis year
      span.val= @dataset.atlas_dataset.analysis_year

  .area.tab
    h5 Area attributes

    - @dataset.editable_attributes.each do |attribute|
      = render 'editable', key: attribute.name, value: dataset_value_for(attribute.name)

  .initializer-inputs.tab
    h5 Inputs

    - @dataset.atlas_dataset.init.each_pair do |key, value|
      = render 'editable', key: key, value: value

.actions
  = link_to "Home", datasets_path, class: "button"

Make the dataset title a bit more readable

h4= @dataset.area.humanize

.attributes
  .static.tab
    h5 Static

    .non-editable
      strong.key Base dataset
      span.val= @dataset.atlas_dataset.base_dataset

    .non-editable
      strong.key Analysis year
      span.val= @dataset.atlas_dataset.analysis_year

  .area.tab
    h5 Area attributes

    - @dataset.editable_attributes.each do |attribute|
      = render 'editable', key: attribute.name, value: dataset_value_for(attribute.name)

  .initializer-inputs.tab
    h5 Inputs

    - @dataset.atlas_dataset.init.each_pair do |key, value|
      = render 'editable', key: key, value: value

.actions
  = link_to "Home", datasets_path, class: "button"


h1 Problems

- for prob in @problems do
  .row.problem
    .col-lg-1
      a href="#{new_solution_path(pname: prob.unique_name)}"
        i.glyphicon.glyphicon-plus
      a href="#{edit_problem_path(prob)}"
        i.glyphicon.glyphicon-edit
    .col-lg-1
      span =prob.unique_name
    .col-lg-3
      a.ptitle href="#{prob.link? ? prob.description : problem_path(prob)}"
        =prob.title
      - prob.tags.each do |tag|
        .ui.horizontal.label.ptag class="#{tag_color(tag.name)}" #{tag.name}
    .col-lg-7
      - for sol in prob.solutions do
        == link_to "solution", solution_path(sol)

h2
  == link_to "New Problem", new_problem_path

css:
  .problem:nth-child(even) {
    background-color: #EEE;
  }
  .ptitle {
    margin-right: 1em;
  }
  .ptag.ui.horizontal.label {
    padding: 0.1em 0.5em;
  }

Add table to problem views

h1 Problems

a href="#{new_problem_path}"
  .ui.button
    | New Problem

table.ui.celled.striped.table
  thead
    tr
      th
      th
      th
        | unique name
      th
        | problem link
      th
        | solution link
  tbody
  - for prob in @problems do
    tr
      td.collapsing
        a href="#{new_solution_path(pname: prob.unique_name)}"
          i.glyphicon.glyphicon-plus
      td.collapsing
        a href="#{edit_problem_path(prob)}"
          i.glyphicon.glyphicon-edit
      td
        span =prob.unique_name
      td
        a.ptitle href="#{prob.link? ? prob.description : problem_path(prob)}"
          i.linkify.icon
          =prob.title
        - prob.tags.each do |tag|
          .ui.horizontal.label.ptag class="#{tag_color(tag.name)}" #{tag.name}
      td
        - for sol in prob.solutions do
          == link_to "solution", solution_path(sol)

css:
  .problem:nth-child(even) {
    background-color: #EEE;
  }
  .ptitle {
    margin-right: 1em;
  }
  .ptag.ui.horizontal.label {
    padding: 0.1em 0.5em;
  }


- state = FormAnswerStateTransition.new
- state.form_answer = resource
- state.subject = current_subject

.well.section-applicant-status
  / This is where you change the application status
  h2
    ' Status
    small= resource.last_state_updated_by

  .btn-group
    button.btn.btn-link.dropdown-toggle.state-toggle type="button" data-toggle="dropdown" aria-expanded="false"
      = @form_answer.progress_text_short
      span.caret
    ul.dropdown-menu role="menu"
      - state.collection.each do |state|
        li.checkbox role="presentation"
          = link_to state.to_s.humanize, "#"
    = simple_form_for([namespace_name, resource, state]) do |f|
      = f.input :state,
                as: :select,
                include_blank: false,
                label: false,
                collection: state.collection
      = f.submit :update_state

Disable the global states select for Primary/Secondary

- state = FormAnswerStateTransition.new
- state.form_answer = resource
- state.subject = current_subject

.well.section-applicant-status
  / This is where you change the application status
  h2
    ' Status
    small= resource.last_state_updated_by

  - if policy(:form_answer_state_transition).create?
    .btn-group
      button.btn.btn-link.dropdown-toggle.state-toggle type="button" data-toggle="dropdown" aria-expanded="false"
        = @form_answer.state.humanize
      span.caret
      ul.dropdown-menu role="menu"
        - state.collection.each do |state|
          li.checkbox role="presentation"
            = link_to state.to_s.humanize, "#"
      = simple_form_for([namespace_name, resource, state], html: { class: "if-js-hide" }) do |f|
        = f.input :state,
                  as: :select,
                  include_blank: false,
                  label: false,
                  collection: state.collection
        = f.submit :update_state
  - else

    .btn-group style= "font-size: 20px;"
      = @form_answer.state.humanize


table.mdm.prescriptions
  thead
    tr
      th.col-width-medium= t(".drug_name")
      th.col-width-small= t(".drug_type")
      th.col-width-small= t(".dose")
      th.col-width-tiny= t(".frequency")
      th.col-width-tiny= t(".route")
      - if local_assigns[:show_administer_on_hd]
        th.col-width-small= t(".administer_on_hd")
      th.col-width-tiny=t(".provider")
      th.col-width-date= t(".started_on")
      - if local_assigns[:show_terminated_on]
        th.col-width-date= t(".terminated_on")
  tbody
    - prescriptions.each do |prescription|
      tr class="drug-#{drug_types_colour_tag(prescription.drug_types)}"
        td= prescription.drug.name
        td= prescription.drug_type_names
        td= prescription.dose
        td= prescription.frequency
        td= prescription.route_code
        - if local_assigns[:show_administer_on_hd]
          td= prescription.administer_on_hd?
        td= prescription.provider
        td= I18n.l prescription.prescribed_on
        - if local_assigns[:show_terminated_on]
          td= l(prescription.terminated_on)

Hide drug type in MDM prescription listings

table.mdm.prescriptions
  thead
    tr
      th.col-width-medium= t(".drug_name")
      - if local_assigns[:show_drug_types]
        th.col-width-small= t(".drug_type")
      th.col-width-small= t(".dose")
      th.col-width-tiny= t(".frequency")
      th.col-width-tiny= t(".route")
      - if local_assigns[:show_administer_on_hd]
        th.col-width-small= t(".administer_on_hd")
      th.col-width-tiny=t(".provider")
      th.col-width-date= t(".started_on")
      - if local_assigns[:show_terminated_on]
        th.col-width-date= t(".terminated_on")
  tbody
    - prescriptions.each do |prescription|
      tr class="drug-#{drug_types_colour_tag(prescription.drug_types)}"
        td= prescription.drug.name
        - if local_assigns[:show_drug_types]
          td= prescription.drug_type_names
        td= prescription.dose
        td= prescription.frequency
        td= prescription.route_code
        - if local_assigns[:show_administer_on_hd]
          td= prescription.administer_on_hd?
        td= prescription.provider
        td= I18n.l prescription.prescribed_on
        - if local_assigns[:show_terminated_on]
          td= l(prescription.terminated_on)


= render :partial => 'spree/admin/shared/product_sub_menu'
= render :partial => 'spree/admin/shared/product_tabs', :locals => {:current => "Product Sale Prices"}

= csrf_meta_tag

#add-line-item
  fieldset
    legend align="center" = Spree.t('add_product_sale_prices')

    = form_for [:admin, @product, Spree::SalePrice.new], remote: true do |f|
      .row
        .columns.three
          = label_tag t('original_price')
          = text_field_tag '', @product.original_price.to_f, disabled: true

      .row
        .columns.three
          = f.label :value, t('sale_price_amount')
          = f.text_field :value
        .columns.three
          = f.label :currency, t('sale_price_currency')
          = f.select :currency, options_for_select(supported_currencies_for_sale_price)

      .row
        .columns.three
          = f.label :start_at, t('sale_price_start_at')
          = f.text_field :start_at, class: "datepicker"
        .columns.three
          = f.label :end_at, t('sale_price_end_at')
          = f.text_field :end_at, class: "datepicker"
        .columns.three
          = f.label :submit, style: 'visibility: hidden;'
          = f.submit "Add Sale Price"

#product-sale-prices-table
  = render partial: "table", locals: { product: @product }

Remove sub menu for sales price index view


doctype html
html lang="en"
  head
    meta charset="utf-8"
    meta name="viewport" content="width=device-width, initial-scale=1.0"
    title = site_name
    = stylesheet_link_tag "application"
    link rel="icon" type="image/x-icon" href=image_url("favicon.png")

  body
    #container
      #content
        .welcome-row
          .welcome
            .welcome-content
              - flash.each do |type, message|
                .alert class=bootstrap_class_for(type) role="alert"
                  = message
              h1 Welcome
              - if ENV['GOOGLE_HOME_DOMAIN']
                p You need to login with a #{ENV['GOOGLE_HOME_DOMAIN']} account to continue.
              - else
                p You need to login to continue.
              p
                a.btn.btn-primary href="/auth/google" Login with Google

    footer.footer
      .container
        ul
          li
            a href="https://github.com/csexton/corporate-tool"
              = image_tag 'logo.png', class: 'logo', style: "max-height: 20px;"

Add a minor change to test automatic deploys

doctype html
html lang="en"
  head
    meta charset="utf-8"
    meta name="viewport" content="width=device-width, initial-scale=1.0"
    title = site_name
    = stylesheet_link_tag "application"
    link rel="icon" type="image/x-icon" href=image_url("favicon.png")

  body
    #container
      #content
        .welcome-row
          .welcome
            .welcome-content
              - flash.each do |type, message|
                .alert class=bootstrap_class_for(type) role="alert"
                  = message
              h1 Welcome!
              - if ENV['GOOGLE_HOME_DOMAIN']
                p You need to login with a #{ENV['GOOGLE_HOME_DOMAIN']} account to continue.
              - else
                p You need to login to continue.
              p
                a.btn.btn-primary href="/auth/google" Login with Google

    footer.footer
      .container
        ul
          li
            a href="https://github.com/csexton/corporate-tool"
              = image_tag 'logo.png', class: 'logo', style: "max-height: 20px;"


.container
  = link_to '/admin/auth/github', class: 'btn btn-primary' do
    i.glyphicon.glyphicon-log-in
    |  Iniciar sesión con GitHub.

Remove container wrapper for login button


- update = Update.find @notification.update_id
br
br
|Check it out - #{update.user.display_name} just posted an update to #{update.project.name} on #{Configuration[:company_name]}!
br
br
| View the update #{link_to "here", project_by_slug_path(update.project.permalink, anchor: "updates")}, and help spread the word!
br
br
hr
br
h2 #{link_to update.title, project_by_slug_url(update.project.permalink, anchor: "updates")}
= update.comment_html
br
br
hr
br
| Keep on truckin',
br
|The #{Configuration[:company_name]} Team

Change text message on updates notification

- update = Update.find @notification.update_id
br
br
|Howdy, #{@notification.user.display_name}, an update was just posted to #{update.project.name} on #{Configuration[:company_name]}!
br
br
| View the update #{link_to "here", project_by_slug_path(update.project.permalink, anchor: "updates")}, and help spread the word!
br
br
hr
br
h2 #{link_to update.title, project_by_slug_url(update.project.permalink, anchor: "updates")}
= update.comment_html
br
br
hr
br
| Keep on truckin',
br
|The #{Configuration[:company_name]} Team


= content_for(:actions) do
  = link_to(patient_pd_peritonitis_episode_path(patient, peritonitis_episode, format: :pdf),
            class: "button") do
    i.fas.fa-print
    |  Print

- title = "Peritonitis Episode - Diagnosed: #{l(peritonitis_episode.diagnosis_date)}"

= within_patient_layout(title: title,
                        breadcrumbs: pd_summary_breadcrumb(patient),
                        **local_assigns) do

  = render "details",
           patient: patient,
           peritonitis_episode: peritonitis_episode

  = article_tag "Organisms/Sensitivity" do

    = render "renalware/pd/infection_organisms/index",
             infectable: peritonitis_episode,
             infection_organisms: peritonitis_episode.infection_organisms

  = article_tag "Antibiotics/Routes" do

    = render "renalware/medications/prescriptions/index",
             patient: patient,
             treatable: treatable,
             current_search: nil,
             current_prescriptions: prescriptions

Remove peritonitis episode print button

/ Removing Print button for now
/ = content_for(:actions) do
/   = link_to(patient_pd_peritonitis_episode_path(patient, peritonitis_episode, format: :pdf),
/             class: "button") do
/     i.fas.fa-print
/     |  Print

- title = "Peritonitis Episode - Diagnosed: #{l(peritonitis_episode.diagnosis_date)}"

= within_patient_layout(title: title,
                        breadcrumbs: pd_summary_breadcrumb(patient),
                        **local_assigns) do

  = render "details",
           patient: patient,
           peritonitis_episode: peritonitis_episode

  = article_tag "Organisms/Sensitivity" do

    = render "renalware/pd/infection_organisms/index",
             infectable: peritonitis_episode,
             infection_organisms: peritonitis_episode.infection_organisms

  = article_tag "Antibiotics/Routes" do

    = render "renalware/medications/prescriptions/index",
             patient: patient,
             treatable: treatable,
             current_search: nil,
             current_prescriptions: prescriptions


div#ideasCarousel.carousel.slide data-ride="carousel"
  ol.carousel-indicators
    - @ideas.each_with_index do |idea, index|
      li data-target="#ideasCarousel" data-slide-to="#{index}" class=('active' if index == 0)
  div.carousel-inner
    - @ideas.each_with_index do |idea, index|
      div.item class=('active' if index == 0)
        img data-src="holder.js/900x500/auto/#777:#7a7a7a/text:First slide"
        div.container
          div.carousel-caption
            h1= idea.title
            p= truncate(strip_tags(idea.description), length: 70)
            p
              =link_to idea, class: "btn btn-lg btn-primary", role: "button"
                ="Learn more"
  a.left.carousel-control href="#ideasCarousel" data-slide="prev"
    span.glyphicon.glyphicon-chevron-left
  a.right.carousel-control href="#ideasCarousel" data-slide="next"
    span.glyphicon.glyphicon-chevron-right

Add image backgroup for idea slides

div#ideasCarousel.carousel.slide data-ride="carousel"
  ol.carousel-indicators
    - @ideas.each_with_index do |idea, index|
      li data-target="#ideasCarousel" data-slide-to="#{index}" class=('active' if index == 0)
  div.carousel-inner
    - @ideas.each_with_index do |idea, index|
      div.item class=('active' if index == 0)
        img src="http://ideaegg-me.qiniudn.com/slide#{index+1}.jpg"
        div.container
          div.carousel-caption
            h1= idea.title
            p= truncate(strip_tags(idea.description), length: 70)
            p
              =link_to idea, class: "btn btn-lg btn-primary", role: "button"
                ="Learn more"
  a.left.carousel-control href="#ideasCarousel" data-slide="prev"
    span.glyphicon.glyphicon-chevron-left
  a.right.carousel-control href="#ideasCarousel" data-slide="next"
    span.glyphicon.glyphicon-chevron-right


.container
  .row
    .col-md-12
      h1 Invalid login link

      br

      p Your login link is either invalid or has expired.

      p
        ' Login links are valid for 15 minutes. If you think this may be the case then
        a href=new_login_path request a new login link
        | .

      p If you're copy-pasting the link check if the link hasn't been corrupted by your email client's message formatting.

Make login error message more clear

.container
  .row
    .col-md-12
      h1 Invalid login link

      br

      p Your login link is either invalid or has expired.

      p
        ' Login links are valid for 15 minutes. If you think yours might have expired then
        a href=new_login_path request a new login link
        | .

      p If you're copy-pasting the link check if the link hasn't been corrupted by your email client's message formatting.


- filters = locals[:filters] || ["sepia-40", "vignette-90"]
.intro-header.chapter-divider.snap[style="background-image: url('#{post_image_path image}')" class="#{Array(filters).join(" ")}"]
  .row
    .col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1
      .chapter
        = yield

Make divider narrow for panorama images.

- filters = locals[:filters] || ["sepia-40", "vignette-90"]
- tall = locals[:panorama] ? "" : 'chapter-divider-tall'
.intro-header.chapter-divider.snap[style="background-image: url('#{post_image_path image}')" class="#{Array(filters).join(" ")} " class="#{tall}"]
  .row
    .col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1
      .chapter
        = yield


.col-sm-3.col-md-3.hidden-xs
  form.navbar-form(name="SearchForm" role="search" ng-submit="doSearch()")
    .input-group
      input.form-control(type="text" name="keywords" placeholder="Search" ng-model="search.text" autofocus bs-typeahead
        data-delay="500" data-min-length="3" data-template="products/typeahead.html"
        ng-options="product.name as product.name for product in getProducts($viewValue)")

      .input-group-addon
        span.glyphicon.glyphicon-search(ng-click="doSearch()")

Remove autofocus from typeahead to fix js error in angular-strap js

.col-sm-3.col-md-3.hidden-xs
  form.navbar-form(name="SearchForm" role="search" ng-submit="doSearch()")
    .input-group
      input.form-control(type="text" name="keywords" placeholder="Search" ng-model="search.text" bs-typeahead
        data-delay="500" data-min-length="3" data-template="products/typeahead.html"
        ng-options="product.name as product.name for product in getProducts($viewValue)")

      .input-group-addon
        span.glyphicon.glyphicon-search(ng-click="doSearch()")


nav.navbar.navbar-default.navbar-static-top role="navigation"
  .container
    .navbar-header
      button.navbar-toggle type="button" data-toggle="collapse" data-target="#menu"
        span.sr-only Afficher le menu
        - 3.times do
          span.icon-bar
      = link_to root_path, class: 'navbar-brand' do
        = image_tag 'logo.png', width: '100'

    #menu.collapse.navbar-collapse.navbar-right
      ul.nav.navbar-nav
        li = link_to 'Accueil', root_path
        li = link_to 'Vidéos', videos_path
        li = link_to 'Proposer un talk', talks_path
        li = link_to 'Job board', 'http://parisrb.jobboardmaker.com'
        li = link_to 'Meetup', 'http://www.meetup.com/parisrb/'

Add forum to the link list

nav.navbar.navbar-default.navbar-static-top role="navigation"
  .container
    .navbar-header
      button.navbar-toggle type="button" data-toggle="collapse" data-target="#menu"
        span.sr-only Afficher le menu
        - 3.times do
          span.icon-bar
      = link_to root_path, class: 'navbar-brand' do
        = image_tag 'logo.png', width: '100'

    #menu.collapse.navbar-collapse.navbar-right
      ul.nav.navbar-nav
        li = link_to 'Accueil', root_path
        li = link_to 'Vidéos', videos_path
        li = link_to 'Proposer un talk', talks_path
        li = link_to 'Job board', 'http://parisrb.jobboardmaker.com'
        li = link_to 'Forum', 'http://forum.rubyparis.org'
        li = link_to 'Meetup', 'http://www.meetup.com/parisrb/'


- title @user.name
- content_for(:header) do
  h2= @user.name
  h6
    a#twitch-channel href=@user.uri target=:_blank = @user.uri.to_s.gsub('http://www.', '')
  h6
    - @user.games.named.each do |game|
      = link_to game.shortname || game.name.downcase, game, class: 'game-link stealth-link'
article
  = render partial: 'shared/run_table', locals: table_locals(:pbs, user: @user)

Fix no spaces between game names on user profile pages

- title @user.name
- content_for(:header) do
  h2= @user.name
  h6
    a#twitch-channel href=@user.uri target=:_blank = @user.uri.to_s.gsub('http://www.', '')
  h6
    - @user.games.named.each do |game|
      => link_to game.shortname || game.name.downcase, game, class: 'game-link stealth-link'
article
  = render partial: 'shared/run_table', locals: table_locals(:pbs, user: @user)


doctype html
html[lang="en"]
  head
    meta[charset="utf-8"]
    meta[name="viewport" content="width=device-width, initial-scale=1.0"]
    title = page_title
    = csrf_meta_tags
    = stylesheet_link_tag "application", :media => "all"
    - if Rails.env.development?
      = javascript_include_tag "persona-include.js"
    - else
      = javascript_include_tag "https://login.persona.org/include.js"
    = javascript_include_tag "application"
    = javascript_include_tag "player"
    = favicon_link_tag 'favicon.png'
    = render 'layouts/ga'
    script
      | window.mainWorkerPath = '#{javascript_path "main_worker"}';
      | window.browserIdUser = #{browser_id_user};
  body
    = render 'layouts/header'
    = render 'shared/flash'
    .main = content_for?(:content) ? yield(:content) : yield
    = render 'layouts/footer'

Load app js bundle before persona

doctype html
html[lang="en"]
  head
    meta[charset="utf-8"]
    meta[name="viewport" content="width=device-width, initial-scale=1.0"]
    title = page_title
    = csrf_meta_tags
    = stylesheet_link_tag "application", :media => "all"
    = javascript_include_tag "application"
    = javascript_include_tag "player"
    - if Rails.env.development?
      = javascript_include_tag "persona-include.js"
    - else
      = javascript_include_tag "https://login.persona.org/include.js"
    = favicon_link_tag 'favicon.png'
    = render 'layouts/ga'
    script
      | window.mainWorkerPath = '#{javascript_path "main_worker"}';
      | window.browserIdUser = #{browser_id_user};
  body
    = render 'layouts/header'
    = render 'shared/flash'
    .main = content_for?(:content) ? yield(:content) : yield
    = render 'layouts/footer'


.modal
  .modal__header
    h2= slot.patient
    = render "renalware/shared/modal_close_link"

  .modal__body
    = render "renalware/shared/errors", model: slot

    p.which-diary= slot.description

    /- unless slot.diary.master?
    = link_to "Remove them",
            hd_scheduling_diary_slot_path(slot.diary, slot),
            method: :delete,
            remote: true,
            class: "button alert"

    / - destroy_btn_title = slot.diary.master ? "Remove" : "Remove and revert to master diary"
    / = link_to destroy_btn_title,
    /           hd_scheduling_diary_slot_path(slot.diary, slot),
    /           method: :delete,
    /           remote: true,
    /           class: "button alert"

    h2 Replace with another patient
    = render "form", slot: slot

Add patient link to HD diary slot dialog

.modal
  .modal__header
    h2
      = link_to(patient_clinical_summary_path(slot.patient), target: "_blank") do
        = slot.patient.to_s(:default)
        |
        i.fa.fa-external-link-square-alt

    = render "renalware/shared/modal_close_link"

  .modal__body
    = render "renalware/shared/errors", model: slot

    p.which-diary= slot.description

    /- unless slot.diary.master?
    = link_to "Remove them",
            hd_scheduling_diary_slot_path(slot.diary, slot),
            method: :delete,
            remote: true,
            class: "button alert"

    / - destroy_btn_title = slot.diary.master ? "Remove" : "Remove and revert to master diary"
    / = link_to destroy_btn_title,
    /           hd_scheduling_diary_slot_path(slot.diary, slot),
    /           method: :delete,
    /           remote: true,
    /           class: "button alert"

    h2 Replace with another patient
    = render "form", slot: slot


div.btn-group
  - if current_course_user
    - submissions = assessment.submissions.select { |s| s.creator == current_user }
    - attempting_submission = submissions.find(&:attempting?)
    - submitted_submission = submissions.find { |s| !s.attempting? }
    - if attempting_submission
      = link_to(t('.resume'), edit_course_assessment_submission_path(current_course,
          assessment, attempting_submission), class: ['btn', 'btn-info'])
    - elsif submitted_submission
      = link_to(t('.view'), edit_course_assessment_submission_path(current_course,
          assessment, submitted_submission), class: ['btn', 'btn-info'])
    - elsif can?(:attempt, assessment)
      = link_to t('.attempt'), course_assessment_submissions_path(current_course, assessment),
                class: ['btn','btn-info'], method: :post
  - else
    = link_to(t('.attempt'), '#', class: ['btn', 'btn-info', 'disabled'])

  - if can?(:manage, assessment)
    = link_to(course_assessment_submissions_path(current_course, assessment),
              class: ['btn', 'btn-default']) do
      span.visible-xs-block = fa_icon 'book'
      span.hidden-xs = t('.submissions')

Fix N+1 query when submissions are not preloaded for assessments.

div.btn-group
  - if current_course_user
    / If submissions are preloaded, find through the array. Otherwise, execute a SQL query.
    / Remove N+1 Queries on this partial.
    - submissions = assessment.submissions.loaded? ? \
          assessment.submissions.select { |s| s.creator == current_user } : \
          assessment.submissions.where(creator: current_user)

    - attempting_submission = submissions.find(&:attempting?)
    - submitted_submission = submissions.find { |s| !s.attempting? }
    - if attempting_submission
      = link_to(t('.resume'), edit_course_assessment_submission_path(current_course,
          assessment, attempting_submission), class: ['btn', 'btn-info'])
    - elsif submitted_submission
      = link_to(t('.view'), edit_course_assessment_submission_path(current_course,
          assessment, submitted_submission), class: ['btn', 'btn-info'])
    - elsif can?(:attempt, assessment)
      = link_to t('.attempt'), course_assessment_submissions_path(current_course, assessment),
                class: ['btn','btn-info'], method: :post
  - else
    = link_to(t('.attempt'), '#', class: ['btn', 'btn-info', 'disabled'])

  - if can?(:manage, assessment)
    = link_to(course_assessment_submissions_path(current_course, assessment),
              class: ['btn', 'btn-default']) do
      span.visible-xs-block = fa_icon 'book'
      span.hidden-xs = t('.submissions')


- title "hello"
- content_for(:header) do
  h2 splits i/o
  - if logged_in? && current_user.runs.present?
    h5 want some jelly with these PBs?
  - else
    h5
      | upload
      u<> all
      | the splits
article
  - if logged_in?
    - if current_user.runs.present?
      = render partial: 'shared/run_table', locals: table_locals(:my_pbs)
    - else
      .jumbotron
        h4 Drag and drop as many runs as you want right here
  - else
    p Save your splits to a file using your favorite splitting program, then drag that file anywhere on this page.
- if logged_in?
  article#follows

Add note to signed out users about uploading multiple files

- title "hello"
- content_for(:header) do
  h2 splits i/o
  - if logged_in? && current_user.runs.present?
    h5 want some jelly with these PBs?
  - else
    h5
      | upload
      u<> all
      | the splits
article
  - if logged_in?
    - if current_user.runs.present?
      = render partial: 'shared/run_table', locals: table_locals(:my_pbs)
    - else
      .jumbotron
        h4 Drag and drop as many runs as you want right here
  - else
    p Save your splits to a file using your favorite splitting program, then drag that file anywhere on this page.
    p To upload several files at once, #{link_to 'sign in', '/auth/twitch'} first.
- if logged_in?
  article#follows


article.hep_b_antibody_path_results
  h2 Latest BHI Hep B Anti HBS Status
  - if dashboard.latest_hep_b_antibody_statuses?
    = render "renalware/pathology/historical_observation_results/table",
             table: dashboard.latest_hep_b_antibody_statuses

Correct Hep B Surface Antibody Titre label

article.hep_b_antibody_path_results
  h2 Latest Hep B Surface Antibody Titre
  - if dashboard.latest_hep_b_antibody_statuses?
    = render "renalware/pathology/historical_observation_results/table",
             table: dashboard.latest_hep_b_antibody_statuses


p
  | Welcome
  = @email
  | !
p
  | You can confirm your account email through the link below:
p
  = link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token)

COPY Updated the signup confirmation email

p
  ' Welcome
  = @email
  ' !
p You have signed up for a Queens' Awards for Enterprise account.

p
  ' You can
  = link_to "confirm your email account here", confirmation_url(@resource, confirmation_token: @token)
  ' .

p If you've not signed up for an account with us, you can ignore this email.

p Thank you,

p The Queen's Awards Office


- effective_time = item.time_for(course_user)
- reference_time = item.reference_time_for(course_user)
- if effective_time.is_a? Course::PersonalTime and effective_time.fixed?
  span title=t('course.lesson_plan.items.fixed_desc')
    = fa_icon 'lock'
=< format_datetime(effective_time[attribute], datetime_format)
- if effective_time[attribute] != reference_time[attribute]
  br
  strike
    = t('course.lesson_plan.items.ref')
    = format_datetime(reference_time[attribute], datetime_format)

Add missing nil guard to _personal_or_ref_time

- effective_time = item.time_for(course_user)
- reference_time = item.reference_time_for(course_user)
- if effective_time.is_a? Course::PersonalTime and effective_time.fixed?
  span title=t('course.lesson_plan.items.fixed_desc')
    = fa_icon 'lock'
=< format_datetime(effective_time[attribute], datetime_format) if effective_time[attribute]
- if effective_time[attribute] != reference_time[attribute]
  br
  strike
    = t('course.lesson_plan.items.ref')
    = format_datetime(reference_time[attribute], datetime_format)


.overview
  .container
    .col-md-8.col-md-offset-2
      p Local Welcome connects volunteers and refugees to help them learn English and return to work. We aim to match people with similar skills and qualifications. Groups meet monthly in safe public spaces, and we encourage pairs to also meet monthly for coffee.

.container
  .row.chapters
    h1 Find a group near you
    - @chapters.each do |chapter|
      .col-md-4
        .chapter-block
          h2
            = link_to chapter.name, chapter_path(chapter)
          - if chapter.next_event.nil?
            = link_to "Learn more about this group", chapter_path(chapter), class: "btn btn-large btn-default"
          - else
            h3
              ' Next event: #{chapter.next_event.name}
              | (in #{distance_of_time_in_words(chapter.next_event.starts_at, Time.now)})
            = link_to "Register to attend", chapter_event_path(chapter, chapter.next_event), class: "btn btn-large btn-primary"

/*   .row.sponsors */
/*     .col-md-2.col-md-offset-2[style="background-color: #a2ded0; min-height: 100px"] */
/*       | [Logo goes here] */
/*     .col-md-6 */
/*       h2 Thanks to our supporters */
/*       p Local Welcome has received financial support from the XYXY Group, without which this project would not be possible. This line is more text that exists just to fill out the design, and will be replaced with something real at some point in the future. */

Update front page copy to match latest version from Trello.

.overview
  .container
    .col-md-8.col-md-offset-2
      p Local Welcome hosts monthly groups in public spaces to help refugees learn english, volunteer in the community, and return to work.

.container
  .row.chapters
    h1 Find a group near you
    - @chapters.each do |chapter|
      .col-md-4
        .chapter-block
          h2
            = link_to chapter.name, chapter_path(chapter)
          - if chapter.next_event.nil?
            = link_to "Learn more about this group", chapter_path(chapter), class: "btn btn-large btn-default"
          - else
            h3
              ' Next event: #{chapter.next_event.name}
              | (in #{distance_of_time_in_words(chapter.next_event.starts_at, Time.now)})
            = link_to "Register to attend", chapter_event_path(chapter, chapter.next_event), class: "btn btn-large btn-primary"

/*   .row.sponsors */
/*     .col-md-2.col-md-offset-2[style="background-color: #a2ded0; min-height: 100px"] */
/*       | [Logo goes here] */
/*     .col-md-6 */
/*       h2 Thanks to our supporters */
/*       p Local Welcome has received financial support from the XYXY Group, without which this project would not be possible. This line is more text that exists just to fill out the design, and will be replaced with something real at some point in the future. */


.modal id="rewards_banner_intro_modal" role="dialog" tabindex="-1"
  .modal-dialog
    .modal-header id="instant-donation-modal-selection"
      center id="intro-container"
        = image_tag "icn-donation-jar@1x.png", id: 'icn-donation-jar'
        h2.modal-title = t ".headline"
        p = t ".intro"
        = link_to(t(".continue"), "#", class: 'btn btn-primary', id: "open-banner-button")
        - if wallet&.default_currency.present? && wallet&.default_currency.eql?('BAT')
          = hidden_field_tag 'preferred_currency', wallet.default_currency
          = hidden_field_tag 'conversion_rate', wallet.rates[wallet.default_currency]
        - else
          = hidden_field_tag 'preferred_currency', 'USD'
          = hidden_field_tag 'conversion_rate', wallet.rates['USD']
      center
    .modal-header style="display: none;" id="rewards-banner-container"
      = hidden_field_tag 'publisher_id', current_publisher.id

Check to make sure rates is present for the Wallet

.modal id="rewards_banner_intro_modal" role="dialog" tabindex="-1"
  .modal-dialog
    .modal-header id="instant-donation-modal-selection"
      center id="intro-container"
        = image_tag "icn-donation-jar@1x.png", id: 'icn-donation-jar'
        h2.modal-title = t ".headline"
        p = t ".intro"
        = link_to(t(".continue"), "#", class: 'btn btn-primary', id: "open-banner-button")
        - if wallet.present? && wallet&.default_currency.present? && wallet&.rates.present? && wallet&.default_currency.eql?('BAT')
          = hidden_field_tag 'preferred_currency', wallet.default_currency
          = hidden_field_tag 'conversion_rate', wallet.rates[wallet.default_currency]
        - else
          = hidden_field_tag 'preferred_currency', 'USD'
          = hidden_field_tag 'conversion_rate', 0.18
      center
    .modal-header style="display: none;" id="rewards-banner-container"
      = hidden_field_tag 'publisher_id', current_publisher.id


= stylesheet_link_tag 'umakadata/bootstrap-datepicker3.min'
= stylesheet_link_tag 'umakadata/calendar'
= javascript_include_tag 'bootstrap-datepicker.min'

javascript:
  $(function(){
    $('#calendar').datepicker({
      autoclose: true,
      startDate: "#{@start_date}",
      endDate: new Date(),
      format: 'dd-mm-yyyy',
      todayHighlight: true,
    });
  });

.form-inline.calendar-form.pull-right
  .form-group
    label.calendar-title Data for the day of
    input.date-input#calendar[readonly='readonly' name='date' value=@date.strftime('%d-%m-%Y')]
    input.go-button#jump-button[type='button' value='GO']

Change the time format of calendar.

= stylesheet_link_tag 'umakadata/bootstrap-datepicker3.min'
= stylesheet_link_tag 'umakadata/calendar'
= javascript_include_tag 'bootstrap-datepicker.min'

javascript:
  $(function(){
    $('#calendar').datepicker({
      autoclose: true,
      startDate: "#{@start_date}",
      endDate: new Date(),
      format: 'dd-mm-yyyy',
      todayHighlight: true,
    });
  });

.form-inline.calendar-form.pull-right
  .form-group
    label.calendar-title Data for the day of
    input.date-input#calendar[readonly='readonly' name='date' value=@date.strftime('%d-%b-%Y')]
    input.go-button#jump-button[type='button' value='GO']


doctype html
html lang="en"
  head
    meta charset="utf-8"
    title= content_for?(:title) ? yield(:title) : "ATLRUG"
    = csrf_meta_tags

    /! Le HTML5 shim, for IE6-8 support of HTML elements
    /[if lt IE 9]
    = javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js"
    /! Le styles
    = stylesheet_link_tag "application", :media => "all"
    / Le fav and touch icons
    link href="images/favicon.ico" rel="shortcut icon"
    link href="images/apple-touch-icon.png" rel="apple-touch-icon"
    link href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon" sizes="72x72"
    link href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon" sizes="114x114"

Add viewport for mobile browsers

doctype html
html lang="en"
  head
    meta charset="utf-8"
    meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"
    title= content_for?(:title) ? yield(:title) : "ATLRUG"
    = csrf_meta_tags

    /! Le HTML5 shim, for IE6-8 support of HTML elements
    /[if lt IE 9]
    = javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js"
    /! Le styles
    = stylesheet_link_tag "application", :media => "all"
    / Le fav and touch icons
    link href="images/favicon.ico" rel="shortcut icon"
    link href="images/apple-touch-icon.png" rel="apple-touch-icon"
    link href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon" sizes="72x72"
    link href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon" sizes="114x114"


- content_for(:title) {"Кой е в лабата"}
section.container
  header.row
    .col-sm-12
      h2
        | Кой е в лабата
        .pull-right
          span.small
            => @users.count
            | към
            time< datetime="#{Time.now.iso8601}" = Time.now.to_formatted_s(:time)
  .present_users
    - if @users.any?
      - @users.each_slice(4) do |users|
        == render partial: 'present_user_row', locals: {users: users}
    - else
      .row
        .no_users
          .thumbnail
            = icon 'frown-o'
            .caption
              h5 Всички ги е хванала липсата

Remove the border around the no users frowny face

- content_for(:title) {"Кой е в лабата"}
section.container
  header.row
    .col-sm-12
      h2
        | Кой е в лабата
        .pull-right
          span.small
            => @users.count
            | към
            time< datetime="#{Time.now.iso8601}" = Time.now.to_formatted_s(:time)
  .present_users
    - if @users.any?
      - @users.each_slice(4) do |users|
        == render partial: 'present_user_row', locals: {users: users}
    - else
      .row
        .no_users
          = icon 'frown-o'
          h5 Всички ги е хванала липсата


- if question.header
  h2
    = question.header
  - if question.header_context
    == question.header_context

fieldset class="question-block js-conditional-answer #{question.classes} #{'js-conditional-drop-answer' if question.drop_condition}" data-answer=question.parameterized_title
  = condition_divs question do
    - if question.title != ""
      h2
        - if question.ref
          span class="steps step-#{question.ref.to_s.parameterize}"
            span.visuallyhidden
              = "Step #{question.ref.to_s}"
            span.todo
              = question.ref.to_s

        = question.title

        - if question.required
          abbr
            | *

    - if question.context
      == question.context

    .question-group
      label
        span.visuallyhidden
          = question.title
          - if question.required
            abbr
              | *
        = render partial: "qae_form/#{question.class.name.split('::').last.gsub!(/(.)([A-Z])/,'\1_\2').downcase}", object: question, as: 'question', locals: {answers: answers}
      .clear

    - for help in question.help
      div.hidden-hint
        span.hidden-link
          = help.title
        span.hidden-content
          == help.text

Add drop conditionals to the form dsl

- if question.header
  h2
    = question.header
  - if question.header_context
    == question.header_context

fieldset class="question-block js-conditional-answer #{question.classes} #{'js-conditional-drop-answer' if question.drop_condition}" data-answer=question.parameterized_title data-drop-question="#{question.form[question.drop_condition].parameterized_title if question.drop_condition}"
  = condition_divs question do
    - if question.title != ""
      h2
        - if question.ref
          span class="steps step-#{question.ref.to_s.parameterize}"
            span.visuallyhidden
              = "Step #{question.ref.to_s}"
            span.todo
              = question.ref.to_s

        = question.title

        - if question.required
          abbr
            | *

    - if question.context
      == question.context

    .question-group
      label
        span.visuallyhidden
          = question.title
          - if question.required
            abbr
              | *
        = render partial: "qae_form/#{question.class.name.split('::').last.gsub!(/(.)([A-Z])/,'\1_\2').downcase}", object: question, as: 'question', locals: {answers: answers}
      .clear

    - for help in question.help
      div.hidden-hint
        span.hidden-link
          = help.title
        span.hidden-content
          == help.text


- talks.sorted_talks.each do |t|
  == link_to '/' + t.path, :class => planner_classes(t.data).join(" ")
      div.item-container
        .talk_room == t.data.room
        .talk_title == t.data.title
        | by
        span.speaker == t.data.speaker
      div.forward-arrow
        <i class="fa fa-chevron-right"></i>

Add indicator of talks with previews

- talks.sorted_talks.each do |t|
  == link_to '/' + t.path, :class => planner_classes(t.data).join(" ")
      div.item-container
        .talk_room == t.data.room
        .talk_title == t.data.title
        | by
        span.speaker
          = t.data.speaker
          - if t.preview
            |
            i.fa.fa-star
      div.forward-arrow
        <i class="fa fa-chevron-right"></i>


- post = @object
- topic = post.topic.actable
- course = topic.course
- host = course.instance.host
- unsubscribe_url = subscribe_course_forum_topic_url(course, topic.forum, topic, subscribe: false,
                                                     host: host)

- course_title = format_inline_text(course_title)
- topic_title = format_inline_text(topic_title)
- post_author = format_inline_text(post.creator.name)

- message.subject = t('.subject', course: course_title, topic: topic_title)

= format_html(t('.message',
                topic: link_to(topic_title,
                               course_forum_topic_url(course, topic.forum, topic, host: host)),
                post: post.text,
                post_author: post_author))

= simple_format(t('.unsubscribe.message',
                unsubscribe_link: link_to(t('.unsubscribe.tag'), unsubscribe_url)))

Fix missing topic title in post reply notification email

- post = @object
- topic = post.topic.actable
- course = topic.course
- host = course.instance.host
- unsubscribe_url = subscribe_course_forum_topic_url(course, topic.forum, topic, subscribe: false,
                                                     host: host)

- course_title = format_inline_text(course.title)
- topic_title = format_inline_text(topic.title)
- post_author = format_inline_text(post.creator.name)

- message.subject = t('.subject', course: course_title, topic: topic_title)

= format_html(t('.message',
                topic: link_to(topic_title,
                               course_forum_topic_url(course, topic.forum, topic, host: host)),
                post: post.text,
                post_author: post_author))

= simple_format(t('.unsubscribe.message',
                unsubscribe_link: link_to(t('.unsubscribe.tag'), unsubscribe_url)))


= content_for :title, t('.titles.site')

= render 'devise/shared/header'

.row
  .large-5.medium-7.large-centered.columns
    .login-box.animated.fadeIn
      h3.text-center You're almost done!
      hr

      .large-11.large-centered.columns
        = simple_form_for(resource, as: resource_name, url: confirm_path) do |f|
          = devise_error_messages!
          = f.input :confirmation_token, as: :hidden
          - if resource.bonds_early_adopter?
            = f.input :password, input_html: { autofocus: true }
            = f.input :password_confirmation
          = f.submit t('.form.inputs.submit'), class: [:button, 'large-12', 'columns']

Remove placeholders from confirmation form

= content_for :title, t('.titles.site')

= render 'devise/shared/header'

.row
  .large-5.medium-7.large-centered.columns
    .login-box.animated.fadeIn
      h3.text-center You're almost done!
      hr

      .large-11.large-centered.columns
        = simple_form_for(resource, as: resource_name, url: confirm_path) do |f|
          = devise_error_messages!
          = f.input :confirmation_token, as: :hidden
          - if resource.bonds_early_adopter?
            = f.input :password, placeholder: false, input_html: { autofocus: true }
            = f.input :password_confirmation, placeholder: false
          = f.submit t('.form.inputs.submit'), class: [:button, 'large-12', 'columns']


meta http-equiv='x-dns-prefetch-control' content='on'

link rel="dns-prefetch" href="//adservice.google.co.jp"
link rel="dns-prefetch" href="//cm.g.doubleclick.net"
link rel="dns-prefetch" href="//d17jazaimr5n2x.cloudfront.net"
link rel="dns-prefetch" href="//annict.imgix.net"
link rel="dns-prefetch" href="//fonts.googleapis.com"
link rel="dns-prefetch" href="//fonts.gstatic.com"
link rel="dns-prefetch" href="//googleads.g.doubleclick.net"
link rel="dns-prefetch" href="//pagead2.googlesyndication.com"
link rel="dns-prefetch" href="//use.fontawesome.com"
link rel="dns-prefetch" href="//www.google-analytics.com"

link rel="shortcut icon" href="/images/favicon.png" type="image/png"
link rel="author" href="#{ENV.fetch('ANNICT_URL')}/humans.txt" type="text/plain"
link rel="canonical" href="#{request.protocol}#{request.host_with_port}#{request.path}"
link rel="alternate" hreflang="x-default" href="#{ENV.fetch('ANNICT_URL')}#{request.path}"
link rel="alternate" hreflang="ja" href="#{ENV.fetch('ANNICT_JP_URL')}#{request.path}"
link rel="alternate" hreflang="en" href="#{ENV.fetch('ANNICT_URL')}#{request.path}"

= csrf_meta_tags
= csp_meta_tag

Remove old asset domain from dns-prefetch

meta http-equiv='x-dns-prefetch-control' content='on'

link rel="dns-prefetch" href="//adservice.google.co.jp"
link rel="dns-prefetch" href="//cm.g.doubleclick.net"
link rel="dns-prefetch" href="//annict.imgix.net"
link rel="dns-prefetch" href="//fonts.googleapis.com"
link rel="dns-prefetch" href="//fonts.gstatic.com"
link rel="dns-prefetch" href="//googleads.g.doubleclick.net"
link rel="dns-prefetch" href="//pagead2.googlesyndication.com"
link rel="dns-prefetch" href="//use.fontawesome.com"
link rel="dns-prefetch" href="//www.google-analytics.com"

link rel="shortcut icon" href="/images/favicon.png" type="image/png"
link rel="author" href="#{ENV.fetch('ANNICT_URL')}/humans.txt" type="text/plain"
link rel="canonical" href="#{request.protocol}#{request.host_with_port}#{request.path}"
link rel="alternate" hreflang="x-default" href="#{ENV.fetch('ANNICT_URL')}#{request.path}"
link rel="alternate" hreflang="ja" href="#{ENV.fetch('ANNICT_JP_URL')}#{request.path}"
link rel="alternate" hreflang="en" href="#{ENV.fetch('ANNICT_URL')}#{request.path}"

= csrf_meta_tags
= csp_meta_tag


.row
  .small-12.columns
    section.investors.text-center
      h3
        = "#{number_with_precision(@total_investors, precision: 0, delimiter: ',')} people pledge to invest #{number_to_currency(@total_pledged_for_investment, precision: 0)} in their communities."

      - for user in @users
          = link_to user
            = user.display_image_html width: 85, height: 85

Change language in investors section

.row
  .small-12.columns
    section.investors.text-center
      h3
        = "#{number_with_precision(@total_investors, precision: 0, delimiter: ',')} people have pledged to invest #{number_to_currency(@total_pledged_for_investment, precision: 0)} in communities."

      - for user in @users
          = link_to user
            = user.display_image_html width: 85, height: 85


.form-margin.well
  = simple_form_for content_plan,
                    html: { class: 'form-horizontal form-container' } do |f|
    = f.input :title
    = f.input :ref_no
    = f.input :type, as: :select, collection: ContentPlan::TYPES, include_blank: false
    = f.input :size
    = f.input :status, as: :select, collection: ContentPlan::STATUS, include_blank: false
    = f.input :tag_list, as: :string, input_html: {class: "js-tags", style: "width:300px"}
    = f.input :maslow_need_ids, as: :string, input_html: {class: "js-needs", style: "width:300px"}
    = f.input :content_type
    = f.input :details, input_html: {class: 'span12'}
    = f.input :sources, input_html: {class: 'span12'}
    = f.input :handover_detailed_guidance, input_html: {class: 'span12'}
    = f.input :notes, input_html: {class: 'span12'}
    .control-group
      .controls
        = f.button :submit, class: 'btn-success'

Reorder fields on content plans

.form-margin.well
  = simple_form_for content_plan,
                    html: { class: 'form-horizontal form-container' } do |f|
    = f.input :ref_no
    = f.input :title
    = f.input :size
    = f.input :type, as: :select, collection: ContentPlan::TYPES, include_blank: false
    = f.input :status, as: :select, collection: ContentPlan::STATUS, include_blank: false
    = f.input :tag_list, as: :string, input_html: {class: "js-tags", style: "width:300px"}
    = f.input :maslow_need_ids, as: :string, input_html: {class: "js-needs", style: "width:300px"}
    = f.input :content_type
    = f.input :details, input_html: {class: 'span12'}
    = f.input :sources, input_html: {class: 'span12'}
    = f.input :handover_detailed_guidance, input_html: {class: 'span12'}
    = f.input :notes, input_html: {class: 'span12'}
    .control-group
      .controls
        = f.button :submit, class: 'btn-success'


doctype html
html
  head
    title = current_site.display_name
    meta name="viewport" content="width=device-width, initial-scale=1.0"
    = stylesheet_link_tag    "application", media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag "application", 'data-turbolinks-track' => true
    = csrf_meta_tags

  body
    #main
      = yield

Add a bunch of mobile-related META tags.

doctype html
html
  head
    title = current_site.display_name
    meta name="viewport" content="width=device-width, initial-scale=1.0"
    = stylesheet_link_tag    "application", media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag "application", 'data-turbolinks-track' => true
    = csrf_meta_tags

    meta name="viewport" content="width=device-width, initial-scale=1.0"
    meta name="apple-mobile-web-app-capable" content="yes"
    meta name="apple-mobile-web-app-status-bar-style" content="black"

  body
    #main
      = yield


= content_tag_for :tr, post, :"data-post-id" => post.id, :"data-state" => post.state, :"data-ready-for-review" => post.ready_for_review do
  td= post.title
  td= post.author_email
  td.span2.published-at = post.published_at.try(:to_s, :crowdblog_short)
  td.span1
    - if current_user.is_publisher?
      = link_to 'Publish', '#', :class => "btn btn-small publish-btn btn-danger #{(post.published? ? 'draft' : 'publish')}"
  td.span1
    .btn-group.states
      button.btn.btn-small.draft Drafted
      button.btn.btn-small.finish Finished
      - if !current_user.is_publisher?
        button.btn.btn-small.disabled.publish-status
      - if current_user.is_publisher?
        button.btn.btn-small.review Reviewed
  td.span1
    = link_to 'Delete', crowdblog.admin_post_path(post), :method => :delete, :confirm => 'Are you sure?', :class => "btn btn-small"
  td.span1
    = link_to 'Edit', crowdblog.edit_admin_post_path(post), :class => "btn btn-small"

Change the confirm option for links

= content_tag_for :tr, post, :"data-post-id" => post.id, :"data-state" => post.state, :"data-ready-for-review" => post.ready_for_review do
  td= post.title
  td= post.author_email
  td.span2.published-at = post.published_at.try(:to_s, :crowdblog_short)
  td.span1
    - if current_user.is_publisher?
      = link_to 'Publish', '#', :class => "btn btn-small publish-btn btn-danger #{(post.published? ? 'draft' : 'publish')}"
  td.span1
    .btn-group.states
      button.btn.btn-small.draft Drafted
      button.btn.btn-small.finish Finished
      - if !current_user.is_publisher?
        button.btn.btn-small.disabled.publish-status
      - if current_user.is_publisher?
        button.btn.btn-small.review Reviewed
  td.span1
    = link_to 'Delete', crowdblog.admin_post_path(post), :method => :delete, :data => { :confirm => 'Are you sure?' }, :class => "btn btn-small"
  td.span1
    = link_to 'Edit', crowdblog.edit_admin_post_path(post), :class => "btn btn-small"


p#notice = notice

h1#top = @venue.name

- if @venue.image.present?
  = image_tag(@venue.image.thumb, :alt => @venue.image_alt, :class => "float-right")

p
  strong #{@venue.name}
  - if @venue.phone.present?
    |  (#{@venue.phone})
  br
  | #{@venue.address}, #{@venue.postcode}
  br
  a href="#{@venue.url}" title="#{@venue.name}" #{@venue.url}

= @venue.content.html_safe

- if @venue_events
  h2 Upcoming Events

  = render partial: 'shared/social_share'

  = render :partial => @venue_events, :as => :event

Move venue social share out of the event loop

p#notice = notice

h1#top = @venue.name

- if @venue.image.present?
  = image_tag(@venue.image.thumb, :alt => @venue.image_alt, :class => "float-right")

p
  strong #{@venue.name}
  - if @venue.phone.present?
    |  (#{@venue.phone})
  br
  | #{@venue.address}, #{@venue.postcode}
  br
  a href="#{@venue.url}" title="#{@venue.name}" #{@venue.url}

= @venue.content.html_safe

  = render partial: 'shared/social_share'

- if @venue_events

  h2 Upcoming Events

  = render :partial => @venue_events, :as => :event


= simple_form_for @contact_form, validate: true, remote: true do |f|
  .row
    .small-12.medium-6.columns
        = f.input :name, required: true, label: false, placeholder: "* #{I18n.t('contact.placeholder.name')}"
        = f.input :email, as: :email, required: true, label: false, placeholder: "* #{I18n.t('contact.placeholder.email')}"
        = f.input :nickname, input_html: { class: 'hide', style: 'display: none' }, label: false
        = f.input :message, as: :text, required: true, input_html: { class: 'autosize contact-form' }, placeholder: "* #{I18n.t('contact.placeholder.message')}", label: false

        = button_tag class: 'submit-btn text-right tiny right' do
          - fa_icon('paper-plane')

    - if @qrcode_module.enabled? && setting.show_qrcode?
      .small-12.medium-6.columns
        = image_tag "http://chart.apis.google.com/chart?chs=350x350&cht=qr&chl=#{u vcard}"

Hide QrCode for small devices, update alt attribute

= simple_form_for @contact_form, validate: true, remote: true do |f|
  .row
    .small-12.medium-6.columns
        = f.input :name, required: true, label: false, placeholder: "* #{I18n.t('contact.placeholder.name')}"
        = f.input :email, as: :email, required: true, label: false, placeholder: "* #{I18n.t('contact.placeholder.email')}"
        = f.input :nickname, input_html: { class: 'hide', style: 'display: none' }, label: false
        = f.input :message, as: :text, required: true, input_html: { class: 'autosize contact-form' }, placeholder: "* #{I18n.t('contact.placeholder.message')}", label: false

        = button_tag class: 'submit-btn text-right tiny right' do
          - fa_icon('paper-plane')

    - if @qrcode_module.enabled? && setting.show_qrcode?
      .small-12.medium-6.columns.hide-for-small
        = image_tag "http://chart.apis.google.com/chart?chs=350x350&cht=qr&chl=#{u vcard}", alt: 'QrCode'


- content_for :title, "Editing: #{@user.display_name}"

- content_for :meta_tags do
  -# Meta tags for facebook social graph
  meta property="og:title" content=@user.name
  meta property="og:url" content=="#{Configuration[:base_url]}#{user_path(@user)}"
  meta property="og:image" content==@user.display_image
  meta property="og:site_name" content=::Configuration[:company_name]
  meta property="og:description" content=@user.bio
  meta property="fb:admins" content="#{fb_admins}"

.user-edit-page
  .row.page-main-content
    section.large-12.columns.main
      nav.tabs[data-target-container=".user-edit-page section.content"]
        = tab_link_to t('.tabs.edit'), edit_user_path(@user)
        - if @user.projects.any?
          = tab_link_to t('.tabs.my_campaigns'), user_projects_path(@user)
        - if @user.contributions.any?
          = tab_link_to t('.tabs.ive_contributed'), user_contributions_path(@user)
        = tab_link_to t('.tabs.credits'), credits_user_path(@user)
        = tab_link_to t('.tabs.settings'), settings_user_path(@user)

      section.content
        - if content_for? :page_content
          = yield :page_content
        - else
          = render template: 'users/profile', locals: { partial: true }

Add back the payments tab on user's page

- content_for :title, "Editing: #{@user.display_name}"

- content_for :meta_tags do
  -# Meta tags for facebook social graph
  meta property="og:title" content=@user.name
  meta property="og:url" content=="#{Configuration[:base_url]}#{user_path(@user)}"
  meta property="og:image" content==@user.display_image
  meta property="og:site_name" content=::Configuration[:company_name]
  meta property="og:description" content=@user.bio
  meta property="fb:admins" content="#{fb_admins}"

.user-edit-page
  .row.page-main-content
    section.large-12.columns.main
      nav.tabs[data-target-container=".user-edit-page section.content"]
        = tab_link_to t('.tabs.edit'), edit_user_path(@user)
        - if @user.projects.any?
          = tab_link_to t('.tabs.my_campaigns'), user_projects_path(@user)
        - if @user.contributions.any?
          = tab_link_to t('.tabs.ive_contributed'), user_contributions_path(@user)
        = tab_link_to t('.tabs.credits'), credits_user_path(@user)
        = tab_link_to t('.tabs.payments'), payments_user_path(@user)
        = tab_link_to t('.tabs.settings'), settings_user_path(@user)

      section.content
        - if content_for? :page_content
          = yield :page_content
        - else
          = render template: 'users/profile', locals: { partial: true }


html
  head
    title= content_for?(:title) ? "ScienceGist Blog - #{yield(:title)}"  : "The ScienceGist Blog"
    = stylesheet_link_tag "application", :media => "all"
    = javascript_include_tag "application"
    = stylesheet_link_tag "blog"
    = csrf_meta_tags
    = load_typekit
  body#blog
    .row
      .large-6.large-offset-3.medium-8.medium-offset-2.columns
        = render :partial => 'layouts/blog_header'
        - if flash[:notice] || flash[:alert]
          .notice= notice
          .alert= alert
        = yield
        = render 'layouts/blog_footer'

Add Google analytics to blog

html
  head
    title= content_for?(:title) ? "ScienceGist Blog - #{yield(:title)}"  : "The ScienceGist Blog"
    = stylesheet_link_tag "application", :media => "all"
    = javascript_include_tag "application"
    = stylesheet_link_tag "blog"
    = csrf_meta_tags
    = load_typekit
  body#blog
    .row
      .large-6.large-offset-3.medium-8.medium-offset-2.columns
        = render :partial => 'layouts/blog_header'
        - if flash[:notice] || flash[:alert]
          .notice= notice
          .alert= alert
        = yield
        = render 'layouts/blog_footer'

    javascript:
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-42335063-1', 'sciencegist.com');
      ga('send', 'pageview');


- Mobility.with_locale(admin_current_resource_locale) do
  = simple_form_for [:admin, @speaker] do |f|
    = admin_box_body do
      = f.input :name, as: :string
      = f.input :title, as: :string
      = f.input :order
      = f.input :description, as: :text, input_html: { data: { editor: true }, rows: 20 }
      = f.input :avatar do
        = f.input_field :avatar
        -if @speaker.avatar.present?
          = image_tag @speaker.avatar.url
          = f.input :remove_avatar, as: :boolean
    = admin_box_footer do
      = f.submit class: 'btn btn-primary'

Set speaker photo as option to prevent re-uploading avatar

- Mobility.with_locale(admin_current_resource_locale) do
  = simple_form_for [:admin, @speaker] do |f|
    = admin_box_body do
      = f.input :name, as: :string
      = f.input :title, as: :string
      = f.input :order
      = f.input :description, as: :text, input_html: { data: { editor: true }, rows: 20 }
      = f.input :avatar do
        = f.input_field :avatar, required: false
        - if @speaker.avatar.present?
          = image_tag @speaker.avatar.url
          = f.input :remove_avatar, as: :boolean
    = admin_box_footer do
      = f.submit class: 'btn btn-primary'


- Globalize.with_locale(admin_current_resource_locale) do
  = simple_form_for [:admin, @speaker] do |f|
    = admin_box_body do
      = f.input :name
      = f.input :description
      = f.input :avatar do
        = f.input_field :avatar
        -if @speaker.avatar.present?
          = image_tag @speaker.avatar
          = f.input :remove_avatar, as: :boolean
      = f.hidden_field :locale, value: admin_current_resource_locale
    = admin_box_footer do
      = f.submit class: 'btn btn-primary'

Fix speaker description not display as text

- Globalize.with_locale(admin_current_resource_locale) do
  = simple_form_for [:admin, @speaker] do |f|
    = admin_box_body do
      = f.input :name
      = f.input :description, as: :text, input_html: { data: { editor: true }, rows: 20 }
      = f.input :avatar do
        = f.input_field :avatar
        -if @speaker.avatar.present?
          = image_tag @speaker.avatar
          = f.input :remove_avatar, as: :boolean
      = f.hidden_field :locale, value: admin_current_resource_locale
    = admin_box_footer do
      = f.submit class: 'btn btn-primary'


h1 受取確認

table(border=1)
  tr
    td.name(align="center") = "-"
    - Lunchbox.all.each do |lunchbox|
      td.name = lunchbox.name + "(#{lunchbox.price.to_s}円)"
    td.name = "-"

    - @order.order_items.each do |item|
      tr
        td.name = item.customer_name
        - Lunchbox.all.each do |lunchbox|
          - if lunchbox.id == item.lunchbox_id
            td.name(align="center") = "✓"
          - else
            td.name = ""
        td.name
          - if item.received_at?
            = '受け取り済'
          - else
            = link_to '受け取る', receive_order_order_item_path(@order, item), method: :patch

Apply Bootstrap effect for receiption page

h1 受取確認

table.table.table-hover
  thead
    tr
      th.col-xs-1.text-center = '-'
      - Lunchbox.all.each do |lunchbox|
        th = "#{lunchbox.name} (#{lunchbox.price}円)"
      th.text-center = '-'

  tbody
    - @order.order_items.each do |item|
      tr class=('info' if item.received_at?)
        th = item.customer_name
        - Lunchbox.all.each do |lunchbox|
          td
            - if lunchbox.id == item.lunchbox_id
              .text-center = '✓'
        td
          - if item.received_at?
            | 受け取り済み
          - else
            = link_to '受け取る', receive_order_order_item_path(@order, item), method: :patch, class: 'btn btn-primary'

nav
  ul.nav.nav-pills.nav-stacked
    li = link_to '注文日選択画面へもどる', orders_path


doctype html
html[lang="en"]
  head
    meta[charset="utf-8"]
    meta[http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"]
    meta[name="viewport" content="width=device-width, initial-scale=1.0"]
    title = page_title
    = csrf_meta_tags
    = stylesheet_link_tag "application", :media => "all"
    = javascript_include_tag "application"
    = javascript_include_tag "player"
    = favicon_link_tag 'favicon.png'
    = render 'layouts/ga'
  body
    = render 'layouts/header'
    = render 'shared/flash'
    .main = content_for?(:content) ? yield(:content) : yield
    = render 'layouts/footer'

Use Google Analytics script only in production

doctype html
html[lang="en"]
  head
    meta[charset="utf-8"]
    meta[http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"]
    meta[name="viewport" content="width=device-width, initial-scale=1.0"]
    title = page_title
    = csrf_meta_tags
    = stylesheet_link_tag "application", :media => "all"
    = javascript_include_tag "application"
    = javascript_include_tag "player"
    = favicon_link_tag 'favicon.png'
    = render 'layouts/ga' if Rails.env.production?
  body
    = render 'layouts/header'
    = render 'shared/flash'
    .main = content_for?(:content) ? yield(:content) : yield
    = render 'layouts/footer'


- content_for :header do
  meta property="og:title" content=@post.to_title
  meta property="og:type" content="article"
  meta property="og:image" content=@post.user.try(:external_image_url)
  meta property="og:url" content=post_url(@post)

= render @post

- if @post.replies.any?
  section.post-replies
    h2 Replies
    = render @post.replies.order('published_at DESC'), hide_reply_references: true

Add og:description tag for posts.

- content_for :header do
  meta property="og:title" content=@post.to_title
  meta property="og:type" content="article"
  meta property="og:image" content=@post.user.try(:external_image_url)
  meta property="og:url" content=post_url(@post)
  meta property="og:description" content=@post.to_summary

= render @post

- if @post.replies.any?
  section.post-replies
    h2 Replies
    = render @post.replies.order('published_at DESC'), hide_reply_references: true


ul.nav.navbar-nav.navbar-right
  - if user_signed_in?
      li.dropdown
        a.dropdown-toggle data-toggle="dropdown" href="#"
          | Account
          b.caret
        ul.dropdown-menu
          li
            a href="#"
              | Profile
          li
            a href="#"
              | View schedule
          li.divider
          li= link_to 'Sign out', destroy_user_session_path, method: :delete
  - else
      li= link_to "Sign in", "#sign_in", "data-toggle" => "modal"
      li= link_to "Register", "#sign_up", "data-toggle" => "modal"
      li= link_to "Help", "#"

Fix profile links depending on whether profile is blank

ul.nav.navbar-nav.navbar-right
  - if user_signed_in?
      li.dropdown
        a.dropdown-toggle data-toggle="dropdown" href="#"
          | Account
          b.caret
        ul.dropdown-menu
          li
            = link_to 'Profile', user_profile_path(current_user)
            = link_to 'Profile', user_profile_path(current_user) unless current_user.profile.blank?
          li
            a href="#"
              | View schedule
          li.divider
          li= link_to 'Sign out', destroy_user_session_path, method: :delete
  - else
      li= link_to "Sign in", "#sign_in", "data-toggle" => "modal"
      li= link_to "Register", "#sign_up", "data-toggle" => "modal"
      li= link_to "Help", "#"


- if flash.any?
  #flash
    - flash.each do |key, value|
      div id="flash-#{key}"= value

Replace flash id with class

- if flash.any?
  #flash
    - flash.each do |key, value|
      div class="flash-#{key}"= value


javascript:
  !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
  n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
  n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
  t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
  document,'script','https://connect.facebook.net/en_US/fbevents.js');
  fbq('init', #{Settings.facebook.pixel_id});
  fbq('track', 'PageView');

Fix "unexpected token `)`" bug when pixel_id is blank

javascript:
  !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
  n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
  n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
  t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
  document,'script','https://connect.facebook.net/en_US/fbevents.js');
  fbq('init', "#{Settings.facebook.pixel_id}");
  fbq('track', 'PageView');


- provide(:page_content_class, "multi-page page-landing")

.article-related-positioning-container
  header.page-header.group
    div
      h1
        ' The Queen's Awards for Enterprise

  .article-container.group
    = render "landing_page_navigation", current_step: 1

    article.group role="article"
      .inner
        header
          h1 1. Overview

        p
          ' The
          = link_to "Queen’s Awards for Enterprise", awards_for_organisations_path
          '  are annual awards for outstanding achievement by UK organisations in the categories of:

        ul
          li Innovation
          li International Trade
          li Sustainable Development

        br

        .get-started
          - if user_signed_in?
            = link_to "Apply", dashboard_path, class: "button"
          - else
            = link_to "Apply", new_user_registration_path, class: "button"

        br

        p
          ' If you have already signed up then
          = link_to "log in to continue", new_user_session_path
          ' .

        footer
          nav.pagination role="navigation" aria-label="Pagination"
            ul.group
              li.next
                = link_to awards_for_organisations_path, rel: "next", title: "Navigate to next part" do
                  span.pagination-label
                    ' Next
                  span.pagination-part-title
                    ' Eligibility for organisations

Add QAE for individual info on landing page

- provide(:page_content_class, "multi-page page-landing")

.article-related-positioning-container
  header.page-header.group
    div
      h1
        ' The Queen's Awards for Enterprise

  .article-container.group
    = render "landing_page_navigation", current_step: 1

    article.group role="article"
      .inner
        header
          h1 1. Overview

        p
          ' The
          = link_to "Queen’s Awards for Enterprise", awards_for_organisations_path
          '  are annual awards for outstanding achievement by UK organisations in the categories of:

        ul
          li Innovation
          li International Trade
          li Sustainable Development

        br

        p
          ' The
          = link_to "Queen’s Award for Enterprise Promotion", enterprise_promotion_awards_path
          '  is a separate award for individuals. It’s open to people who have played an outstanding role in promoting enterprise skills and attitudes.

        br

        .get-started
          - if user_signed_in?
            = link_to "Apply", dashboard_path, class: "button"
          - else
            = link_to "Apply", new_user_registration_path, class: "button"

        br

        p
          ' If you have already signed up then
          = link_to "log in to continue", new_user_session_path
          ' .

        footer
          nav.pagination role="navigation" aria-label="Pagination"
            ul.group
              li.next
                = link_to awards_for_organisations_path, rel: "next", title: "Navigate to next part" do
                  span.pagination-label
                    ' Next
                  span.pagination-part-title
                    ' Eligibility for organisations


- if asset.persisted?
  .ui.buttons
    a.ui.labeled.icon.button.right.floated data-authorizable="#{asset.to_json}"
      | Permissions

    .or

    a.ui.labeled.icon.button.right.floated href="#{graph_starter.edit_asset_path(id: asset)}"
      i.edit.icon
      | Edit

  .ui.divider

  a.ui.labeled.icon.red.button.right.floated href="#{graph_starter.destroy_asset_path(id: asset)}"
    i.delete.icon
    | Delete

Put delete button into a button group so that it looks better

- if asset.persisted?
  .ui.buttons
    a.ui.labeled.icon.button.right.floated data-authorizable="#{asset.to_json}"
      | Permissions

    .or

    a.ui.labeled.icon.button.right.floated href="#{graph_starter.edit_asset_path(id: asset)}"
      i.edit.icon
      | Edit

  .ui.divider

  .ui.buttons
    a.ui.labeled.icon.red.button.right.floated href="#{graph_starter.destroy_asset_path(id: asset)}"
      i.delete.icon
      | Delete


.frame data-executable=file.file_type.executable? data-filename=file.name_with_extension data-renderable=file.file_type.renderable? data-role=file.role data-binary=file.file_type.binary? data-context-type=file.context_type
  - if file.file_type.binary?
    .binary-file data-file-id=file.ancestor_id
      - if file.file_type.renderable?
        - if file.file_type.audio?
          = audio_tag(file.native_file.url, controls: true)
        - elsif file.file_type.image?
          = image_tag(file.native_file.url)
        - elsif file.file_type.video?
          = video_tag(file.native_file.url, controls: true)
      - else
        = link_to(file.native_file.file.name_with_extension, file.native_file.url)
  - else
    .editor-content.d-none data-file-id=file.ancestor_id = file.content
    .editor data-file-id=file.ancestor_id data-indent-size=file.file_type.indent_size data-mode=file.file_type.editor_mode data-read-only=file.read_only data-allow-auto-completion=exercise.allow_auto_completion.to_s data-id=file.id

Fix download for binary files

.frame data-executable=file.file_type.executable? data-filename=file.name_with_extension data-renderable=file.file_type.renderable? data-role=file.role data-binary=file.file_type.binary? data-context-type=file.context_type
  - if file.file_type.binary?
    .binary-file data-file-id=file.ancestor_id
      - if file.file_type.renderable?
        - if file.file_type.audio?
          = audio_tag(file.native_file.url, controls: true)
        - elsif file.file_type.image?
          = image_tag(file.native_file.url)
        - elsif file.file_type.video?
          = video_tag(file.native_file.url, controls: true)
      - else
        = link_to(file.native_file.file.filename, file.native_file.url)
  - else
    .editor-content.d-none data-file-id=file.ancestor_id = file.content
    .editor data-file-id=file.ancestor_id data-indent-size=file.file_type.indent_size data-mode=file.file_type.editor_mode data-read-only=file.read_only data-allow-auto-completion=exercise.allow_auto_completion.to_s data-id=file.id


doctype html
html
  head
    title NineteenWu
    meta name="viewport" content="width=device-width, initial-scale=1.0"
    = stylesheet_link_tag "application", media: "all"
    = csrf_meta_tags

  body.signed_out
    header#header
      .navbar.navbar-static-top
        .navbar-inner
          .container
            a.btn.btn-navbar data-toggle="collapse" data-target=".nav-collapse"
              span.icon-bar
              span.icon-bar
              span.icon-bar

            a.brand href="#"
              span.icon-19wu
              span= t('layout.19wu')

            .nav-collapse.collapse
              ul.unstyled.pull-right
                li
                  a.btn href='#'
                    = t('label.sign_in')

    #main role="main"

      = yield :before_content

      #content
        .container
          = yield

    footer#footer
      .container
        p.pull-right © #{Date.today.year} 19wu.com
        ul.pull-left.horizontal
          li
            a href="http://github.com/saberma/19wu" Github
          li.muted
            | /
          li
            a href="http://github.com/saberma/19wu" = t('layout.contact_us')

    = javascript_include_tag "application"
    = yield :body_bottom
yi

Delete useless lines entered by accident


script Sprangular.constant('Env', #{ js_environment.to_json.html_safe })

- if @user
  script
    | Sprangular.startupData.User = #{serialize(@user, Sprangular::UserSerializer).html_safe}

- if @order
  script
    | Sprangular.startupData.Order = #{serialize(@order, Sprangular::OrderSerializer).html_safe}

Use lite user serializer in layout

script Sprangular.constant('Env', #{ js_environment.to_json.html_safe })

- if @user
  script
    | Sprangular.startupData.User = #{serialize(@user, Sprangular::LiteUserSerializer).html_safe}

- if @order
  script
    | Sprangular.startupData.Order = #{serialize(@order, Sprangular::OrderSerializer).html_safe}


- provide(:page_wrapper_class, "page-devise")

.article-related-positioning-container
  header.page-header.group
    div
      h1
        | Admin - Log in

  .article-container.group
    article.group role="article"
      .inner
        = simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|

          .form-inputs
            .question
              h2 Email
              .question-body
                = f.input :email, required: false, autofocus: true, label: false, input_html: {class: "medium"}

          .form-inputs
            .question
              h2 Password
              .question-body
                = f.input :password, required: false, label: false, input_html: {class: "medium"}

          .form-inputs
            .question
              .question-body
                = f.input :remember_me, as: :boolean if devise_mapping.rememberable?

          .form-actions
            = f.button :submit, "Log in", class: "button large"

        = render "admins/shared/links"

Fix assessor log in page title

- provide(:page_wrapper_class, "page-devise")

.article-related-positioning-container
  header.page-header.group
    div
      h1
        = resource.model_name
        '  - Log in

  .article-container.group
    article.group role="article"
      .inner
        = simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|

          .form-inputs
            .question
              h2 Email
              .question-body
                = f.input :email, required: false, autofocus: true, label: false, input_html: {class: "medium"}

          .form-inputs
            .question
              h2 Password
              .question-body
                = f.input :password, required: false, label: false, input_html: {class: "medium"}

          .form-inputs
            .question
              .question-body
                = f.input :remember_me, as: :boolean if devise_mapping.rememberable?

          .form-actions
            = f.button :submit, "Log in", class: "button large"

        = render "admins/shared/links"


doctype html
html
  head
    title
      | Railsgirls
    link rel="stylesheet" href="http://railsgirls.com/assets/bootstrap.css"
    link rel="stylesheet" href="http://railsgirls.com/assets/bootstrap-theme.css"
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags
  body
    nav
      .container
        .navbar-header
          button.navbar-toggle data-toggle="collapse" data-target=".navbar-collapse"
            span.sr-only Toggle navigation
            - 3.times
              span.icon-bar
          a.navbar-band href="/"
            |The Idea app
        .collapse.navbar-collapse
          ul.nav.navbar-nav
            li
              = link_to 'New Idea', new_idea_path
    .container
      - if notice
        = content_tag(:p, notice, class: 'alert alert-success')
      - if alert
        = content_tag(:p, alert, class: 'alert alert-danger')
      = yield
    footer
      .container Rails Girls 2014
    script src="http://railsgirls.com/assets/bootstrap.js"

Add login, logout and signup links

doctype html
html
  head
    title
      | Railsgirls
    link rel="stylesheet" href="http://railsgirls.com/assets/bootstrap.css"
    link rel="stylesheet" href="http://railsgirls.com/assets/bootstrap-theme.css"
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags
  body
    nav
      .container
        .navbar-header
          button.navbar-toggle data-toggle="collapse" data-target=".navbar-collapse"
            span.sr-only Toggle navigation
            - 3.times
              span.icon-bar
          a.navbar-band href="/"
            |The Idea app
        .collapse.navbar-collapse
          ul.nav.navbar-nav
            li
              = link_to 'New Idea', new_idea_path
          p.navbar-text.pull-right
            - if user_signed_in?
              |Logged in as
              = content_tag(:strong, ' ' + current_user.email)
              = link_to 'Edit profile', edit_user_registration_path, class: 'navbar-link'
              = link_to 'Logout', destroy_user_session_path, method: :delete, class: 'navbar-link'
            - else
              = link_to 'Sign up', new_user_registration_path, class: 'navbar-link'
              = link_to 'Login', new_user_session_path, class: 'navbar-link'
    .container
      - if notice
        = content_tag(:p, notice, class: 'alert alert-success')
      - if alert
        = content_tag(:p, alert, class: 'alert alert-danger')
      = yield
    footer
      .container Rails Girls 2014
    script src="http://railsgirls.com/assets/bootstrap.js"


= tabs do
  = nav_to(t('.students'), course_users_students_path(current_course))
  = nav_to(t('.staff'), course_users_staff_path(current_course))
  = nav_to(course_enrol_requests_path(current_course)) do
    = t('.requests')
    - requests_count = current_course.enrol_requests.count
    =< badge(requests_count) if requests_count > 0
  = nav_to(t('.invite'), invite_course_users_path(current_course), class: 'dropdown')
  = nav_to(t('.invitations'), course_user_invitations_path(current_course))

Add unconfirmed user_invitation count to tab for invitation page

= tabs do
  = nav_to(t('.students'), course_users_students_path(current_course))
  = nav_to(t('.staff'), course_users_staff_path(current_course))
  = nav_to(course_enrol_requests_path(current_course)) do
    = t('.requests')
    - requests_count = current_course.enrol_requests.count
    =< badge(requests_count) if requests_count > 0
  = nav_to(t('.invite'), invite_course_users_path(current_course), class: 'dropdown')
  = nav_to(course_user_invitations_path(current_course)) do
    = t('.invitations')
    - invitations_count = current_course.invitations.unconfirmed.count
    =< badge(invitations_count) if invitations_count > 0


- cache [cache_buster(1), link] do

  - blurb_length = blurb_length || Setting['advanced.blurb_length'].to_i
  - headline, blurb = blurb(link.main_title, link.subtitle, link.clean_body, link.introduction, blurb_length)
  - url_title = link.url_title || headline
  - url_lede = link.url_lede || blurb

  = link_to link.inferred_url, lang: lang_attr(link.lang), dir: dir_attr(link.lang), title: link.inferred_url do
    h2 = simple_blurbify_link(url_title)
    p = blurbify(url_lede, [])

  ul.details
    li = link_to link.inferred_url_domain, link.inferred_url, title: link.inferred_url
    li == timeago_tag(link.external_updated_at)
    - unless link.tags.blank?
      li = render 'notes/tag_list', tags: link.tags

Add author to link blurbs

- cache [cache_buster(1), link] do

  - blurb_length = blurb_length || Setting['advanced.blurb_length'].to_i
  - headline, blurb = blurb(link.main_title, link.subtitle, link.clean_body, link.introduction, blurb_length)
  - url_title = link.url_title || headline
  - url_lede = link.url_lede || blurb

  = link_to link.inferred_url, lang: lang_attr(link.lang), dir: dir_attr(link.lang), title: link.inferred_url do
    h2 = simple_blurbify_link(url_title)
    p = blurbify(url_lede, [])

  ul.details
    li = link_to link.inferred_url_domain, link.inferred_url, title: link.inferred_url
    - unless link.url_author.blank?
      li = link.url_author
    li = timeago_tag(link.external_updated_at)
    li == timeago_tag(link.external_updated_at)
    - unless link.tags.blank?
      li = render 'notes/tag_list', tags: link.tags


=content_for(:javascript) { javascript_include_tag '//www.google.com/jsapi', 'chartkick' }
-if user_signed_in?
  =render 'layouts/welcome_banner'
-if current_user.present?
  -if current_user.admin?
    ul.accordion data-accordion=''
      l1.accordion-navigation
        =link_to 'Manager panel', '#manager-panel'
        .content#manager-panel
          =render 'home/manager'
      l1.accordion-navigation.active
        =link_to 'Admin panel', '#admin-panel'
        .content.active#admin-panel
           =render 'home/admin'
  -elsif current_user.manager?
    =render 'home/manager'
  -else
    =render 'home/user'
-else
  .pad-top-thirty-px
    = link_to t('functions.log_in'), new_user_session_path, class: 'button'
  h4.pad-top-thirty-px Get help
  div.bold Don't have an account
  div Contact your manager to set up your account. You will then receive an email to sign in.
  div.bold.pad-top-fifteen-px Having technical issues
  div Contact support
  div Email: #{link_to Settings.mail.tech_support, "mailto:#{Settings.mail.tech_support}"}

Fix for hastily applied accordion

=content_for(:javascript) { javascript_include_tag '//www.google.com/jsapi', 'chartkick' }
-if user_signed_in?
  =render 'layouts/welcome_banner'
-if current_user.present?
  -if current_user.admin?
    =render 'home/manager'
    =render 'home/admin'
  -elsif current_user.manager?
    =render 'home/manager'
  -else
    =render 'home/user'
-else
  .pad-top-thirty-px
    = link_to t('functions.log_in'), new_user_session_path, class: 'button'
  h4.pad-top-thirty-px Get help
  div.bold Don't have an account
  div Contact your manager to set up your account. You will then receive an email to sign in.
  div.bold.pad-top-fifteen-px Having technical issues
  div Contact support
  div Email: #{link_to Settings.mail.tech_support, "mailto:#{Settings.mail.tech_support}"}


nav.navbar.navbar-default.navbar-fixed-top role="navigation" ng-controller="AutocompleteController"
  .container
    .navbar-header
      button.navbar-toggle.collapsed data-target="#bs-example-navbar-collapse-1" data-toggle="collapse" type="button"
        span.sr-only Toggle navigation
        span.icon-bar
        span.icon-bar
        span.icon-bar
      a.navbar-brand href="#"  I want to learn:
    #bs-example-navbar-collapse-1.collapse.navbar-collapse
      form.navbar-form.navbar-left role="form" ng-submit='submit()' action="#"
        .input-group.input-group-lg
          input.form-control.tags(type="text" spellcheck="false" autofocus ng-model='fieldValue' typeahead-editable='false' typeahead="subject as subject.name for subject in subjects | filter:$viewValue | limitTo:8")
            span.input-group-btn
               button.btn.btn-primary.btn-lg.btn-block type="button" ng-disabled="fieldValue == null || fieldValue.length == 0" ng-click="submit()" Go!
      .nav.navbar-nav.navbar-right data-target="#myModal" data-toggle="modal"
        button.btn.btn-primary.btn-lg.pull-right.btn-top type="button"  Log in

Add placeholder with current subject to header

nav.navbar.navbar-default.navbar-fixed-top role="navigation" ng-controller="AutocompleteController"
  .container
    .navbar-header
      button.navbar-toggle.collapsed data-target="#bs-example-navbar-collapse-1" data-toggle="collapse" type="button"
        span.sr-only Toggle navigation
        span.icon-bar
        span.icon-bar
        span.icon-bar
      a.navbar-brand href="#"  I want to learn:
    #bs-example-navbar-collapse-1.collapse.navbar-collapse
      form.navbar-form.navbar-left role="form" ng-submit='submit()' action="#"
        .input-group.input-group-lg
          input.form-control.tags(type="text" spellcheck="false" autofocus ng-model='fieldValue' placeholder="#{@subject.name}"  typeahead-editable='false' typeahead="subject as subject.name for subject in subjects | filter:$viewValue | limitTo:8")
            span.input-group-btn
               button.btn.btn-primary.btn-lg.btn-block type="button" ng-disabled="fieldValue == null || fieldValue.length == 0" ng-click="submit()" Go!
      .nav.navbar-nav.navbar-right data-target="#myModal" data-toggle="modal"
        button.btn.btn-primary.btn-lg.pull-right.btn-top type="button"  Log in


h1
  = @error_template
  = render('shared/edit_button', object: @error_template)

= row(label: 'error_template.name', value: @error_template.name)
= row(label: 'exercise.execution_environment', value: link_to(@error_template.execution_environment))
- [:signature, :description, :hint].each do |attribute|
  = row(label: "error_template.#{attribute}", value: @error_template.send(attribute))

h3
  = t 'error_templates.attributes'

.table-responsive
  table.sortable.table
    thead
      tr
        th
        th = t('activerecord.attributes.error_template_attribute.key')
        th = t('activerecord.attributes.error_template_attribute.description')
        th = t('activerecord.attributes.error_template_attribute.regex')
    tbody
      - @error_template.error_template_attributes.order(:important).each do |attribute|
        tr
          td
            - if attribute.important
              span class="fa fa-star" aria-hidden="true"
            - else
              span class="fa fa-star-o" aria-hidden="true"
          td = attribute.key
          td = attribute.description
          td = attribute.regex

Add actions to attribute list

h1
  = @error_template
  = render('shared/edit_button', object: @error_template)

= row(label: 'error_template.name', value: @error_template.name)
= row(label: 'exercise.execution_environment', value: link_to(@error_template.execution_environment))
- [:signature, :description, :hint].each do |attribute|
  = row(label: "error_template.#{attribute}", value: @error_template.send(attribute))

h3
  = t 'error_templates.attributes'

.table-responsive
  table.sortable.table
    thead
      tr
        th
        th = t('activerecord.attributes.error_template_attribute.key')
        th = t('activerecord.attributes.error_template_attribute.description')
        th = t('activerecord.attributes.error_template_attribute.regex')
        th colspan=3 = t('shared.actions')
    tbody
      - @error_template.error_template_attributes.order(:important).each do |attribute|
        tr
          td
            - if attribute.important
              span class="fa fa-star" aria-hidden="true"
            - else
              span class="fa fa-star-o" aria-hidden="true"
          td = attribute.key
          td = attribute.description
          td = attribute.regex
          td = link_to(t('shared.show'), attribute)
          td = "Remove"


- provide(:page_wrapper_class, "page-award-form")

- content_for :breadcrumbs do
  li = link_to "Applications", dashboard_path
  li = @form.title

header.page-header.group.page-header-over-sidebar
  div
    h1
      = @form.title

.steps-progress-container
  .steps-progress-content
    = render 'qae_form/form_header', form: @form, current_step: "nominee-background"

    .article-container.article-container-wider.step-article.step-current
      article.group role="article"
        .inner
          - question = step.questions.detect { |q| q.key =  :position_details }

          .question-block
            label
              h2
                span class="steps step-d-1"
                  span.visuallyhidden
                    = question.ref
                  span.todo
                    = question.ref
                = question.title

          == question.context

          - for help in question.hint
            div.hidden-hint
              span.hidden-link
                = help.title.html_safe
              span.hidden-content
                == help.text

          ul.list-add
            - existing_position_details.each do |attrs|
              = render "form/positions/item", attrs: attrs

          = link_to "+ Add another role", new_form_form_answer_positions_path(@form_answer),
                                          class: "button button-add"

    = render "qae_form/steps_progress_bar", current_step: "nominee-background"

    = render "form/supporters/footer", step: step

COPY non-js EP position button

- provide(:page_wrapper_class, "page-award-form")

- content_for :breadcrumbs do
  li = link_to "Applications", dashboard_path
  li = @form.title

header.page-header.group.page-header-over-sidebar
  div
    h1
      = @form.title

.steps-progress-container
  .steps-progress-content
    = render 'qae_form/form_header', form: @form, current_step: "nominee-background"

    .article-container.article-container-wider.step-article.step-current
      article.group role="article"
        .inner
          - question = step.questions.detect { |q| q.key =  :position_details }

          .question-block
            label
              h2
                span class="steps step-d-1"
                  span.visuallyhidden
                    = question.ref
                  span.todo
                    = question.ref
                = question.title

          == question.context

          - for help in question.hint
            div.hidden-hint
              span.hidden-link
                = help.title.html_safe
              span.hidden-content
                == help.text

          ul.list-add
            - existing_position_details.each do |attrs|
              = render "form/positions/item", attrs: attrs

          = link_to new_form_form_answer_positions_path(@form_answer),
                    class: "button button-add"
            - if existing_position_details.any?
              ' + Add another role
            - else
              ' + Add role

    = render "qae_form/steps_progress_bar", current_step: "nominee-background"

    = render "form/supporters/footer", step: step


.home
  .header-spacer.hidden-xs
  .row
    .col-md-12.text-center
      h1 WaniKani to Anki exporter

  .row
    .col-md-12
      img src="images/wanikanitoanki_logo.png" class="center-block img-responsive"

  .row
    .col-md-12.text-center
      h4 Export your WaniKani reviews to Anki decks!

  .row
    .col-md-12.text-center
      p Enter your #{link_to("WaniKani API Version 1 key", "https://www.wanikani.com/settings/account", target: "blank")} to get started.

    - if flash[:error]
      .row
        .col-md-6.col-md-offset-3.alert.alert-danger.text-center= flash[:error]

    = form_tag '/login', role: "form" do
      .row
        .col-md-4.col-md-offset-4.form-group
          = text_field_tag :wanikani_api_key, placeholder: "WaniKani API Key", class: "form-control"
      .row.text-center
        .col-md-12
          = submit_tag "Let's Go!", class: "btn btn-default"
      .row.text-center
        .col-md-12
        p
          small
            em
              | (Your API key is never saved anywhere!)

Update home page to indicate the site is under maintainance

.home
  .header-spacer.hidden-xs
  .row
    .col-md-12.text-center
      h1 WaniKani to Anki exporter

  .row
    .col-md-12
      img src="images/wanikanitoanki_logo.png" class="center-block img-responsive"

  .row
    .col-md-12.alert.alert-danger.text-center
      strong The WaniKani to Anki exporter is currently offline due to WaniKani API v1 no longer functioning. The application is currently getting updated to support the new API, so look for it in the near future!