fieldset.question-group
  h3 = f.label :subscribed_to_emails, label: "Is the user happy for us to email them in the future with information relating to the Queen's Awards, and with any other information from the Department of Business, Innovation and Skills?"
  = f.input :subscribed_to_emails,
            wrapper_html: { class: "checkbox selectable-group" },
            label_html: { class: "selectable" },
            label: "I am happy to be contacted with information about the Queen's Awards"

fieldset.question-group
  h3 = f.label :qae_info_source, label: "How did the #{controller_name.singularize} hear about the Queen's Awards?"
  .row
    .col-md-4.col-sm-5
      = f.input :qae_info_source,
                as: :select,
                wrapper_html: { class: "form-group" },
                input_html: { class: "form-control" },
                label_html: { class: "visuallyhidden" }

      span.clear
      #qae_info_source_other.visuallyhidden
        = f.input :qae_info_source_other,
                  wrapper_html: { class: "form-group" },
                  input_html: { class: "form-control" },
                  label: "Please specify"

COPY Dept of BIS -> Dept for BIS

fieldset.question-group
  h3 = f.label :subscribed_to_emails, label: "Is the user happy for us to email them in the future with information relating to the Queen's Awards, and with any other information from the Department for Business, Innovation and Skills?"
  = f.input :subscribed_to_emails,
            wrapper_html: { class: "checkbox selectable-group" },
            label_html: { class: "selectable" },
            label: "I am happy to be contacted with information about the Queen's Awards"

fieldset.question-group
  h3 = f.label :qae_info_source, label: "How did the #{controller_name.singularize} hear about the Queen's Awards?"
  .row
    .col-md-4.col-sm-5
      = f.input :qae_info_source,
                as: :select,
                wrapper_html: { class: "form-group" },
                input_html: { class: "form-control" },
                label_html: { class: "visuallyhidden" }

      span.clear
      #qae_info_source_other.visuallyhidden
        = f.input :qae_info_source_other,
                  wrapper_html: { class: "form-group" },
                  input_html: { class: "form-control" },
                  label: "Please specify"


.row
  .span12
    .page
      .row
        .span9
          = bootstrap_form_for(@project) do |f|
            = f.text_field :name
            = f.text_area :mappings, help_block: "Syntax: build_name1=alias1 <newline> build_name2=alias2"
            .form-actions
              = submit_tag "Save", class: "btn btn-primary"
        .span2
          p= link_to("Remove project", project_path(@project), method: :delete, confirm: "Are you sure you want to remove #{@project.name}?")

Improve usability of project edit.

.row
  .span12
    .page
      .row
        .span9
          = bootstrap_form_for(@project) do |f|
            = f.text_field :name
            = f.text_area :mappings, style: "width: 875px", label: "Mappings (ordered aliases for longer build names)"
            p Syntax:
            p= "build_name1=alias1<br/>build_name2=alias2".html_safe
            .form-actions
              = submit_tag "Save", class: "btn btn-primary"
        .span2
          p= link_to("Remove project", project_path(@project), method: :delete, confirm: "Are you sure you want to remove #{@project.name}?")


= admin_page_header t('.sites'), t('.manage_sites_on_system')
.content
  .row
    .col-md-12
      = admin_box do
        = admin_box_header t('.sites'), class: 'with-border'
        = admin_box_body class: 'no-padding' do
          table.table.table-striped
            thead
              tr
                th.table__id-column #
                th = t('.name')
                th = t('.domain')
                th = t('.actions')
            tbody
              = render @sites

Remove unused site list view header

= admin_page_header t('.sites'), t('.manage_sites_on_system')
.content
  .row
    .col-md-12
      = admin_box do
        = admin_box_body class: 'no-padding' do
          table.table.table-striped
            thead
              tr
                th.table__id-column #
                th = t('.name')
                th = t('.domain')
                th = t('.actions')
            tbody
              = render @sites


- bsat_page_title t('.form_overview')
- bsat_page_actions do |action|
  - action.add t('.new'), formgen.new_form_path, icon: 'plus', link_to_options: { class: 'btn btn-primary' }

= table_for Formgen::Form, paginate: true

Move counter to bottom on form overview

- bsat_page_title t('.form_overview')
- bsat_page_actions do |action|
  - action.add t('.new'), formgen.new_form_path, icon: 'plus', link_to_options: { class: 'btn btn-primary' }

= table_for Formgen::Form, paginate: true, counter_position: :bottom


- if user_signed_in?
  |  Signed in as
  = current_user.name
  | . Not you?
  = link_to "Sign out", users_sign_out_path,:method => :delete
- else
  = link_to  user_omniauth_authorize_path(:google_oauth2) do
    .social-login-buttons
      a.btn.btn-link-1.btn-link-1-google-plus href="#{url_for  user_omniauth_authorize_path(:google_oauth2)}"
        i.fa.fa-google-plus
          | &nbsp Login with Google

Fix devise ominauth method deprecation warning

- if user_signed_in?
  |  Signed in as
  = current_user.name
  | . Not you?
  = link_to "Sign out", users_sign_out_path,:method => :delete
- else
  = link_to  user_google_oauth2_omniauth_authorize_path do
    .social-login-buttons
      a.btn.btn-link-1.btn-link-1-google-plus href="#{url_for  user_google_oauth2_omniauth_authorize_path}"
        i.fa.fa-google-plus
          | &nbsp Login with Google


.home-page
  / for SEO
  h1 style="display:none" brother.ly

  section.home-page__slideshow
    - @current_episodes.each do |episode|
      .slideshow__slide.slideshow__slide--current data-youtube="#{episode.youtube_id}"
        h2= link_to "Now Playing: #{episode.title}", episode
        .hero-wrapper
          iframe#stream src="#{episode.stream_url}?rel=0&autoplay=1&&showinfo=0&controls=0" frameborder="0" allowfullscreen="true"
    - @upcoming_episodes.each do |episode|
      .slideshow__slide.slideshow__slide--upcoming
        h2= link_to "Up Next: #{episode.title}", episode
        = image_tag episode.poster_url
    .slideshow__slide.slideshow_slide--workshop
      = image_tag 'workshop.png'
      h2= link_to 'Every Month: The brother.ly Electronic Music Workshop', '/workshop'
    - @past_performances.each do |performance|
      .slideshow__slide.slideshow__slide--upcoming
        h2= link_to "Watch It Again: #{performance.title}", performance.episode
        = render 'video', src: performance.video_url, poster: performance.poster_url, name: performance.name.parameterize

  section.home-page__features
    h2 Featured
    - @features.each do |feature|
      = render present(feature)

Update homepage to put workshop at the end of episodes

.home-page
  / for SEO
  h1 style="display:none" brother.ly

  section.home-page__slideshow
    - @current_episodes.each do |episode|
      .slideshow__slide.slideshow__slide--current data-youtube="#{episode.youtube_id}"
        h2= link_to "Now Playing: #{episode.title}", episode
        .hero-wrapper
          iframe#stream src="#{episode.stream_url}?rel=0&autoplay=1&&showinfo=0&controls=0" frameborder="0" allowfullscreen="true"
    - @upcoming_episodes.each do |episode|
      .slideshow__slide.slideshow__slide--upcoming
        h2= link_to "Up Next: #{episode.title}", episode
        = image_tag episode.poster_url
    - @past_performances.each do |performance|
      .slideshow__slide.slideshow__slide--upcoming
        h2= link_to "Watch It Again: #{performance.title}", performance.episode
        = render 'video', src: performance.video_url, poster: performance.poster_url, name: performance.name.parameterize
    .slideshow__slide.slideshow_slide--workshop
      = image_tag 'workshop.png'
      h2= link_to 'Every Month: The brother.ly Electronic Music Workshop', '/workshop'

  section.home-page__features
    h2 Featured
    - @features.each do |feature|
      = render present(feature)


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

Add reminder about what help page will be for

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


tr
  td = ping.id
  td.nowrap = l ping.created_at, format: :short
  td = ping.user.domain
  td
    - if ping.post.present?
      = link_to ping.post.guid, post_url(ping.post)
  td = link_to ping.source, ping.source, rel: 'nofollow'
  td = link_to ping.target, ping.target, rel: 'nofollow'

Fix links to posts attached to pings.

tr
  td = ping.id
  td.nowrap = l ping.created_at, format: :short
  td = ping.user.domain
  td
    - if ping.post.present?
      = link_to ping.post.guid, ping.post.guid.with_http
  td = link_to ping.source, ping.source, rel: 'nofollow'
  td = link_to ping.target, ping.target, rel: 'nofollow'


= simple_form_for collaborator,
                  as: :collaborator,
                  url: account_collaborators_path,
                  html: {class: 'qae-form', method: :post} do |f|
  .field_with_errors
    - if add_collaborator_interactor.errors.present?
      - add_collaborator_interactor.errors.each do |error|
        span.error
          = error
    - if collaborator.errors[:base].present?
      - collaborator.errors[:base].each do |error|
        span.error
          = error

  = f.input :email, required: true, input_html: { class: '' }
  = f.input :role, required: true, input_html: { class: '' }, include_blank: false
  = f.submit "Add"

Add extra fields to collaborator

= simple_form_for collaborator,
                  as: :collaborator,
                  url: account_collaborators_path,
                  builder: SimpleForm::AccountFormBuilder,
                  html: {class: 'qae-form', method: :post} do |f|
  .field_with_errors
    - if add_collaborator_interactor.errors.present?
      - add_collaborator_interactor.errors.each do |error|
        span.error
          = error
    - if collaborator.errors[:base].present?
      - collaborator.errors[:base].each do |error|
        span.error
          = error

  fieldset
    h3
      ' Collaborator's full name
    = f.input :title, input_html: { class: 'big small', autocomplete: "off"}
    = f.input :first_name, input_html: { class: 'big medium', autocomplete: "off"}
    = f.input :last_name, input_html: { class: 'big medium', autocomplete: "off"}

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

  fieldset
    h3
      ' Email
  = f.input :email, required: true, input_html: { class: 'big medium', autocomplete: "off"}, label_html: { class: 'visuallyhidden' }

  fieldset
    h3
      ' Administrative rights
    = f.input :role, required: true, include_blank: false, input_html: { class: 'big small', autocomplete: "off"}, label_html: { class: 'visuallyhidden' }

  footer
    nav.pagination role="navigation" aria-label="Pagination"
      ul.group
        li.previous.previous-alternate
          = link_to account_collaborators_path, rel: "prev", title: "Navigate back" do
            span class="pagination-label"
              ' Cancel

        li.submit
          = f.submit "Add collaborator", class: "button"


---
layout: lecture
title: The Road To Enumerable
---

section.center data-background="#000"
  h1.white The Road To Enumerable - Classes, Objects, Modules & Blocks

Add first batch of slides

---
layout: lecture
title: The Road To Enumerable
---

section.center data-background="#000"
  h1.white The Road To Enumerable - Classes, Objects, Modules & Blocks

section.center data-background="#000"
  h2.white Intuition

section
  h2 Class
  ul
    li Like a recipe
    li A recipe for an object
    li We describe the recipe by attributes & methods.

  img width='40%' src='http://i.stack.imgur.com/uTlnv.jpg'

section
  h2 Object
  ul
    li Has data / state, as the recipe prescribed
    li Has behavior, as the recipe prescribed

section
  h2 State & Behaviour
  ul
    li Attributes are state & Methods are behaviour
    li Methods usually act on the state
    li They retrieve the state and give to to someone who wants it
    li Or they change the state

section
  h2 Class
  ul
    li It contains methods and instance variables
    li Some of those methods are a bit special
  pre: code.ruby
    '
      class Person
        def initialize(name, age)
          @name = name
          @age = age
        end
      end

  h2 Object
  p Is an instance of a class
  pre: code.ruby
    '
      >> maria = Person.new('Maria', 21)
      >> #<Person:0x00000002b5e850 @age=21, @name="Maria">


h3
  = 'Merged data'
.row
  .col-md-12
    = form_tag Settings.ncbi_blast_api, method: :post,
            target: '_blank', enforce_utf8: false, authenticity_token: false do
      = hidden_field_tag 'CMD', 'Web'
      = hidden_field_tag 'PAGE_TYPE', 'BlastSearch'
      = hidden_field_tag 'LINK_LOC', 'blasthome'
      = text_area_tag 'QUERY', @content, class: 'content-area', id: 'content'
      br
      br
      = submit_tag 'Open BLAST', class: 'btn btn-primary'
hr
= link_to 'Back', fasta_data_path

Add description to Open BLAST button

h3
  = 'Merged data'
.row
  .col-md-12
    = form_tag Settings.ncbi_blast_api, method: :post,
            target: '_blank', enforce_utf8: false, authenticity_token: false do
      = hidden_field_tag 'CMD', 'Web'
      = hidden_field_tag 'PAGE_TYPE', 'BlastSearch'
      = hidden_field_tag 'LINK_LOC', 'blasthome'
      = text_area_tag 'QUERY', @content, class: 'content-area', id: 'content'
      br
      br
      = submit_tag 'Open BLAST', class: 'btn btn-primary'
      | 「NCBIのBLASTページを表示し、上のデータをEnter Query Sequence欄に自動で設定します」
hr
= link_to 'Back', fasta_data_path


- Mobility.with_locale(admin_current_resource_locale) do
  = simple_form_for [:admin, @agenda] do |f|
    = admin_box_body do
      = f.input :subject, as: :string
      = f.input :description, as: :text, input_html: { data: { editor: true }, rows: 20 }
      = f.association :speakers, input_html: { class: 'select2' }
      = f.input :language, collection: Agenda.languages.keys, include_blank: false
      = f.input :translated_language, collection: Agenda.translated_languages.keys
      = f.input :translated_type, collection: Agenda.translated_types.keys
      = f.association :room
      = f.association :time
      = f.input :order
      = f.association :tags, input_html: { class: 'select2' }
    = admin_box_footer do
      = f.submit class: 'btn btn-primary'

Allow blank language for agenda

- Mobility.with_locale(admin_current_resource_locale) do
  = simple_form_for [:admin, @agenda] do |f|
    = admin_box_body do
      = f.input :subject, as: :string
      = f.input :description, as: :text, input_html: { data: { editor: true }, rows: 20 }
      = f.association :speakers, input_html: { class: 'select2' }
      = f.input :language, collection: Agenda.languages.keys, include_blank: true
      = f.input :translated_language, collection: Agenda.translated_languages.keys
      = f.input :translated_type, collection: Agenda.translated_types.keys
      = f.association :room
      = f.association :time
      = f.input :order
      = f.association :tags, input_html: { class: 'select2' }
    = admin_box_footer do
      = f.submit class: 'btn btn-primary'


doctype html
html lang="en"

head
  meta charset="utf-8"
  meta http-equiv="X-UA-Compatible" content="IE=edge"
  meta name="viewport" content="width=device-width, initial-scale=1"
  meta name="description" content="Submit an event for inclusion in the West Cornwall Events Calendar"
  meta name="author" content="Tony Edwards"
  = csrf_meta_tag

  title #{@page_title}

  = stylesheet_link_tag 'bootstrap.min'
  = stylesheet_link_tag 'font-awesome.min'
  = stylesheet_link_tag 'user_submit'
  = stylesheet_link_tag 'bootstrap-clockpicker.min.css'

  /[if lt IE 9]
    = javascript_include_tag "https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"
    = javascript_include_tag "https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"
    = stylesheet_link_tag 'custom-theme/jquery-ui-1.10.0.ie'

body
  .container
      = yield

  = javascript_include_tag 'jquery.min'
  = javascript_include_tag "https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"
  = javascript_include_tag 'bootstrap.min'
  = javascript_include_tag 'bootstrap-clockpicker.min'
  = javascript_include_tag 'user_submit.js'

Include new assets in user events layout

doctype html
html lang="en"

head
  meta charset="utf-8"
  meta http-equiv="X-UA-Compatible" content="IE=edge"
  meta name="viewport" content="width=device-width, initial-scale=1"
  meta name="description" content="Submit an event for inclusion in the West Cornwall Events Calendar"
  meta name="author" content="Tony Edwards"
  = csrf_meta_tag

  title #{@page_title}

  = stylesheet_link_tag 'user_events'

  /[if lt IE 9]
    = javascript_include_tag "https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"
    = javascript_include_tag "https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"

body
  .container
      = yield

  = javascript_include_tag 'application'
  = javascript_include_tag 'user_events'


= page_header do
  div.btn-group
    - if can?(:create, Course::LessonPlan::Milestone.new(course: current_course))
      = new_button([current_course, :lesson_plan_milestone]) { fa_icon 'flag-checkered'.freeze }
    - if can?(:create, Course::LessonPlan::Event.new(course: current_course))
      = new_button([current_course, :lesson_plan_event]) { fa_icon 'calendar-plus-o'.freeze }

div#lesson-plan-items
  = fa_icon 'spinner 4x spin'

Add link to lesson plan edit page

= page_header do
  div.btn-group
    - if can?(:manage, Course::LessonPlan::Item.new(course: current_course))
      = edit_button(course_lesson_plan_edit_path(current_course))
    - if can?(:create, Course::LessonPlan::Milestone.new(course: current_course))
      = new_button([current_course, :lesson_plan_milestone]) { fa_icon 'flag-checkered'.freeze }
    - if can?(:create, Course::LessonPlan::Event.new(course: current_course))
      = new_button([current_course, :lesson_plan_event]) { fa_icon 'calendar-plus-o'.freeze }

div#lesson-plan-items
  = fa_icon 'spinner 4x spin'


- breadcrumb :root

= render 'optional_modules/sliders/show', slider: slider, force: false

= background.handle_background_tag if @background_module.enabled? && !@background.nil?

.row
  - @homes.each do |home|
    article.small-12.columns
      == home.microdata_meta

      header
        h2 = home.title

      div == home.content

      - if @video_module.enabled?
        - home.videos.each do |video|
          - video_info = VideoInfo.new(video.url)
          - if video_info.available? && video.online?
            .flex-video.widescreen == video_info.embed_code

Update foundation grid for video display

- breadcrumb :root

= render 'optional_modules/sliders/show', slider: slider, force: false

= background.handle_background_tag if @background_module.enabled? && !@background.nil?

.row
  - @homes.each do |home|
    article.small-12.columns
      == home.microdata_meta

      header
        h2 = home.title

      div == home.content

      - if @video_module.enabled?
        - home.videos.each do |video|
          - video_info = VideoInfo.new(video.url)
          - if video_info.available? && video.online?
            .small-12.medium-4.large-3.columns
              .flex-video.widescreen == video_info.embed_code


- page = @page

= form_for page do |f|
  - if page.errors.any?
    #error_explanation
      h2 = "#{pluralize(page.errors.count, "error")} prohibited this page from being saved:"
      ul
        - page.errors.full_messages.each do |message|
          li = message

  .form-group
    = f.text_field :path, placeholder: "The path to the page. 'index' will go to #{request.base_url}/index", class: "form-control"
    small#emailHelp.form-text.text-muted Path to the page

  .form-group
    .editor-container
      = f.text_area :body, class: 'editor markdown'
  .form-group
    .actions
        button#page_save.btn.btn-primary type="submit"
          => fa_icon 'save'
          | Save
        - if page.persisted?
          =< link_to "#{fa_icon("trash-o")} Delete".html_safe, page, data: {:confirm => 'Are you sure?'}, :method => :delete, class: "btn btn-danger"

Use a plain text_area for pages

- page = @page

= form_for page do |f|
  - if page.errors.any?
    #error_explanation
      h2 = "#{pluralize(page.errors.count, "error")} prohibited this page from being saved:"
      ul
        - page.errors.full_messages.each do |message|
          li = message

  .form-group
    = f.text_field :path, placeholder: "The path to the page. 'my_page' will go to #{request.base_url}/my_page", class: "form-control"
    small#emailHelp.form-text.text-muted Path to the page

  .form-group
    = f.text_area :body, class: 'plain-text markdown'
  .form-group
    .actions
        button#page_save.btn.btn-primary type="submit"
          => fa_icon 'save'
          | Save
        - if page.persisted?
          =< link_to "#{fa_icon("trash-o")} Delete".html_safe, page, data: {:confirm => 'Are you sure?'}, :method => :delete, class: "btn btn-danger"


.table_content
  table.table.table-striped
    thead
      th= t('.table.project')
      th= t('.table.subscription_date')
      th= t('.table.status')
      th
    - subscriptions.each do |subscription|
        tr[id="subscription_#{subscription.id}"]
          td.project_name
            = link_to subscription.project.name, subscription.project, class: 'link_project'
          td.date = I18n.l(subscription.created_at.to_date)
          td.status = I18n.t(subscription.status, scope: [:activerecord, :attributes, :subscription, :statuses])
          td.cancel
            - unless subscription.canceled?
              = simple_form_for subscription, url: subscription_cancel_path, method: :post do |form|
                = form.input :id, as: :hidden, value: subscription.id
                = form.button :submit, t('.form.submit.cancel'), class: 'bg-red-error'

Update User's dashboard subscriptions tab

.table_content
  table.table.table-striped
    thead
      th= t('.table.project')
      th= t('.table.subscription_date')
      th= t('.table.status')
      th
    - subscriptions.each do |subscription|
        tr[id="subscription_#{subscription.id}"]
          td.project_name
            = link_to subscription.project.name, subscription.project, class: 'link_project'
          td.date = I18n.l(subscription.created_at.to_date)
          td.status = I18n.t(subscription.status, scope: [:activerecord, :attributes, :subscription, :statuses])
          td.cancel
            - if subscription.available_for_canceling?
              = simple_form_for subscription, url: subscription_cancel_path, method: :post do |form|
                = form.input :id, as: :hidden, value: subscription.id
                = form.button :submit, t('.form.submit.cancel'), class: 'bg-red-error'


div.modal-header
  button.close type='button' data-dismiss='modal' aria-label='Close'
    span aria-hidden='true' ×
  h4.modal-title#modal-invocation-show= t('.modals.invocation')
div.modal-body
  = render('invoice', invoice: @invoice, doc: @invoice_doc)
div.modal-footer
  button.btn.btn-default(type="button" data-dismiss="modal")= t('.close')

Fix a title in a modal (invoice)

div.modal-header
  button.close type='button' data-dismiss='modal' aria-label='Close'
    span aria-hidden='true' ×
  h4.modal-title#modal-invocation-show= t('.modals.invoice')
div.modal-body
  = render('invoice', invoice: @invoice, doc: @invoice_doc)
div.modal-footer
  button.btn.btn-default(type="button" data-dismiss="modal")= t('.close')


table.editable.data-table id=table.id
  thead
    tr
      - table.columns.each_with_index do |column, index|
        th data-id=column.id data-name=column.name data-index=index data-type=column.type data-link-id=column.linked_column_id
          = column.name
  tbody
    - table.records.each do |record|
      tr data-id=record.id data-url=record_path(record)
        - table.columns.each_with_index do |c, n|
          td
            = record.data[n] || ''

Add a column for actions to the table.

table.editable.data-table id=table.id
  thead
    tr
      - table.columns.each_with_index do |column, index|
        th data-id=column.id data-name=column.name data-index=index data-type=column.type data-link-id=column.linked_column_id
          = column.name
      th.actions
        |Actions
  tbody
    - table.records.each do |record|
      tr data-id=record.id data-url=record_path(record)
        - table.columns.each_with_index do |c, n|
          td
            = record.data[n] || ''
        th.actions
          '


- wrap_layout :layout do
  .col-md-9.col-offset-md-9
    h1
      = event.title
      = " (SOLD OUT)" if event.sold_out?
    h2 Organized by #{event.organizer}
    .event-location = event.location
    == yield

Improve the formatting of events.

- wrap_layout :layout do
  .col-md-9
    h1.text-center
      = event.title
      = " (SOLD OUT)" if event.sold_out?
    h2.text-center Organized by #{event.organizer}
    .event-location.text-center = event.location
    == yield


doctype html
html xmlns='http://www.w3.org/1999/xhtml' lang=I18n.locale
  head
    meta charset="utf-8"
    meta http-equiv="x-ua-compatible" content="ie=edge"

    title= escape_once(strip_tags(title) + " | Locomotive")

    meta name="viewport" content="width=device-width, initial-scale=1"

    link rel="icon" type="image/png" href="#{asset_url('locomotive/favicon.png')}" sizes="32x32"

    link href="https://fonts.googleapis.com/css?family=Muli:400,300|Noto+Sans:400,700" rel="stylesheet" type="text/css"

    = javascript_include_tag  'locomotive/account'
    = stylesheet_link_tag     'locomotive/account', media: 'screen'

    = csrf_meta_tag

    javascript:
      window.flash_messages = #{{flash_messages_to_json}};

    = yield :head

  body class=[controller.controller_name, flash.empty? ? '' : 'with-flash'].join(' ')
    .public-background
      = yield :header
      .public-container
        .public-wrapper
          = link_to root_path, class: 'public-logo' do
            = image_tag 'locomotive/logo.png'
            span Locomotive
          = yield

    = yield :footer

Use Locomotive.config for title tag

doctype html
html xmlns='http://www.w3.org/1999/xhtml' lang=I18n.locale
  head
    meta charset="utf-8"
    meta http-equiv="x-ua-compatible" content="ie=edge"

    title= escape_once(strip_tags(title) + " | #{Locomotive.config.name}")

    meta name="viewport" content="width=device-width, initial-scale=1"

    link rel="icon" type="image/png" href="#{asset_url('locomotive/favicon.png')}" sizes="32x32"

    link href="https://fonts.googleapis.com/css?family=Muli:400,300|Noto+Sans:400,700" rel="stylesheet" type="text/css"

    = javascript_include_tag  'locomotive/account'
    = stylesheet_link_tag     'locomotive/account', media: 'screen'

    = csrf_meta_tag

    javascript:
      window.flash_messages = #{{flash_messages_to_json}};

    = yield :head

  body class=[controller.controller_name, flash.empty? ? '' : 'with-flash'].join(' ')
    .public-background
      = yield :header
      .public-container
        .public-wrapper
          = link_to root_path, class: 'public-logo' do
            = image_tag 'locomotive/logo.png'
            span Locomotive
          = yield

    = yield :footer


#home
  | POTETI stands for Portal Of TEchnology TIps.

Add tips by signin user to home

#home
  | POTETI stands for Portal Of TEchnology TIps.

  - if user_signed_in?
    .items
      - current_user.tips.each do |tip|
        .item = link_to tip.title, user_tip_path(tip, user_name: current_user.name)


section.section-white.section-shadow
  .container.py-3
    .text-xs-center
      p style="margin-bottom: 0.5rem"
        = image_tag @user.avatar_url(100, 100), class: 'img-circle'
      h1
        | @#{@user.username}

.container.pt-2
  .card
    .card-block
      == cell :events_filters

  = render partial: 'events/events', events: @events

Add blankslate to user profile events

section.section-white.section-shadow
  .container.py-3
    .text-xs-center
      p style="margin-bottom: 0.5rem"
        = image_tag @user.avatar_url(100, 100), class: 'img-circle'
      h1
        | @#{@user.username}

.container.pt-2
  .card
    .card-block
      == cell :events_filters

  = render partial: 'events/events', events: @events

  - unless @events.any?
      == cell :blankslate, \
        title: 'No events found', \
        description: 'Try to modify search criteria'


= simple_form_for(@garage) do |f|
  - if @garage.errors.any?
    #error_explanation
      h2 = "#{pluralize(@garage.errors.count, "error")} prohibited this garage from being saved:"
      ul
        - @garage.errors.full_messages.each do |message|
          li = message

  .col-md-3 = f.input :name
  .col-md-3 = f.input :country
  .col-md-3 = f.input :street
  .col-md-3 = f.input :zip
  .col-md-3 = f.input :city
  .col-md-3 = f.input :email
  .col-md-3 = f.input :phone
  .col-md-3 = f.input :mobile
  .col-md-3 = f.input :fax
  .col-md-3 = f.input :latitude
  .col-md-3 = f.input :longitude
  .col-md-3 = f.input :tax_id
  .col-md-3 = f.input :website
  .col-md-3 = f.input :logo

  .col-md-12 = f.button :submit, class: "btn-success"

Remove form edit latitude and longitude.

= simple_form_for(@garage) do |f|
  - if @garage.errors.any?
    #error_explanation
      h2 = "#{pluralize(@garage.errors.count, "error")} prohibited this garage from being saved:"
      ul
        - @garage.errors.full_messages.each do |message|
          li = message

  .col-md-3 = f.input :name
  .col-md-3 = f.input :country
  .col-md-3 = f.input :street
  .col-md-3 = f.input :zip
  .col-md-3 = f.input :city
  .col-md-3 = f.input :email
  .col-md-3 = f.input :phone
  .col-md-3 = f.input :mobile
  .col-md-3 = f.input :fax
  .col-md-3 = f.input :tax_id
  .col-md-3 = f.input :website
  .col-md-3 = f.input :logo

  .col-md-12 = f.button :submit, class: "btn-success"


li.has-dropdown
  = link_to "Admin", patients_path
  ul.dropdown
    - if current_user_is_super_admin?
      li
        = link_to "Event Types", events_types_path
      li
        = link_to "Drugs", drugs_drugs_path
      li
        = link_to "Modalities", modalities_descriptions_path
      li
        = link_to "PD Bags", pd_bag_types_path
      li
        = link_to "Primary Care Physicians", patients_primary_care_physicians_path

    - if current_user_is_admin?
      li
        = link_to "Users", admin_users_path
      li
        = link_to "Hospital Units", hospitals_units_path
      li
        = link_to "HD Cannulation Types", hd_cannulation_types_path
      li
        = link_to "HD Dialysers", hd_dialysers_path
      li
        = link_to "Request Form Print History", pathology_requests_requests_path
      li
        = link_to "Pathology Requesting Configuration", pathology_requests_rules_path

    - unless Rails.env.production?
      li
        = link_to "Email Templates", system_email_templates_path

Remove spurious 'Admin' link in topnav

li.has-dropdown
  = link_to "Admin", "#"
  ul.dropdown
    - if current_user_is_super_admin?
      li
        = link_to "Event Types", events_types_path
      li
        = link_to "Drugs", drugs_drugs_path
      li
        = link_to "Modalities", modalities_descriptions_path
      li
        = link_to "PD Bags", pd_bag_types_path
      li
        = link_to "Primary Care Physicians", patients_primary_care_physicians_path

    - if current_user_is_admin?
      li
        = link_to "Users", admin_users_path
      li
        = link_to "Hospital Units", hospitals_units_path
      li
        = link_to "HD Cannulation Types", hd_cannulation_types_path
      li
        = link_to "HD Dialysers", hd_dialysers_path
      li
        = link_to "Request Form Print History", pathology_requests_requests_path
      li
        = link_to "Pathology Requesting Configuration", pathology_requests_rules_path

    - unless Rails.env.production?
      li
        = link_to "Email Templates", system_email_templates_path


doctype 5
html lang="en"
  head
    title Bookmark Manager
    = csrf_meta_tags
    = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
    = javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
  body
    .container
      .columns
        .column
          header.navbar.pt-2.pl-2
            section.navbar-section
              a.navbar-brand.mr-2 href="/bookmarks" Bookmarks
              a.btn.btn-link target="_blank" href="https://github.com/christopherstyles/bookmark-manager" GitHub
            section.navbar-section
              .input-group.input-inline
                input.form-input placeholder="search" type="text" /
                button.btn.btn-primary.input-group-btn Search
              = link_to new_bookmark_path, class: 'btn btn-primary ml-1' do
                = fa_icon 'plus-circle'
    .divider.mb-0
    = link_to new_bookmark_path, class: 'btn btn-primary btn-lg btn-block mb-4' do
      = fa_icon 'plus-circle', class: 'mr-1'
      | New Bookmark
    = yield

Remove unnecessary button from navbar

doctype 5
html lang="en"
  head
    title Bookmark Manager
    = csrf_meta_tags
    = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
    = javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
  body
    .container
      .columns
        .column
          header.navbar.pt-2.pl-2
            section.navbar-section
              a.navbar-brand.mr-2 href="/bookmarks" Bookmarks
              a.btn.btn-link target="_blank" href="https://github.com/christopherstyles/bookmark-manager" GitHub
            section.navbar-section
              .input-group.input-inline
                input.form-input placeholder="search" type="text" /
                button.btn.btn-primary.input-group-btn Search
    .divider.mb-0
    = link_to new_bookmark_path, class: 'btn btn-primary btn-lg btn-block mb-4' do
      = fa_icon 'plus-circle', class: 'mr-1'
      | New Bookmark
    = yield


.container.grid-xs.pb-2
  .columns
    .column.col-12.pt-2
      p#notice.text-success = notice

      - if @bookmark.title?
        h4.mb-2 = @bookmark.title

      p.mb-2
        = link_to @bookmark.url, @bookmark.url

      - if @bookmark.tags.any?
        .mb-2
          - @bookmark.tags.each do |tag|
            span.chip = tag.name

      - if @bookmark.notes?
        p
          = markdown(@bookmark.notes).html_safe

    .column.col-12.pt-2
      .btn-group
        = link_to 'Edit', edit_bookmark_path(@bookmark), class: 'btn btn-primary'
        = link_to 'Back', bookmarks_path, class: 'btn'

Add right margin to button group

.container.grid-xs.pb-2
  .columns
    .column.col-12.pt-2
      p#notice.text-success = notice

      - if @bookmark.title?
        h4.mb-2 = @bookmark.title

      p.mb-2
        = link_to @bookmark.url, @bookmark.url

      - if @bookmark.tags.any?
        .mb-2
          - @bookmark.tags.each do |tag|
            span.chip = tag.name

      - if @bookmark.notes?
        p
          = markdown(@bookmark.notes).html_safe

    .column.col-12.pt-2
      .btn-group.mr-2
        = link_to 'Edit', edit_bookmark_path(@bookmark), class: 'btn btn-primary'
        = link_to 'Back', bookmarks_path, class: 'btn'


h1 = @exercise

= row(label: '.participants', value: @exercise.users.count)
- [:intermediate, :final].each do |scope|
  = row(label: ".#{scope}_submissions") do
    = "#{@exercise.submissions.send(scope).count} (#{t('.users', count: @exercise.submissions.send(scope).distinct.count(:user_id, :user_type))})"
= row(label: '.average_score') do
  p == @exercise.average_score ? t('shared.out_of', maximum_value: @exercise.maximum_score, value: @exercise.average_score.round(2)) : empty
  p = progress_bar(@exercise.average_percentage)

- Hash[:internal_users => t('.internal_users'), :external_users => t('.external_users')].each_pair do |symbol, label|
  strong = label
  .table-responsive
    table.table
      thead
        tr
          - ['.user', '.score', '.runs', '.worktime'].each do |title|
            th.header = t(title)
      tbody
        - @exercise.send(symbol).distinct().each do |user|
          tr
            - submissions = @exercise.submissions.where('user_id=?', user.id)
            td = "#{user.name} (#{user.email})"
            td = submissions.maximum('score')
            td = submissions.count('id')
            td = @exercise.average_working_time_for(user.id) or 0

Use default value for missing scores

h1 = @exercise

= row(label: '.participants', value: @exercise.users.count)
- [:intermediate, :final].each do |scope|
  = row(label: ".#{scope}_submissions") do
    = "#{@exercise.submissions.send(scope).count} (#{t('.users', count: @exercise.submissions.send(scope).distinct.count(:user_id, :user_type))})"
= row(label: '.average_score') do
  p == @exercise.average_score ? t('shared.out_of', maximum_value: @exercise.maximum_score, value: @exercise.average_score.round(2)) : empty
  p = progress_bar(@exercise.average_percentage)

- Hash[:internal_users => t('.internal_users'), :external_users => t('.external_users')].each_pair do |symbol, label|
  strong = label
  .table-responsive
    table.table
      thead
        tr
          - ['.user', '.score', '.runs', '.worktime'].each do |title|
            th.header = t(title)
      tbody
        - @exercise.send(symbol).distinct().each do |user|
          tr
            - submissions = @exercise.submissions.where('user_id=?', user.id)
            td = "#{user.name} (#{user.email})"
            td = submissions.maximum('score') or 0
            td = submissions.count('id')
            td = @exercise.average_working_time_for(user.id) or 0


h1
  | GuestUsers#new
p
  | Find me in app/views/guest_users/new.html.erb

Add guest users new form

h1
  | GuestUsers#new
p
  | Find me in app/views/guest_users/new.html.erb
= form_for(@guest_user, url: {action: 'create'}) do |f|
  .field
    = f.label :name
    br
    = f.text_field :name
  .field
    = f.label :email
    br
    = f.text_field :email
  .actions
    = f.submit


doctype html
html
  head
    meta charset="utf-8"
    link href="/css/github.css" rel="stylesheet"
    style type="text/css"
      = Rouge::Themes::Github.render(scope: ".highlight")
  body
    == yield
    script src="/js/jquery-2.1.0.min.js"
    script src="/js/application.js"

Apply monospace font to code block

doctype html
html
  head
    meta charset="utf-8"
    link href="/css/github.css" rel="stylesheet"
    style type="text/css"
      | .highlight { font-family: Consolas, "Liberation Mono", Courier, monospace; font-size: 12px }
    style type="text/css"
      = Rouge::Themes::Github.render(scope: ".highlight")
  body
    == yield
    script src="/js/jquery-2.1.0.min.js"
    script src="/js/application.js"


.row
  .small-12.medium-3.columns.right
    = simple_form_for :search, url: searches_path, method: :get, remote: true do |f|
      = text_field_tag :term, params[:term], class: 'autocomplete'
      = button_tag class: 'submit-btn text-right tiny right', name: nil do
        - fa_icon('paper-plane')

Move submit button inline after the input field

.row
  .small-12.medium-3.columns.right
    = simple_form_for :search, url: searches_path, method: :get, remote: true do |f|
      .row.collapse
        .small-10.columns
          = text_field_tag :term, params[:term], placeholder: 'Search', class: 'autocomplete'
        .small-2.columns
          = button_tag class: 'button postfix', name: nil do
            - fa_icon('paper-plane')


- content_for :title, post.page_title
- content_for :twitter_title, post.twitter_title
- content_for :url, post_url(post)
- content_for :image_url, post.author.photo_url
- content_for :description, post.description
- content_for :twitter_description, post.description
- content_for :twitter_creator, "@#{post.author.twitter_handle}"

= render 'post_hero', post: post

/* - cache [post, 'show'] */
.u-xSmallThenSmallMargin

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

.Post
  .Post-body = post.processed_body

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

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

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

.PostWidthConstrainer
  = render 'shared/hire_us'
.u-defaultMargin

.Separator.Separator--subvisual
.u-largeMargin

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

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

Revert "Disable post cache for now"

- content_for :title, post.page_title
- content_for :twitter_title, post.twitter_title
- content_for :url, post_url(post)
- content_for :image_url, post.author.photo_url
- content_for :description, post.description
- content_for :twitter_description, post.description
- content_for :twitter_creator, "@#{post.author.twitter_handle}"

= render 'post_hero', post: post

- cache [post, 'show']
  .u-xSmallThenSmallMargin

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

  .Post
    .Post-body = post.processed_body

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

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

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

.PostWidthConstrainer
  = render 'shared/hire_us'
.u-defaultMargin

.Separator.Separator--subvisual
.u-largeMargin

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

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


doctype html
html lang="en"

  head
    title Explore with FirstGlance
    meta charset="utf-8" /
    meta content="width=device-width, initial-scale=1" name="viewport" /
    link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" /
    script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"
    script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"
  body
    section
      == styled_flash
      == yield

Fix CDN links to get it work on Heroku

doctype html
html lang="en"

  head
    title Explore with FirstGlance
    meta charset="utf-8" /
    meta content="width=device-width, initial-scale=1" name="viewport" /
    link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" /
    script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"
    script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"
  body
    section
      == styled_flash
      == yield


.tweak-title
  .d-inline-block.my-3.mx-2
    = mega_octicon_for(@tweak)
  h3.d-inline-block.my-3 = @tweak.title
.border.p-2
  .pb-2.clearfix
    = gettext "Last updated about "
    = relative_time(@tweak.updated_at)
    = render_if(@current_user && @current_user.name == @tweak.user.name, TweakView, "edit_tweak_button.html", assigns)
    = render("copy_tweak_button.html", assigns)
  = render_code(@tweak)
  .tweak-description
    = render_markdown(@tweak.description)

Add created by link on show tweak page

.tweak-title
  .d-inline-block.my-3.mx-2
    = mega_octicon_for(@tweak)
  h3.d-inline-block.my-3 = @tweak.title
  .d-inline-block.mx-2
    ' Created by
    a href="#{user_path(@conn, :show, @tweak.user.name)}" = @tweak.user.name
.border.p-2
  .pb-2.clearfix
    = gettext "Last updated about "
    = relative_time(@tweak.updated_at)
    = render_if(@current_user && @current_user.name == @tweak.user.name, TweakView, "edit_tweak_button.html", assigns)
    = render("copy_tweak_button.html", assigns)
  = render_code(@tweak)
  .tweak-description
    = render_markdown(@tweak.description)


doctype html
html
  head
    meta content='text/html; charset=UTF-8' http-equiv='Content-Type'
  body
    h1= "#{@comment.user.name} said:"
    p= @comment.body

Add a link to comment emails

doctype html
html
  head
    meta content='text/html; charset=UTF-8' http-equiv='Content-Type'
  body
    h1= "#{@comment.user.name} said:"
    p= @comment.body
    a href=@comment.photo.url
      |See this comment on the web


#my_projects
  - if collection.empty?
    = t('.no_projects')
  - else
    .bootstrap-twitter
      table.table.table-striped
        thead
          tr
            th= t('.id')
            th= 'cover'
            th= 'project'
            th= 'pleged'
            th= 'deadline'
            th= 'total of backers'
            th= 'actions'
            /th= t('.rejected')
        tbody
          - collection.each do |project|
            tr class=cycle("even", "odd")
              td= link_to project.id, project_path(project)
              td title=project.name
                = link_to project_path(project, anchor: 'edit') do
                  = image_tag project.display_image, class: 'project_img'
              td= project.name
              td
                = "#{project.display_pledged} / #{project.display_goal}"
              td= project.display_expires_at
              td= project.total_backers
              td
                = link_to project_path(project, anchor: 'edit'), :class => 'btn' do
                  i.icon-pencil

Fix infilite loading on my projects

- if collection.any?
  #my_projects
    .bootstrap-twitter
      table.table.table-striped
        thead
          tr
            th= t('.id')
            th= 'cover'
            th= 'project'
            th= 'pleged'
            th= 'deadline'
            th= 'total of backers'
            th= 'actions'
            /th= t('.rejected')
        tbody
          - collection.each do |project|
            tr class=cycle("even", "odd")
              td= link_to project.id, project_path(project)
              td title=project.name
                = link_to project_path(project, anchor: 'edit') do
                  = image_tag project.display_image, class: 'project_img'
              td= project.name
              td
                = "#{project.display_pledged} / #{project.display_goal}"
              td= project.display_expires_at
              td= project.total_backers
              td
                = link_to project_path(project, anchor: 'edit'), :class => 'btn' do
                  i.icon-pencil


= content_tag_for :article, tabs, 'component',
  id: tabs.anchor_name,
  data: {component_key: tabs.key} do

  .inner
    = tabs.decorate.h1

    /! Nav tabs
    ul.nav.nav-tabs role='tablist'
      - tabs.items.each_with_index do |item, i|
        li[class=('active' if i.zero?)]
          a data-toggle='tab' href="##{dom_id(item)}" role='tab'
            = item.decorate.icon_image
            = item.h1

    /! Tab panes
    .tab-content
      - tabs.items.each_with_index do |item, i|
        .tab-pane.fade id=dom_id(item) class=('active in' if i.zero?)
          - if item_capture = options[:custom_items] && options[:custom_items][item.key]
            = item_capture
          - else
            = component item.key

Use component_tag_for for tabs too

= component_tag_for tabs do
  .inner
    = tabs.decorate.h1

    /! Nav tabs
    ul.nav.nav-tabs role='tablist'
      - tabs.items.each_with_index do |item, i|
        li[class=('active' if i.zero?)]
          a data-toggle='tab' href="##{dom_id(item)}" role='tab'
            = item.decorate.icon_image
            = item.h1

    /! Tab panes
    .tab-content
      - tabs.items.each_with_index do |item, i|
        .tab-pane.fade id=dom_id(item) class=('active in' if i.zero?)
          - if item_capture = options[:custom_items] && options[:custom_items][item.key]
            = item_capture
          - else
            = component item.key


header.main-header
  h3 Page 1 of 11
  h1= claim_header

.main-section
  aside
    h3 Get Help
    nav
      ul
        li
          = link_to('Read the guide', guide_path)
        li
          = link_to('Sign out', user_session_path)
  .main-content
    = simple_form_for resource, url: claim_path, multipart: true do |f|
      = hidden_field_tag :page, current_step
      = f.error_notification
      .form-inputs
        = render current_step.to_s, f: f
      .form-actions
        = f.button :submit
        - if current_step != 'password'

Remove unnecessary line in the show view


/ categories/index
/ website header
= image_tag('headers/website_header.png', height: 200, style: 'margin: 10px 0 5px')

.space-half
/ Categories list
#js-categories-list
  .find-categories
    / Instant client-side searching via list.js
    input.search.js-search type='text' autocomplete='off' placeholder='Background Jobs...'

    / Sort categories in list.js
    .sort-list
      = link_to 'Sort by Name', 'javascript:;', class: 'sort active', :'data-sort' => 'js-name'
      span.divider
      = link_to 'Sort by Score', 'javascript:;', class: 'sort', :'data-sort' => 'js-score'

    .space-half

    / sidenotes
    .sidenotes
      / services
      = render 'services/featured_services'
      .space-half
      / featured categories
      = render 'categories/featured_categories'

    / List for list.js
    - cache [@language.name, 'categories', @categories] do
      .categories-wrapper.list data-page=24
        = render partial: 'category', collection: @categories

    .space-half

    / Show all matches on click
    .show-all.js-show-all: b = link_to 'Show all (matching) categories', 'javascript:;'

Change cache key on categories index page to only include language's cache key

/ categories/index
/ website header
= image_tag('headers/website_header.png', height: 200, style: 'margin: 10px 0 5px')

.space-half
/ Categories list
#js-categories-list
  .find-categories
    / Instant client-side searching via list.js
    input.search.js-search type='text' autocomplete='off' placeholder='Background Jobs...'

    / Sort categories in list.js
    .sort-list
      = link_to 'Sort by Name', 'javascript:;', class: 'sort active', :'data-sort' => 'js-name'
      span.divider
      = link_to 'Sort by Score', 'javascript:;', class: 'sort', :'data-sort' => 'js-score'

    .space-half

    / sidenotes
    .sidenotes
      / services
      = render 'services/featured_services'
      .space-half
      / featured categories
      = render 'categories/featured_categories'

    / List for list.js
    - cache [@language, 'categories'] do
      .categories-wrapper.list data-page=24
        = render partial: 'category', collection: @categories

    .space-half

    / Show all matches on click
    .show-all.js-show-all: b = link_to 'Show all (matching) categories', 'javascript:;'


section.address
  section.existing-address(ng-show='existingAddress')
    select(ng-options='addr as addr.shortAddress() for addr in addresses' ng-model='address' ng-disabled='disabled')

    p(ng-hide='disabled')
      a.new-address(ng-click='toggleExistingAddress()')
        | {{:: 'address.use_new' | translate}}

  section.new-address(ng-hide='existingAddress')
    address-form(address='address' countries='countries' disabled='disabled')

    p(ng-hide='disabled')
      a.existing-address(ng-if='addresses.length > 0' ng-click='toggleExistingAddress()')
        | {{:: 'address.use_existing' | translate}}

Update address select, to track addresses by id

section.address
  section.existing-address(ng-show='existingAddress')
    select(ng-options='addr as addr.shortAddress() for addr in addresses track by id' ng-model='address' ng-disabled='disabled')

    p(ng-hide='disabled')
      a.new-address(ng-click='toggleExistingAddress()')
        | {{:: 'address.use_new' | translate}}

  section.new-address(ng-hide='existingAddress')
    address-form(address='address' countries='countries' disabled='disabled')

    p(ng-hide='disabled')
      a.existing-address(ng-if='addresses.length > 0' ng-click='toggleExistingAddress()')
        | {{:: 'address.use_existing' | translate}}


= simple_form_for [:admin, @site] do |f|
  = admin_box_body do
    = f.input :name
    = f.input :domain
    = f.input :tenant_name if @site.new_record?
    = f.input :description, as: :text, input_html: { data: { editor: true }, rows: 20 }
  = admin_box_footer do
    = f.submit class: 'btn btn-primary'

Fix mobility brakes admin sites form

= simple_form_for [:admin, @site] do |f|
  = admin_box_body do
    / TODO: Upgrade mobility to support jsonb in form
    = f.input :name, as: :string
    = f.input :domain
    = f.input :tenant_name if @site.new_record?
    = f.input :description, as: :text, input_html: { data: { editor: true }, rows: 20 }
  = admin_box_footer do
    = f.submit class: 'btn btn-primary'


= semantic_form_for component,
  as:     :component,
  url:    admin_component_path(component),
  remote: true,
  html:   {id: dom_id(component, 'form'), data: {type: :json, autosave: true}} do |f|

  = f.inputs do
    = f.input :h1
    = f.input :text, as: :default_wysiwyg
    = f.input :key, as: :hidden

  - background = component.background || component.images.build(kind: 'background')
  - image = component.image || component.images.build(kind: 'image')
  = render 'components/_shared/images_inputs', f: f, images: [background, image]

Update Content component form. Include h2 field

= semantic_form_for component,
  as:     :component,
  url:    admin_component_path(component),
  remote: true,
  html:   {id: dom_id(component, 'form'), data: {type: :json, autosave: true}} do |f|

  = f.inputs do
    = f.input :h1
    = f.input :h2
    = f.input :text, as: :default_wysiwyg
    = f.input :key, as: :hidden

  - background = component.background || component.images.build(kind: 'background')
  - image = component.image || component.images.build(kind: 'image')
  = render 'components/_shared/images_inputs', f: f, images: [background, image]


doctype html
html lang="ja"
  head
    title= yield(:title)
    = stylesheet_link_tag "application"
  body
    - if flash[:notice]
      p class="notice" = flash[:notice]
    - if @current_user
      p= link_to "Logout(#{@current_user[:name]})", logout_path
    - else
      p= link_to "Login", login_path(:twitter)
    = yield

Add placeholder for additional meta tag

doctype html
html lang="ja"
  head
    title= yield(:title)
    = yield(:additional_meta)
    = stylesheet_link_tag "application"
  body
    - if flash[:notice]
      p class="notice" = flash[:notice]
    - if @current_user
      p= link_to "Logout(#{@current_user[:name]})", logout_path
    - else
      p= link_to "Login", login_path(:twitter)
    = yield


doctype 5
html lang="en"
  head
    title Bookmark Manager
    = csrf_meta_tags
    = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
    = javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
  body
    .container
      .columns
        .column
          header.navbar.pt-2.pl-2
            section.navbar-section
              a.navbar-brand.mr-2 href="/bookmarks" Bookmarks
              a.btn.btn-link target="_blank" href="https://github.com/christopherstyles/bookmark-manager" GitHub
            section.navbar-section
              .input-group.input-inline
                input.form-input placeholder="search" type="text" /
                button.btn.btn-primary.input-group-btn Search
    .divider
    = yield

Add a link for new bookmarks from navbar

doctype 5
html lang="en"
  head
    title Bookmark Manager
    = csrf_meta_tags
    = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
    = javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
  body
    .container
      .columns
        .column
          header.navbar.pt-2.pl-2
            section.navbar-section
              a.navbar-brand.mr-2 href="/bookmarks" Bookmarks
              a.btn.btn-link target="_blank" href="https://github.com/christopherstyles/bookmark-manager" GitHub
            section.navbar-section
              .input-group.input-inline
                input.form-input placeholder="search" type="text" /
                button.btn.btn-primary.input-group-btn Search
              = link_to new_bookmark_path, class: 'btn btn-primary ml-1' do
                = fa_icon 'plus-circle'
    .divider
    = yield


= 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? || can?(:update, resource, :title)
    = f.input :title

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

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

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

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

  = f.input :soon, as: :boolean
  = f.input :show_contact_button, as: :boolean

  = f.button :submit, data: { disable_with: t('words.sending') }
  - if resource.persisted? && can?(:destroy, resource)
    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 reward contact 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 resource.new_record? || can?(:update, resource, :title)
    = f.input :title

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

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

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

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

  = f.input :soon, as: :boolean

  = f.button :submit, data: { disable_with: t('words.sending') }
  - if resource.persisted? && can?(:destroy, resource)
    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')


.description
  h3 About Me
  p My name is Justin Harrison. I'm a software developer with a love of all
    things open source.
.right-bar
  h3 Profiles
  ul.profiles
    li: a href="https://github.com/matthin" GitHub
    li: a href="https://www.reddit.com/u/matthin" Reddit
    li: a href="https://rubygems.org/profiles/matthin" RubyGems
    li: a href="https://keybase.io/matthin" Keybase
    li: a href="https://stackoverflow.com/users/2239400/matthin" Stack Overflow
  h3 Contact
  .contact
    p Feel free to contact me by email.
    p If you wish to securely email me, you can encode your message using my
      public key.
    p You can also message me using
      XMPP. Which can be done
      securely using Conversations.

Add tor info to about-me

.description
  h3 About Me
  p My name is Justin Harrison. I'm a software developer with a love of all
    things open source.
  p The right to privacy and anonymity is a priority to me.
    To help those two causes, I run a tor
    relay. I also mantain a tor bridge, but can not publicly share the location.

  p This website is accessible through the tor network as an
    onion
.right-bar
  h3 Profiles
  ul.profiles
    li: a href="https://github.com/matthin" GitHub
    li: a href="https://www.reddit.com/u/matthin" Reddit
    li: a href="https://rubygems.org/profiles/matthin" RubyGems
    li: a href="https://keybase.io/matthin" Keybase
    li: a href="https://stackoverflow.com/users/2239400/matthin" Stack Overflow
  h3 Contact
  .contact
    p Feel free to contact me by email.
    p If you wish to securely email me, you can encode your message using my
      public key.
    p You can also message me using
      XMPP. Which can be done
      securely using Conversations.


li
  div
    = button_to "Remove", form_form_answer_positions_url(@form_answer, name: attrs["name"], start_month: attrs["start_month"], start_year: attrs["start_year"]),
                          method: :delete,
                          class: "non-js-remove-link",
                          form_class: "non-js-button-to"

  = simple_form_for :position, url: "#", html: { class: 'qae-form' } do |f|

    label
      strong Position/role
    p =  attrs["name"]
    br

    label
      strong Start Date
    p
      = "#{attrs['start_month']}/#{attrs['start_year']}"
    br

    label
      strong End Date
    p
      - if attrs["ongoing"].to_s == "1"
        ' Ongoing
      - else
        = "#{attrs['end_month']}/#{attrs['end_year']}"
    br

    label
      strong Details
    p
      = attrs["details"]
    br

  = link_to "Edit role", edit_form_form_answer_positions_path(@form_answer)

COPY Empty text for non-JS EP position

li
  div
    = button_to "Remove", form_form_answer_positions_url(@form_answer, name: attrs["name"], start_month: attrs["start_month"], start_year: attrs["start_year"]),
                          method: :delete,
                          class: "non-js-remove-link",
                          form_class: "non-js-button-to"

  = simple_form_for :position, url: "#", html: { class: 'qae-form' } do |f|

    label
      strong Position/role
    p
      - if attrs["name"].present?
        = attrs["name"]
      - else
        ' -
    br

    label
      strong Start Date
    p
      - if attrs["start_month"].present? and attrs["start_year"].present?
        = "#{attrs['start_month']}/#{attrs['start_year']}"
      - else
        ' -
    br

    label
      strong End Date
    p
      - if attrs["ongoing"].to_s == "1"
        ' Ongoing
      - else
        - if attrs["end_month"].present? and attrs["end_year"].present?
          = "#{attrs['end_month']}/#{attrs['end_year']}"
        - else
          ' -
    br

    label
      strong Details
    p
      - if attrs["details"].present?
        = attrs["details"]
      - else
        ' -
    br

  = link_to "Edit role", edit_form_form_answer_positions_path(@form_answer)


= page_header
= simple_form_for @settings, url: admin_instance_components_path, method: :patch do |f|
  = f.error_notification message: f.object.errors.full_messages.first
  table.table.table-hover
    thead
      tr
        th = t('.name')
        th = t('.enabled')
    tbody
      - collection = Course::ControllerComponentHost.disableable_components.map { |c| [c.display_name, c.key.to_s] }
      = f.collection_check_boxes :enabled_component_ids, collection, :last, :first do |f|
        tr
          th = f.label
          td = f.check_box

  = f.button :submit, t('.submit')

Sort components on instance settings page for display.

= page_header
= simple_form_for @settings, url: admin_instance_components_path, method: :patch do |f|
  = f.error_notification message: f.object.errors.full_messages.first
  table.table.table-hover
    thead
      tr
        th = t('.name')
        th = t('.enabled')
    tbody
      - collection = Course::ControllerComponentHost.disableable_components.map { |c| [c.display_name, c.key.to_s] }.sort
      = f.collection_check_boxes :enabled_component_ids, collection, :last, :first do |f|
        tr
          th = f.label
          td = f.check_box

  = f.button :submit, t('.submit')


|Welcome, #{@email},
br
br
|Almost ready to use #{Configuration[:company_name]}! Please confirm your email by clicking the link below:
br
br
h1 #{link_to 'Confirm my email', confirmation_url(@resource, :confirmation_token => @token)}
br
br
|If you received this email in error, please disregard.
br
br
|High fives,
br
|The #{Configuration[:company_name]} Team

Solve problem with email confirmation

|Welcome, #{@email},
br
br
|Almost ready to use #{Configuration[:company_name]}! Please confirm your email by clicking the link below:
br
br
h1 #{link_to 'Confirm my email', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token)}
br
br
|If you received this email in error, please disregard.
br
br
|High fives,
br
|The #{Configuration[:company_name]} Team


= div_for(course, class: ['col-xs-12', 'col-sm-6', 'col-md-4', 'col-lg-3']) do
  div.box.text-center.thumbnail
    = link_to '', course_path(course)
    div.course-logo
      = display_course_logo(course)
    div.caption
      / TODO: Truncate text when text truncator is implemented for HTML pipeline
      h4 = format_inline_text(course.title)
      - unless course.description.blank?
        div.description
          = format_html(course.description)

Remove tags from course description on course index page.

= div_for(course, class: ['col-xs-12', 'col-sm-6', 'col-md-4', 'col-lg-3']) do
  div.box.text-center.thumbnail
    = link_to '', course_path(course)
    div.course-logo
      = display_course_logo(course)
    div.caption
      / TODO: Truncate text when text truncator is implemented for HTML pipeline
      h4 = format_inline_text(course.title)
      - unless course.description.blank?
        div.description
          = strip_tags(course.description)


- if can? :create, Post
  = render 'posts/miniform', post: Post.new

- incoming_users = current_site.timeline_entries.visible.from_others.joins(:post).count('DISTINCT posts.domain')
- if incoming_users > 0
  .incoming-notice You have #{link_to "incoming posts", :incoming_network} from
                   #{pluralize incoming_users, "new follower"}.

= render 'more'

Remove publish form on network page


doctype html
html
  head
    title
      | Admin
    = favicon

    link rel="stylesheet" href="https://yui-s.yahooapis.com/pure/0.6.0/pure-min.css"
  body

    div.admin-menu.pure-menu.pure-menu-horizontal.pure-menu-fixed
      a.pure-menu-heading href="" OSSBoard

      ul.pure-menu-list
        li.pure-menu-item.pure-menu-selected
          = link_to 'Dashboard', routes.root_path, class: 'pure-menu-link'
        li.pure-menu-item
          = link_to 'Moderation', routes.moderations_path, class: 'pure-menu-link'
        li.pure-menu-item
          = link_to 'Tasks', routes.tasks_path, class: 'pure-menu-link'

      ul.pure-menu-list.pure-menu-list-right
        li.pure-menu-item
          a.pure-menu-link href="#" Main App
        li.pure-menu-item
          a.pure-menu-link href="#" Logout

    .container
      = yield

    script src=webpack_asset_path('admin')

Fix link to web app

doctype html
html
  head
    title
      | Admin
    = favicon

    link rel="stylesheet" href="https://yui-s.yahooapis.com/pure/0.6.0/pure-min.css"
  body

    div.admin-menu.pure-menu.pure-menu-horizontal.pure-menu-fixed
      a.pure-menu-heading href="" OSSBoard

      ul.pure-menu-list
        li.pure-menu-item.pure-menu-selected
          = link_to 'Dashboard', routes.root_path, class: 'pure-menu-link'
        li.pure-menu-item
          = link_to 'Moderation', routes.moderations_path, class: 'pure-menu-link'
        li.pure-menu-item
          = link_to 'Tasks', routes.tasks_path, class: 'pure-menu-link'

      ul.pure-menu-list.pure-menu-list-right
        li.pure-menu-item
          a.pure-menu-link href="/" Main App
        li.pure-menu-item
          a.pure-menu-link href="#" Logout

    .container
      = yield

    script src=webpack_asset_path('admin')


doctype html

html
  head
    title
      = content_for?(:title) ? yield(:title) : "QAE"
    = stylesheet_link_tag    'application', media: 'all'
    /[if gt IE 8]
      = stylesheet_link_tag  "application.css"
    /[if IE 6]
      = stylesheet_link_tag  "application-ie6.css"
    /[if IE 7]
      = stylesheet_link_tag  "application-ie7.css"
    /[if IE 8]
      = stylesheet_link_tag  "application-ie8.css"
    = javascript_include_tag 'application'
    = csrf_meta_tags

  body
    .header-proposition
      .content
        nav#proposition-menu
          a#proposition-name href="/"
            ' QAE
            span.alpha-tag ALPHA
          ul#proposition-links
            li
              = link_to "Your account", account_path
            li
              = link_to "Log out", "#"

    #wrapper.guide.smart_answer.answer
      #QAE
        main#content.group role="main"
          = yield

COPY app title QAE -> Queens Award for Enterprise

doctype html

html
  head
    title
      = content_for?(:title) ? yield(:title) : "QAE"
    = stylesheet_link_tag    'application', media: 'all'
    /[if gt IE 8]
      = stylesheet_link_tag  "application.css"
    /[if IE 6]
      = stylesheet_link_tag  "application-ie6.css"
    /[if IE 7]
      = stylesheet_link_tag  "application-ie7.css"
    /[if IE 8]
      = stylesheet_link_tag  "application-ie8.css"
    = javascript_include_tag 'application'
    = csrf_meta_tags

  body
    .header-proposition
      .content
        nav#proposition-menu
          a#proposition-name href="/"
            ' Queens Award for Enterprise
            span.alpha-tag ALPHA
          ul#proposition-links
            li
              = link_to "Your account", account_path
            li
              = link_to "Log out", "#"

    #wrapper.guide.smart_answer.answer
      #QAE
        main#content.group role="main"
          = yield


h1.header
  = icon('inbox')
  span Application drafts

table.table.table-striped.table-bordered.table-condensed
  thead
    tr
      th Project Name
      th Team
      th Created
      th Your Role
  tbody
    - @application_drafts.each do |draft|
      tr
        td= link_to (draft.project_name.presence || '<Pending>'), edit_application_draft_path(draft)
        td= link_to draft.team.display_name, team_path(draft.team), class: "team #{draft.team.kind}"
        td= draft.created_at
        td= draft.role_for(current_user)

Add a link to create a new draft

nav.actions
  ul
    li = link_to 'New Application Draft', new_application_draft_path, class: 'btn btn-primary btn-small', disabled: !can?(:create, :application_draft), title: ("You cannot lodge another application" unless can?(:create, :application))

h1.header
  = icon('inbox')
  span Application Drafts

table.table.table-striped.table-bordered.table-condensed
  thead
    tr
      th Project Name
      th Team
      th Created
      th Your Role
  tbody
    - @application_drafts.each do |draft|
      tr
        td= link_to (draft.project_name.presence || '<Pending>'), edit_application_draft_path(draft)
        td= link_to draft.team.display_name, team_path(draft.team), class: "team #{draft.team.kind}"
        td= draft.created_at
        td= draft.role_for(current_user)


.section
  .container
    h1.header.center.teal-text.accent-4-text
      | Welcome to Haruno
    .row.center
      h5.header.col.s12.light
        | A simple workflow
    .row.center
      = link_to 'Get Started', getting_started_path, class: 'btn-large waves-effect waves-light red lighten-2'

Add login link on root page

.section
  .container
    h1.header.center.teal-text.accent-4-text
      | Welcome to Haruno
    .row.center
      h5.header.col.s12.light
        | A simple workflow
    .row.center
      = link_to 'Get Started', getting_started_path, class: 'btn-large waves-effect waves-light red lighten-2'
      p
        | or
        = link_to 'login', nil


.row
  .span2
  .span8
    | {{#followers.length}}
    | {{#guest_authenticated}}
    h1.page-header Followers of {{formatted.domain_entity}}
    | {{/guest_authenticated}}

    | {{^guest_authenticated}}
    h1.page-header Your Followers
    | {{/guest_authenticated}}
    table.table.table-striped
      thead
        tr
          th Name
          th Entity
          th
          th
      tbody
        | {{#followers}}
        | {{> _follower}}
        | {{/followers}}
    | {{/followers.length}}
    | {{^followers.length}}
    h1.page-header You don't have any Followers yet
    | {{/followers.length}}

Fix followers page when no followers

.row
  .span2
  .span8
    | {{#followers.length}}
    | {{#guest_authenticated}}
    h1.page-header Followers of {{formatted.domain_entity}}
    | {{/guest_authenticated}}

    | {{^guest_authenticated}}
    h1.page-header Your Followers
    | {{/guest_authenticated}}
    table.table.table-striped
      thead
        tr
          th Name
          th Entity
          th
          th
      tbody
        | {{#followers}}
        | {{> _follower}}
        | {{/followers}}
    | {{/followers.length}}
    | {{^followers.length}}
    | {{#guest_authenticated}}
    h1.page-header {{formatted.domain_entity}} doesn't have any followers yet
    | {{/guest_authenticated}}
    | {{^guest_authenticated}}
    h1.page-header You don't have any Followers yet
    | {{/guest_authenticated}}
    | {{/followers.length}}


h2 Orders History

div ng-repeat="order in account.orders"
  dl
    dt Number
    dd
      | {{order.number}}

    dt Ordered on
    dd
      | {{order.completed_at | date}}

    dt Amount
    dd
      | {{order.total | currency}}

    dt Shipment Status
    dd
      | {{order.shipment_state}}

  a.btn.btn-primary.btn-small ng-click="showOrderDetails(order)" See details

  hr

Update title in order template

h2 Order History

div ng-repeat="order in account.orders"
  dl
    dt Number
    dd
      | {{order.number}}

    dt Ordered on
    dd
      | {{order.completed_at | date}}

    dt Amount
    dd
      | {{order.total | currency}}

    dt Shipment Status
    dd
      | {{order.shipment_state}}

  a.btn.btn-primary.btn-small ng-click="showOrderDetails(order)" See details

  hr


h1 Do you want to accept the answer?

h2 Your question:
p = @question.title

h2 Answer:
p = @answer.contents

= form_for [@question, @answer] do |f|
  .field
    = f.check_box :accepted_answer
    = f.label :accepted_answer
  .actions
    = f.submit "Save"

Add back link in edit answer

h1 Do you want to accept the answer?

h2 Your question:
p = @question.title

h2 Answer:
p = @answer.contents

= form_for [@question, @answer] do |f|
  .field
    = f.check_box :accepted_answer
    = f.label :accepted_answer
  .actions
    = f.submit "Save"
= link_to "Back", @question


- activity = notification.activity
- video = activity.object

= div_for(notification) do
  // TODO: Display user image here.
  - user_link = link_to_user(activity.actor)
  // TODO: Enable video_link when routes are fixed
  // - video_link = link_to video.title, course_video_path(notification.course, video)
  - video_link = video.title
  => t('.attempted_video_html', user: user_link, video: video_link)
  i.clearfix.timestamp = format_datetime(activity.created_at)

Add link to feed message

- activity = notification.activity
- video = activity.object

= div_for(notification) do
  // TODO: Display user image here.
  - user_link = link_to_user(activity.actor)
  - video_link = link_to(video.title,
                         course_video_path(notification.course, video))
  => t('.attempted_video_html', user: user_link, video: video_link)
  i.clearfix.timestamp = format_datetime(activity.created_at)


.brochure
  span.slide-span.first
    span.number-circle 1
    a ng-href='/users/sign_in' target="_self"
      span.title Create an account
      img.image src='#{asset_path("account.svg")}'
      span.content It's easy to sign up using your existing Facebook, Twitter, or PRX account.

  span.slide-span
    span.number-circle 2
    a ng-href='/imports/choose'
      span.title Archive your audio
      img.image src='#{asset_path("archive.svg")}'
      span.content You can upload individual files or batch import with a CSV.

  span.slide-span
    span.number-circle 3
    a ng-href='/collections'
      span.title Make it searchable
      img.image src='#{asset_path("search.svg")}' style='padding-bottom: 0px;'
      span.content Tags & transcripts will be automatically generated. You can also customize your own metadata.

  span.slide-span
    span.number-circle 4
    a ng-href='/search'
      span.title Explore
      img.image src='#{asset_path("explore.svg")}'
      span.content You can search & browse your own material or the entire public archive.

Change dashboard Create Account link from sign-in to sign-up

.brochure
  span.slide-span.first
    span.number-circle 1
    a ng-href='/users/sign_up' target="_self"
      span.title Create an account
      img.image src='#{asset_path("account.svg")}'
      span.content It's easy to sign up using your existing Facebook, Twitter, or PRX account.

  span.slide-span
    span.number-circle 2
    a ng-href='/imports/choose'
      span.title Archive your audio
      img.image src='#{asset_path("archive.svg")}'
      span.content You can upload individual files or batch import with a CSV.

  span.slide-span
    span.number-circle 3
    a ng-href='/collections'
      span.title Make it searchable
      img.image src='#{asset_path("search.svg")}' style='padding-bottom: 0px;'
      span.content Tags & transcripts will be automatically generated. You can also customize your own metadata.

  span.slide-span
    span.number-circle 4
    a ng-href='/search'
      span.title Explore
      img.image src='#{asset_path("explore.svg")}'
      span.content You can search & browse your own material or the entire public archive.


- add_breadcrumb @video.title
= page_header @video.title do
  - if can?(:manage, @video)
    div.pull-right
      = render partial: 'video_management_buttons', locals: { video: @video }

= div_for(@video) do
  - unless @video.description.blank?
    h3 = t('.description')
    div.well
      = format_html(@video.description)

  table.table.table-bordered.details-table
    tbody
      tr.start_at
        th = t('.start_at')
        td = format_datetime(@video.start_at)

Add a Watch button for the Video show page

- add_breadcrumb @video.title
= page_header @video.title do
  div.pull-right
    - if can?(:attempt, @video)
      = render partial: 'course/video/videos/video_attempt_button',
        locals: { video: @video }
    - if can?(:manage, @video)
      = render partial: 'video_management_buttons', locals: { video: @video }

= div_for(@video) do
  - unless @video.description.blank?
    h3 = t('.description')
    div.well
      = format_html(@video.description)

  table.table.table-bordered.details-table
    tbody
      tr.start_at
        th = t('.start_at')
        td = format_datetime(@video.start_at)


// Render simple form parameters in block style.

// Fetch parameters.

- params ||= []
- focus ||= focus.nil?
- report ||= report.nil? && request.post?

// Choose parameter to focus on if enabled.

- focused = params.find{ |x| x.invalid? } || params.find{ |x| x.blank? } || params.first if focus

// Render each parameter, reporting errors as necessary.

- for p in params
  - case p.type
  - when :ignore
  - when :hidden
    input type='hidden' name=p.form_name value=p.form_value
  - else
    .form-group
      input.form-control type=p.type name=p.form_name value=p.form_value placeholder=p.form_title autofocus=(p == focused)
      - if report and error = p.error
        .help-block
          span.text-danger = error

// EOF //

Fix passing of focused parameter to the example snippet.

// Render simple form parameters in block style.

// Fetch parameters.

- params ||= []
- focus ||= focus.nil?
- report ||= report.nil? && request.post?

// Choose parameter to focus on if enabled.

- focused ||= params.find{ |x| x.invalid? } || params.find{ |x| x.blank? } || params.first if focus

// Render each parameter, reporting errors as necessary.

- for p in params
  - case p.type
  - when :ignore
  - when :hidden
    input type='hidden' name=p.form_name value=p.form_value
  - else
    .form-group
      input.form-control type=p.type name=p.form_name value=p.form_value placeholder=p.form_title autofocus=(p == focused)
      - if report and error = p.error
        .help-block
          span.text-danger = error

// EOF //


.navbar.navbar-default.navbar-fixed-bottom
  .container-fluid
    nav
      ul.nav.navbar-nav
        li
          ul.pagination.no-padding
            - (0...5).each do |i|
              li
                = link_to "#{i}", "#"

Move pagination to the right hand side of the page

.navbar.navbar-default.navbar-fixed-bottom
  .container-fluid
    nav.pull-right
      ul.nav.navbar-nav
        li
          ul.pagination.no-padding
            - (0...5).each do |i|
              li
                = link_to "#{i}", "#"


table.responsive
  thead
    th.col-width-9
    th.col-width-date Diagnosed on
    th Outcome
    th Treatment
    th.col-width-date Updated on

  tbody
    - exit_site_infections.each do |e|
      tr valign="top"
        td valign="top"
          - unless current_user.has_role?(:read_only)
          = link_to "View",
                    patient_pd_exit_site_infection_path(patient, e.id),
                    class: "view-es-infection",
                    id: "view-es-infection-#{e.id}"
        td valign="top"
          = l e.diagnosis_date

        td valign="top"
          = e.outcome

        td valign="top"
          = e.treatment

        td valign="top"
          = e.updated_at.to_date

Make exist site infections table less responsive

table
  thead
    th.col-width-9
    th.col-width-date Diagnosed on
    th Outcome
    th Treatment
    th.col-width-date Updated on

  tbody
    - exit_site_infections.each do |e|
      tr valign="top"
        td valign="top"
          - unless current_user.has_role?(:read_only)
          = link_to "View",
                    patient_pd_exit_site_infection_path(patient, e.id),
                    class: "view-es-infection",
                    id: "view-es-infection-#{e.id}"
        td valign="top"
          = l e.diagnosis_date

        td valign="top"
          = e.outcome

        td valign="top"
          = e.treatment

        td valign="top"
          = e.updated_at.to_date


- f.inputs 'Picture', for: [:picture, f.object.picture || Picture.new] do |item|

  - item.input :image,
               as: :file,
               label: I18n.t('form.label.picture'),
               hint: retina_image_tag(item.object, :image, :medium)
  - item.input :online,
               as: :boolean,
               hint: I18n.t('form.hint.media.online')

  - if item.object.picture?
    - item.input :_destroy,
                 as: :boolean,
                 required: false,
                 label: 'Supprimer ?',
                 hint: 'Si coché, l\'image sera supprimée après mise à jour du mailing'

Update I18n translation for Picture form

- f.inputs I18n.t('activerecord.models.picture.one'), for: [:picture, f.object.picture || Picture.new] do |item|

  - item.input :image,
               as: :file,
               label: I18n.t('form.label.picture'),
               hint: retina_image_tag(item.object, :image, :medium) + '<br/> N\'oubliez pas de sauvegarder votre contenu (avec le bouton en bas de page) afin d\'ajouter votre visuel'.html_safe
  - item.input :online,
               as: :boolean,
               hint: I18n.t('form.hint.media.online')

  - if item.object.picture?
    - item.input :_destroy,
                 as: :boolean,
                 required: false,
                 label: 'Supprimer ?',
                 hint: 'Si coché, l\'image sera supprimée après mise à jour du mailing'


javascript:
  analytics.timeOnPage.baseUrl = #{url_for(controller: 'analytics_plugin/time_on_page').to_json}
  analytics.timeOnPage.updateInterval = #{AnalyticsPlugin::TimeOnPageUpdateIntervalMs.to_json}
  analytics.requestId = #{request.env['action_dispatch.request_id'].to_json}
  analytics.init()

Use profile to avoid problems with custom domains

javascript:
  analytics.timeOnPage.baseUrl = #{url_for(profile: profile.identifier, controller: 'analytics_plugin/time_on_page').to_json}
  analytics.timeOnPage.updateInterval = #{AnalyticsPlugin::TimeOnPageUpdateIntervalMs.to_json}
  analytics.requestId = #{request.env['action_dispatch.request_id'].to_json}
  analytics.init()


doctype html
html[lang="en"]
  head
    meta[charset="utf-8"]
    meta[name="viewport" content="width=device-width, initial-scale=1.0"]
    title
      = content_for?(:title) ? yield(:title) : "Fee remission staff app"
    = stylesheet_link_tag    "application"
    = javascript_include_tag "vendor/modernizr"
    = javascript_include_tag "application"
    = yield(:javascript) if content_for?(:javascript)
    = csrf_meta_tags
  body
    .contain-to-grid
      nav.top-bar(data-topbar)
        ul.title-area
          li.name
            h1 =link_to 'Help with fees', root_url
          li.toggle-topbar.menu-icon
            a href="#"
              span
        section.top-bar-section
          ul.right
            li
              - if user_signed_in?
                .inline
                  = "Welcome #{current_user.name}"
                  = link_to "Sign out", destroy_user_session_path, :method => :delete
              - else
                = link_to 'Sign in', new_user_session_path
    =render 'layouts/toolbar'
    .row
      .large-12.columns
        - flash.each do |key, value|
          .alert-box class="#{key}" data-alert=''
            |#{value}
            = link_to '×'.html_safe, '#', class: 'close'
    .row
      .large-12.columns
        = yield

Hide sign-in link on sign-in page

doctype html
html[lang="en"]
  head
    meta[charset="utf-8"]
    meta[name="viewport" content="width=device-width, initial-scale=1.0"]
    title
      = content_for?(:title) ? yield(:title) : "Fee remission staff app"
    = stylesheet_link_tag    "application"
    = javascript_include_tag "vendor/modernizr"
    = javascript_include_tag "application"
    = yield(:javascript) if content_for?(:javascript)
    = csrf_meta_tags
  body
    .contain-to-grid
      nav.top-bar(data-topbar)
        ul.title-area
          li.name
            h1 =link_to 'Help with fees', root_url
          li.toggle-topbar.menu-icon
            a href="#"
              span
        section.top-bar-section
          -if !current_page?(new_user_session_path)
            ul.right
                li
                  - if user_signed_in?
                    .inline
                      = "Welcome #{current_user.name}"
                      = link_to "Sign out", destroy_user_session_path, :method => :delete
                  - else
                    = link_to 'Sign in', new_user_session_path
    =render 'layouts/toolbar'
    .row
      .large-12.columns
        - flash.each do |key, value|
          .alert-box class="#{key}" data-alert=''
            |#{value}
            = link_to '×'.html_safe, '#', class: 'close'
    .row
      .large-12.columns
        = yield


- content_for :header_tags do
  - if Rails.env.development?
    = stylesheet_link_tag '../main.css', :plugin => 'redmine_dashboard_linked'
    = javascript_include_tag '../main.js', :plugin => 'redmine_dashboard_linked'
  - else
    = stylesheet_link_tag '../main.min.css', :plugin => 'redmine_dashboard'
    = javascript_include_tag '../main.min.js', :plugin => 'redmine_dashboard'

#redmine-dashboard
  javascript:
    Rdb.init({locale: "#{::I18n.locale}"}, #{{@board.to_json}});

Use non-minified assets also in e.g. tests when NO_MIN env is set

- content_for :header_tags do
  - if Rails.env.development? || ENV['NO_MIN']
    = stylesheet_link_tag '../main.css', :plugin => 'redmine_dashboard_linked'
    = javascript_include_tag '../main.js', :plugin => 'redmine_dashboard_linked'
  - else
    = stylesheet_link_tag '../main.min.css', :plugin => 'redmine_dashboard'
    = javascript_include_tag '../main.min.js', :plugin => 'redmine_dashboard'

#redmine-dashboard
  javascript:
    Rdb.init({locale: "#{::I18n.locale}"}, #{{@board.to_json}});


- contribution = @notification.contribution

|Olá, #{contribution.user.name}!
br
br
| Infelizmente o projeto #{link_to(contribution.project.name, project_by_slug_url(permalink: contribution.project.permalink))} que você apoiou não atingiu a meta estabelecida e não foi financiado no #{CatarseSettings[:company_name]}.
br
br
| Em até 5 dias úteis faremos o reembolso do valor do seu apoio, que virá como crédito na próxima ou
| subsequente fatura do seu cartão. Assim que o reembolso for feito você receberá um e-mail de confirmação da operação.
br
br
br
| Se ficou com alguma dúvida, entre em contato conosco respondendo a esta mensagem ou através do e-mail #{mail_to CatarseSettings[:email_contact]}
| e nos informe a chave de identificação do seu apoio, que é: #{contribution.payment_id}
br
br
|Um abraço,
br
| #{CatarseSettings[:company_name]}

Update `confirmed contribution for unsuccessful project - credit card`

- contribution = @notification.contribution

|Olá, #{contribution.user.name}!
br
br
| Infelizmente o projeto #{link_to(contribution.project.name, project_by_slug_url(permalink: contribution.project.permalink))} que você apoiou não atingiu a meta estabelecida e não foi financiado no #{CatarseSettings[:company_name]}.
br
br
|Faremos o reembolso do valor do seu apoio, que virá como crédito na próxima ou subsequente fatura do seu cartão. Assim que o reembolso for feito você receberá um e-mail de confirmação da operação.
br
br
br
| Se ficou com alguma dúvida, entre em contato conosco respondendo a esta mensagem ou através do e-mail #{mail_to CatarseSettings[:email_contact]}
| e nos informe a chave de identificação do seu apoio, que é: #{contribution.payment_id}
br
br
|Um abraço,
br
| #{CatarseSettings[:company_name]}


.show-user.main-content
  .show-user__info
    .show-user__avatar
      img src=user.avatar_url
    .show-user__name
      h2 = user.name || user.login
    .show-user__bio
      = user.bio
    .show-user__github
      = link_to 'Github', "http://github.com/#{user.login}"

  #js-switcher.show-user__tasks.tasks
    .show-user__switch
      .show-user__switch-item
        button.show-user__switch-item-link v-bind:class="{ 'show-user__switch-item-link_active': firstCase }"  v-on:click="displayFirstCase" Complited
      span
        | /
      .show-user__switch-item
        button.show-user__switch-item-link v-bind:class="{ 'show-user__switch-item-link_active': secondCase }"  v-on:click="displaySecondCase" Posted

    .tasks__list v-if="firstCase"
      - complited_tasks.each do |task|
        .task-item
          .task-item__title
            = link_to_task(task)
          .task-item__status
            = task.status
          .task-item__lang = task.lang

    .tasks__list v-if="secondCase"
      - user.tasks.each do |task|
        .task-item class=task_status_style(task)
          .task-item__title
            = link_to_task(task)
          .task-item__status
            = task.status
          .task-item__lang = task.lang

Fix naming on user profile page

.show-user.main-content
  .show-user__info
    .show-user__avatar
      img src=user.avatar_url
    .show-user__name
      h2 = user.name || user.login
    .show-user__bio
      = user.bio
    .show-user__github
      = link_to 'Github', "http://github.com/#{user.login}"

  #js-switcher.show-user__tasks.tasks
    .show-user__switch
      .show-user__switch-item
        button.show-user__switch-item-link v-bind:class="{ 'show-user__switch-item-link_active': firstCase }"  v-on:click="displayFirstCase" Assigned tasks
      span
        | /
      .show-user__switch-item
        button.show-user__switch-item-link v-bind:class="{ 'show-user__switch-item-link_active': secondCase }"  v-on:click="displaySecondCase" User tasks

    .tasks__list v-if="firstCase"
      - complited_tasks.each do |task|
        .task-item
          .task-item__title
            = link_to_task(task)
          .task-item__status
            = task.status
          .task-item__lang = task.lang

    .tasks__list v-if="secondCase"
      - user.tasks.each do |task|
        .task-item class=task_status_style(task)
          .task-item__title
            = link_to_task(task)
          .task-item__status
            = task.status
          .task-item__lang = task.lang


= f.input :form_id, collection: current_user.filter_by_context(Formgen::Form.eager_load(:context_tags)), label_method: lambda { |f| f.title.presence || f.path }, value_method: :id

Remove depricated filter from formgen_paragraph

= f.input :form_id, collection: Formgen::Form.all, label_method: lambda { |f| f.title.presence || f.path }, value_method: :id


.pq-columns.row
  /! start of 'sub column 1'
  .col-md-7
    .dashboard-column1-commissioned
- if question.internal_deadline
  h3 Internal deadline:
  span.deadline-date.text
    = question.internal_deadline
    = render partial: 'shared/deadline_time', locals: {internal_deadline: question.internal_deadline, is_closed: question.closed?, draft_reply: question.draft_answer_received}
  br
  h3 Replying minister:
  span.replying-minister
    = question.minister.name
  - if question.policy_minister
    h3 Policy minister:
    span.policy-minister
      = question.policy_minister.name
    //br

Add Action officers and reminder back in for no-response scenario

.pq-columns.row
  /! start of 'sub column 1'
  .col-md-7
    .dashboard-column1-commissioned
- if question.internal_deadline
  h3 Internal deadline:
  span.deadline-date.text
    = question.internal_deadline
    = render partial: 'shared/deadline_time', locals: {internal_deadline: question.internal_deadline, is_closed: question.closed?, draft_reply: question.draft_answer_received}
  br
  h3 Replying minister:
  span.replying-minister
    = question.minister.name
  - if question.policy_minister
    h3 Policy minister:
    span.policy-minister
      = question.policy_minister.name
  //br
  - if question.action_officer_accepted.nil?
    .row
    h3 Action officer(s)
    - question.action_officers_pqs.each do | ao_pq |
      - if !ao_pq.rejected? && !ao_pq.action_officer.nil?
          = link_to ao_pq.action_officer.name, action_officer_path(ao_pq.action_officer)
          a<>
          = render partial: 'shared/ao_reminder_link', locals: {ao_pq: ao_pq, question: question}
          a>


/ I had to use this ugly code because the locale params is lost between the controller and the view.
- I18n.with_locale(locale.to_sym) do
  - error = StringBox.find_by(key: "error_#{status_code}")

  .error-container.row
    .small-12.columns
      h1.error-title = error.try(:title)
      .error-content == error.try(:content)

      p.error-link == I18n.t('link.error_404', page: link_to(I18n.t('routes.home'), root_path))

Fix bug with back_to link in error page template

/ I had to use this ugly code because the locale params is lost between the controller and the view.
- I18n.with_locale(locale.to_sym) do
  - error = StringBox.find_by(key: "error_#{status_code}")

  .error-container.row
    .small-12.columns
      h1.error-title = error.try(:title)
      .error-content == error.try(:content)

      p.error-link == I18n.t('link.back_to', page: link_to(I18n.t('routes.home'), root_path))


== content_for :content do
  h1 style="font-size:18px; font-weight:700; color:#464646; margin-bottom:16px;"
    | You've been invited to a space in OpenTBL!

  p Hi #{@to.first_name},
  p
    | Your instructor #{@sender.full_name} has invited you to join the space #{@space.title}. Accept your invitation to get started!
  br
  a href="#{@url}" class="btn btn--primary" style="display:inline-block; font-weight:700; font-size:12px; text-align:center; vertical-align:middle; text-transform:capitalize; background-color:#12a6c7; color:#ffffff; border-radius:4px; border:none; cursor:pointer; white-space:nowrap; overflow:hidden; padding:0 1.15rem; text-decoration:none; height:2rem; line-height:2rem; margin-bottom:48px;" Accept Invitation

  .email-faq__label style="font-size:12px; font-weight:700; color:#464646; line-height: 1.6rem; margin-bottom:0px;"
    | What if I don't have an OpenTBL account?
  p.text--small style="font-size:12px; margin-top:0px;"
    | If you don't have an account with OpenTBL you will be taken through an account creation step before getting access.

Change button text on space invite email

== content_for :content do
  h1 style="font-size:18px; font-weight:700; color:#464646; margin-bottom:16px;"
    | You've been invited to a space in OpenTBL!

  p Hi #{@to.first_name},
  p
    | Your instructor #{@sender.full_name} has invited you to join the space #{@space.title}. Accept your invitation to get started!
  br
  a href="#{@url}" class="btn btn--primary" style="display:inline-block; font-weight:700; font-size:12px; text-align:center; vertical-align:middle; text-transform:capitalize; background-color:#12a6c7; color:#ffffff; border-radius:4px; border:none; cursor:pointer; white-space:nowrap; overflow:hidden; padding:0 1.15rem; text-decoration:none; height:2rem; line-height:2rem; margin-bottom:48px;" Click here to get started

  .email-faq__label style="font-size:12px; font-weight:700; color:#464646; line-height: 1.6rem; margin-bottom:0px;"
    | What if I don't have an OpenTBL account?
  p.text--small style="font-size:12px; margin-top:0px;"
    | If you don't have an account with OpenTBL you will be taken through an account creation step before getting access.


---
pageable: true
layout: simple
per_page: 5
intro:
  image: backgrounds/index.jpg
  filters:
    - vignette-90
title: "Всі витрішки"
---
= partial :by_year
ul.list-unstyled
  - blog.articles.group_by {|a| a.date.year }.each do |year, articles|
    li
      h1= year
      ul
        - articles.each do |article|
          li
            = link_to "#{article.title}  #{article.data.series.nil? ? "" : "<small>  (З циклу #{article.data.series}»)</small>"}", article

Return back lost left quote.

---
pageable: true
layout: simple
per_page: 5
intro:
  image: backgrounds/index.jpg
  filters:
    - vignette-90
title: "Всі витрішки"
---
= partial :by_year
ul.list-unstyled
  - blog.articles.group_by {|a| a.date.year }.each do |year, articles|
    li
      h1= year
      ul
        - articles.each do |article|
          li
            = link_to "#{article.title}  #{article.data.series.nil? ? "" : "<small>  (З циклу «#{article.data.series}»)</small>"}", article