doctype html
html ng-app="app"
  head
    title Rails Assets

    meta name="viewport" content="width=device-width, initial-scale=1"
    = stylesheet_link_tag 'application', media: 'all'
    = stylesheet_link_tag '//cloud.typography.com/6743452/745062/css/fonts.css', media: 'all'
    = javascript_include_tag '//use.typekit.net/jvv3pir.js'
    script try{Typekit.load();}catch(e){}

    = javascript_include_tag 'application'
    = csrf_meta_tags
    = render 'shared/open_graph'
    link rel="icon" href="/favicon.ico"

  body
    = render 'main/top'
    = yield
    = render 'main/footer'
    .development
      = honey_badger 'preview'
    = render 'shared/analytics'

Replace preview badge with beta

doctype html
html ng-app="app"
  head
    title Rails Assets

    meta name="viewport" content="width=device-width, initial-scale=1"
    = stylesheet_link_tag 'application', media: 'all'
    = stylesheet_link_tag '//cloud.typography.com/6743452/745062/css/fonts.css', media: 'all'
    = javascript_include_tag '//use.typekit.net/jvv3pir.js'
    script try{Typekit.load();}catch(e){}

    = javascript_include_tag 'application'
    = csrf_meta_tags
    = render 'shared/open_graph'
    link rel="icon" href="/favicon.ico"

  body
    = render 'main/top'
    = yield
    = render 'main/footer'
    .development
      = honey_badger 'beta'
    = render 'shared/analytics'


.text-right
  = paginate users
table.users.table
  thead
    tr.hide_on_mobile
      th= sort_link @q, :email, 'Email'
      th= sort_link @q, :name, %i(last_name first_name)
      th= sort_link @q, :groups_name, 'Groups'
      th= sort_link @q, :created_at
      th

    tbody
      - users.each do |user|
        tr
          td
            = link_to user.email, edit_admin_user_path(user)
            br/
            p
              em
                = user.roles.map(&:name).join(', ')
          td.name
            = user.name
          td.groups
            em
              = user.groups.map(&:name).join(', ')
          td
            = user.created_date
          td.actions
            = link_to [ :admin, user ], method: :delete, data: { confirm: 'Are you sure?' }, title: "Delete user #{user.name}" do
              = fa_icon(:"times-circle-o")
.text-right
  = paginate users

Sort roles and groups in listing

.text-right
  = paginate users
table.users.table
  thead
    tr.hide_on_mobile
      th= sort_link @q, :email, 'Email'
      th= sort_link @q, :name, %i(last_name first_name)
      th= sort_link @q, :groups_name, 'Groups'
      th= sort_link @q, :created_at
      th

    tbody
      - users.each do |user|
        tr
          td
            = link_to user.email, edit_admin_user_path(user)
            br/
            p
              em
                = user.roles.map(&:name).sort.join(', ')
          td.name
            = user.name
          td.groups
            em
              = user.groups.map(&:name).sort.join(', ')
          td
            = user.created_date
          td.actions
            = link_to [ :admin, user ], method: :delete, data: { confirm: 'Are you sure?' }, title: "Delete user #{user.name}" do
              = fa_icon(:"times-circle-o")
.text-right
  = paginate users


doctype html
html lang=I18n.locale
  head
    meta charset="utf-8"
    meta name="ROBOTS" content="NOODP"
    meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"

    / Configure default and controller-, and view-specific titles in
      config/locales/en.yml. For more see:
      https://github.com/calebthompson/title#usage

    title= title
    = stylesheet_link_tag :application, media: 'all'
    = csrf_meta_tags
  body class=body_class
    = render 'flashes'
    = yield
    = render 'javascript'
    = render 'css_overrides'

Add missing csp meta tag

doctype html
html lang=I18n.locale
  head
    meta charset="utf-8"
    meta name="ROBOTS" content="NOODP"
    meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"

    / Configure default and controller-, and view-specific titles in
      config/locales/en.yml. For more see:
      https://github.com/calebthompson/title#usage

    title= title
    = stylesheet_link_tag :application, media: 'all'
    = csrf_meta_tags
    = csp_meta_tag
  body class=body_class
    = render 'flashes'
    = yield
    = render 'javascript'
    = render 'css_overrides'


= cache [index_view, post] do
  .post
    h1= link_to post.title, main_app.post_path(*post.url_params)
    .well.well-sm.post-well
      .header
        .pull-right.col-md-6
          .image #{image_tag post.gravatar_url, class: 'img-circle pull-right' }
          .author #{link_to post.author_name, main_app.posts_by_author_path(post.author.to_param)}
          .email
            #{post.author_email}
            #{post.formatted_published_date}
        .clearfix
      .body #{post.html_body}
      .bottom
        - if index_view
          .links
            center
              = link_to 'Comments', main_app.post_path(*post.url_params) + '#disqus_thread'
        - else
          .social-links.row= render 'social', post: post

Fix a bug on preview where social partial is not being found

= cache [index_view, post] do
  .post
    h1= link_to post.title, main_app.post_path(*post.url_params)
    .well.well-sm.post-well
      .header
        .pull-right.col-md-6
          .image #{image_tag post.gravatar_url, class: 'img-circle pull-right' }
          .author #{link_to post.author_name, main_app.posts_by_author_path(post.author.to_param)}
          .email
            #{post.author_email}
            #{post.formatted_published_date}
        .clearfix
      .body #{post.html_body}
      .bottom
        - if index_view
          .links
            center
              = link_to 'Comments', main_app.post_path(*post.url_params) + '#disqus_thread'
        - else
          .social-links.row= render 'crowdblog/posts/social', post: post


- if @user
  - @title = t('.update_email_title')
  - if @user.email =~ /change-your-email\+[0-9]+@neighbor\.ly/
    - @user.email = nil
- else
  - @title = t('.site_title')

= content_for :title, @title

= render 'layouts/flash'
= render 'devise/shared/header'

.row
  .large-7.large-centered.columns
    .login-box.animated.fadeIn
      h3.text-center
        - if @user
          | Howdy, #{@user.display_name}.
          br/
          br/
          |We need some info - please
          i add your email address
          |.
        - else
          = @title
      .separator
      .clearfix

      .large-12.large-centered.columns
        - if @user
          - url = update_email_user_path(@user)
          - method = 'put'
          - submit_text = t('.submit')
        - else
          - @user = User.new
          - url = sign_up_path
          - method = 'post'
          - submit_text = t('.create')

        = form_for @user, url: url, html: { method: method } do |f|
          = render 'devise/shared/alert' if @user.persisted?
          p
            = f.label :email
            = f.text_field :email, required: true

          = f.submit submit_text, class: [:button, :success, 'large-12', 'columns', 'large-centered']
      .clearfix

Use flash_messages helper in custom view

- if @user
  - @title = t('.update_email_title')
  - if @user.email =~ /change-your-email\+[0-9]+@neighbor\.ly/
    - @user.email = nil
- else
  - @title = t('.site_title')

= content_for :title, @title

= flash_messages
= render 'devise/shared/header'

.row
  .large-7.large-centered.columns
    .login-box.animated.fadeIn
      h3.text-center
        - if @user
          | Howdy, #{@user.display_name}.
          br/
          br/
          |We need some info - please
          i add your email address
          |.
        - else
          = @title
      .separator
      .clearfix

      .large-12.large-centered.columns
        - if @user
          - url = update_email_user_path(@user)
          - method = 'put'
          - submit_text = t('.submit')
        - else
          - @user = User.new
          - url = sign_up_path
          - method = 'post'
          - submit_text = t('.create')

        = form_for @user, url: url, html: { method: method } do |f|
          = render 'devise/shared/alert' if @user.persisted?
          p
            = f.label :email
            = f.text_field :email, required: true

          = f.submit submit_text, class: [:button, :success, 'large-12', 'columns', 'large-centered']
      .clearfix


= simple_form_for [parent, resource], html: { class: 'remote-form' } do |f|
  .pull-right
    a.cancel.button.secondary href="#" = t('words.cancel')
  .clearfix

  - if resource.new_record? || policy(resource).permitted_for?(:title, :update)
    = f.input :title

  - if resource.new_record? || policy(resource).permitted_for?(:minimum_value, :update)
    = f.input :minimum_value, as: :integer, input_html: {pattern: "^[\\d+.]+"}

  - if resource.new_record? || policy(resource).permitted_for?(:days_to_delivery, :update)
    = f.input :days_to_delivery

  - if resource.new_record? || policy(resource).permitted_for?(:description, :update)
    = f.input :description

  - if resource.new_record? || policy(resource).permitted_for?(:maximum_contributions, :update)
    = f.input :maximum_contributions

  = f.input :soon, as: :boolean

  = f.button :submit, data: { disable_with: t('words.sending') }
  - if resource.persisted? && policy(resource).destroy?
    span.or = t('words.or')
    = link_to [parent, resource], class: 'button alert', method: :delete, confirm: t('words.confirm') do
      i.icon-et-trash.icon-white
      = t('words.delete')

Remove resource.new_record? from reward form

= simple_form_for [parent, resource], html: { class: 'remote-form' } do |f|
  .pull-right
    a.cancel.button.secondary href="#" = t('words.cancel')
  .clearfix

  - if policy(resource).permitted_for?(:title, :update)
    = f.input :title

  - if policy(resource).permitted_for?(:minimum_value, :update)
    = f.input :minimum_value, as: :integer, input_html: {pattern: "^[\\d+.]+"}

  - if policy(resource).permitted_for?(:days_to_delivery, :update)
    = f.input :days_to_delivery

  - if policy(resource).permitted_for?(:description, :update)
    = f.input :description

  - if policy(resource).permitted_for?(:maximum_contributions, :update)
    = f.input :maximum_contributions

  = f.input :soon, as: :boolean

  = f.button :submit, data: { disable_with: t('words.sending') }
  - if resource.persisted? && policy(resource).destroy?
    span.or = t('words.or')
    = link_to [parent, resource], class: 'button alert', method: :delete, confirm: t('words.confirm') do
      i.icon-et-trash.icon-white
      = t('words.delete')


= cache [index_view, post] do
  .post
    h1= link_to post.title, main_app.post_path(*post.url_params)
    .well.well-sm.post-well class=(index_view ? "hidden-xs" : "")
      .header
        .pull-right.col-md-6
          .image #{image_tag post.gravatar_url, class: 'img-circle pull-right' }
          .author #{link_to post.author_name, main_app.posts_by_author_path(post.author.to_param)}
          .email
            #{post.author_email}
            #{post.formatted_published_date}
        .clearfix
      .body #{(index_view ? post.short_description : post.html_body)}
      .bottom
        - if index_view
          .links
            center
              = link_to 'Read More...', main_app.post_path(*post.url_params)
        - else
          .social-links.row= render 'crowdblog/posts/social', post: post
  hr.visible-xs

Add date to post title on phone view

= cache [index_view, post] do
  .post
    h1= link_to post.title, main_app.post_path(*post.url_params)
    .visible-xs
      = post.formatted_published_date
      hr
    .well.well-sm.post-well class=(index_view ? "hidden-xs" : "")
      .header
        .pull-right.col-md-6
          .image #{image_tag post.gravatar_url, class: 'img-circle pull-right' }
          .author #{link_to post.author_name, main_app.posts_by_author_path(post.author.to_param)}
          .email
            #{post.author_email}
            #{post.formatted_published_date}
        .clearfix
      .body #{(index_view ? post.short_description : post.html_body)}
      .bottom
        - if index_view
          .links
            center
              = link_to 'Read More...', main_app.post_path(*post.url_params)
        - else
          .social-links.row= render 'crowdblog/posts/social', post: post


.minister-dropdown.form-group id="answering-minister-form-#{question.try(:id)}"
  label.form-label for="commission_form_minister_id" Answering minister
  = form.collection_select(:minister_id, Minister.active_or_having_id(question.minister_id), :id, :name_with_inactive_status, {include_blank: false}, { class: 'minister-select required-for-commission'})
  = render('shared/warning_icon') if minister_warning?(question, question.try(:minister))

.minister-dropdown.form-group id="policy-minister-form-#{question.try(:id)}"
  label.form-label for="pq_policy_minister_id" Policy minister (Optional)
  = form.collection_select(:policy_minister_id, Minister.active_or_having_id(question.policy_minister_id), :id, :name_with_inactive_status, {include_blank: true}, { class: ' minister-select' })
  = render('shared/warning_icon') if minister_warning?(question, question.try(:policy_minister))

Add blank entry to the answering minister dropdown

.minister-dropdown.form-group id="answering-minister-form-#{question.try(:id)}"
  label.form-label for="commission_form_minister_id" Answering minister
  = form.collection_select(:minister_id, Minister.active_or_having_id(question.minister_id), :id, :name_with_inactive_status, {include_blank: true}, { class: 'minister-select required-for-commission'})
  = render('shared/warning_icon') if minister_warning?(question, question.try(:minister))

.minister-dropdown.form-group id="policy-minister-form-#{question.try(:id)}"
  label.form-label for="pq_policy_minister_id" Policy minister (Optional)
  = form.collection_select(:policy_minister_id, Minister.active_or_having_id(question.policy_minister_id), :id, :name_with_inactive_status, {include_blank: true}, { class: ' minister-select' })
  = render('shared/warning_icon') if minister_warning?(question, question.try(:policy_minister))


.container
  h1 Create Sending Mail

  = form_tag(mail_sends_confirm_path) do
    .form-group
      = label_tag 'Subject'
      = text_field_tag 'Subject', '', class: 'form-control', placeholder: 'subject'
    .form-group
      = label_tag 'To'
      = text_field_tag 'To', '', class: 'form-control', placeholder: 'example@example.com'
    .form-group
      = label_tag 'Body'
      = text_area_tag 'Body', '', class: 'form-control', rows: 10, placeholder: 'Message body'
    = button_tag 'submit', class: 'btn btn-primary'

Add class specification form-group and btn-lg

.container
  h1 Create Sending Mail

  = form_tag(mail_sends_confirm_path) do
    .form-group
      = label_tag 'Subject'
      = text_field_tag 'Subject', '', class: 'form-control', placeholder: 'subject'
    .form-group
      = label_tag 'To'
      = text_field_tag 'To', '', class: 'form-control', placeholder: 'example@example.com'
    .form-group
      = label_tag 'Body'
      = text_area_tag 'Body', '', class: 'form-control', rows: 10, placeholder: 'Message body'
    .form-group
      = button_tag 'submit', class: 'btn btn-primary btn-lg'


#formatting_tips
  h3 Formatting Tips
  = image_tag "catarse/icon_media.png"
  p If you paste the url of an image or a video from vimeo or youtube, they will appear the video. try it!
  = image_tag "catarse/icon_url.png"
  p When you paste any url, it will turn a link. For example, http://mylink.com will turn http://www.mylink.com
  = image_tag "catarse/icon_linktext.png"
  p If you want to put text in link, simply use the following format: "the text you want":http://your.url. For example, 'My link':http://mylink.com will turn My link.
  = image_tag "catarse/icon_bold.png"
  p
    | You can use bold adding two asterisks (**) before and after the text you want to format. For example, **my bold text** will appear as
    strong  my bold text
    |.
  = image_tag "catarse/icon_italic.png"
  p
    | You can use italic adding an underscore (_) before and after the text you want to format. For example, _my italic text_ will appear as
    i  my italic text
    |.

Fix typo on english formatting tips

#formatting_tips
  h3 Formatting Tips
  = image_tag "catarse/icon_media.png"
  p If you paste the url of an image or a video from vimeo or youtube, they will appear on the page. try it!
  = image_tag "catarse/icon_url.png"
  p When you paste any url, it will turn a link. For example, http://mylink.com will turn http://www.mylink.com
  = image_tag "catarse/icon_linktext.png"
  p If you want to put text in link, simply use the following format: "the text you want":http://your.url. For example, 'My link':http://mylink.com will turn My link.
  = image_tag "catarse/icon_bold.png"
  p
    | You can use bold adding two asterisks (**) before and after the text you want to format. For example, **my bold text** will appear as
    strong  my bold text
    |.
  = image_tag "catarse/icon_italic.png"
  p
    | You can use italic adding an underscore (_) before and after the text you want to format. For example, _my italic text_ will appear as
    i  my italic text
    |.


div.doc-item__section
  h3.doc-item__sub-title
    | Arguments

  table.doc-item__arguments
    thead
      tr
        th scope="col"
          | Name
        th scope="col"
          | Description

    tbody
      - item.parameter.each do |argument|
        tr
          td.u-white-space-pre
            code
              = argument.name

          td
            - if argument.description
              = markdown(argument.description)

            div
              | Type:
              code< #{argument.type}

            div
              - if argument.default
                | Default:
                code< #{argument.default}
              - else
                | Required

Add `$` to argument names

div.doc-item__section
  h3.doc-item__sub-title
    | Arguments

  table.doc-item__arguments
    thead
      tr
        th scope="col"
          | Name
        th scope="col"
          | Description

    tbody
      - item.parameter.each do |argument|
        tr
          td.u-white-space-pre
            code
              | $
              = argument.name

          td
            - if argument.description
              = markdown(argument.description)

            div
              | Type:
              code< #{argument.type}

            div
              - if argument.default
                | Default:
                code< #{argument.default}
              - else
                | Required


nav.navbar.navbar-default.navbar-static-top.main-navbar
  .container-fluid
    .navbar-header
      = link_to "moi", admin_root_path, class: "navbar-brand"

    .collapse.navbar-collapse
      ul.nav.navbar-nav
        = nav_item "dashboard", admin_root_path
        - if can? :manage, User
          = nav_item "users", admin_users_path
        - if can? :read, Neuron
          = nav_item "neurons", admin_neurons_path

      ul.nav.navbar-nav.navbar-right
        li.dropdown
          = link_to "#", data: {toggle: "dropdown"} do
            = current_user
            span.caret
          ul.dropdown-menu role="menu"
            li
              = link_to t("actions.my_profile"), admin_user_path(current_user)
            li.divider
            li
              = link_to t("actions.logout"), destroy_user_session_path, method: :delete

Fix error if user don't have name

nav.navbar.navbar-default.navbar-static-top.main-navbar
  .container-fluid
    .navbar-header
      = link_to "moi", admin_root_path, class: "navbar-brand"

    .collapse.navbar-collapse
      ul.nav.navbar-nav
        = nav_item "dashboard", admin_root_path
        - if can? :manage, User
          = nav_item "users", admin_users_path
        - if can? :read, Neuron
          = nav_item "neurons", admin_neurons_path

      ul.nav.navbar-nav.navbar-right
        li.dropdown
          = link_to "#", data: {toggle: "dropdown"} do
            = current_user.to_s
            span.caret
          ul.dropdown-menu role="menu"
            li
              = link_to t("actions.my_profile"), admin_user_path(current_user)
            li.divider
            li
              = link_to t("actions.logout"), destroy_user_session_path, method: :delete


= form_for(CodeOcean::File.new) do |f|
  .form-group
    = f.label(:name, t('activerecord.attributes.file.name'))
    = f.text_field(:name, class: 'form-control', required: true)
  .form-group
    = f.label(:path, t('activerecord.attributes.file.path'))
    = f.select(:path, @paths, {}, class: 'form-control')
  .form-group
    = f.label(:file_type_id, t('activerecord.attributes.file.file_type_id'))
    = f.collection_select(:file_type_id, FileType.where(binary: false).order(:name), :id, :name, {selected: @exercise.execution_environment.file_type.try(:id)}, class: 'form-control')
  .form-group
    = f.label(:file_template_id, t('activerecord.attributes.file.file_template_id'))
    = f.collection_select(:file_template_id, FileTemplate.all.order(:name), :id, :name, {:include_blank => true}, class: 'form-control')
  = f.hidden_field(:context_id)
  .d-none#noTemplateLabel data-text=t('file_template.no_template_label')
  .actions = render('shared/submit_button', f: f, object: CodeOcean::File.new)

Allow specifying a new path for new files

= form_for(CodeOcean::File.new) do |f|
  .form-group
    = f.label(:name, t('activerecord.attributes.file.name'))
    = f.text_field(:name, class: 'form-control', required: true)
  .form-group
    = f.label(:path, t('activerecord.attributes.file.path'))
    |
    a.toggle-input data={text_initial: t('shared.new'), text_toggled: t('shared.back')} href='#' = t('shared.new')
    .original-input = f.select(:path, @paths, {}, class: 'form-control')
    = f.text_field(:path, class: 'alternative-input form-control', disabled: true)
  .form-group
    = f.label(:file_type_id, t('activerecord.attributes.file.file_type_id'))
    = f.collection_select(:file_type_id, FileType.where(binary: false).order(:name), :id, :name, {selected: @exercise.execution_environment.file_type.try(:id)}, class: 'form-control')
  .form-group
    = f.label(:file_template_id, t('activerecord.attributes.file.file_template_id'))
    = f.collection_select(:file_template_id, FileTemplate.all.order(:name), :id, :name, {:include_blank => true}, class: 'form-control')
  = f.hidden_field(:context_id)
  .d-none#noTemplateLabel data-text=t('file_template.no_template_label')
  .actions = render('shared/submit_button', f: f, object: CodeOcean::File.new)


head
  meta charset='utf-8'
  title = page_title
  meta name='description' content='#{page_description}'
  meta name='keywords' content='#{page_keywords}'
  meta name='author' content=''
  meta http-equiv='X-UA-Compatible' content='IE=edge'
  meta content='on' http-equiv='cleartype'
  meta content='True' name='HandheldFriendly'
  meta content='320' name='MobileOptimized'
  meta content='initial-scale=1, user-scalable=yes, width=device-width' name='viewport'
  link rel='shortcut icon' href='#{image_path('favicon.png')}'
  = stylesheet_link_tag 'application.css', media: 'all'
  / -------------------------------------
  / Modernizr - Development version
  / Use the Development version to develop with and learn from. Then, when you’re
  / ready for production, use the build tool below to pick only the tests you need.
  / -------------------------------------
  = javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.2/modernizr.js'
  /[if lt IE 9]
    = javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.min.js'
    = javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js'
  = yield_content :head

Add dns-prefetch metatag. Updating order of elements on the head

head
  meta charset='utf-8'
  title = page_title

  = stylesheet_link_tag 'application.css', media: 'all'
  / Prefetch DNS for external assets (Twitter widgets etc).
  link rel='dns-prefetch' href='//cdnjs.cloudflare.com'
  link rel='dns-prefetch' href='//www.google-analytics.com'
  link rel='shortcut icon' href='#{image_path('favicon.png')}'

  meta content='initial-scale=1, user-scalable=yes, width=device-width' name='viewport'
  meta http-equiv='X-UA-Compatible' content='IE=edge'
  meta content='on' http-equiv='cleartype'
  meta content='True' name='HandheldFriendly'
  meta content='320' name='MobileOptimized'

  meta name='description' content='#{page_description}'
  meta name='keywords' content='#{page_keywords}'
  meta name='author' content=''

  / -------------------------------------
  / Modernizr - Development version
  / Use the Development version to develop with and learn from. Then, when you’re
  / ready for production, use the build tool below to pick only the tests you need.
  / -------------------------------------
  = javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.2/modernizr.js'
  /[if lt IE 9]
    = javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.min.js'
    = javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js'
  = yield_content :head


doctype html
html
  head
    title
    = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"
    = csrf_meta_tags
  body.home.mdl-grid data-turbolinks='false'
    .mdl-cell.mdl-cell--6-col.mdl-cell--6-col-tablet.main-cell
      .login-surface.mdl-card.mdl-shadow--8dp
        .mdl-card__title
          h2.mdl-card__title-text MindLeaps Tracker
        .logo-container
          = image_tag 'mindleaps_logo_transparent.png', class: 'home-mindleaps-logo'
        .mdl-card__supporting-text
          | Welcome to MindLeaps Tracker. Please sign in with your Google Account.
        .mdl-card__actions.mdl-card--border
          = button_to 'Sign in with Google', omniauth_authorize_path(User, :google_oauth2), { class: 'mdl-button js-button.mdl-button mdl-button--raised mdl-js-ripple-effect google-button' }
          .mdl-layout-spacer
          a.mdl-button.mdl-js-button.mdl-js-ripple-effect.mdl-button--colored href='https://releases.mindleaps.app/latest'
            = inline_svg_tag'tablet.svg', class: 'button-icon'
            span Download Mobile App

Remove ripple from the login button

doctype html
html
  head
    title
    = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"
    = csrf_meta_tags
  body.home.mdl-grid data-turbolinks='false'
    .mdl-cell.mdl-cell--6-col.mdl-cell--6-col-tablet.main-cell
      .login-surface.mdl-card.mdl-shadow--8dp
        .mdl-card__title
          h2.mdl-card__title-text MindLeaps Tracker
        .logo-container
          = image_tag 'mindleaps_logo_transparent.png', class: 'home-mindleaps-logo'
        .mdl-card__supporting-text
          | Welcome to MindLeaps Tracker. Please sign in with your Google Account.
        .mdl-card__actions.mdl-card--border
          = button_to 'Sign in with Google', omniauth_authorize_path(User, :google_oauth2), { class: 'mdl-button js-button.mdl-button mdl-button--raised google-button' }
          .mdl-layout-spacer
          a.mdl-button.mdl-js-button.mdl-js-ripple-effect.mdl-button--colored href='https://releases.mindleaps.app/latest'
            = inline_svg_tag'tablet.svg', class: 'button-icon'
            span Download Mobile App


- if submit.notice
  br
  .application-notice.info-notice
    == submit.notice

br
p.form-submit
  button type="submit" class="button #{submit.style.presence}"
    = submit.text

/ TODO: REMOVE ME ONCE REDIRECT WILL BE READY
br
= link_to "Download PDF (Im here just for TEST)", user_form_answer_path(current_user, @form_answer, format: :pdf)

Remove test download pdf link

- if submit.notice
  br
  .application-notice.info-notice
    == submit.notice

br
p.form-submit
  button type="submit" class="button #{submit.style.presence}"
    = submit.text

/ TODO: REMOVE ME ONCE REDIRECT WILL BE READY
/ br
/= link_to "Download PDF (Im here just for TEST)", user_form_answer_path(current_user, @form_answer, format: :pdf)


- if item.parameter.present?
  h3.c-doc-item__sub-title
    | Arguments

  div.c-doc-item__arguments
    div.table-wrap
      table
        thead
          tr
            th scope="col"
              | Name
            th scope="col"
              | Type
            th scope="col"
              | Default
            th scope="col"
              | Description

        tbody
          - item.parameter.each do |argument|
            tr
              th scope="row"
                code
                  = argument.name.prepend("$")
              td
                code
                  = argument.type
              td
                - if argument.default
                  code
                    = argument.default
                - else
                  span aria-label="No default"
                    | —
              td.c-doc-item__mininum-content-width
                - if argument.description
                  = markdown(argument.description)
                - else
                  span aria-label="No description"
                    | —

Put default argument value in its name

- if item.parameter.present?
  h3.c-doc-item__sub-title
    | Arguments

  div.c-doc-item__arguments
    div.table-wrap
      table
        thead
          tr
            th scope="col"
              | Name
            th scope="col"
              | Type
            th scope="col"
              | Description

        tbody
          - item.parameter.each do |argument|
            tr
              th scope="row"
                code
                  - if argument.default
                    => argument.name.prepend("$")
                    | (#{argument.default})
                  - else
                    = argument.name.prepend("$")
              td
                code
                  = argument.type
              td.c-doc-item__mininum-content-width
                - if argument.description
                  = markdown(argument.description)
                - else
                  span aria-label="No description"
                    | —


=content_for(:javascript) { javascript_include_tag '//www.google.com/jsapi', 'chartkick' }
-if current_user.present?
  -if current_user.admin?
    =render 'home/admin'
  -elsif current_user.manager?
    =render 'home/manager'
  -else
    p
      span.bold 'Check benefits'
      | to see if an applicant is eligible for benefits-based remission.
    p
      |Use the
      span.bold  'Income calculator'
      | to see if an applicant can get help with their fees based on their income.
      br You'll also be able to calculate part-remissions.
-else
  .pad-top-fifteen-px
    = link_to t('functions.log_in'), new_user_session_path, class: 'button'
    h4
      |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 Having technical issues
    div Contact support
    div Email: #{link_to Settings.mail_tech_support, "mailto:#{Settings.mail_tech_support}"}

Add space to homepage elements

=content_for(:javascript) { javascript_include_tag '//www.google.com/jsapi', 'chartkick' }
-if current_user.present?
  -if current_user.admin?
    =render 'home/admin'
  -elsif current_user.manager?
    =render 'home/manager'
  -else
    p
      span.bold 'Check benefits'
      | to see if an applicant is eligible for benefits-based remission.
    p
      |Use the
      span.bold  'Income calculator'
      | to see if an applicant can get help with their fees based on their income.
      br You'll also be able to calculate part-remissions.
-else
  .pad-top-thirty-pix
    = link_to t('functions.log_in'), new_user_session_path, class: 'button'
  h4
    .pad-top-thirty-pix
      |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}"}


- delete = local_assigns[:delete] ? local_assigns[:delete] : false
= content_tag_for(:div, attachment, class: ['attachment'])
  span = link_to format_inline_text(attachment.name), attachment_reference_path(attachment),
                 target: "_blank"
  span.uploaded-by = t('.uploaded_by', name: attachment.creator.name)
  - if delete
    span.delete-attachment
      = link_to t('.delete_attachment'), attachment_reference_path(attachment),
                data: { confirm: t('.confirm_delete_attachment') }, method: :delete, remote: true

Add in a check to only render attachments if they exist

- delete = local_assigns[:delete] ? local_assigns[:delete] : false
- if attachment
  = content_tag_for(:div, attachment, class: ['attachment'])
    span = link_to format_inline_text(attachment.name), attachment_reference_path(attachment),
                   target: "_blank"
    span.uploaded-by = t('.uploaded_by', name: attachment.creator.name)
    - if delete
      span.delete-attachment
        = link_to t('.delete_attachment'), attachment_reference_path(attachment),
                  data: { confirm: t('.confirm_delete_attachment') }, method: :delete, remote: true


.navbar.navbar-expand-lg.navbar-light.bg-light
  a.navbar-brand.mr-2 href="/bookmarks" Bookmarks
  button.navbar-toggler type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"
    span = icon 'fas', 'bars'
  #navbarSupportedContent.collapse.navbar-collapse
    ul.navbar-nav.mr-auto
      - if signed_in?
        li.nav-item
          = link_to 'New Bookmark', new_bookmark_path, class: 'nav-link'
    - if signed_in?
      = form_tag search_bookmarks_path, method: :get, class: 'form-inline my-2 my-lg-0' do
        input.form-control.mr-sm-2 aria-label="Search" placeholder="Search" type="search" name="q" autocorrect="off" autocapitalize="none" value=params[:q]
        button.btn.btn-outline-secondary.my-2.my-sm-0 type="submit" Search
      ul.navbar-nav
        li.nav-item
          = link_to t('.sign_out'), sign_out_path, method: :delete, class: 'nav-link'
    - else
      ul.navbar-nav.ml-auto
        li.nav-item
          = link_to t('.sign_in'), sign_in_path, class: 'nav-link'

Use feather icons in nav

.navbar.navbar-expand-lg.navbar-light.bg-light.pt-1
  a.navbar-brand.mr-2 href="/bookmarks" = feather_icon 'home', width: '16', height: '16'
  button.navbar-toggler.border-0 type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"
    span = feather_icon 'menu', width: '16', height: '16'
  #navbarSupportedContent.collapse.navbar-collapse
    ul.navbar-nav.mr-auto
      - if signed_in?
        li.nav-item
          = link_to 'New Bookmark', new_bookmark_path, class: 'nav-link'
    - if signed_in?
      = form_tag search_bookmarks_path, method: :get, class: 'form-inline my-2 my-lg-0' do
        input.form-control.mr-sm-2 aria-label="Search" placeholder="Search" type="search" name="q" autocorrect="off" autocapitalize="none" value=params[:q]
        button.btn.btn-outline-secondary.my-2.my-sm-0 type="submit" Search
      ul.navbar-nav
        li.nav-item
          = link_to t('.sign_out'), sign_out_path, method: :delete, class: 'nav-link'
    - else
      ul.navbar-nav.ml-auto
        li.nav-item
          = link_to t('.sign_in'), sign_in_path, class: 'nav-link'


- 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 }


.article-related-positioning-container
  header.page-header.group
    div
      h1
        ' Check your eligibility

      = render "eligibility_check/steps_progress_bar"

      h2
        ' Step 3 of 3: Sustainability Development

  .article-container
    article.group role="article"
      .inner
        form
          .current-question#current-question
            = render "eligibility_check/form_sustainable_development"

          footer
            nav.pagination role="navigation" aria-label="Pagination"
              ul.group
                li.previous
                  = link_to eligibility_check_2_path, rel: "prev", title: "Navigate to previous part" do
                    span class="pagination-label"
                      ' Previous
                    span class="pagination-part-title"
                      ' Innovation award eligibility

                li.next
                  = link_to dashboard_path, rel: "next", title: "Navigate to Dashboard" do
                    span class="pagination-label"
                      ' Back
                    span class="pagination-part-title"
                      ' Dashboard

  .related-positioning
    .related-container
      .related#related
        nav.pagination role="navigation" aria-label="Pagination"
          ul.group
            li.next
              = link_to dashboard_path, rel: "next", title: "Navigate to Dashboard" do
                span class="pagination-label"
                  ' Back
                span class="pagination-part-title"
                  ' Dashboard

        .inner.group
          = link_to "Return to top ↑", "#content", class: "return-to-top"

Hide sidebar and use button to submit eligibility check

.article-related-positioning-container
  header.page-header.group
    div
      h1
        ' Check your eligibility

      = render "eligibility_check/steps_progress_bar"

      h2
        ' Step 3 of 3: Sustainability Development

  .article-container
    article.group role="article"
      .inner
        form
          .current-question#current-question
            = render "eligibility_check/form_sustainable_development"

          footer
            nav.pagination role="navigation" aria-label="Pagination"
              ul.group
                li.previous
                  = link_to eligibility_check_2_path, rel: "prev", title: "Navigate to previous part" do
                    span class="pagination-label"
                      ' Previous
                    span class="pagination-part-title"
                      ' Innovation award eligibility

                li.submit
                  = link_to "Check eligibility", dashboard_path, class: "button"

  /.related-positioning
    .related-container
      .related#related
        nav.pagination role="navigation" aria-label="Pagination"
          ul.group
            li.next
              = link_to dashboard_path, rel: "next", title: "Navigate to Dashboard" do
                span class="pagination-label"
                  ' Back
                span class="pagination-part-title"
                  ' Dashboard

        .inner.group
          = link_to "Return to top ↑", "#content", class: "return-to-top"


tr
  td= t('relatives')
  td
    - if relative.relatives.any?
      dl.dl-horizontal
        - relative.relatives.each do |relative|
          dt= relative.full_name
          - if relative.full_name.present?
            dd
              = relative.birth_year.try(:year)
              - if relative.relation.present?
              |,
              = t("relation.#{relative.relation}")

Fix display of relatives without relation

tr
  td= t('relatives')
  td
    - if relative.relatives.any?
      dl.dl-horizontal
        - relative.relatives.each do |relative|
          dt= relative.full_name
          - if relative.full_name.present?
            dd
              = relative.birth_year.try(:year)
              - if relative.relation.present?
                = ', '
                = t("relation.#{relative.relation}")


dl.sub-nav
  dd= link_to 'Current', patient_pathology_current_observations_path(@patient)
  dd= link_to 'Recent', patient_pathology_recent_observations_path(@patient)
  dd= link_to 'Historical', patient_pathology_historical_observations_path(@patient)
  dd= link_to 'Investigations', patient_pathology_observation_requests_path(@patient)
  dd= link_to 'Required Observations', patient_pathology_required_observations_path(@patient)
  dd= link_to 'New Patient Rule', new_patient_pathology_patient_rule_path(@patient)

Change pathology navigation tab order

dl.sub-nav
  dd= link_to 'Historical', patient_pathology_historical_observations_path(@patient)
  dd= link_to 'Current', patient_pathology_current_observations_path(@patient)
  dd= link_to 'Recent', patient_pathology_recent_observations_path(@patient)
  dd= link_to 'Investigations', patient_pathology_observation_requests_path(@patient)
  dd= link_to 'Required Observations', patient_pathology_required_observations_path(@patient)
  dd= link_to 'New Patient Rule', new_patient_pathology_patient_rule_path(@patient)


.well
  h2
    ' Case Summaries
  ul.list-unstyled.list-actions
    - FormAnswer::AWARD_TYPE_FULL_NAMES.each do |key, value|
      li
        .pull-right
          = link_to download_case_summary_pdf_admin_reports_path(category: key, format: :pdf)
            span.glyphicon.glyphicon-download-alt
            span.visible-lg.visible-md
              ' Download
        = link_to download_case_summary_pdf_admin_reports_path(category: key, format: :pdf), class: "action-title"
          span.glyphicon.glyphicon-file
          = value
  .clear

Add year scoping for case summaries reports

.well
  h2
    ' Case Summaries
  ul.list-unstyled.list-actions
    - FormAnswer::AWARD_TYPE_FULL_NAMES.each do |key, value|
      li
        .pull-right
          = link_to download_case_summary_pdf_admin_reports_path(category: key, format: :pdf, year: @award_year.year)
            span.glyphicon.glyphicon-download-alt
            span.visible-lg.visible-md
              ' Download
        = link_to download_case_summary_pdf_admin_reports_path(category: key, format: :pdf, year: @award_year.year), class: "action-title"
          span.glyphicon.glyphicon-file
          = value
  .clear


footer.footer-container#footer
  .row.footer
    .small-12.large-4.columns
      |
      == setting.newsletter(newsletter_user) if @newsletter_module.enabled?

    .small-12.large-4.columns.credentials
      == setting.credentials

    .small-12.large-4.columns.socials
      - if setting.show_social? && @social_module.enabled?
        h3 Follow me
        ul.inline-list
          li = link_to fa_icon('rss 2x'), posts_rss_path(format: :atom), target: :blank if @rss_module.enabled?

          - unless @socials_share.nil?
            - @socials_follow.each do |social_follow|
              li
                = link_to retina_image_tag(social_follow, :ikon, :small), social_follow.link, target: :_blank

        - unless @socials_share.nil?
          h4 Share me
          = social_share_buttons

  .row.lower-footer
    .small-12.colunms
      p.no-margin-bottom.text-center == t('footer.made_by', amour: fa_icon('heart'), company: link_to(image_tag('logo.png', width: '40px'), 'http://www.lr-agenceweb.fr', target: :blank, title: 'L&R Agence web'))

Fix bug with width attribute for img tag

footer.footer-container#footer
  .row.footer
    .small-12.large-4.columns
      |
      == setting.newsletter(newsletter_user) if @newsletter_module.enabled?

    .small-12.large-4.columns.credentials
      == setting.credentials

    .small-12.large-4.columns.socials
      - if setting.show_social? && @social_module.enabled?
        h3 Follow me
        ul.inline-list
          li = link_to fa_icon('rss 2x'), posts_rss_path(format: :atom), target: :blank if @rss_module.enabled?

          - unless @socials_share.nil?
            - @socials_follow.each do |social_follow|
              li
                = link_to retina_image_tag(social_follow, :ikon, :small), social_follow.link, target: :_blank

        - unless @socials_share.nil?
          h4 Share me
          = social_share_buttons

  .row.lower-footer
    .small-12.colunms
      p.no-margin-bottom.text-center == t('footer.made_by', amour: fa_icon('heart'), company: link_to(image_tag('logo.png', width: '40'), 'http://www.lr-agenceweb.fr', target: :blank, title: 'L&R Agence web'))


= content_tag_for(:tr, instance)
  td = (current_page - 1) * per_page + instance_counter + 1
  th
    a
      = link_to format_inline_text(instance.name), \
                admin_instance_admin_url(host: instance.host, port: nil)

  td = instance.host

  td
    = instance.active_user_count
    = ' / '
    = link_to instance.user_count, admin_instance_users_url(host: instance.host)

  td
    = instance.active_course_count
    = ' / '
    = link_to instance.course_count, admin_instance_courses_url(host: instance.host)

  td
    = edit_button([:admin, instance]) if can?(:edit, instance)
    = delete_button([:admin, instance]) if can?(:destroy, instance)

Add links to active users/courses in instance management

= content_tag_for(:tr, instance)
  td = (current_page - 1) * per_page + instance_counter + 1
  th
    a
      = link_to format_inline_text(instance.name), \
                admin_instance_admin_url(host: instance.host, port: nil)

  td = instance.host

  td
    = link_to instance.active_user_count, admin_instance_users_url(host: instance.host, active: true)
    = ' / '
    = link_to instance.user_count, admin_instance_users_url(host: instance.host)

  td
    = link_to instance.active_course_count, admin_instance_courses_url(host: instance.host, active: true)
    = ' / '
    = link_to instance.course_count, admin_instance_courses_url(host: instance.host)

  td
    = edit_button([:admin, instance]) if can?(:edit, instance)
    = delete_button([:admin, instance]) if can?(:destroy, instance)


= render layout: "renalware/patients/layout", locals: { title: "Modality History" } do
  table
    thead
      tr
        th Modality Code
        th Notes
        th.col-width-date Start Date
        th.col-width-date.wide Termination Date

    tbody
      - @modalities.each do |modality|
        tr
          td= modality.description.name
          td= modality.notes
          td= l modality.started_on
          td= l modality.ended_on

Add 'Added by' to modalities listing

= render layout: "renalware/patients/layout", locals: { title: "Modality History" } do
  table
    thead
      tr
        th Modality
        th Notes
        th.col-width-date Start Date
        th.col-width-date.wide Termination Date
        th Added by

    tbody
      - @modalities.each do |modality|
        tr
          td= modality.description.name
          td= modality.notes
          td= l modality.started_on
          td= l modality.ended_on
          td= modality.created_by.full_name


- hide_actions ||= false
= content_tag_for(:article, post) do
  header
    .post-avatar
      = avatar post.user
    ul.post-information
      li.post-author
        = link_to post.user.display_name, post.user.url
      li.post-time
        =' link_to l(post.published_at.to_date, format: :short), day_path(date: post.published_at)
        ' ·
        = link_to l(post.published_at, format: :time), post.url
      - if post.referenced_guid.present?
        li.post-referenced-url
          = link_to post.referenced_guid.without_http, post.referenced_guid.with_http

  // show referenced post if available
  - if post.referenced_post.present? && (@post.blank? || @post == post)
    .post-reference
      .post-reference-body
        == post.referenced_post.body_html

  // show actual post body
  .post-body
    == post.body_html

  - if current_user.present? && !hide_actions
    ul.post-actions
      - if can?(:edit, post)
        li.post-edit-link = link_to 'edit', [:edit, post]
      - if can?(:create, Post)
        li.post-reply-link = link_to 'reply', new_post_path(referenced_guid: post.guid)

Change date links so they link to the post author's site

- hide_actions ||= false
= content_tag_for(:article, post) do
  header
    .post-avatar
      = avatar post.user
    ul.post-information
      li.post-author
        = link_to post.user.display_name, post.user.url
      li.post-time
        =' link_to l(post.published_at.to_date, format: :short),
           day_url(year: post.published_at.year, month: post.published_at.month, day: post.published_at.day, host: post.user.domain)
        ' ·
        = link_to l(post.published_at, format: :time), post.url
      - if post.referenced_guid.present?
        li.post-referenced-url
          = link_to post.referenced_guid.without_http, post.referenced_guid.with_http

  // show referenced post if available
  - if post.referenced_post.present? && (@post.blank? || @post == post)
    .post-reference
      .post-reference-body
        == post.referenced_post.body_html

  // show actual post body
  .post-body
    == post.body_html

  - if current_user.present? && !hide_actions
    ul.post-actions
      - if can?(:edit, post)
        li.post-edit-link = link_to 'edit', [:edit, post]
      - if can?(:create, Post)
        li.post-reply-link = link_to 'reply', new_post_path(referenced_guid: post.guid)


fieldset
  h3
    ' Name of your organisation
  = f.input :company_name, input_html: { class: 'big medium', autocomplete: "off"}, label_html: { class: 'visuallyhidden' }

/fieldset
  h3
    ' Organisation address
    = f.input :company_address_first, input_html: { class: 'big large', autocomplete: "off"}, label: 'Building and street'
    = f.input :company_address_second, input_html: { class: 'big large', autocomplete: "off"}, label: false

  = f.input :company_city, input_html: { class: "big medium", autocomplete: "off"}, label: 'City'
  /= f.input :company_country, input_html: { class: "big medium"}, as: :string, label: 'Country'
  .input.question-group
    label.control-label
      ' Country
    = country_select(:user, :company_country, priority_countries: ["GB", "US"], selected: current_user.company_country)
  = f.input :company_postcode, input_html: { class: "big small", autocomplete: "off"}, label: 'Postcode'

fieldset
  h3
    ' Main telephone number
  = f.input :company_phone_number, input_html: { class: 'big small', autocomplete: "off"}, label_html: { class: 'visuallyhidden' }

Use new bootstrap label class

fieldset
  h3
    ' Name of your organisation
  = f.input :company_name, input_html: { class: 'big medium', autocomplete: "off"}, label_html: { class: 'visuallyhidden' }

/fieldset
  h3
    ' Organisation address
    = f.input :company_address_first, input_html: { class: 'big large', autocomplete: "off"}, label: 'Building and street'
    = f.input :company_address_second, input_html: { class: 'big large', autocomplete: "off"}, label: false

  = f.input :company_city, input_html: { class: "big medium", autocomplete: "off"}, label: 'City'
  /= f.input :company_country, input_html: { class: "big medium"}, as: :string, label: 'Country'
  .input.question-group
    label.form-label
      ' Country
    = country_select(:user, :company_country, priority_countries: ["GB", "US"], selected: current_user.company_country)
  = f.input :company_postcode, input_html: { class: "big small", autocomplete: "off"}, label: 'Postcode'

fieldset
  h3
    ' Main telephone number
  = f.input :company_phone_number, input_html: { class: 'big small', autocomplete: "off"}, label_html: { class: 'visuallyhidden' }


= component_tag_for hover_item do
  .outer
    = hover_item.decorate.background

    .inner
      - content = capture do
        = hover_item.decorate.icon
        = hover_item.decorate.h1
        = hover_item.decorate.text
        - if hover_item.text.present?
          .more-icon= inline_svg 'icons/more.svg'

      - if hover_item.link_url.present? && hover_item.video_id.blank?
        = link_to content, hover_item.link_url, target: hover_item.decorate.link_url_target_attr
      - else
        .modal-trigger data={target: "##{dom_id(hover_item, 'modal')}"}
          div data={toggle: 'popover', content: "#{hover_item.decorate.text}"}
            = content

Update HoverItem template to display inner link when link_label is filled

= component_tag_for hover_item do
  .outer
    = hover_item.decorate.background

    .inner
      - content = capture do
        = hover_item.decorate.icon
        = hover_item.decorate.h1
        = hover_item.decorate.text

        - if hover_item.text.present? && !hover_item.link_label.present?
          .more-icon= inline_svg 'icons/more.svg'

        - if hover_item.link_label.present?
          = link_to hover_item.link_label, hover_item.link_url,
            target: hover_item.decorate.link_url_target_attr,
            class: "btn link-btn #{hover_item.options[:link_btn_class]}"

      - if hover_item.link_url.present? && hover_item.video_id.blank?
        - if hover_item.link_label.present?
          = content
        - else
          = link_to content, hover_item.link_url, target: hover_item.decorate.link_url_target_attr
      - else
        .modal-trigger data={target: "##{dom_id(hover_item, 'modal')}"}
          div data={toggle: 'popover', content: "#{hover_item.decorate.text}"}
            = content


- if src.present?
  video.video-player.video-js.vjs-sublime-skin.vjs-16-9 width="640" height="264" controls="controls" preload="auto" poster="#{poster}" id=name.parameterize data-controller="video" data-video-src=src
    - unless request.user_agent =~ /Firefox/
      source src="#{src}" type="application/x-mpegURL"

Fix ID issue in production videojs data

- if src.present?
  video.video-player.video-js.vjs-sublime-skin.vjs-16-9 width="640" height="264" controls="controls" preload="auto" poster="#{poster}" id="#{name.parameterize}" data-controller="video" data-video-src=src
    - unless request.user_agent =~ /Firefox/
      source src="#{src}" type="application/x-mpegURL"


= 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, required: true, placeholder: false, input_html: { autofocus: true }
          = f.input :name, as: :string, placeholder: false, label: t('.form.labels.name')
          = f.submit t('.form.inputs.submit'), class: [:button, 'large-12', 'columns']

Remove duplicated error messages on confirmations show 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|
          = f.input :confirmation_token, as: :hidden
          - if resource.bonds_early_adopter?
            = f.input :password, required: true, placeholder: false, input_html: { autofocus: true }
          = f.input :name, as: :string, placeholder: false, label: t('.form.labels.name')
          = f.submit t('.form.inputs.submit'), class: [:button, 'large-12', 'columns']


header.page-header
  = link_to canteen_path(@canteen, date: (@date - 1.day)), remote: true, 'data-push' => 'true', class: :prev do
    span
  = link_to canteen_path(@canteen, date: (@date + 1.day)), remote: true, 'data-push' => 'true', class: :next do
    span
  h2.centered
    - if @date.to_date == Time.zone.now.to_date
      = t :today
    - else
      = l @date.to_date, format: :with_weekday
ul.meals
  = render partial: "day", object: @canteen.days.find_by_date(@date)

- if @date == Time.zone.now.to_date and @canteen.days.find_by_date(@date + 1.day).try(:meals).try(:any?)
  header.page-header
    h3.centered= l (@date + 1.day).to_date, format: :with_weekday
  ul.meals
    = render partial: "day", object: @canteen.days.find_by_date(@date + 1.day)

Use locals instead of object. object seems to be buggy.

header.page-header
  = link_to canteen_path(@canteen, date: (@date - 1.day)), remote: true, 'data-push' => 'true', class: :prev do
    span
  = link_to canteen_path(@canteen, date: (@date + 1.day)), remote: true, 'data-push' => 'true', class: :next do
    span
  h2.centered
    - if @date.to_date == Time.zone.now.to_date
      = t :today
    - else
      = l @date.to_date, format: :with_weekday
ul.meals
  = render partial: "day", locals: { day: @canteen.days.find_by_date(@date) }

- if @date == Time.zone.now.to_date and @canteen.days.find_by_date(@date + 1.day).try(:meals).try(:any?)
  header.page-header
    h3.centered= l (@date + 1.day).to_date, format: :with_weekday
  ul.meals
    = render partial: "day", locals: { day: @canteen.days.find_by_date(@date + 1.day) }


.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"
        = hidden_field_tag 'preferred_currency', current_publisher.wallet.default_currency
        = hidden_field_tag 'conversion_rate', current_publisher.wallet.rates[current_publisher.wallet.default_currency]
        = link_to(t(".continue"), "#", class: 'btn btn-primary', id: "open-banner-button")
      center
    .modal-header style="display: none;" id="rewards-banner-container"
      = hidden_field_tag 'publisher_id', current_publisher.id

Check default currency for nil and BAT, return USD in either case

.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 !current_publisher.wallet.default_currency.nil? && !current_publisher.wallet.default_currency.eql?('BAT')
          = hidden_field_tag 'preferred_currency', current_publisher.wallet.default_currency
          = hidden_field_tag 'conversion_rate', current_publisher.wallet.rates[current_publisher.wallet.default_currency]
        - else
          = hidden_field_tag 'preferred_currency', 'USD'
          = hidden_field_tag 'conversion_rate', current_publisher.wallet.rates['USD']
      center
    .modal-header style="display: none;" id="rewards-banner-container"
      = hidden_field_tag 'publisher_id', current_publisher.id


= f.association project, collection: Project.accepted.order(:name), input_html: { disabled: !application_draft.as_student? || application_draft.applied? }

h3 Your project goals
= f.input "why_selected_#{project}", input_html: { rows: 4, disabled: !application_draft.as_student? || application_draft.applied? }
= f.input "plan_#{project}", hint: 'Please describe some issues and features that you want to work on this summer.'.html_safe, input_html: { rows: 6, disabled: !application_draft.as_student? || application_draft.applied? }

Fix application_draft form to only show projects of the current season

= f.association project, collection: Project.in_current_season.accepted.order(:name), input_html: { disabled: !application_draft.as_student? || application_draft.applied? }

h3 Your project goals
= f.input "why_selected_#{project}", input_html: { rows: 4, disabled: !application_draft.as_student? || application_draft.applied? }
= f.input "plan_#{project}", hint: 'Please describe some issues and features that you want to work on this summer.'.html_safe, input_html: { rows: 6, disabled: !application_draft.as_student? || application_draft.applied? }


.row
  .span2
  .span8
    h1.page-header Global Feed

.row
  .span2 &nbsp
  .span8.fetch-pool.hide data-view='FetchPostsPool' data-posts-feed='GlobalPostsFeed'
    a href='#'
      .alert.alert-info style='text-align:center'
        span.num_new_posts 0
        span   New Posts
.row
  .span2
  .span8
    ul.unstyled.posts data-view='GlobalPostsFeed'

Change Global Feed header with Tent.is prefix

.row
  .span2
  .span8
    h1.page-header Tent.is Global Feed

.row
  .span2 &nbsp
  .span8.fetch-pool.hide data-view='FetchPostsPool' data-posts-feed='GlobalPostsFeed'
    a href='#'
      .alert.alert-info style='text-align:center'
        span.num_new_posts 0
        span   New Posts
.row
  .span2
  .span8
    ul.unstyled.posts data-view='GlobalPostsFeed'


h1 = "#{@exercise} (external user #{@external_user})"

#editor.row data-exercise-id=@exercise.id data-message-depleted=t('exercises.editor.depleted') data-user-id=@external_user.id
  div class=(@exercise.hide_file_tree ? 'hidden col-sm-3' : 'col-sm-3') id='files' data-entries=FileTree.new(@exercise.files).to_js_tree
  div id='frames' class=(@exercise.hide_file_tree ? 'col-sm-12' : 'col-sm-9')
    - @exercise.files.each do |file|
      = render('editor_frame', exercise: @exercise, file: file)

#slider

#timeline

Add a slider based on submissions

h1 = "#{@exercise} (external user #{@external_user})"
- submissions = Submission.where("user_id = ?  AND exercise_id = ?", @external_user.id, @exercise.id).to_a
- current_index = submissions.length - 1
- current_submission = submissions[current_index]
- files = current_submission.files.to_a

#editor.row data-exercise-id=@exercise.id data-message-depleted=t('exercises.editor.depleted') data-user-id=@external_user.id
  div class=(@exercise.hide_file_tree ? 'hidden col-sm-3' : 'col-sm-3') id='files' data-entries=FileTree.new(files).to_js_tree
  div id='frames' class=(@exercise.hide_file_tree ? 'col-sm-12' : 'col-sm-9')
    - files.each do |file|
      = render('editor_frame', exercise: @exercise, file: file)

#slider
    input type='range' orient='horizontal' list='datapoints' min=0 max=submissions.length-1 value=current_index
    datalist#datapoints
        - index=0
        - submissions.each do |submission|
            option data-submission=submission
                =index
            - index += 1

#timeline


article
  header
    h1 Prescriptions
    .supplemental
      span= "#{mdm.current_prescriptions.length} of #{mdm.patient.summary.prescriptions_count}"
      = render "prescription_buttons", patient: mdm.patient

  #prescriptions.expandable

    ul.tab-strip(data-tab)
      li.tab-title.active= link_to "Current", "#current", data: { "trigger-masonry-refresh" => true }
      li.tab-title= link_to "Current Immunosuppressant", "#current_immunosuppressant", data: { "trigger-masonry-refresh" => true }
      li.tab-title= link_to "Historical", "#historical", data: { "trigger-masonry-refresh" => true }
      li.tab-title= link_to "Historical Immunosuppressant", "#historical_immunosuppressant", data: { "trigger-masonry-refresh" => true }

    .tabs-content
      #current.content.active
        = render "renalware/mdm/prescriptions/table",
                 prescriptions: mdm.current_prescriptions
      #current_immunosuppressant.content
        = render "renalware/mdm/prescriptions/table",
                 prescriptions: mdm.current_immunosuppressant_prescriptions
      #historical.content
        = render "renalware/mdm/prescriptions/table",
                 prescriptions: mdm.historical_prescriptions,
                 show_terminated_on: true
      #historical_immunosuppressant.content
        = render "renalware/mdm/prescriptions/table",
                 prescriptions: mdm.historical_immunosuppressant_prescriptions,
                 show_terminated_on: true

Add bone meds to Tx MDM

article
  header
    h1 Prescriptions
    .supplemental
      span= "#{mdm.current_prescriptions.length} of #{mdm.patient.summary.prescriptions_count}"
      = render "prescription_buttons", patient: mdm.patient

  #prescriptions.expandable
    = render Renalware::Medications::TabbedPrescriptionsListComponent.new([ \
      { title: "Current", prescriptions: mdm.current_prescriptions, show_terminated_on: false }, \
      { title: "Current Immunosuppressant", prescriptions: mdm.current_immunosuppressant_prescriptions, show_terminated_on: false },
      { title: "Historical", prescriptions: mdm.historical_prescriptions },
      { title: "Historical Immunosuppressant", prescriptions: mdm.historical_immunosuppressant_prescriptions },
      { title: "Bone Meds", prescriptions: mdm.bone_prescriptions }])


= simple_form_for [current_course, @video] do |f|
  = f.error_notification
  = f.input :title
  = f.input :description
  = f.input :url, placeholder: t('.url_placeholder')
  = f.input :start_at
  = f.input :published

  = f.button :submit

Bring back summernote for video description

= simple_form_for [current_course, @video] do |f|
  = f.error_notification
  = f.input :title
  = f.input :description, as: :text
  = f.input :url, placeholder: t('.url_placeholder')
  = f.input :start_at
  = f.input :published

  = f.button :submit


h1 = t('.title')

- exercises = Exercise.where(:id => @user.submissions.group(:exercise_id).select(:exercise_id).distinct())

.table-responsive
  table.table
    thead
      tr
        - ['.exercise', '.score', '.runs', '.worktime'].each do |title|
          th.header = t(title)
    tbody
      - exercises.each do |exercise|
        - if statistics[exercise.id] then stats = statistics[exercise.id] else stats = {"working_time" => 0, "runs" => 0, "score" => 0}
        tr
          td = link_to exercise, controller: "exercises", action: "statistics", external_user_id: @user.id, id: exercise.id
          td = stats["maximum_score"] or 0
          td = stats["runs"] or 0
          td = stats["working_time"] or 0

Add sorting to external user statistics table

h1 = t('.title')

- exercises = Exercise.where(:id => @user.submissions.group(:exercise_id).select(:exercise_id).distinct())

.table-responsive
  table.table.table-striped.sortable
    thead
      tr
        - ['.exercise', '.score', '.runs', '.worktime'].each do |title|
          th.header = t(title)
    tbody
      - exercises.each do |exercise|
        - if statistics[exercise.id] then stats = statistics[exercise.id] else stats = {"working_time" => 0, "runs" => 0, "score" => 0}
        tr
          td = link_to exercise, controller: "exercises", action: "statistics", external_user_id: @user.id, id: exercise.id
          td = stats["maximum_score"] or 0
          td = stats["runs"] or 0
          td = stats["working_time"] or 0


- 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_path(update.project.permalink, anchor: "updates")}
= update.comment_html
br
br
hr
br
| Keep on truckin',
br
|The #{Configuration[:company_name]} Team

Fix project url on update notification

- 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


= simple_form_for filter_form,
                  as: :q,
                  url: hd_mdm_patients_path,
                  method: :get,
                  html: { autocomplete: "off" },
                  wrapper: :horizontal_form do |f|
  .row
    .medium-4.columns
      = f.input :hospital_unit_id,
          collection: Renalware::Hospitals::Centre.with_hd_sites.ordered,
          as: :grouped_select, group_method: :hd_sites,
          label: t(".hospital_unit")

    .medium-4.columns
      = f.input :schedule_definition_ids,
          collection: Renalware::HD::ScheduleDefinitionFilter.all,
          label_method: :days,
          value_method: :ids,
          include_blank: true,
          label:  t(".schedule")

    .medium-4.columns.actions
      = f.submit t("helpers.submit.filter"), class: "button", name: nil
      span= " or "
      = link_to t("helpers.reset"), hd_mdm_patients_path

Fix order issue on Heroku

= simple_form_for filter_form,
                  as: :q,
                  url: hd_mdm_patients_path,
                  method: :get,
                  html: { autocomplete: "off" },
                  wrapper: :horizontal_form do |f|
  .row
    .medium-4.columns
      = f.input :hospital_unit_id,
          collection: Renalware::Hospitals::Centre.with_hd_sites.ordered,
          as: :grouped_select, group_method: :hd_sites,
          label: t(".hospital_unit")

    .medium-4.columns
      = f.input :schedule_definition_ids,
          collection: Renalware::HD::ScheduleDefinitionFilter.order('ids::text').all,
          label_method: :days,
          value_method: :ids,
          include_blank: true,
          label:  t(".schedule")

    .medium-4.columns.actions
      = f.submit t("helpers.submit.filter"), class: "button", name: nil
      span= " or "
      = link_to t("helpers.reset"), hd_mdm_patients_path


.ui.items
  - if asset.class.rated? && defined?(current_user) && current_user
    .item
      .content
        .ui.horizontal.divider Rating
        .description
          .ui.star.rating data-max-rating="5" data-rating="#{asset.rating_level_for(current_user)}"
          coffee:
            $('#right-column .ui.rating').rating
              clearable: true
              onRate: (new_rating) ->
                $.ajax
                  method: 'PUT'
                  url: "/#{model_slug}/#{asset_id}/rate/#{new_rating}"

  - asset.class.authorized_properties(defined?(current_user) && current_user).each do |property|
    - next if !asset.class.display_property?(property.name)
    - next if asset.class.name_property?(property.name) || asset.class.body_property?(property.name)

    - if asset.read_attribute(property.name).present?
      .item
        .content
          .ui.horizontal.divider data-authorizable="#{property.to_json}"
            = property.name.humanize
            - if property.private?
              i.red.hide.icon
          .description
            = render partial: 'graph_starter/properties/property', locals: {property: property, asset: asset, level: 'read'}

  - if asset.class.display_property?(:created_at)
    .item
      .content
        .ui.horizontal.divider Created
        .description = asset.created_at

  - if asset.class.display_property?(:updated_at)
    .item
      .content
        .ui.horizontal.divider Last updated
        .description = asset.updated_at

Fix render of `_property` partial

.ui.items
  - if asset.class.rated? && defined?(current_user) && current_user
    .item
      .content
        .ui.horizontal.divider Rating
        .description
          .ui.star.rating data-max-rating="5" data-rating="#{asset.rating_level_for(current_user)}"
          coffee:
            $('#right-column .ui.rating').rating
              clearable: true
              onRate: (new_rating) ->
                $.ajax
                  method: 'PUT'
                  url: "/#{model_slug}/#{asset_id}/rate/#{new_rating}"

  - asset.class.authorized_properties(defined?(current_user) && current_user).each do |property|
    - next if !asset.class.display_property?(property.name)
    - next if asset.class.name_property?(property.name) || asset.class.body_property?(property.name)

    - if asset.read_attribute(property.name).present?
      .item
        .content
          .ui.horizontal.divider data-authorizable="#{property.to_json}"
            = property.name.humanize
            - if property.private?
              i.red.hide.icon
          .description
            = render partial: 'graph_starter/properties/property', locals: {property: property, asset: asset, level: 'read', can_write: false}

  - if asset.class.display_property?(:created_at)
    .item
      .content
        .ui.horizontal.divider Created
        .description = asset.created_at

  - if asset.class.display_property?(:updated_at)
    .item
      .content
        .ui.horizontal.divider Last updated
        .description = asset.updated_at


h1 Listing <%= plural_table_name %>

table
  tr
<% attributes.each do |attribute| -%>
    th <%= attribute.human_name %>
<% end -%>
    th
    th
    th

  - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
    tr
<% attributes.each do |attribute| -%>
      td = <%= singular_table_name %>.<%= attribute.name %>
<% end -%>
      td = link_to 'Show', <%= singular_table_name %>
      td = link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
      td = link_to 'Destroy', <%= singular_table_name %>, data: {:confirm => 'Are you sure?'}, :method => :delete

br

= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path

Add thead and tbody to index template

h1 Listing <%= plural_table_name %>

table
  thead
    tr
<% attributes.each do |attribute| -%>
      th <%= attribute.human_name %>
<% end -%>
      th
      th
      th

  tbody
    - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
      tr
<% attributes.each do |attribute| -%>
        td = <%= singular_table_name %>.<%= attribute.name %>
<% end -%>
        td = link_to 'Show', <%= singular_table_name %>
        td = link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
        td = link_to 'Destroy', <%= singular_table_name %>, data: {:confirm => 'Are you sure?'}, :method => :delete

br

= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path


= within_patient_layout(title: "Demographics") do

  .row
    .large-12.columns
      = render "renalware/shared/errors", model: @patient

      = simple_form_for @patient,
          url: patient_death_path(@patient),
          html: { autocomplete: "off" },
          wrapper: "horizontal_form" do |f|

        .row
          .large-12.columns
            fieldset
              legend Cause of Death
              .large-9.columns
                = f.input :died_on, as: :date_picker, label: "Date of Death"

                = f.association :first_cause,
                    label: "Cause of Death (1)",
                    label_method: :description,
                    value_method: :id,
                    include_blank: "Select 1st cause of death"

                = f.association :second_cause,
                    label: "Cause of Death (2)",
                    label_method: :description,
                    value_method: :id,
                    include_blank: "Select 2nd cause of death"

                = f.input :death_notes, label: "Notes",
                    as: :text, input_html: { rows: 5 }

        = submit_tag "Save Cause of Death", class: "button tiny right save"

        = link_to "Cancel", new_patient_modality_path(@patient), class: "button tiny left cancel"

Use standard submit/cancel button styling

= within_patient_layout(title: "Demographics") do

  .row
    .large-12.columns
      = render "renalware/shared/errors", model: @patient

      = simple_form_for @patient,
          url: patient_death_path(@patient),
          html: { autocomplete: "off" },
          wrapper: "horizontal_form" do |f|

        .row
          .large-12.columns
            fieldset
              legend Cause of Death
              .large-9.columns
                = f.input :died_on, as: :date_picker, label: "Date of Death"

                = f.association :first_cause,
                    label: "Cause of Death (1)",
                    label_method: :description,
                    value_method: :id,
                    include_blank: "Select 1st cause of death"

                = f.association :second_cause,
                    label: "Cause of Death (2)",
                    label_method: :description,
                    value_method: :id,
                    include_blank: "Select 2nd cause of death"

                = f.input :death_notes, label: "Notes",
                    as: :text, input_html: { rows: 5 }

        .row
          .large-12.columns
            = f.button :submit
            span= " or "
            = link_to "cancel", new_patient_modality_path(@patient)


html
  head
    title= content_for?(:title) ? yield(:title) : 'Reminders'
    meta name="description" content="#{content_for?(:description) ? yield(:description) : 'Reminders App'}"
    = stylesheet_link_tag 'application', media: 'all'
    = stylesheet_link_tag 'project_checks'
    = javascript_include_tag 'application'
    = csrf_meta_tags
  body
    header
      = render 'layouts/navigation'
    main
      .container
        .row
          .col-xs-12
            = render 'layouts/messages'
        = yield

Remove referrence to a non-existing stylesheet

html
  head
    title= content_for?(:title) ? yield(:title) : 'Reminders'
    meta name="description" content="#{content_for?(:description) ? yield(:description) : 'Reminders App'}"
    = stylesheet_link_tag 'application', media: 'all'
    = javascript_include_tag 'application'
    = csrf_meta_tags
  body
    header
      = render 'layouts/navigation'
    main
      .container
        .row
          .col-xs-12
            = render 'layouts/messages'
        = yield


.js-financial-conditional
  - for c in question.by_year_conditions
    .js-conditional-question data-question=question.step.form[c.question_key].parameterized_title data-value=c.question_value
      .row
        - (1..c.years).each do |y|
          - year_span = (c.years > 2 ? "span-2-4" : "span-4")
          - if c.years == 6
            - year_span = "span-4"
          div class=(c.span_class || year_span)
            label
              span.js-year-end.show-default data-year="#{y}of#{c.years}"
                span.js-year-default
                  = question.format_label(y)
                span.js-year-text
              br
              ul.errors-container
              span class="#{'currency-input' if question.type == :money}"
                - if question.type == :money
                  span.currency-unit £
                input.small.js-trigger-autosave type="text" name=question.input_name(suffix: "#{y}of#{c.years}") value=question.input_value(suffix: "#{y}of#{c.years}") autocomplete="off" *possible_read_only_ops

Fix the default financial year label

.js-financial-conditional
  - for c in question.by_year_conditions
    .js-conditional-question data-question=question.step.form[c.question_key].parameterized_title data-value=c.question_value
      .row
        - (1..c.years).each do |y|
          - year_span = (c.years > 3 ? "span-2-4" : "span-4")
          - if c.years == 6
            - year_span = "span-4"
          div class=(c.span_class || year_span)
            label
              span.js-year-end.show-default data-year="#{y}of#{c.years}"
                span.js-year-default
                  ' Financial year
                  = y
                  - if y == c.years
                    '  (Current)
                span.js-year-text
              br
              ul.errors-container
              span class="#{'currency-input' if question.type == :money}"
                - if question.type == :money
                  span.currency-unit £
                input.small.js-trigger-autosave type="text" name=question.input_name(suffix: "#{y}of#{c.years}") value=question.input_value(suffix: "#{y}of#{c.years}") autocomplete="off" *possible_read_only_ops


javascript:
  comable_google_map_element_id = "#{id}";
  comable_google_map_address = "#{address.full_address}";

coffee:
  window.initialize_google_map_api = ->
    return if google?
    script = document.createElement('script')
    script.type = 'text/javascript'
    script.src = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=initialize_google_map'
    script.async = true
    document.body.appendChild(script)

  window.initialize_google_map = ->
    google_map = new google.maps.Map(document.getElementById(comable_google_map_element_id), { zoom: 15 })
    google_geo = new google.maps.Geocoder()
    google_geo.geocode({ address: comable_google_map_address }, (result, status) =>
      return if status != google.maps.GeocoderStatus.OK
      location = result[0].geometry.location
      google_map.setCenter(location)
      new google.maps.Marker({ map: google_map, position: location })
    )

  $(document).ready(->
    initialize_google_map_api()
  )

.comable-map
  .comable-google-map id="#{id}"
    | Loading map...

Fix a problem for Google Map

javascript:
  comable_google_map_element_id = "#{id}";
  comable_google_map_address = "#{address.full_address}";

coffee:
  window.can_google_map = ->
    return false unless comable_google_map_element_id?
    return false unless comable_google_map_address?
    return false unless $('#' + comable_google_map_element_id).length
    true

  window.initialize_google_map_api = ->
    script = document.createElement('script')
    script.type = 'text/javascript'
    script.src = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=initialize_google_map'
    script.async = true
    document.body.appendChild(script)

  window.initialize_google_map = ->
    return unless can_google_map()
    google_map = new google.maps.Map(document.getElementById(comable_google_map_element_id), { zoom: 15 })
    google_geo = new google.maps.Geocoder()
    google_geo.geocode({ address: comable_google_map_address }, (result, status) =>
      return if status != google.maps.GeocoderStatus.OK
      location = result[0].geometry.location
      google_map.setCenter(location)
      new google.maps.Marker({ map: google_map, position: location })
    )

  $(document).ready(->
    if google?
      initialize_google_map()
    else
      initialize_google_map_api()
  )

.comable-map
  .comable-google-map id="#{id}"
    | Loading map...


doctype 5
html
  head
    title InnoViz

    ==stylesheet_link_tag :application
    ==javascript_include_tag :jquery, 'foundation/jquery.foundation.topbar.js'

  body
    nav.contain-to-grid.top-bar
      ul
        li.name
          h1
            a href=url(:base, :index) title="InnoViz Home"
              | InnoViz

    ==yield

    javascript:
      $(document).foundationTopBar();

Correct layout and mock navigation

doctype 5
html
  head
    title InnoViz

    ==stylesheet_link_tag :application
    ==javascript_include_tag :jquery, 'foundation/jquery.foundation.topbar.js'

  body
    ==partial 'base/nav'

    ==yield

    javascript:
      $(document).foundationTopBar();


article.session
  h6 = link_to agenda.subject, agenda.speakers.first
  p
    = agenda_speaker_links(agenda.speakers)
  p
    / TODO: Improve translation display
    - if agenda.language.present?
      - if agenda.translated_language.present?
        span.session__badge.badge.badge-primary
          | #{agenda.language} → #{agenda.translated_language}
      - else
        span.session__badge.badge.badge-primary = agenda.language
  p
    - agenda.tags.each do |tag|
      span.session__badge.badge.badge-pink.px-2.py-1 = tag.name

Fix badge background color disappera

article.session
  h6 = link_to agenda.subject, agenda.speakers.first
  p
    = agenda_speaker_links(agenda.speakers)
  p
    / TODO: Improve translation display
    - if agenda.language.present?
      - if agenda.translated_language.present?
        span.session__badge.badge.bg-primary
          | #{agenda.language} → #{agenda.translated_language}
      - else
        span.session__badge.badge.badge-primary = agenda.language
  p
    - agenda.tags.each do |tag|
      span.session__badge.badge.badge-pink.px-2.py-1 = tag.name


div(itemprop="video" itemscope itemtype="http://schema.org/VideoObject")
  h4 itemprop="name" #{video.title}
  / TODO Add more metadata
  span itemprop="duration" content="#{video.duration_in_seconds}"
  span itemprop="thumbnail" content="#{video.thumb_url}"
  span itemprop="uploadDate" content="#{video.upload_date_iso8601}"
  .flex-video(widescreen vimeo)
    iframe(src="//player.vimeo.com/video/#{video.id}?title=0&byline=0&portrait=0&badge=0&color=2664A2" width="500" height="313" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen)
/ TODO Add this back in once we have identity support
  - video.cast.each do |c|
    .follow-links
      span(class="title")Follow #{first_name(c.display_name)}
      a: i.icon-rss
      a: i.icon-facebook
      a: i.icon-twitter
      a: i.icon-linkedin

Switch to dynamically adding contributors

div(itemprop="video" itemscope itemtype="http://schema.org/VideoObject" data-searchisko-type="jbossdeveloper_vimeo" data-searchisko-id="#{video.id}")
  h4 itemprop="name" #{video.title}
  / TODO Add more metadata
  span itemprop="duration" content="#{video.duration_in_seconds}"
  span itemprop="thumbnail" content="#{video.thumb_url}"
  span itemprop="uploadDate" content="#{video.upload_date_iso8601}"
  .flex-video(widescreen vimeo)
    iframe(src="//player.vimeo.com/video/#{video.id}?title=0&byline=0&portrait=0&badge=0&color=2664A2" width="500" height="313" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen)
  span.contributors


- if can?(:attempt, video) && current_course_user
  - submission = video.submissions.select { |s| s.creator == current_user }.first
  - if submission
    = link_to t('.rewatch'),
      edit_course_video_submission_path(current_course, video, submission),
      class: ['btn', 'btn-info']
  - else
    = link_to t('.watch'), course_video_submissions_path(current_course, video),
      class: ['btn', 'btn-info'], method: :post
- else
  = link_to(t('.watch'), '#', class: ['btn', 'btn-info', 'disabled'])

Fix N+1 queries in video_attempt_button

- if can?(:attempt, video) && current_course_user
  - submission = video.submissions.by_user(current_user).first
  - if submission
    = link_to t('.rewatch'),
      edit_course_video_submission_path(current_course, video, submission),
      class: ['btn', 'btn-info']
  - else
    = link_to t('.watch'), course_video_submissions_path(current_course, video),
      class: ['btn', 'btn-info'], method: :post
- else
  = link_to(t('.watch'), '#', class: ['btn', 'btn-info', 'disabled'])


header.header-main
  .wrapper-inner
    h1.Logo.Logo--start = link_to "clarat.org", '/'

    .Distributor
      = render '/offers/shared/search_form', search_cache: search_cache

Fix logo modifier for non-start pages

header.header-main
  .wrapper-inner
    h1.Logo.Logo = link_to "clarat.org", '/'

    .Distributor
      = render '/offers/shared/search_form', search_cache: search_cache


- if @today_order&.realized?
  h2
    | 本日 (#{l(@today_order.date)}) のお弁当を受け取る
  / TODO インタフェースとしてはイケてないけどとりあえずやりたいことはこういうこと
  p
    | 本日の予約は締め切りました。受け取りチェックをするには以下のリンクをクリックしてください。
  = link_to l(@today_order.date), order_order_items_path(@today_order)
- else
  h2
    | 本日 (#{l(@today_order.date)}) の発注は注文数不足のため注文されませんでした
h2
  | お弁当を予約する

- if @orders.any?
  p
    | 予約したい日付を選んでください。
  - @orders.each do |order|
    ul
      li= link_to l(order.date), order_order_items_path(order)
- else
  p
    | 予約できる日がありません。管理者にお問い合わせください。

Fix bug with no order record on holiday

- if !@today_order
- elsif @today_order&.realized?
  h2
    | 本日 (#{l(@today_order.date)}) のお弁当を受け取る
  / TODO インタフェースとしてはイケてないけどとりあえずやりたいことはこういうこと
  p
    | 本日の予約は締め切りました。受け取りチェックをするには以下のリンクをクリックしてください。
  = link_to l(@today_order.date), order_order_items_path(@today_order)
- else
  h2
    | 本日 (#{l(@today_order.date)}) の発注は注文数不足のため注文されませんでした
h2
  | お弁当を予約する

- if @orders.any?
  p
    | 予約したい日付を選んでください。
  - @orders.each do |order|
    ul
      li= link_to l(order.date), order_order_items_path(order)
- else
  p
    | 予約できる日がありません。管理者にお問い合わせください。


.well
  p.text-center
    | No results found. Do you want to
    = button_to "Add one", '#', class: "btn btn-primary btn-lg center-block", method: :get

Add link to no resoults button

.well
  p.text-center
    | No results found. Do you want to
    = button_to "Add one", new_subject_link_path, class: "btn btn-primary btn-lg center-block", method: :get


= form_for [page, share], remote: true, html: { class: "shares-editor__new-form #{css_class}", data: {share: share.name} }  do |f|

  = f.hidden_field :name
  = render partial: "share/#{share.name}s/share_fields", locals: { form: f, share: share, page: page }
  = f.submit 'Add share variant', class: 'btn btn-primary', 'data-disable-with' => t('common.saving')

Save share variant instead of add share variant

= form_for [page, share], remote: true, html: { class: "shares-editor__new-form #{css_class}", data: {share: share.name} }  do |f|

  = f.hidden_field :name
  = render partial: "share/#{share.name}s/share_fields", locals: { form: f, share: share, page: page }
  = f.submit 'Save share variant', class: 'btn btn-primary', 'data-disable-with' => t('common.saving')


- title "hello"
- content_for(:header) do
  - if current_user.try(:avatar).present?
    h2
      span style="margin-right: .5em;"
        img src=current_user.avatar width=50 height=50
      span Splits I/O
  - else
    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
  .row
    .col-md-12
      - 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

Add random link on logged-out frontpage

- title "hello"
- content_for(:header) do
  - if current_user.try(:avatar).present?
    h2
      span style="margin-right: .5em;"
        img src=current_user.avatar width=50 height=50
      span Splits I/O
  - else
    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
  .row
    .col-md-12
      - 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.
        p Not sure what Splits I/O is about? #{link_to 'Roll the dice', random_path} to visit a random run.
- if logged_in?
  article#follows


- content_for :title, post.page_title
- content_for :url, post_url(post)
- content_for :image_url, post.author.photo_url
- content_for :description, post.description
- content_for :hero_class, 'Hero--large Hero--center'
- content_for :hero
  = render 'post_hero', post: post

.u-smallMargin
.PostWidthConstrainer
  = render 'shared/tag_list', tag_list: post.tag_list
.u-defaultMargin

.Post
  .Post-body = post.processed_body

.PostWidthConstrainer
  .u-doubleLargeMargin
  .Separator.Separator--subvisual
  .u-defaultThenLargeMargin

  = render 'author_bio', author: post.author
  .u-defaultThenLargeMargin

= render 'related_posts', post: post
.u-largeMargin

= render 'shared/hire_us'
.u-defaultMargin

.Separator.Separator--subvisual
.u-largeMargin

= render '/shared/newsletter'
.u-largeMargin

= render 'shared/disqus', post: post
.u-largeMargin

Tag margin on post page fixed

- content_for :title, post.page_title
- content_for :url, post_url(post)
- content_for :image_url, post.author.photo_url
- content_for :description, post.description
- content_for :hero_class, 'Hero--large Hero--center'
- content_for :hero
  = render 'post_hero', post: post

.u-xSmallThenSmallMargin
.PostWidthConstrainer
  = render 'shared/tag_list', tag_list: post.tag_list
.u-defaultMargin

.Post
  .Post-body = post.processed_body

.PostWidthConstrainer
  .u-doubleLargeMargin
  .Separator.Separator--subvisual
  .u-defaultThenLargeMargin

  = render 'author_bio', author: post.author
  .u-defaultThenLargeMargin

= render 'related_posts', post: post
.u-largeMargin

= render 'shared/hire_us'
.u-defaultMargin

.Separator.Separator--subvisual
.u-largeMargin

= render '/shared/newsletter'
.u-largeMargin

= render 'shared/disqus', post: post
.u-largeMargin


article.block.projet
  h3 Projet envisagé
  = link_to t('projets.visualisation.lien_edition'), etape2_description_projet_path(@projet_courant), class: 'edit'
  .content-block
    = affiche_demande_souhaitee(@projet_courant.demande)
    hr/
    h4 Organisme qui vous accompagne pour la suite de votre projet :
    - operateur = @projet_courant.intervenants.pour_role(:operateur).first
    - if operateur.present?
      p
        strong= operateur
      - unless current_agent
        br
        br
        p Vous pouvez à présent dialoguer avec cet intervenant par la messagerie. Vous serez informé par email pour chaque réponse de sa part.
        - unless @projet_courant.operateur
          = link_to t('projets.visualisation.s_engager_avec_operateur'), new_projet_choix_intervenant_path(@projet_courant, intervenant_id: @projet_courant.intervenants.first), class: 'btn'
      - else
        p
          strong Aucun
        - unless current_agent
          br
          br
          = link_to "Choisir un opérateur", etape3_choix_intervenant_path(@projet_courant), class: 'btn'

Fix erreur 500 sur projet envisagé si l'étape 2 n'a pas été remplie

article.block.projet
  h3 Projet envisagé
  = link_to t('projets.visualisation.lien_edition'), etape2_description_projet_path(@projet_courant), class: 'edit'
  .content-block
    - if @projet_courant.demande.blank?
      - if current_agent
        p Le demandeur n'a pas encore rempli le projet.
      - else
        = link_to "Remplir le projet", etape2_description_projet_path(@projet_courant), class: 'btn pen'
    - else
      = affiche_demande_souhaitee(@projet_courant.demande)
      hr/
      h4 Organisme qui vous accompagne pour la suite de votre projet :
      - operateur = @projet_courant.intervenants.pour_role(:operateur).first
      - if operateur.present?
        p
          strong= operateur
        - unless current_agent
          br
          br
          p Vous pouvez à présent dialoguer avec cet intervenant par la messagerie. Vous serez informé par email pour chaque réponse de sa part.
          - unless @projet_courant.operateur
            = link_to t('projets.visualisation.s_engager_avec_operateur'), new_projet_choix_intervenant_path(@projet_courant, intervenant_id: @projet_courant.intervenants.first), class: 'btn'
        - else
          p
            strong Aucun
          - unless current_agent
            br
            br
            = link_to "Choisir un opérateur", etape3_choix_intervenant_path(@projet_courant), class: 'btn'


h1 予約確認・注文確認

h1= link_to "予約する", new_order_order_item_path(@order)

table(border=1)
  tr
    td.name(align="center") = "-"
    - Lunchbox.all.each do |lunchbox|
      td.name = lunchbox.name
    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 = ""

Add price in order index

h1 予約確認・注文確認

h1= link_to "予約する", new_order_order_item_path(@order)

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 = ""