%i.fa.diff-toggle-caret.fa-fw
- if defined?(blob) && blob && diff_file.submodule?
  %span
    = icon('archive fw')
    %span
      = submodule_link(blob, diff_commit.id, project.repository)
- else
  = conditional_link_to url.present?, url do
    = blob_icon diff_file.b_mode, diff_file.file_path

    - if diff_file.renamed_file
      - old_path, new_path = mark_inline_diffs(diff_file.old_path, diff_file.new_path)
      %strong
        = old_path
      →
      %strong
        = new_path
    - else
      %strong
        = diff_file.new_path
      - if diff_file.deleted_file
        deleted

  = clipboard_button(clipboard_text: diff_file.new_path, class: 'btn-clipboard btn-transparent prepend-left-5', title: 'Copy filename to clipboard')

  - if diff_file.mode_changed?
    %small
      = "#{diff_file.a_mode} → #{diff_file.b_mode}"

Rename filename to file path in tooltip of file header in merge request diff

%i.fa.diff-toggle-caret.fa-fw
- if defined?(blob) && blob && diff_file.submodule?
  %span
    = icon('archive fw')
    %span
      = submodule_link(blob, diff_commit.id, project.repository)
- else
  = conditional_link_to url.present?, url do
    = blob_icon diff_file.b_mode, diff_file.file_path

    - if diff_file.renamed_file
      - old_path, new_path = mark_inline_diffs(diff_file.old_path, diff_file.new_path)
      %strong
        = old_path
      →
      %strong
        = new_path
    - else
      %strong
        = diff_file.new_path
      - if diff_file.deleted_file
        deleted

  = clipboard_button(clipboard_text: diff_file.new_path, class: 'btn-clipboard btn-transparent prepend-left-5', title: 'Copy file path to clipboard')

  - if diff_file.mode_changed?
    %small
      = "#{diff_file.a_mode} → #{diff_file.b_mode}"


!!!
%html
  %head
    %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
    - if @title
      %title #{@title} - mtg.wtf
    - else
      %title mtg.wtf
    = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    %link{rel: "search", href: "http://mtg.wtf/opensearchdescription.xml", type: "application/opensearchdescription+xml", title: "mtg.wtf"}
    = csrf_meta_tags
  %body
    %h1
      %a.site_logo{href: "/"} mtg.wtf
    = form_tag("/card", method: :get, class: "search") do
      = text_field_tag(:q, @search, {autofocus: true})
      = submit_tag("Search", name: nil)
    = yield
    %div.footer
      = link_to controller: "set", action: "index" do
        Sets
      •
      = link_to controller: "help", action: "syntax" do
        Syntax Help
      •
      = link_to controller: "help", action: "rules" do
        Rules
      •
      = link_to controller: "help", action: "contact" do
        Contact

Hide pointless utf8 parameter, it's not 90s any more

!!!
%html
  %head
    %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
    - if @title
      %title #{@title} - mtg.wtf
    - else
      %title mtg.wtf
    = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    %link{rel: "search", href: "http://mtg.wtf/opensearchdescription.xml", type: "application/opensearchdescription+xml", title: "mtg.wtf"}
    = csrf_meta_tags
  %body
    %h1
      %a.site_logo{href: "/"} mtg.wtf
    = form_tag("/card", method: :get, class: "search", enforce_utf8: false) do
      = text_field_tag(:q, @search, {autofocus: true})
      = submit_tag("Search", name: nil)
    = yield
    %div.footer
      = link_to controller: "set", action: "index" do
        Sets
      •
      = link_to controller: "help", action: "syntax" do
        Syntax Help
      •
      = link_to controller: "help", action: "rules" do
        Rules
      •
      = link_to controller: "help", action: "contact" do
        Contact


= title _('You are about to leave a new response')
= head_embed javascript_include_tag('editor')
= head_embed stylesheet_link_tag('editor')
= breadcrumbs(render('breadcrumbs'))

.row#response
  .eight.columns

    .hide.assignment_content
      %h4.marginless-top
        = @assignment.title
      %hr
      .formatted
        = @assignment.content.html_safe

    %h4.marginless-top
      = _('Your response')
    %hr

    = form_for(@response, :url => lecture_assignment_responses_path) do |f|
      = f.text_area :content, :class => 'wysiwyg', :required => true

      - unless @assignment.quiz.blank?
        %h5
          = _('Please also answer the questions below')
        %hr

        - @assignment.quiz.each_with_index do |question, question_id|
          .panel
            = render(:partial => "quiz_#{question['type']}", :locals => {:question => question, :question_id => question_id, :show_results => false})

      %p
        = hidden_field_tag :assetable_type, @response.class, :class => 'assetable_type'
        = hidden_field_tag :assetable_id, @response.id, :class => 'assetable_id'
        = f.submit _('Create'), :id => 'submit_response', :class => 'button primary'
        = link_to _('Cancel'), lecture_assignment_path(@assignment.lecture, @assignment), :class => 'pull right'

  = render('sidebar_new')

Add some padding between textarea and buttons.

= title _('You are about to leave a new response')
= head_embed javascript_include_tag('editor')
= head_embed stylesheet_link_tag('editor')
= breadcrumbs(render('breadcrumbs'))

.row#response
  .eight.columns

    .hide.assignment_content
      %h4.marginless-top
        = @assignment.title
      %hr
      .formatted
        = @assignment.content.html_safe

    %h4.marginless-top
      = _('Your response')
    %hr

    = form_for(@response, :url => lecture_assignment_responses_path) do |f|
      %p
        = f.text_area :content, :class => 'wysiwyg', :required => true

      - unless @assignment.quiz.blank?
        %h5
          = _('Please also answer the questions below')
        %hr

        - @assignment.quiz.each_with_index do |question, question_id|
          .panel
            = render(:partial => "quiz_#{question['type']}", :locals => {:question => question, :question_id => question_id, :show_results => false})

      %p
        = hidden_field_tag :assetable_type, @response.class, :class => 'assetable_type'
        = hidden_field_tag :assetable_id, @response.id, :class => 'assetable_id'
        = f.submit _('Create'), :id => 'submit_response', :class => 'button primary'
        = link_to _('Cancel'), lecture_assignment_path(@assignment.lecture, @assignment), :class => 'pull right'

  = render('sidebar_new')


%h1 Preferences
= form_with url: {controller: "session", action: "preferences"}, model: @user do |f|
  = label_tag(:sort, "Default sorting")
  = f.text_field(:sort)
  = label_tag(:sort, "Default view")
  = f.select(:view, options_for_select(@views.map{|view| [view, view] }, @user.view))
  = f.text_field(:view)
  = f.submit("Save")

Remove redundant text field from preferences

%h1 Preferences
= form_with url: {controller: "session", action: "preferences"}, model: @user do |f|
  = label_tag(:sort, "Default sorting")
  = f.text_field(:sort)
  = label_tag(:sort, "Default view")
  = f.select(:view, options_for_select(@views.map{|view| [view, view] }, @user.view))
  = f.submit("Save")


%form{action: url("/search", false, true), method: :get}
  %input{type: "textarea", name: "word", size: 20, value: params[:word]}
  - params.each do |key, value|
    - next if key == "word"
    %input{type: "hidden", name: key, value: value}
  %input{type: "submit", value: "検索"}
  %input{type: "checkbox", name: "reset_params", value: "1"} 絞り込み条件をリセット

Hide reset checkbox if not drilldowned

%form{action: url("/search", false, true), method: :get}
  %input{type: "textarea", name: "word", size: 20, value: params[:word]}
  - params.each do |key, value|
    - next if key == "word"
    %input{type: "hidden", name: key, value: value}
  %input{type: "submit", value: "検索"}
  - unless params_to_description.empty?
    %input{type: "checkbox", name: "reset_params", value: "1"} 絞り込み条件をリセット


= simple_form_for @incident, html: { class: 'form-horizontal' } do |f|
  = f.error_notification

  .form-inputs
    = f.input :description
    = f.input :datetime_of_incident
    = f.input :location
    = f.input :injured
    = f.input :severity, as: :range, hint: 'How badly you were hurt', input_html: { min: Incident::MIN_SEVERITY, max: Incident::MAX_SEVERITY }
    = f.input :police_report_number
    = f.input :video
  %h4 The vehicle
  = f.simple_fields_for :car do |car|
    = render 'car_fields', f: car

  .form-actions
    = f.button :submit, :class => 'btn btn-primary'

.severity-levels{style: 'display:none'}
  - for i in 0..10
    .severity{ data: { level: i, color: Incident.severity_color(i) } }
      = Incident.severity_text i

Remove dead injured column from _form partial

= simple_form_for @incident, html: { class: 'form-horizontal' } do |f|
  = f.error_notification

  .form-inputs
    = f.input :description
    = f.input :datetime_of_incident
    = f.input :location
    = f.input :severity, as: :range, hint: 'How badly you were hurt', input_html: { min: Incident::MIN_SEVERITY, max: Incident::MAX_SEVERITY }
    = f.input :police_report_number
    = f.input :video
  %h4 The vehicle
  = f.simple_fields_for :car do |car|
    = render 'car_fields', f: car

  .form-actions
    = f.button :submit, :class => 'btn btn-primary'

.severity-levels{style: 'display:none'}
  - for i in 0..10
    .severity{ data: { level: i, color: Incident.severity_color(i) } }
      = Incident.severity_text i


.node-report.btn-group.dropdown.pull-right
  %button.dropdown-toggle.btn{:'data-toggle' => 'dropdown'}
    %i.icon-bolt
    %span.caret

  .node-report-accordion.dropdown-accordion
    %header
      .pull-right
        = link_to('FAQ', I18n.locale == :de ? '//wheelmap.org/about/faqs/' : '//wheelmap.org/en/faqs/', class: 'btn btn-mini', target: '_blank')
        = mail_to('bugs@wheelmap.org', content_tag(:i, '', class: 'icon-envelope-alt'), class: 'btn btn-mini', encode: :hex, subject: I18n.t('models.node.mail.subject', headline: @node.headline), body: I18n.t('models.node.mail.body', url: node_url(@node)))
      = t('faq.headline')
    - t('faq.questions').size.times do |i|
      .accordion-group
        %a.collapsed.accordion-toggle{href: "#node-report-#{i}", :'data-toggle' => 'collapse', :'data-parent' => '#node-report-accordion'}
          %i.icon-chevron-up.pull-right
          = t('faq.questions')[i]
        .collapse{id: "node-report-#{i}"}
          .accordion-inner
            =t("faq.answers")[i]

Fix two missing links to blog.

.node-report.btn-group.dropdown.pull-right
  %button.dropdown-toggle.btn{:'data-toggle' => 'dropdown'}
    %i.icon-bolt
    %span.caret

  .node-report-accordion.dropdown-accordion
    %header
      .pull-right
        = link_to('FAQ', I18n.locale == :de ? '//community.wheelmap.org/about/faqs/' : '//community.wheelmap.org/en/faqs/', class: 'btn btn-mini', target: '_blank')
        = mail_to('bugs@wheelmap.org', content_tag(:i, '', class: 'icon-envelope-alt'), class: 'btn btn-mini', encode: :hex, subject: I18n.t('models.node.mail.subject', headline: @node.headline), body: I18n.t('models.node.mail.body', url: node_url(@node)))
      = t('faq.headline')
    - t('faq.questions').size.times do |i|
      .accordion-group
        %a.collapsed.accordion-toggle{href: "#node-report-#{i}", :'data-toggle' => 'collapse', :'data-parent' => '#node-report-accordion'}
          %i.icon-chevron-up.pull-right
          = t('faq.questions')[i]
        .collapse{id: "node-report-#{i}"}
          .accordion-inner
            =t("faq.answers")[i]


%p
  You need to log in with an MOJ DS or GDS account.

Add login link to failed login page

%p
  You need to
  = link_to "log in", "/auth/gplus"
  with an MOJ DS or GDS account.


#modal-privileges.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-privileges-label", :role => "dialog", :tabindex => "-1"}
  .modal-dialog
    .modal-content
      .modal-header
        %button.close{"data-dismiss" => "modal", :type => "button"}
          %span{"aria-hidden" => "true"} ×
          %span.sr-only= t 'views.actions.close'
        %h4#modal-privileges-label.modal-title
          = raw t('views.actions.privilege', user: @user.screen_name)
      %ul.list-group.groups--list
        = render 'user/modal_privileges_item', privilege: 'blogger', description: t('views.modal.privilege.blogger'), user: @user
        = render 'user/modal_privileges_item', privilege: 'contributor', description: t('views.modal.privilege.contributor'), user: @user
        = render 'user/modal_privileges_item', privilege: 'translator', description: t('views.modal.privilege.translator'), user: @user
        - if current_user.has_role?(:administrator)
          = render 'user/modal_privileges_item', privilege: 'supporter', description: t('views.modal.privilege.supporter'), user: @user
          = render 'user/modal_privileges_item', privilege: 'moderator', description: t('views.modal.privilege.moderator'),user: @user
          = render 'user/modal_privileges_item', privilege: 'admin', description: t('views.modal.privilege.admin'), user: @user
      .modal-footer
        %button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }}= t 'views.actions.done'

Remove unused roles from privileges modal

#modal-privileges.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-privileges-label", :role => "dialog", :tabindex => "-1"}
  .modal-dialog
    .modal-content
      .modal-header
        %button.close{"data-dismiss" => "modal", :type => "button"}
          %span{"aria-hidden" => "true"} ×
          %span.sr-only= t 'views.actions.close'
        %h4#modal-privileges-label.modal-title
          = raw t('views.actions.privilege', user: @user.screen_name)
      %ul.list-group.groups--list
        - if current_user.has_role?(:administrator)
          = render 'user/modal_privileges_item', privilege: 'moderator', description: t('views.modal.privilege.moderator'),user: @user
          = render 'user/modal_privileges_item', privilege: 'admin', description: t('views.modal.privilege.admin'), user: @user
      .modal-footer
        %button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }}= t 'views.actions.done'


Oh no, that's a serious error! You gotta fix it asap.

= raw @error.inspect

Include the backtrace if any

Oh no, that's a serious error! You gotta fix it asap.

= raw @error.inspect
= raw @error.backtrace.join("\n") if @error.backtrace


%link{rel: 'stylesheet', href:'/mailer.css'}
%table.row
  %tbody
    %tr
      %th
        %table
          %tr
            %td.main-content
              %p.paragraph
                = "Hi #{@alert.user.username}."
                Here are all the assigned training modules for
                %a.link{href: @course_url}> your course
                , with your status for each one:
            %td.expander
          %tr
            %td
              %table
                %tr
                  %th.trainings-table Module
                  %th.trainings-table Status
                  %th.trainings-table Due Date
                - @alert.details.each do |slug, module_details|
                  - training = TrainingModule.find_by(slug: slug)
                  %tr
                    %td.trainings-table-cell
                      %a.link.training{href: "https://#{ENV['dashboard_url']}/training/students/#{slug}"}
                        = training.name
                    %td{class: "trainings-table-cell #{module_details[:status]}"}= module_details[:status]
                    %td.trainings-table-cell= module_details[:due_date]

        %table
          %tr
            %td.main-content
              %p.paragraph
              %p.paragraph
                We'll send you another reminder in about
                = @days_until_next_alert
                days if you still have overdue training modules.
                If you don't want to receive any more training reminders,
                %a{href: @alert.opt_out_link} click here
                to opt out.

Add ticket ignore code to overdue training alert notification

%link{rel: 'stylesheet', href:'/mailer.css'}
%table.row
  %tbody
    %tr
      %th
        %table
          %tr
            %td.main-content
              %p.paragraph
                = "Hi #{@alert.user.username}."
                Here are all the assigned training modules for
                %a.link{href: @course_url}> your course
                , with your status for each one:
            %td.expander
          %tr
            %td
              %table
                %tr
                  %th.trainings-table Module
                  %th.trainings-table Status
                  %th.trainings-table Due Date
                - @alert.details.each do |slug, module_details|
                  - training = TrainingModule.find_by(slug: slug)
                  %tr
                    %td.trainings-table-cell
                      %a.link.training{href: "https://#{ENV['dashboard_url']}/training/students/#{slug}"}
                        = training.name
                    %td{class: "trainings-table-cell #{module_details[:status]}"}= module_details[:status]
                    %td.trainings-table-cell= module_details[:due_date]

        %table
          %tr
            %td.main-content
              %p.paragraph
              %p.paragraph
                We'll send you another reminder in about
                = @days_until_next_alert
                days if you still have overdue training modules.
                If you don't want to receive any more training reminders,
                %a{href: @alert.opt_out_link} click here
                to opt out.
.hidden
  %p -- DO NOT DELETE ANYTHING BELOW THIS LINE --
  %p= ENV['TICKET_IGNORE_CODE']


- anchors = local_assigns.fetch(:anchors, [])

- if anchors.size > 0
  %ul.nav
    - anchors.each do |anchor|
      %li
        - if anchor.link
          = link_to anchor.link, class: anchor.enabled ? 'stat-link' : "btn btn-#{anchor.class_modifier || 'missing'}" do
            = anchor.label
        - else
          %span.stat-text
            = anchor.label

Remove indent and reduce bloat with link_to_if

- anchors = local_assigns.fetch(:anchors, [])

- return unless anchors.any?
%ul.nav
  - anchors.each do |anchor|
    %li
      = link_to_if anchor.link, anchor.label, anchor.link, class: anchor.enabled ? 'stat-link' : "btn btn-#{anchor.class_modifier || 'missing'}" do
        %span.stat-text= anchor.label


.scraper-download-block
  - unless signed_in?
    %p
      To download data
      = button_link_to "sign in with GitHub", user_omniauth_authorize_path(:github)
  .btn-group
    = button_link_to "Download table (as CSV)", data_scraper_path(scraper, format: :csv, query: scraper.database.select_all(table), key: (current_user.api_key if current_user)), disabled: !signed_in?
    = button_link_to "Download SQLite database (#{number_to_human_size scraper.database.sqlite_db_size})", data_scraper_path(scraper, :format => :sqlite, key: (current_user.api_key if current_user)), disabled: !signed_in?
    = button_link_to "Use the API", api_documentation_index_path(scraper: scraper.full_name)
  - if user_signed_in?
    %span.download-privacy-notice.alert.alert-info
      Your downloads will be shown above.
      = link_to "Why?", documentation_index_path(anchor: "open_downloads"), title: 'Read about why downloader information is public and open.'

Use the cached sqlite database size from the scraper model

.scraper-download-block
  - unless signed_in?
    %p
      To download data
      = button_link_to "sign in with GitHub", user_omniauth_authorize_path(:github)
  .btn-group
    = button_link_to "Download table (as CSV)", data_scraper_path(scraper, format: :csv, query: scraper.database.select_all(table), key: (current_user.api_key if current_user)), disabled: !signed_in?
    = button_link_to "Download SQLite database (#{number_to_human_size scraper.sqlite_db_size})", data_scraper_path(scraper, :format => :sqlite, key: (current_user.api_key if current_user)), disabled: !signed_in?
    = button_link_to "Use the API", api_documentation_index_path(scraper: scraper.full_name)
  - if user_signed_in?
    %span.download-privacy-notice.alert.alert-info
      Your downloads will be shown above.
      = link_to "Why?", documentation_index_path(anchor: "open_downloads"), title: 'Read about why downloader information is public and open.'


= article_for tracker do |c|
  - c.title = "#{link_to "Suivi - #{tracker.category_title}", "/suivi?tracker[category_id]=#{tracker.category_id}", :class => "topic"} #{link_to tracker.title, tracker}".html_safe
  - c.meta = capture do
    %span.tracker_id ##{tracker.id}
    = posted_by(tracker)
    État de l'entrée : #{tracker.state_name}
  - if current_account && current_account.can_update?(tracker)
    - c.actions = link_to("Modifier", "/suivi/#{tracker.to_param}/modifier", :class => 'action')

Fix HTML by URL encoding [ and ] in tracker

= article_for tracker do |c|
  - c.title = "#{link_to "Suivi - #{tracker.category_title}", "/suivi?tracker%5Bcategory_id%5D=#{tracker.category_id}", :class => "topic"} #{link_to tracker.title, tracker}".html_safe
  - c.meta = capture do
    %span.tracker_id ##{tracker.id}
    = posted_by(tracker)
    État de l'entrée : #{tracker.state_name}
  - if current_account && current_account.can_update?(tracker)
    - c.actions = link_to("Modifier", "/suivi/#{tracker.to_param}/modifier", :class => 'action')


%h2.center-text
  Please confirm your additional email

%p.center-text{ style: 'margin-bottom: 3em;' }
  #{@user.display_name} would like to merge this email into their account (#{@user.email}).

= link_to 'Verify email', confirm_user_email_url(id: @user_email.id, confirmation_token: @user_email.confirmation_token), class: 'binx-button'

%p.center-text.less-strong
  Click the Verify email button to merge these accounts on BikeIndex.org!

%hr

%p.center-text
  If you didn't request this merge please reply to this email and tell us.

Add additional email to email

%h2.center-text
  Please confirm your additional email
  %br
  %small
    %em
      = @user_email.email

%p.center-text{ style: 'margin-bottom: 3em;' }
  #{@user.display_name} would like to merge this email into their account (#{@user.email}).

= link_to 'Verify email', confirm_user_email_url(id: @user_email.id, confirmation_token: @user_email.confirmation_token), class: 'binx-button'

%p.center-text.less-strong
  Click the Verify email button to merge these accounts on BikeIndex.org!

%hr

%p.center-text
  If you didn't request this merge please reply to this email and tell us.


%h1.page-title
  Administration

.grid-row.clear-float
  %h2.heading-medium.left
    List of Advocates
  = link_to 'New Advocate', new_advocates_admin_advocate_path, class: 'button right'

%table
  %thead
    %th
      Surname
    %th
      Name
    %th
      Supplier Number
    %th
      Email
    %%th
  %tbody
    - @advocates.each do |advocate|
      %tr
        %td
          = advocate.last_name
        %td
          = advocate.first_name
        %td
          = advocate.account_number
        %td
          = mail_to advocate.email, advocate.email, {title: "Email #{advocate.name}"}
        %td.user-controls
          = link_to 'Edit',  edit_advocates_admin_advocate_path(advocate)
          = " | "
          = link_to 'Delete',advocates_admin_advocate_path(advocate), method: :delete, data: { confirm: 'Are you sure?' }

Change the report to refer to advocates supplier number instead of account number

%h1.page-title
  Administration

.grid-row.clear-float
  %h2.heading-medium.left
    List of Advocates
  = link_to 'New Advocate', new_advocates_admin_advocate_path, class: 'button right'

%table
  %thead
    %th
      Surname
    %th
      Name
    %th
      Supplier Number
    %th
      Email
    %%th
  %tbody
    - @advocates.each do |advocate|
      %tr
        %td
          = advocate.last_name
        %td
          = advocate.first_name
        %td
          = advocate.supplier_number
        %td
          = mail_to advocate.email, advocate.email, {title: "Email #{advocate.name}"}
        %td.user-controls
          = link_to 'Edit',  edit_advocates_admin_advocate_path(advocate)
          = " | "
          = link_to 'Delete',advocates_admin_advocate_path(advocate), method: :delete, data: { confirm: 'Are you sure?' }


#alert_profile_folders_div
  - if @ap_folders
    = render :partial => "layouts/flash_msg"
    %table.table.table-striped.table-bordered.table-hover
      %tbody
        - @ap_folders.each do |f|
          %tr{:title => _("Open Folder"),
            :onclick => "miqTreeActivateNode('alert_profile_tree', 'xx-#{f.last}');"}
            %td.table-view-pf-select
              %img{:src => image_path("100/#{f.last.underscore.downcase}.png")}
            %td
              = f.first

              = _('Alert Profiles')

Use fonticons for alert profile folders

#alert_profile_folders_div
  - if @ap_folders
    = render :partial => "layouts/flash_msg"
    %table.table.table-striped.table-bordered.table-hover
      %tbody
        - @ap_folders.each do |f|
          %tr{:title => _("Open Folder"),
            :onclick => "miqTreeActivateNode('alert_profile_tree', 'xx-#{f.last}');"}
            %td.table-view-pf-select
              %i{:class => f.last.constantize.decorate.fonticon}
            %td
              = f.first

              = _('Alert Profiles')


%h3 Shared runners

.bs-callout.bs-callout-warning
  GitLab Runners do not offer secure isolation between projects that they do builds for. You are TRUSTING all GitLab users who can push code to project A, B or C to run shell scripts on the machine hosting runner X.
  %hr
  - if @ci_project.shared_runners_enabled
    = link_to toggle_shared_runners_ci_project_path(@ci_project), class: 'btn btn-warning', method: :post do
      Disable shared runners
  - else
    = link_to toggle_shared_runners_ci_project_path(@ci_project), class: 'btn btn-success', method: :post do
      Enable shared runners
    for this project

- if @shared_runners_count.zero?
  This application has no shared runners yet.
  Please use specific runners or ask administrator to create one
- else
  %h4.underlined-title Available shared runners - #{@shared_runners_count}
  %ul.bordered-list.available-shared-runners
    = render partial: 'runner', collection: @shared_runners, as: :runner
  - if @shared_runners_count > 10
    .light
      and #{@shared_runners_count - 10} more...

Fix wording on runner setup page

%h3 Shared runners

.bs-callout.bs-callout-warning
  GitLab Runners do not offer secure isolation between projects that they do builds for. You are TRUSTING all GitLab users who can push code to project A, B or C to run shell scripts on the machine hosting runner X.
  %hr
  - if @ci_project.shared_runners_enabled
    = link_to toggle_shared_runners_ci_project_path(@ci_project), class: 'btn btn-warning', method: :post do
      Disable shared runners
  - else
    = link_to toggle_shared_runners_ci_project_path(@ci_project), class: 'btn btn-success', method: :post do
      Enable shared runners
    for this project

- if @shared_runners_count.zero?
  This GitLab server does not provide any shared runners yet.
  Please use specific runners or ask the administrator to create one.
- else
  %h4.underlined-title Available shared runners - #{@shared_runners_count}
  %ul.bordered-list.available-shared-runners
    = render partial: 'runner', collection: @shared_runners, as: :runner
  - if @shared_runners_count > 10
    .light
      and #{@shared_runners_count - 10} more...


- if @search_results.empty?
  = render partial: "search/results/empty"
- else
  .gray-content-block
    Search results for
    %code
      = @search_term
    - unless @show_snippets
      - if @project
        in project #{link_to @project.name_with_namespace, [@project.namespace.becomes(Namespace), @project]}
      - elsif @group
        in group #{link_to @group.name, @group}

  .results.prepend-top-10
    .search-results
      - if @scope == 'projects'
        .term
          = render 'shared/projects/list', projects: @objects
      - else
        = render partial: "search/results/#{@scope.singularize}", collection: @objects
    = paginate @objects, theme: 'gitlab'

:javascript
  $(".search-results .term").highlight("#{escape_javascript(params[:search])}");

Include pagination for other than projects search


.nested-fields
  .row
    .large-4.columns
      %label{for: "name"}
        %i.fa.fa-users.fa-fw.fa-lg.subheader
        = t("speaker.name")
        %small
          = t("event.required")
      = f.text_field :name, label: false, maxlength: 28, required: true, class: "radius"

      = link_to_remove_association t("speaker.remove"), f, class: "button small radius"

    .large-4.columns
      %label{for: "surname"}
        %i.fa.fa-users.fa-fw.fa-lg.subheader
        = t("speaker.surname")
      = f.text_field :surname, label: false, maxlength: 36, class: "radius"

    .large-4.columns
      %label{for: "email"}
        %i.fa.fa-envelope.fa-fw.fa-lg.subheader
        = t("speaker.email")
        %small
          = t("event.required")
      = f.text_field :email, label: false, maxlength: 64, required: true, type: "email", class: "radius"

Add box to speaker fields

.nested-fields
  = field_set_tag do
    .row
      .large-4.columns
        %label{for: "name"}
          %i.fa.fa-users.fa-fw.fa-lg.subheader
          = t("speaker.name")
          %small
            = t("event.required")
        = f.text_field :name, label: false, maxlength: 28, required: true, class: "radius"

      .large-4.columns
        %label{for: "surname"}
          %i.fa.fa-users.fa-fw.fa-lg.subheader
          = t("speaker.surname")
        = f.text_field :surname, label: false, maxlength: 36, class: "radius"

      .large-4.columns
        %label{for: "email"}
          %i.fa.fa-envelope.fa-fw.fa-lg.subheader
          = t("speaker.email")
          %small
            = t("event.required")
        = f.text_field :email, label: false, maxlength: 64, required: true, type: "email", class: "radius"

        = link_to_remove_association f, class: "button tiny radius" do
          %i.fa.fa-minus.fa-fw.fa-lg


= render '/application/mailer_doctype'
%html
  %head
    = stylesheet_link_tag 'thread_mailer'
  %body
    .everything
      %p= t(:'email.missed_yesterday.heres_what_happened')
      %h1= t(:'email.missed_yesterday.headlines')
      .toc
        =render 'user_mailer/missed_yesterday/headlines'
      %hr
      - @user.inbox_groups.each do |group|
        - next unless @discussions_by_group.has_key?(group)
        %h1= link_to group.full_name, group_url(group)
        - @discussions_by_group[group].each do |discussion|
          = render 'user_mailer/missed_yesterday/discussion', discussion: discussion

    %p
      = t(:'email.missed_yesterday.thanks_for_reading')
      %br
      =link_to(t('email.missed_yesterday.mark_as_read'), mark_summary_as_read_url_for(@user))
      %img{src: mark_summary_as_read_url_for(@user, format: 'gif'), alt: '', width: 1, height: 1}
    =render 'user_mailer/unsubscribe_link'

Remove mark summary as read links

= render '/application/mailer_doctype'
%html
  %head
    = stylesheet_link_tag 'thread_mailer'
  %body
    .everything
      %p= t(:'email.missed_yesterday.heres_what_happened')
      %h1= t(:'email.missed_yesterday.headlines')
      .toc
        =render 'user_mailer/missed_yesterday/headlines'
      %hr
      - @user.inbox_groups.each do |group|
        - next unless @discussions_by_group.has_key?(group)
        %h1= link_to group.full_name, group_url(group)
        - @discussions_by_group[group].each do |discussion|
          = render 'user_mailer/missed_yesterday/discussion', discussion: discussion

    %p
      = t(:'email.missed_yesterday.thanks_for_reading')
      %br
    =render 'user_mailer/unsubscribe_link'


.investigation_other_data
  - unless investigation.domain.name.nil?
    .data_header Scientific Domain
    .data_value
      = investigation.domain.name
  - unless investigation.grade_span.nil?
    .data_header Grade
    .data_value
      = investigation.grade_span
  - required_equipments = probe_types(investigation).map { |p| p.name }.join(", ")
  - unless required_equipments == ""
    .data_header Required sensor(s)
    .data_value
      = required_equipments

Handle nil case for investigation data

.investigation_other_data
  - unless investigation.grade_span_expectation.nil?
    .data_header Scientific Domain
    .data_value
      = investigation.domain.name
    .data_header Grade
    .data_value
      = investigation.grade_span
  - required_equipments = probe_types(investigation).map { |p| p.name }.join(", ")
  - unless required_equipments == ""
    .data_header Required sensor(s)
    .data_value
      = required_equipments


-# The inline navigation for wide screens
.wv--split--right.nav--inline.nav--secondary.wv--block
  - properties[:items].each do |n|
    - active = n[:title] == properties[:section_name] || (n[:slug].end_with? properties[:section_name].downcase.strip.gsub(' ', '-'))
    %a.nav__item.nav__item--secondary.js-nav-item{:class=>(active ? 'current' : ''), :href=> n[:slug]}<
      = n[:title]

-# The select navigation for small screens
.wv--split--right.nav--inline.nav--secondary.wv--hidden.nav--secondary__dropdown
  = ui_component('navigation/dropdown', properties: { action: "/redirector", dropdown: {name: 'url', options: subnav_options(properties[:items]), selected: properties[:section_name], class: 'js-responsive-nav', data: { form_submit: "true" }} })

Update secondary nav to handle responsive better

-# The inline navigation for wide screens
.wv--split--right.nav--inline.nav--secondary.wv--block
  - properties[:items].each do |n|
    - active = n[:title] == properties[:section_name] || (n[:slug].end_with? properties[:section_name].downcase.strip.gsub(' ', '-'))
    %a.nav__item.nav__item--secondary.js-nav-item{:class=>(active ? 'current' : ''), :href=> n[:slug]}<
      = n[:title]

-# The select navigation for small screens
.wv--split--right.nav--inline.nav--secondary.wv--hidden.nav--secondary__dropdown
  = ui_component('navigation/dropdown', properties: { action: "/redirector", dropdown: {name: 'url', options: subnav_options(properties[:responsive_items] || properties[:items]), selected: properties[:section_name], placeholder: properties[:responsive_placeholder], class: 'js-responsive-nav', data: { form_submit: "true" }} })


- if enabled_oauth_providers.present?
  %hr
  %div{:'data-no-turbolink' => 'data-no-turbolink'}
    %span Sign in with:
    - (enabled_oauth_providers - [:ldap]).each do |provider|
      %span
        - if default_providers.include?(provider)
          = link_to authbutton(provider, 32), omniauth_authorize_path(resource_name, provider)
        - else
          = link_to provider.to_s.titleize, omniauth_authorize_path(resource_name, provider), class: "btn"

Hide sign-in bottom block if no providers

- providers = (enabled_oauth_providers - [:ldap])
- if providers.present?
  %hr
  %div{:'data-no-turbolink' => 'data-no-turbolink'}
    %span Sign in with:
    - providers.each do |provider|
      %span
        - if default_providers.include?(provider)
          = link_to authbutton(provider, 32), omniauth_authorize_path(resource_name, provider)
        - else
          = link_to provider.to_s.titleize, omniauth_authorize_path(resource_name, provider), class: "btn"


= render :partial => "layouts/flash_msg"
%table.table.table-striped.table-bordered.table-hover
  %tbody
    %tr{:onclick => remote_function(:url => {:action => 'tree_select', :id => 'xx-Compute'})}
      %td.narrow{:title => _("Edit Compute Rate Assignments")}
        %ul.icons.list-unstyled
          %li
            %span.product.product-memory
      %td{:title => _("Edit Compute Rate Assignments")}
        = _('Compute')
    %tr{:onclick => remote_function(:url => {:action => 'tree_select', :id => "xx-Storage"})}
      %td.narrow{:title => _("Edit Compute Rate Assignments")}
        %i.fa-2x.fa.fa-hdd-o
      %td{:title => _("Edit Compute Rate Assignments")}
        = _('Storage')

Fix chargeback rate assignments' title

= render :partial => "layouts/flash_msg"
%table.table.table-striped.table-bordered.table-hover
  %tbody
    %tr{:onclick => remote_function(:url => {:action => 'tree_select', :id => 'xx-Compute'})}
      %td.narrow{:title => _("Edit Compute Rate Assignments")}
        %ul.icons.list-unstyled
          %li
            %span.product.product-memory
      %td{:title => _("Edit Compute Rate Assignments")}
        = _('Compute')
    %tr{:onclick => remote_function(:url => {:action => 'tree_select', :id => "xx-Storage"})}
      %td.narrow{:title => _("Edit Storage Rate Assignments")}
        %i.fa-2x.fa.fa-hdd-o
      %td{:title => _("Edit Storage Rate Assignments")}
        = _('Storage')


- if !!(value)
  %label.c-input.c-checkbox
    %input{ :type => :checkbox, :checked => true, :disabled => true }
    %span.c-indicator

Fix boolean checkbox with icon


.page-header
  %nav.navbar.navbar-default
    .container-fluid
      .navbar-header
        .navbar-brand
          = link_to editor_root_url do
            = image_tag current_site.logo_image_url.presence || current_site.logo_url, height: 24
            Editor for
          %span.dropdown
            %a#change-site.dropdown-toggle(href='#' role="button" data-toggle='dropdown' aria-expanded='false')
              %b= current_site.name
              %span.caret

            %ul.dropdown-menu(aria-labelledby='change-site')
              - current_user.sites.each do |site|
                %li= link_to site.name, editor_root_url(host: site.fqdn)

      %ul.nav.navbar-nav.navbar-right
        = active_link_to 'カテゴリ', editor_categories_url, wrap_tag: 'li'
        = active_link_to '記事',     editor_posts_url,      wrap_tag: 'li'
        = active_link_to '固定ページ', editor_fixed_pages_url, wrap_tag: 'li'
        = active_link_to 'リンク', editor_links_url, wrap_tag: 'li'

        %li
          = link_to 'ログアウト', destroy_user_session_url, method: :delete

Add link to author index on navigation

.page-header
  %nav.navbar.navbar-default
    .container-fluid
      .navbar-header
        .navbar-brand
          = link_to editor_root_url do
            = image_tag current_site.logo_image_url.presence || current_site.logo_url, height: 24
            Editor for
          %span.dropdown
            %a#change-site.dropdown-toggle(href='#' role="button" data-toggle='dropdown' aria-expanded='false')
              %b= current_site.name
              %span.caret

            %ul.dropdown-menu(aria-labelledby='change-site')
              - current_user.sites.each do |site|
                %li= link_to site.name, editor_root_url(host: site.fqdn)

      %ul.nav.navbar-nav.navbar-right
        = active_link_to 'カテゴリ', editor_categories_url, wrap_tag: 'li'
        = active_link_to '記事',     editor_posts_url,      wrap_tag: 'li'
        = active_link_to '著者情報', editor_authors_url, wrap_tag: 'li'
        = active_link_to '固定ページ', editor_fixed_pages_url, wrap_tag: 'li'
        = active_link_to 'リンク', editor_links_url, wrap_tag: 'li'

        %li
          = link_to 'ログアウト', destroy_user_session_url, method: :delete


%input.form-control{ name: "champs['#{champ.id}']",
  placeholder: champ.libelle,
  id: "champs_#{champ.id}",
  value: champ.value,
  type: champ.type_champ,
  "data-provide": champ.data_provide,
  "data-date-format": champ.data_date_format }

Add a placeholder to help IE users to fill the date input with the right format

%input.form-control{ name: "champs['#{champ.id}']",
  placeholder: "JJ/MM/AAAA",
  id: "champs_#{champ.id}",
  value: champ.value,
  type: champ.type_champ,
  "data-provide": champ.data_provide,
  "data-date-format": champ.data_date_format }


-# The inline navigation for wide screens
.wv--split--right.nav--inline.nav--secondary.wv--block
  - properties[:items].each do |n|
    %a.nav__item.nav__item--secondary.js-nav-item{:class=>(n[:title] == properties[:section_name] ? 'current' : ''), :href=> n[:slug]}<
      = n[:title]

-# The select navigation for small screens
.wv--split--right.nav--inline.nav--secondary.wv--hidden.nav--secondary__dropdown
  = ui_component('forms/dropdown', properties: {options: subnav_options(properties[:items]), selected: properties[:section_name], class: 'js-responsive-nav'})

Switch to navigational dropdown in secondary nav.

-# The inline navigation for wide screens
.wv--split--right.nav--inline.nav--secondary.wv--block
  - properties[:items].each do |n|
    %a.nav__item.nav__item--secondary.js-nav-item{:class=>(n[:title] == properties[:section_name] ? 'current' : ''), :href=> n[:slug]}<
      = n[:title]

-# The select navigation for small screens
.wv--split--right.nav--inline.nav--secondary.wv--hidden.nav--secondary__dropdown
  = ui_component('navigation/dropdown', properties: { action: "/redirector", dropdown: {name: 'url', options: subnav_options(properties[:items]), selected: properties[:section_name], class: 'js-responsive-nav', data: { form_submit: "true" }} })


- page_title t(".page_title")

= link_to t('fluentd.settings.in_tail.restart_from_first'), daemon_setting_in_tail_path(@fluentd)

= form_for(@setting, as: "setting", url: finish_daemon_setting_in_tail_path(@fluentd)) do |f|
  = render partial: "form", locals: { f: f }

  %pre= @setting.to_config

  %p
    = f.submit t('fluentd.common.finish')   , class: "btn btn-lg btn-primary float-right"
    = f.submit t('terms.prev'),   class: "btn btn-lg btn-secondary", name: "back"
    .clearfix.float-right= t('terms.notice_restart_for_config_edit', brand: fluentd_ui_brand)

Apply changes same as after_format

- page_title t(".page_title")

= link_to t('fluentd.settings.in_tail.restart_from_first'), daemon_setting_in_tail_path(@fluentd)

= form_with(model: @setting, scope: "setting", url: finish_daemon_setting_in_tail_path(@fluentd), local: true, builder: FluentdFormBuilder) do |form|
  = render partial: "form", locals: { form: form, setting: @setting }

  %pre= @setting.to_config

  %p
    = form.submit t('fluentd.common.finish')   , class: "btn btn-lg btn-primary float-right"
    = form.submit t('terms.prev'),   class: "btn btn-lg btn-secondary", name: "back"
    .clearfix.float-right= t('terms.notice_restart_for_config_edit', brand: fluentd_ui_brand)


= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login form-horizontal" }) do |f|
  .form-group
    = f.label :email, :class => "col-sm-2 control-label"
    = f.email_field :email, :class => "col-sm-10 form-control"
  .form-group
    = f.label :password, :class => "col-sm-2 control-label"
    = f.password_field :password, :class => "col-sm-10 form-control"
    - if devise_mapping.recoverable? && controller_name != 'passwords'
      = link_to "Forgot your password?", new_password_path(resource_name)
      %br/
  - if devise_mapping.rememberable?
    .form-group
      = f.label :remember_me
      = f.check_box :remember_me
  %div{:style => "text-align: center;"}= f.submit "Sign in"

Add bootstrap form styling to the login form.

= bootstrap_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
  .form-group
    = f.email_field :email
  .form-group
    = f.password_field :password
    - if devise_mapping.recoverable? && controller_name != 'passwords'
      = link_to "Forgot your password?", new_password_path(resource_name)
      %br/
  - if devise_mapping.rememberable?
    .form-group
      = f.check_box :remember_me
  %div
    = f.submit "Sign in"


= boot_page_title

%table.table.table-striped
  - @salary_declaration_codes.each do |code|
    %tr
      %th= code
      %td.currency= @line_items.select{|li| li.booking_template.salary_declaration_code == code}.sum(&:total_amount).floor

Add year filter for salary declaration report.

= boot_page_title

%table.table.table-striped
  - @salary_declaration_codes.each do |code|
    %tr
      %th= code
      %td.currency= @line_items.select{|li| li.booking_template.salary_declaration_code == code}.sum(&:total_amount).floor

= render 'filters/by_calendar_year'


!!!
%html
  %head
    %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
    %title Compliments
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = stylesheet_link_tag('https://fonts.googleapis.com/css?family=Open+Sans:400italic,400,700,300')
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = favicon_link_tag 'favicon.ico'
    = csrf_meta_tags
  %body
    %header.row.row--a.header
      .cell.well
        .g
          .g-b.g-b--1of2
            = link_to root_path do
              = image_tag 'logo-compliments.svg', alt: 'Compliments'
          .g-b.g-b--1of2
            = image_tag current_user.image, class: "thumb fr", height: "50", width: "50"

    %main.row.content
      .cell.well
        = yield

Remove light weight of 'Open Sans' font

!!!
%html
  %head
    %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
    %title Compliments
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = stylesheet_link_tag('https://fonts.googleapis.com/css?family=Open+Sans:400italic,400,700')
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = favicon_link_tag 'favicon.ico'
    = csrf_meta_tags
  %body
    %header.row.row--a.header
      .cell.well
        .g
          .g-b.g-b--1of2
            = link_to root_path do
              = image_tag 'logo-compliments.svg', alt: 'Compliments'
          .g-b.g-b--1of2
            = image_tag current_user.image, class: "thumb fr", height: "50", width: "50"

    %main.row.content
      .cell.well
        = yield


- if @portal_clazz.is_teacher?(current_user) || current_user.has_role?("admin")
  = render_portal_clazz_partial 'portal/clazzes/show'
  = render_portal_clazz_partial 'portal/offerings/list_for_clazz'
  %br
  = link_to 'Manage Student Roster', roster_portal_clazz_url(@portal_clazz), :class => "button pie", :id=>"btn_manage_student_roster"
  / all these br's are to keep a strange scroll bar from showing up
  %br
  %br

- elsif current_user.has_role?("manager", "researcher")
  = render :partial => 'shared/offering_for_teacher', :collection => @portal_clazz.offerings, :as => :offering
- else
  = render_portal_clazz_partial 'portal/clazzes/show'
  - # Added to show investigations to students in class view. -- Cantina-CMH 6/21/10
  %h4 #{top_level_container_name.capitalize.pluralize}:
  = render :partial => 'shared/offerings_for_student', :locals => { :offerings => @offerings }

Remove the class roster from the class home page

- if @portal_clazz.is_teacher?(current_user) || current_user.has_role?("admin")
  = render_portal_clazz_partial 'portal/clazzes/show'
  = render_portal_clazz_partial 'portal/offerings/list_for_clazz'
  = link_to 'Manage Student Roster', roster_portal_clazz_url(@portal_clazz), :class => "button pie", :id=>"btn_manage_student_roster"
  / all these br's are to keep a strange scroll bar from showing up
  %br
  %br

- elsif current_user.has_role?("manager", "researcher")
  = render :partial => 'shared/offering_for_teacher', :collection => @portal_clazz.offerings, :as => :offering
- else
  = render_portal_clazz_partial 'portal/clazzes/show'
  - # Added to show investigations to students in class view. -- Cantina-CMH 6/21/10
  %h4 #{top_level_container_name.capitalize.pluralize}:
  = render :partial => 'shared/offerings_for_student', :locals => { :offerings => @offerings }


#main_div
  - if %w(generic_objects).include?(@display)
    = render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"}
  - else
    = render :partial => 'layouts/textual_groups_generic'

  - if @record.picture
    %hr
      %h3
        = _('Custom Image')
      .form-horizontal
        .form-group
          .col-md-9
            %img{:src => "#{@record.picture.url_path}", :style => "width:100px; height:100px;"}

  %generic-object-definition-toolbar#generic_object_definition_show_form{'record-id'    => @record.id,
                                                                         'entity'       => _('Generic Object Class'),
                                                                         'entity-name'  => @record.name,
                                                                         'redirect-url' => "/generic_object_definition",}
:javascript
  miq_bootstrap('#generic_object_definition_show_form');
  $('#searchbox').hide();

Adjust the haml indentation for custom image


!!!
%html(lang="en")
  %head
    %meta(charset="utf-8")
    %meta(http-equiv="X-UA-Compatible" content="IE=edge,chrome=1")
    %link(rel="stylesheet" href="/vendor/base.css")
    = javascript_include_tag 'react-with-addons.min.js'
    = javascript_include_tag 'application'

  %body
    %section#todoapp
    #info
      %p Double-click to edit a todo
      %p
        Part of
        %a(href="http://todomvc.com") TodoMVC

Use un minify version of react.js in examples

!!!
%html(lang="en")
  %head
    %meta(charset="utf-8")
    %meta(http-equiv="X-UA-Compatible" content="IE=edge,chrome=1")
    %link(rel="stylesheet" href="/vendor/base.css")
    = javascript_include_tag 'react-with-addons.js'
    = javascript_include_tag 'application'

  %body
    %section#todoapp
    #info
      %p Double-click to edit a todo
      %p
        Part of
        %a(href="http://todomvc.com") TodoMVC


- url = submodule_item.url(@ref) rescue ''
- name = submodule_item.basename
- return '' unless url
%tr{ class: "tree-item", url: url }
  %td.tree-item-file-name
    = image_tag "submodule.png"
    %span= truncate(name, length: 40)
  %td
    %code= submodule_item.id[0..10]
  %td{ colspan: 2 }
    = link_to truncate(url, length: 40), url

Fix 500 error on page with submodules

%tr{ class: "tree-item" }
  %td.tree-item-file-name
    = image_tag "submodule.png"
    %span
      = link_to truncate(submodule_item.name, length: 40), '#'
    @
    %span.monospace #{submodule_item.id[0..10]}
  %td
  %td
  %td


%ul.nav-links.new-session-tabs.nav-tabs{ role: 'tablist'}
  %li.active{ role: 'presentation' }
    %a{ href: '#login-pane', data: {'toggle':'tab'}, role: 'tab'} Sign in
  %li{ role: 'presentation'}
    %a{ href: '#register-pane', data: {'toggle':'tab'}, role: 'tab'} Register

Fix Hash syntax to work for both Ruby 2.1 and 2.3

%ul.nav-links.new-session-tabs.nav-tabs{ role: 'tablist'}
  %li.active{ role: 'presentation' }
    %a{ href: '#login-pane', data: { toggle: 'tab' }, role: 'tab'} Sign in
  %li{ role: 'presentation'}
    %a{ href: '#register-pane', data: { toggle: 'tab' }, role: 'tab'} Register


.page-container
  =image_tag("loomio-orange.png")
  #invitation-container
    .row
      %h3.span8.offset2 Your request to a start a new group on Loomio has been approved!
      %p
    .row
      .span6.offset2
        %p If you're new to Loomio, you'll need to set up an account before you create your group.
        %p
          %a.btn.btn-info.btn-large{:href => new_user_path, :id => 'create-account'}
            Create an account
        %p
        %p If you already have an account, log in to continue.
        %p
          %a.btn.btn-info.btn-large{:href => new_user_session_path, :id => 'sign-in'}
            Sign in here
      .span2
        =image_tag("mascot-medium-lefthand.gif")

Improve verbiage on invitation page.

.page-container
  =image_tag("loomio-orange.png")
  #invitation-container
    .row
      %h3.span8.offset2 Your request to a start a new group on Loomio has been approved!
      %p
    .row
      .span6.offset2
        %p If you're new to Loomio, you'll need to set up an account before you create your group.
        %p
          %a.btn.btn-info.btn-large{:href => new_user_path, :id => 'create-account'}
            Create an account
        %p
        %p If you already have an account, sign in to continue.
        %p
          %a.btn.btn-info.btn-large{:href => new_user_session_path, :id => 'sign-in'}
            Sign in here
      .span2
        =image_tag("mascot-medium-lefthand.gif")


.btn-group.pull-right.panel-action
  %button.btn.btn-primary.btn-sm.dropdown-toggle{:data => {:toggle => 'dropdown'}}
    I want to
    %span.caret
  %ul.dropdown-menu{:role => 'menu'}
    - if can? :create, GeneralLedgerAccount
      %li
        = link_to new_general_ledger_account_path do
          %i.fa.fa-plus.fa-fw
          = " Add General Ledger Account";
= form_tag general_ledger_accounts_path, :id => 'filter_form', :method => "get", :class => 'navbar-form navbar-right panel-action' do
  .form-group
    = select_tag(:type, options_for_select(GeneralLedgerAccountType.all.collect{|a| [a.name, a.id]}, :selected => @account_type_id), :class => "form-control", :style => "width: 100px;", :prompt => "Any GLA...")

:javascript
  $(document).ready(function() {

    $('#type').change(function() {
      $('#filter_form').submit();
    });

  });

Fix layout of gla index dropdowns

.btn-group.pull-right.panel-action
  %button.btn.btn-primary.btn-sm.dropdown-toggle{:data => {:toggle => 'dropdown'}}
    I want to
    %span.caret
  %ul.dropdown-menu{:role => 'menu'}
    - if can? :create, GeneralLedgerAccount
      %li
        = link_to new_general_ledger_account_path do
          %i.fa.fa-plus.fa-fw
          = " Add General Ledger Account";
= form_tag general_ledger_accounts_path, :id => 'filter_form', :method => "get", :class => 'navbar-form navbar-right panel-action' do
  .form-group
    = select_tag(:type, options_for_select(GeneralLedgerAccountType.all.collect{|a| [a.name, a.id]}, :selected => @account_type_id), :class => "form-control", :style => "width: 150px;", :prompt => "Any GLA...")

:javascript
  $(document).ready(function() {

    $('#type').change(function() {
      $('#filter_form').submit();
    });

  });


!!!
%html
  %head
    %meta(charset="UTF-8")
    %title= page_title
    %meta(name="viewport" content="width=device-width" initial-scale="1.0")
    %meta(name="description" content="青空文庫の本文を検索できるサイト。キーワードの前後を部分表示します。著者やNDC、仮名遣いなどでの絞り込み機能付き。全文検索エンジンとしてGroongaを使用。")
    %meta(name="keywords" content="青空文庫,全文検索")
    %link(href="vendor/bootstrap/css/bootstrap.min.css"
          rel="stylesheet" media="screen")
    %link(href="css/aozorasearch.css" rel="stylesheet" media="screen")
    %link(rel="shortcut icon" type="image/vnd.microsoft.icon" href="favicon.ico")
  %body
    = render :_header, layout: false

    .container
      = yield

    #footer.container.text-right
      = render :_footer, layout: false

Add page title to meta desciription

!!!
%html
  %head
    %meta(charset="UTF-8")
    %title= "#{page_title}"
    %meta(name="viewport" content="width=device-width" initial-scale="1.0")
    %meta(name="description" content="青空文庫の本文を検索できるサイト。キーワードの前後を部分表示します。著者やNDC、仮名遣いなどでの絞り込み機能付き。全文検索エンジンとしてGroongaを使用。 / #{page_title}")
    %meta(name="keywords" content="青空文庫,全文検索")
    %link(href="vendor/bootstrap/css/bootstrap.min.css"
          rel="stylesheet" media="screen")
    %link(href="css/aozorasearch.css" rel="stylesheet" media="screen")
    %link(rel="shortcut icon" type="image/vnd.microsoft.icon" href="favicon.ico")
  %body
    = render :_header, layout: false

    .container
      = yield

    #footer.container.text-right
      = render :_footer, layout: false


.container
  .row
    .col-md-3
      %h1.page-header
        Machine Learning Resources
        -#%small Helpful Links
.row
  .col-md-3
  .list-group
    = link_to 'Quick review of the linear algebra concepts relevant to machine learning', "http://www.deeplearningbook.org/contents/linear_algebra.html", class: 'list-group-item', target: '_blank'
    -#= link_to 'Best Python Resources', "https://www.fullstackpython.com/best-python-resources.html", class: 'list-group-item', target: '_blank'
    -#= link_to 'Python Packages List', "https://github.com/vinta/awesome-python", class: 'list-group-item', target: '_blank'

Add Stats learning book to ML resources (as suggested by Dan Bikle).

.container
  .row
    .col-md-3
      %h1.page-header
        Machine Learning Resources
        -#%small Helpful Links
.row
  .col-md-3
  .list-group
    = link_to 'Quick review of the linear algebra concepts relevant to machine learning', "http://www.deeplearningbook.org/contents/linear_algebra.html", class: 'list-group-item', target: '_blank'
    = link_to 'An Introduction to Statistical Learning (Book and MOOC slides', "http://www-bcf.usc.edu/~gareth/ISL/", class: 'list-group-item', target: '_blank'


.container
  .row
    .col-md-3
      %h1.page-header
        Machine Learning Resources
        -#%small Helpful Links
.row
  .col-md-3
  .list-group
    = link_to 'Quick review of the linear algebra concepts relevant to machine learning', "http://www.deeplearningbook.org/contents/linear_algebra.html", class: 'list-group-item', target: '_blank'
    -#= link_to 'Best Python Resources', "https://www.fullstackpython.com/best-python-resources.html", class: 'list-group-item', target: '_blank'
    -#= link_to 'Python Packages List', "https://github.com/vinta/awesome-python", class: 'list-group-item', target: '_blank'

Add link to ML courses. Also includes previously added link in branch to synch with master.

.container
  .row
    .col-md-3
      %h1.page-header
        Machine Learning Resources
        -#%small Helpful Links
.row
  .col-md-3
  .list-group
    = link_to 'Quick review of the linear algebra concepts relevant to machine learning', "http://www.deeplearningbook.org/contents/linear_algebra.html", class: 'list-group-item', target: '_blank'
    = link_to 'An Introduction to Statistical Learning (Book and MOOC slides', "http://www-bcf.usc.edu/~gareth/ISL/", class: 'list-group-item', target: '_blank'
    = link_to 'Every single Machine Learning course on the internet, ranked by your reviews', "https://medium.freecodecamp.org/every-single-machine-learning-course-on-the-internet-ranked-by-your-reviews-3c4a7b8026c0", class: 'list-group-item', target: '_blank'


-# Generate dynamic styles that get embedded on the page.
- content_for :styles do

  - if models.include?(:account)
    - Setting.account_category_color.each do |key, value|
      li.account .#{key} { background:#{value}; }
    - Setting.account_status_color.each do |key, value|
      li.account .#{key} { background:#{value}; }

  - if models.include?(:campaign)
    - Setting.campaign_status_color.each do |key, value|
      li.campaign .#{key} { background:#{value}; }

  - if models.include?(:lead)
    - Setting.lead_status_color.each do |key, value|
      li.lead .#{key} { background:#{value}; }

  - if models.include?(:opportunity)
    - Setting.opportunity_stage_color.each do |key, value|
      li.opportunity .#{key} { background:#{value}; }

  - if models.include?(:task)
    - Setting.task_category_color.each do |key, value|
      li.task .#{key} { background:#{value}; }

  - if models.include?(:user)
    li.user .admin     { background: lightblue; }
    li.user .suspended { background: gainsboro; }
    li.user .active    { background: lightgreen; }
    li.user .signed_up { background: lightsalmon; }

  = hook(:inline_styles, self, local_assigns)

Add if statement to allow Specs to pass

-# Generate dynamic styles that get embedded on the page.
- content_for :styles do

  - if models.include?(:account)
    - Setting.account_category_color.each do |key, value|
      li.account .#{key} { background:#{value}; }
    - if Setting.account_status_color.present?
      - Setting.account_status_color.each do |key, value|
        li.account .#{key} { background:#{value}; }

  - if models.include?(:campaign)
    - Setting.campaign_status_color.each do |key, value|
      li.campaign .#{key} { background:#{value}; }

  - if models.include?(:lead)
    - Setting.lead_status_color.each do |key, value|
      li.lead .#{key} { background:#{value}; }

  - if models.include?(:opportunity)
    - Setting.opportunity_stage_color.each do |key, value|
      li.opportunity .#{key} { background:#{value}; }

  - if models.include?(:task)
    - Setting.task_category_color.each do |key, value|
      li.task .#{key} { background:#{value}; }

  - if models.include?(:user)
    li.user .admin     { background: lightblue; }
    li.user .suspended { background: gainsboro; }
    li.user .active    { background: lightgreen; }
    li.user .signed_up { background: lightsalmon; }

  = hook(:inline_styles, self, local_assigns)


-# Expects locals: object
- if object && object.respond_to?('projects') && current_visitor.has_role?('admin', 'manager')
  = field_set_tag 'Projects' do
    .aligned
      %ul.menu_h
        - prop_name = "#{object.class.name.underscore}[project_ids][]"
        -# Hidden field handles a case when all checkboxes are unchecked.
        = hidden_field_tag prop_name
        - project_assigned = Hash[object.projects.map { |p| [p.id, true ] }]
        - Admin::Project.all.each do |project|
          - if policy(project).visible?
            %li
              - label_str = "project_#{project.id}"
              = label_tag label_str, project.name
              = check_box_tag prop_name, project.id, project_assigned[project.id], id: label_str
          - elsif project_assigned[project.id]
            -# This is necessary to keep hidden projects still assigned to the material.
            = hidden_field_tag prop_name, project.id

Remove projects filtering from material settings

-# Expects locals: object
- if object && object.respond_to?('projects') && current_visitor.has_role?('admin', 'manager')
  = field_set_tag 'Projects' do
    .aligned
      %ul.menu_h
        - prop_name = "#{object.class.name.underscore}[project_ids][]"
        -# Hidden field handles a case when all checkboxes are unchecked.
        = hidden_field_tag prop_name
        - project_assigned = Hash[object.projects.map { |p| [p.id, true ] }]
        - Admin::Project.all.each do |project|
          %li
            - label_str = "project_#{project.id}"
            = label_tag label_str, project.name
            = check_box_tag prop_name, project.id, project_assigned[project.id], id: label_str


- unless @page.new_record?
  %span#show-bucket
    = t('paperclipped.bucket')
    = link_to t("paperclipped.show_assets_bucket"), "#"

Fix bug where paperclipped partial would fail to render on a new page part

- unless @page && @page.new_record?
  %span#show-bucket
    = t('paperclipped.bucket')
    = link_to t("paperclipped.show_assets_bucket"), "#"


.items-preview-header
  - if visualizations
    %a.btn.btn-default.btn-transparent{ href: "#{params[:controller] == 'pages' ? '/explore/stories' : '/users/'+params[:id]+'/stories'}" }
      Stories
    .btn.btn-default.btn-primary
      Visualizations
  - else
    .btn.btn-default.btn-primary
      Stories
    %a.btn.btn-default.btn-transparent{ href: "#{params[:controller] == 'pages' ? '/explore/visualizations' : '/users/'+params[:id]+'/visualizations'}" }
      Visualizations
  .search-input.pull-right
    .input-group
      %input.form-control{:type => "text"}
      %span.input-group-btn
        %button.btn.btn-default{:type => "button"}
          %span.search-icon
  .items-orderby.pull-right
    Order by
    %a.active{href: '#', title: 'The popularity is based on the number of embeded & social shares', data: {toggle: 'tooltip', placement: 'bottom'}}
      Popularity
    %a{href: '#', title: 'Most recent items first', data: {toggle: 'tooltip', placement: 'bottom'}}
      Most recent

Comment order select in explore page

.items-preview-header
  - if visualizations
    %a.btn.btn-default.btn-transparent{ href: "#{params[:controller] == 'pages' ? '/explore/stories' : '/users/'+params[:id]+'/stories'}" }
      Stories
    .btn.btn-default.btn-primary
      Visualizations
  - else
    .btn.btn-default.btn-primary
      Stories
    %a.btn.btn-default.btn-transparent{ href: "#{params[:controller] == 'pages' ? '/explore/visualizations' : '/users/'+params[:id]+'/visualizations'}" }
      Visualizations
  .search-input.pull-right
    .input-group
      %input.form-control{:type => "text"}
      %span.input-group-btn
        %button.btn.btn-default{:type => "button"}
          %span.search-icon
  / .items-orderby.pull-right
  /   Order by
  /   %a.active{href: '#', title: 'The popularity is based on the number of embeded & social shares', data: {toggle: 'tooltip', placement: 'bottom'}}
  /     Popularity
  /   %a{href: '#', title: 'Most recent items first', data: {toggle: 'tooltip', placement: 'bottom'}}
  /     Most recent


.card
  %header
    %h4
      = @audience.title
      = vertical.title
  .card-trend{ class: vertical.direction }
    - if vertical.trend == :increase
      %i.icon.circle.circle-positive.circle-hollow 
      %h3
        Trend
      %small More spending
    - elsif vertical.trend == :decrease
      %i.icon.circle.circle-negative.circle-hollow 
      %h3
        Trend
      %small Less spending
    - else
      %i.icon.circle.circle-hollow 
      %h3 Trend
      %small No trend
  .card-stat
    %h5 Council Spending
    %span.stat-value-na
      = (vertical.council_spend && number_to_currency(vertical.council_spend, unit: "£", precision: 0)) || "Not Provided"
  .card-stat
    %h5 NHS Spending
    %span.stat-value
      = (vertical.nhs_spend && number_to_currency(vertical.council_spend, unit: "£", precision: 0)) || "Not Provided"

Add correct classes to vertical text

.card
  %header
    %h4
      = @audience.title
      = vertical.title
  .card-trend{ class: vertical.direction }
    - if vertical.trend == :increase
      %i.icon.circle.circle-positive.circle-hollow 
      %h3
        Trend
      %small More spending
    - elsif vertical.trend == :decrease
      %i.icon.circle.circle-negative.circle-hollow 
      %h3
        Trend
      %small Less spending
    - else
      %i.icon.circle.circle-hollow 
      %h3 Trend
      %small No trend
  - [vertical.council_spend, vertical.nhs_spend].each_with_index do |data, index|
    .card-stat
      %h5= "#{index == 0 ? "Council" : "NHS" } Spending"
      %span{ class: "#{data ? 'stat-value' : 'stat-value-na'}" }
        = (data && number_to_currency(data, unit: "£", precision: 0)) || "Not Provided"


- content_for(:title, "Démarches")

.container
  %h1.page-title Démarches

  - if @previous_demarches_still_active.present?
    %h2.list-header SUR LESQUELLES VOUS AVEZ DÉJÀ DÉPOSÉ UN DOSSIER
    %ul.demarche-links
      - @previous_demarches_still_active.each do |demarche|
        %li
          = link_to(demarche.libelle, commencer_url(procedure_path: demarche.path), class: "demarche-link")

  - if @popular_demarches.present?
    %h2.list-header LES PLUS POPULAIRES
    %ul.demarche-links
      - @popular_demarches.each do |demarche|
        %li
          = link_to(demarche.libelle, commencer_url(procedure_path: demarche.path), class: "demarche-link")

  %h2.list-header TOUTES LES DÉMARCHES
  = link_to("Voir l'intégralité des démarches disponibles", LISTE_DES_DEMARCHES_URL, class: "button")

Add a footer to the new demarches page

- content_for(:title, "Démarches")

- content_for :footer do
  = render partial: "new_user/dossiers/index_footer"

.container
  %h1.page-title Démarches

  - if @previous_demarches_still_active.present?
    %h2.list-header SUR LESQUELLES VOUS AVEZ DÉJÀ DÉPOSÉ UN DOSSIER
    %ul.demarche-links
      - @previous_demarches_still_active.each do |demarche|
        %li
          = link_to(demarche.libelle, commencer_url(procedure_path: demarche.path), class: "demarche-link")

  - if @popular_demarches.present?
    %h2.list-header LES PLUS POPULAIRES
    %ul.demarche-links
      - @popular_demarches.each do |demarche|
        %li
          = link_to(demarche.libelle, commencer_url(procedure_path: demarche.path), class: "demarche-link")

  %h2.list-header TOUTES LES DÉMARCHES
  = link_to("Voir l'intégralité des démarches disponibles", LISTE_DES_DEMARCHES_URL, class: "button")


.form-group.form-actions
  .col-sm-offset-2.col-sm-10
    %input{type: :hidden, name: 'return_to', value: (params[:return_to].presence || request.referer)}
    %button.btn.btn-primary{type: "submit", name: "_save", :'data-disable-with' => t("admin.form.save")}
      %i.icon-white.icon-ok
      = t("admin.form.save")
    %span.extra_buttons
      - if authorized? :new, @abstract_model
        %button.btn.btn-info{type: "submit", name: "_add_another", :'data-disable-with' => t("admin.form.save_and_add_another")}
          = t("admin.form.save_and_add_another")
      - if authorized? :edit, @abstract_model
        %button.btn.btn-info{type: "submit", name: "_add_edit", :'data-disable-with' => t("admin.form.save_and_edit")}
          = t("admin.form.save_and_edit")
      %button.btn{type: "submit", name: "_continue", :'data-disable-with' => t("admin.form.cancel"), :formnovalidate => true}
        %i.icon-remove
        = t("admin.form.cancel")

Update button class to Bootstrap 3.

.form-group.form-actions
  .col-sm-offset-2.col-sm-10
    %input{type: :hidden, name: 'return_to', value: (params[:return_to].presence || request.referer)}
    %button.btn.btn-primary{type: "submit", name: "_save", :'data-disable-with' => t("admin.form.save")}
      %i.icon-white.icon-ok
      = t("admin.form.save")
    %span.extra_buttons
      - if authorized? :new, @abstract_model
        %button.btn.btn-info{type: "submit", name: "_add_another", :'data-disable-with' => t("admin.form.save_and_add_another")}
          = t("admin.form.save_and_add_another")
      - if authorized? :edit, @abstract_model
        %button.btn.btn-info{type: "submit", name: "_add_edit", :'data-disable-with' => t("admin.form.save_and_edit")}
          = t("admin.form.save_and_edit")
      %button.btn.btn-default{type: "submit", name: "_continue", :'data-disable-with' => t("admin.form.cancel"), :formnovalidate => true}
        %i.icon-remove
        = t("admin.form.cancel")


.tooltip
  - if tag && tag.has_icon?
    .tooltip-avatar
      = image_tag(tag_icon_path(current_group,tag.name))

  .tooltip-name
    %p= t('questions.index.has_followers', :count => tag.followers_count.to_i)
    = follow_tag_link(tag)
  .tooltip-description
    - if !tag.description.blank?
      = tag.description
    - else
      - if logged_in? && current_user.mod_of?(current_group)
        = link_to t('tags.show_json.edit_it'), edit_tag_path(tag)
      - else
        = t('tags.show_json.no_description')

Fix the tooltip display issues.

.tooltip
  - if tag && tag.has_icon?
    .tooltip-avatar
      = image_tag(tag_icon_path(current_group,tag.name))

  .tooltip-name
    %p= t('questions.index.has_followers', :count => tag.followers_count.to_i)
    = follow_tag_link(tag)
  .tooltip-description
    - if !tag.description.blank?
      = truncate(tag.description, :length => 50)
    - else
      - if logged_in? && current_user.mod_of?(current_group)
        = link_to t('tags.show_json.edit_it'), edit_tag_path(tag)
      - else
        = t('tags.show_json.no_description')


%h1 Registrant Summaries

%p Print the Registrant Summaries, in bulk.

%p
  %b Note
  This page will create the PDF in the background, and then provide a link to download it on the
  = link_to "Reports page", reports_path

%ul
  %li= link_to t('.registrant_summaries_by_last_name'), registrant_summaries_path(format: :pdf)
  %li= link_to t('.registrant_summaries_by_id'), registrant_summaries_path(order: :id, format: :pdf)

= form_tag url: registrant_summaries_path, method: :post do
  .row
    .small-12.medium-6.columns
      = label_tag :order, "Order"
      = select_tag :order, options_for_select(["name", "id"])
    .small-12.medium-6.columns
      .row
        If no offset and limit are specified, creates ALL Summaries at once.
        Use the offset and limit to create smaller PDFs.
      .row
        .small-6.medium-3.columns.right_aligned
          = label_tag :offset, "Offset"
        .small-6.medium-3.columns
          = text_field_tag :offset
        .small-6.medium-3.columns.right_aligned
          = label_tag :limit, "Limit"
        .small-6.medium-3.columns
          = text_field_tag :limit
  .row
    .small-12.medium-6.columns
      = submit_tag "Create PDF", class: "button", data: { disable_with: false }

Remove links for displaying RegistrantSummaries pdfs which were replaced by forms

%h1 Registrant Summaries

%p Print the Registrant Summaries, in bulk.

%p
  %b Note
  This page will create the PDF in the background, and then provide a link to download it on the
  = link_to "Reports page", reports_path

= form_tag url: registrant_summaries_path, method: :post do
  .row
    .small-12.medium-6.columns
      = label_tag :order, "Order"
      = select_tag :order, options_for_select(["name", "id"])
    .small-12.medium-6.columns
      .row
        If no offset and limit are specified, creates ALL Summaries at once.
        Use the offset and limit to create smaller PDFs.
      .row
        .small-6.medium-3.columns.right_aligned
          = label_tag :offset, "Offset"
        .small-6.medium-3.columns
          = text_field_tag :offset
        .small-6.medium-3.columns.right_aligned
          = label_tag :limit, "Limit"
        .small-6.medium-3.columns
          = text_field_tag :limit
  .row
    .small-12.medium-6.columns
      = submit_tag "Create PDF", class: "button", data: { disable_with: false }


- if results.empty?
  %p.no_results Report returned no results.
- else
  %table
    %thead
      %tr
        - results.columns.each do |column|
          %th= column
    %tbody
      - results.each do |row|
        - results.columns.each do |column|
          %td= row[column]

Fix rows in report results

- if results.empty?
  %p.no_results Report returned no results.
- else
  %table
    %thead
      %tr
        - results.columns.each do |column|
          %th= column
    %tbody
      - results.each do |row|
        %tr
          - results.columns.each do |column|
            %td= row[column]


!!!
%html{:lang => "en"}
  %head
    = csrf_meta_tags

    / Required meta tags
    %meta{:charset => "utf-8"}/
    %meta{:content => "width=device-width, initial-scale=1, shrink-to-fit=no", :name => "viewport"}/
    / Bootstrap CSS
    %link{:crossorigin => "anonymous", :href => "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css", :integrity => "sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ", :rel => "stylesheet"}/
    = stylesheet_link_tag    "rails/add_ons/application",  media: 'all', :'data-turbolinks-track' => 'reload'
    = javascript_include_tag "rails/add_ons/application", :'data-turbolinks-track' => 'reload'
    / widget endpoint
    %meta{name: 'widget-base-path', content: rails_add_ons.widget_path}
  %body
    = render 'navbar'
    .container-fluid
      .starter-template
        = bootstrap_flash
        = yield
    / /.container

Fix exception when widgets are not used.

!!!
%html{:lang => "en"}
  %head
    = csrf_meta_tags

    / Required meta tags
    %meta{:charset => "utf-8"}/
    %meta{:content => "width=device-width, initial-scale=1, shrink-to-fit=no", :name => "viewport"}/
    / Bootstrap CSS
    %link{:crossorigin => "anonymous", :href => "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css", :integrity => "sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ", :rel => "stylesheet"}/
    = stylesheet_link_tag    "rails/add_ons/application",  media: 'all', :'data-turbolinks-track' => 'reload'
    = javascript_include_tag "rails/add_ons/application", :'data-turbolinks-track' => 'reload'
    / widget endpoint
    - if respond_to?(:rails_add_ons)
      %meta{name: 'widget-base-path', content: rails_add_ons.widget_path}
  %body
    = render 'navbar'
    .container-fluid
      .starter-template
        = bootstrap_flash
        = yield
    / /.container


%main.container
  %h1 Who profits from WestConnex?
  %p.lede
    These #{@contractors.count} companies have been contracted by the NSW Government.
    So far, their #{pluralize(Contract.count, "contracts")} are worth #{number_to_currency(Contract.sum(:value), precision: 0)}.
  %ul.contractors
    = render @contractors
  %section.history#history
    %h2 Recent changes
    %ul.updates-list
      - @last_two_weeks.each do |day|
        - if !@contractor_history.where("created_at::timestamp::date = ?", day).empty?
          %li
            %h3= day.strftime("%b %-d")
            = new_contractors_sentence(@contractor_history.where("created_at::timestamp::date = ?", day))

Make history section full width

%main.container
  %h1 Who profits from WestConnex?
  %p.lede
    These #{@contractors.count} companies have been contracted by the NSW Government.
    So far, their #{pluralize(Contract.count, "contracts")} are worth #{number_to_currency(Contract.sum(:value), precision: 0)}.
  %ul.contractors
    = render @contractors
%section.history#history
  %div.container
    %h2 Recent changes
    %ul.updates-list
      - @last_two_weeks.each do |day|
        - if !@contractor_history.where("created_at::timestamp::date = ?", day).empty?
          %li
            %h3= day.strftime("%b %-d")
            = new_contractors_sentence(@contractor_history.where("created_at::timestamp::date = ?", day))


= render "data/shared/data_subnav"

.row
  .span12
    .page-header
      %h2 Inputs
    .alert
      Min-, max- and start values on this screen are calculated for the current scenarios.

    %table.table.table-condensed
      %thead
        %th Id
        %th Key
        %th Start/User
        %th Share group
        %th Min
        %th Max
      %tbody
        - @inputs.each do |i|
          %tr
            %td= i.id
            %td= link_to highlight(i.key, params[:q]), data_input_path(:id => i.id)
            %td= auto_number i.start_value_for(@gql)
            %td= auto_number i.share_group
            %td= auto_number i.min_value_for(@gql)
            %td= auto_number i.max_value_for(@gql)

Make data/latest/inputs rescue from errors

= render "data/shared/data_subnav"

.row
  .span12
    .page-header
      %h2 Inputs
    .alert
      Min-, max- and start values on this screen are calculated for the current scenarios.

    %table.table.table-condensed
      %thead
        %th Id
        %th Key
        %th Start/User
        %th Share group
        %th Min
        %th Max
      %tbody
        - @inputs.each do |i|
          %tr
            %td= i.id
            %td= link_to highlight(i.key, params[:q]), data_input_path(:id => i.id)
            %td
              - begin
                = auto_number(i.start_value_for(@gql) / nil)
              - rescue => e
                %strong{:style => 'color: red'}= e
            %td= auto_number(i.share_group)
            %td
              - begin
                = auto_number(i.min_value_for(@gql))
              - rescue => e
                %strong{:style => 'color: red'}= e
            %td
              - begin
                = auto_number(i.max_value_for(@gql))
              - rescue => e
                %strong{:style => 'color: red'}= e


#main_div
  - url = url_for(:action => 'resize_field_changed', :id => @record.id.to_s)

  = render :partial => "layouts/flash_msg"

  %h3
    = _('Reconfigure Instance')
  .form-horizontal
    .form-group
      %label.col-md-2.control-label
        = _('Current Flavor')
      .col-md-8
        = @record.flavor.name_with_details if @record.flavor
    .form-group
      %label.col-md-2.control-label
        = _('Choose Flavor')
      .col-md-8
        = select_tag('flavor',
            options_for_select(@flavors.sort),
            :class             => "selectpicker",
            "data-miq_sparkle_on" => true, "data-miq_sparkle_off" => true,
            :multiple          => false,
            :id                => "flavor",
            "data-miq_observe" => {:interval => '.5', :url => url}.to_json)
      :javascript
        miqInitSelectPicker();
        miqSelectPickerEvent("flavor", "#{url}");

Add sort flavors by id

#main_div
  - url = url_for(:action => 'resize_field_changed', :id => @record.id.to_s)

  = render :partial => "layouts/flash_msg"

  %h3
    = _('Reconfigure Instance')
  .form-horizontal
    .form-group
      %label.col-md-2.control-label
        = _('Current Flavor')
      .col-md-8
        = @record.flavor.name_with_details if @record.flavor
    .form-group
      %label.col-md-2.control-label
        = _('Choose Flavor')
      .col-md-8
        = select_tag('flavor',
            options_for_select(@flavors.sort_by),
            :class             => "selectpicker",
            "data-miq_sparkle_on" => true, "data-miq_sparkle_off" => true,
            :multiple          => false,
            :id                => "flavor",
            "data-miq_observe" => {:interval => '.5', :url => url}.to_json)
      :javascript
        miqInitSelectPicker();
        miqSelectPickerEvent("flavor", "#{url}");


- if adjustments.present?
  %fieldset.no-border-bottom
    %legend= title
    %table>
      %thead
        %th= Spree.t('name')
        %th= Spree.t('amount')
      %tbody#order-charges.with-border
        - adjustments.each do |adjustment|
          - if (adjustment.originator_type != 'Spree::ShippingMethod') && !(adjustment.originator_type == 'Spree::TaxRate' && adjustment.amount == 0)
            %tr.total
              %td.strong= adjustment.label + ":"
              %td.total.align-center
                %span= Spree::Money.new(adjustment.amount)

Fix HTML syntax in admin view

- if adjustments.present?
  %fieldset.no-border-bottom
    %legend= title
    %table>
      %thead
        %tr
          %th= Spree.t('name')
          %th= Spree.t('amount')
      %tbody#order-charges.with-border
        - adjustments.each do |adjustment|
          - if (adjustment.originator_type != 'Spree::ShippingMethod') && !(adjustment.originator_type == 'Spree::TaxRate' && adjustment.amount == 0)
            %tr.total
              %td.strong= adjustment.label + ":"
              %td.total.align-center
                %span= Spree::Money.new(adjustment.amount)


-#     Chicago Ideas Week
-#     _member_program_callout.html.haml
-#     07/17/2012

.box.right.yellow_box#edison_talks_callout
  .column_row
    %a{:href => "#{member_program_path}", :class => "callout_link"}
      %span.call_out WANT VIP ACCESS? CLICK HERE!

Change to Member Program page callout text

-#     Chicago Ideas Week
-#     _member_program_callout.html.haml
-#     07/17/2012

.box.right.yellow_box#edison_talks_callout
  .column_row
    %a{:href => "#{member_program_path}", :class => "callout_link"}
      %span.call_out WANT VIP ACCESS TO CIW? CLICK HERE!


- content_for :title, "About"

- content_for :header do
  .section-header.clearfix
    .page-header.container
      %h1= yield :title
      %p.lead
        Forget what politicians say. What truly matters is what they do. And what they do is vote, to write our laws which affect us all.

.row
  .col-md-8
    = render "about"

Add default meta description to about page

- content_for :title, "About"
- set_meta_tags description: default_meta_description

- content_for :header do
  .section-header.clearfix
    .page-header.container
      %h1= yield :title
      %p.lead
        Forget what politicians say. What truly matters is what they do. And what they do is vote, to write our laws which affect us all.

.row
  .col-md-8
    = render "about"


.variants.row
  .small-12.medium-4.large-4.columns.variant-name
    .table-cell
      .inline {{ ::variant.name_to_display }}
      .bulk-buy.inline{"ng-if" => "::variant.product.group_buy"}
        %i.ofn-i_056-bulk><
        %em><
          \ {{::'bulk' | t}}

  %ng-include{src: "'partials/shop_variant_no_group_buy.html'"}
  %ng-include{src: "'partials/shop_variant_with_group_buy.html'"}

  .small-3.medium-1.large-1.columns.variant-unit
    .table-cell
      %em {{ ::variant.unit_to_display }}

  .small-4.medium-2.large-2.columns.variant-price
    .table-cell.price
      %i.ofn-i_009-close
      {{  ::variant.price_with_fees | localizeCurrency }}

      -# Now in a template in app/assets/javascripts/templates !
      %price-breakdown{"price-breakdown" => "_", variant: "variant",
        "price-breakdown-append-to-body" => "true",
        "price-breakdown-placement" => "left",
        "price-breakdown-animation" => true}

  .small-12.medium-2.large-2.columns.total-price.text-right
    .table-cell
      %strong{"ng-class" => "{filled: variant.line_item.total_price}"}
        {{ variant.line_item.total_price | localizeCurrency }}

Fix prices not updating with new exchange fees when changing OC

.variants.row
  .small-12.medium-4.large-4.columns.variant-name
    .table-cell
      .inline {{ ::variant.name_to_display }}
      .bulk-buy.inline{"ng-if" => "::variant.product.group_buy"}
        %i.ofn-i_056-bulk><
        %em><
          \ {{::'bulk' | t}}

  %ng-include{src: "'partials/shop_variant_no_group_buy.html'"}
  %ng-include{src: "'partials/shop_variant_with_group_buy.html'"}

  .small-3.medium-1.large-1.columns.variant-unit
    .table-cell
      %em {{ ::variant.unit_to_display }}

  .small-4.medium-2.large-2.columns.variant-price
    .table-cell.price
      %i.ofn-i_009-close
      {{ variant.price_with_fees | localizeCurrency }}

      -# Now in a template in app/assets/javascripts/templates !
      %price-breakdown{"price-breakdown" => "_", variant: "variant",
        "price-breakdown-append-to-body" => "true",
        "price-breakdown-placement" => "left",
        "price-breakdown-animation" => true}

  .small-12.medium-2.large-2.columns.total-price.text-right
    .table-cell
      %strong{"ng-class" => "{filled: variant.line_item.total_price}"}
        {{ variant.line_item.total_price | localizeCurrency }}


- storing ||= f.object
- variant = Maybe(storing.parcel_item.variant)
- storage_name = storing.storage.name if storing.storage

.nested-fields.storing-fields
  .delivery-item
    = f.referenced_association :storage, source: :storage, label: false, input_html: { class: 'storing-storage', data: { product_of_delivery_item: { url: backend_product_path("RECORD_ID", format: :json), scope: 'storage' }, required: true } }
    %input.hidden{data: { 'when-item': 'name', 'when-set-value': 'RECORD_VALUE', 'when-scope': 'storage'}, value: storage_name}
  .storing-quantifier
    = f.input :quantity, label: false, wrapper: :append do
      = f.input_field :quantity, class: 'storing-quantity', placeholder: '0', data: { required: true }
      %span.add-on.item-population-unit-name.storage-unit-name{data: { 'when-item': 'unit_name', 'when-set-value': 'RECORD_VALUE', 'when-scope': 'unit'}}
        = variant.unit_name.or_else('#')
  .nested-remove.act
    - if f.object.destroyable?
      = link_to_remove_association(content_tag(:i) + h(:destroy.tl), f, 'data-no-turbolink' => true, class: 'destroy remove remove-item')

Fix delete storing area icon location

- storing ||= f.object
- variant = Maybe(storing.parcel_item.variant)
- storage_name = storing.storage.name if storing.storage

.nested-fields.storing-fields
  = f.referenced_association :storage, source: :storage, label: false, input_html: { class: 'storing-storage', data: { product_of_delivery_item: { url: backend_product_path("RECORD_ID", format: :json), scope: 'storage' }, required: true } }
  %input.hidden{data: { 'when-item': 'name', 'when-set-value': 'RECORD_VALUE', 'when-scope': 'storage'}, value: storage_name}
  .storing-quantifier
    = f.input :quantity, label: false, wrapper: :append do
      = f.input_field :quantity, class: 'storing-quantity', placeholder: '0', data: { required: true }
      %span.add-on.item-population-unit-name.storage-unit-name{data: { 'when-item': 'unit_name', 'when-set-value': 'RECORD_VALUE', 'when-scope': 'unit'}}
        = variant.unit_name.or_else('#')
  .nested-remove.act
    - if f.object.destroyable?
      = link_to_remove_association(content_tag(:i) + h(:destroy.tl), f, 'data-no-turbolink' => true, class: 'destroy remove remove-item')


- next_page = nil unless defined?(next_page)
- previous_page = nil unless defined?(previous_page)
%div{:class => ["content", page.theme]}
  #forward-page
    -if next_page
      = link_to "Next page", interactive_page_show_path(next_page)
  #back-page
    -if previous_page
      = link_to "Previous page", interactive_page_show_path(previous_page)
  .title
    = page.lightweight_activity.name
    %p.question= page.name
  .text
    .instructions= page.text
    .questions
      = form_tag(main_app.answers_portal_offering_path) do
        - page.embeddables.each do |e|
          - e_type = e.class.name.underscore
          = render :partial => "#{e_type}/lightweight", :locals => {:embeddable => e}
        = submit_tag "Answer"
  .other
    - page.interactives.each do |interactive|
      - i_type = interactive.class.name.underscore
      = render :partial => "#{i_type}/show", :locals => {:interactive => interactive}

Adjust HAML to create a more semantic structure of content

- next_page = nil unless defined?(next_page)
- previous_page = nil unless defined?(previous_page)
%div{:class => ["content", page.theme]}
  #forward-page
    -if next_page
      = link_to "Next page", interactive_page_show_path(next_page)
  #back-page
    -if previous_page
      = link_to "Previous page", interactive_page_show_path(previous_page)
  %h1
    = page.lightweight_activity.name
  %p.question= page.name
  .text
    %p.instructions= page.text
    .questions
      = form_tag(main_app.answers_portal_offering_path) do
        - page.embeddables.each do |e|
          - e_type = e.class.name.underscore
          = render :partial => "#{e_type}/lightweight", :locals => {:embeddable => e}
        = submit_tag "Answer"
  .other
    - page.interactives.each do |interactive|
      - i_type = interactive.class.name.underscore
      = render :partial => "#{i_type}/show", :locals => {:interactive => interactive}


= comfy_form_for @page, :as => :page, label_col: "form__label-heading", control_col: "form__input-wrapper", :url => comfy_admin_cms_site_pages_path(@site), :method => :post, :html => {:multipart => true, :autocomplete => 'off'} do |form|
  = render form

Move MASEditor dough component hook

= comfy_form_for @page, :as => :page, label_col: "form__label-heading", control_col: "form__input-wrapper", :url => comfy_admin_cms_site_pages_path(@site), :method => :post, :html => {:multipart => true, :autocomplete => 'off'}, data: {dough_component: :MASEditor} do |form|
  = render form


.bulk-notification
  - if e.count > 0
    %h3 #{ pluralize( e.count, "event" ) } in state #{ state }
    - noticket = e.select { |e| e.ticket == nil }
    - if noticket.count > 0
      =link_to 'Warning: ' + pluralize(noticket.count, "event" ) + ' without ticket', events_path(:event_state => state, 'q[s]' => 'ticket_id')
      %p
    - if noticket.count == e.count
      =button_to('no events', {}, { disabled: true, class: "btn disabled"})
    - else
      =button_to( 'Send ' + name + ' notifications to speakers in ' + pluralize( e.count - noticket.count, 'event'), { method: 'post' }, { class: "btn danger", data: { confirm: 'Are you sure you want to send ' + name + ' notifications for ' + pluralize(e.count - noticket.count, 'event') +'?', disable_with: 'working...' }})

Add links to events with problems regarding bulk mails

.bulk-notification
  - if e.count > 0
    %h3 #{ pluralize( e.count, "event" ) } in state #{ state }
    - noticket = e.select { |e| e.ticket == nil }
    - speakers = e.map { |e| e.speakers.count }.sum
    - nospeakers = e.select { |e| e.speakers.count == 0 }
    - if noticket.count > 0
      %p
        = link_to 'Warning: ' + pluralize(noticket.count, "event" ) + ' without ticket:', events_path(:event_state => state, 'q[s]' => 'ticket_id')
        - noticket.each do |e|
          = link_to e.title, e
    - if nospeakers.count > 0
      %p
        Warning: #{ pluralize(nospeakers.count, "event" ) } without speakers:
        - nospeakers.each do |e|
          = link_to e.title, e
    %p
    - if noticket.count == e.count
      =button_to('No events with tickets', {}, { disabled: true, class: "btn disabled"})
    - else
      =button_to( 'Send ' + name + ' notifications to ' + pluralize( speakers, 'speaker') + ' in ' + pluralize( e.count - noticket.count, 'event'), { method: 'post' }, { class: "btn danger", data: { confirm: 'Are you sure you want to send ' + name + ' notifications for ' + pluralize(e.count - noticket.count, 'event') +'?', disable_with: 'working...' }})


.container
  %h1.label-heading
    Search
  = render partial: "search_form"
  - if @q
    - if @all_scrapers.total_count.zero? && @owners.empty?
      %h2 No results found
      %p
        Sorry, we couldn't find any scrapers or users relevant to your search term
        %strong “#{@q}”.
      %p
        Suggestions:
      %ul
        %li check the spelling
        %li try some more general or alternate terms
      %p You could also try browsing all #{link_to "scrapers", scrapers_path} or #{link_to "users", users_path}.
    - else
      .search-results.row
        .col-xs-12
          = render partial: "search_type_nav"
        - if @type == "users"
          - if @owners.total_count.zero?
            = render partial: "no_results_of_type_notice"
          - else
            .col-xs-12
              = render partial: "search_results_list", locals: {results: @owners}
        - else
          - if @all_scrapers.total_count.zero?
            = render partial: "no_results_of_type_notice"
          - else
            %aside.col-xs-12.col-md-3
              = render partial: "scraper_search_filter_controls"
            - # If there are scrapers matching filters
            - if @scrapers.total_count.zero?
              = render partial: "no_results_of_type_notice"
            - else
              .col-xs-12.col-md-9
                = render partial: "search_results_list", locals: {results: @scrapers}

Reorder logic to group partials together

.container
  %h1.label-heading
    Search
  = render partial: "search_form"
  - if @q
    - if @all_scrapers.total_count.zero? && @owners.empty?
      %h2 No results found
      %p
        Sorry, we couldn't find any scrapers or users relevant to your search term
        %strong “#{@q}”.
      %p
        Suggestions:
      %ul
        %li check the spelling
        %li try some more general or alternate terms
      %p You could also try browsing all #{link_to "scrapers", scrapers_path} or #{link_to "users", users_path}.
    - else
      .search-results.row
        .col-xs-12
          = render partial: "search_type_nav"

        - if @type != "users" && !@all_scrapers.total_count.zero?
          %aside.col-xs-12.col-md-3
            = render partial: "scraper_search_filter_controls"

        - if (@type == "users" && @owners.total_count.zero?) || (@type != "users" && (@all_scrapers.total_count.zero? || @scrapers.total_count.zero?))
          = render partial: "no_results_of_type_notice"
        - else
          - if @type == "users"
            .col-xs-12
              = render partial: "search_results_list", locals: {results: @owners}
          - else
            .col-xs-12.col-md-9
              = render partial: "search_results_list", locals: {results: @scrapers}


%p To your Gemfile add

:coderay
  #!ruby
  gem 'rest-client'
  gem 'json'

%p
  Then run bundle install. Use the following code snippet to get data
  from the API.

- block = capture do
  :coderay
    #!ruby
    # Get data from the morph.io api
    require 'rest-client'
    require 'json'

    # We're always asking for json because it's the easiest to deal with
    morph_api_url = '[scraper_url]/data.json'

    # Keep this key secret!
    morph_api_key = '[api_key]'

    result = RestClient.get morph_api_url, params:
      {
        key: morph_api_key,
        query: "[query]"
      }

    p JSON.parse(result)

= block.sub("[scraper_url]", "#{api_root}#{h(scraper.full_name)}").sub("[api_key]", "#{current_user ? current_user.api_key : '[api_key]'}").sub("[query]", "#{h(query)}").html_safe

Use consistent quoting for example ruby code

%p To your Gemfile add

:coderay
  #!ruby
  gem 'rest-client'
  gem 'json'

%p
  Then run bundle install. Use the following code snippet to get data
  from the API.

- block = capture do
  :coderay
    #!ruby
    # Get data from the morph.io api
    require 'rest-client'
    require 'json'

    # We're always asking for json because it's the easiest to deal with
    morph_api_url = '[scraper_url]/data.json'

    # Keep this key secret!
    morph_api_key = '[api_key]'

    result = RestClient.get morph_api_url, params:
      {
        key: morph_api_key,
        query: '[query]'
      }

    p JSON.parse(result)

= block.sub("[scraper_url]", "#{api_root}#{h(scraper.full_name)}").sub("[api_key]", "#{current_user ? current_user.api_key : '[api_key]'}").sub("[query]", "#{h(query)}").html_safe


.block#block-tables
  .content
    %h2.title Roles
    .inner
      = partial('navigation', :active => 'index')
    .content
      .inner
        %table.table
          %tr
            %th.first{:colspan => 2} Name
            %th
            %th.last
          - even = false;
          - @role_list.sort_by {|value| value.downcase}.each do |role|
            %tr{ :class => even ? "even" : "odd" }
              %td{:colspan => 2}= link_to(role[0], url(:role, role[0]))
              %td
                = link_to('Edit', url(:edit_role, role[0]))
                |
                = link_to('Delete', url(:role, role[0]), :method => "delete", :confirm => "Really delete Role #{role[0]}?  there is no undo.")
              - even = (not even)

Sort roles hash on key

.block#block-tables
  .content
    %h2.title Roles
    .inner
      = partial('navigation', :active => 'index')
    .content
      .inner
        %table.table
          %tr
            %th.first{:colspan => 2} Name
            %th
            %th.last
          - even = false;
          - @role_list.sort_by {|name, api_uri| name.downcase}.each do |role|
            %tr{ :class => even ? "even" : "odd" }
              %td{:colspan => 2}= link_to(role[0], url(:role, role[0]))
              %td
                = link_to('Edit', url(:edit_role, role[0]))
                |
                = link_to('Delete', url(:role, role[0]), :method => "delete", :confirm => "Really delete Role #{role[0]}?  there is no undo.")
              - even = (not even)