!!! 5
%html
  %head
    %meta(charset="utf-8")
    %meta(httpEquiv="X-UA-Compatible", content="IE=edge,chrome=1")
    %title
      %%block(name="title")
      \- Dexter
    %meta(name='csrf-param', value='csrf_token')
    %meta(name='csrf-token', value=csrf_token())
    %meta(name="viewport", content="width=device-width, initial-scale=1.0")
    - for url in webassets('css'):
      %link(rel="stylesheet", href=url)

  %body
    %header
      .navbar.navbar-default
        .container
          .navbar-header
            %a.navbar-brand(href="/")
              Dexter

    .container
      -# show flash messages
      - for category, message in (get_flashed_messages(with_categories=True) or []):
        - category = 'info' if category == 'message' else category
        - category = 'danger' if category == 'error' else category
        %p.alert(class_="alert-" + category)
          &= message

      ${next.body()}

    %footer
      .container

    - for url in webassets('js'):
      %script(src=url)

Add button to add an article.

!!! 5
%html
  %head
    %meta(charset="utf-8")
    %meta(httpEquiv="X-UA-Compatible", content="IE=edge,chrome=1")
    %title
      %%block(name="title")
      \- Dexter
    %meta(name='csrf-param', value='csrf_token')
    %meta(name='csrf-token', value=csrf_token())
    %meta(name="viewport", content="width=device-width, initial-scale=1.0")
    - for url in webassets('css'):
      %link(rel="stylesheet", href=url)

  %body
    %header
      .navbar.navbar-default
        .container
          .navbar-header
            %a.navbar-brand(href="/")
              Dexter

          .pull-right
            %a.btn.btn-default.navbar-btn(href=url_for('new_article'))
              %i.fa.fa-plus
              Add article

    .container
      -# show flash messages
      - for category, message in (get_flashed_messages(with_categories=True) or []):
        - category = 'info' if category == 'message' else category
        - category = 'danger' if category == 'error' else category
        %p.alert(class_="alert-" + category)
          &= message

      ${next.body()}

    %footer
      .container

    - for url in webassets('js'):
      %script(src=url)


-default_video_key = 'FC5FbmsH4fw'
-default_download_url = "http://s3.amazonaws.com/cdo-videos/Code-5-minute.mov"

%div{style: "text-align:right"}
  %div{style: "width:100%; height: 100%; margin: 0 auto;"}
    %div{style: "position:relative"}
      %img{style: "display:block; width:100%; height:auto", src: "/images/16x9.png"}/
      -if custom_video_key
        %iframe{style: "position:absolute; top: 0; left: 0; width: 100%; height: 100%", src: "https://www.youtube.com/embed/#{custom_video_key}?iv_load_policy=3&rel=0&autohide=1&showinfo=0", frameborder: "0", allowfullscreen: true}
      -else
        %iframe{style: "position:absolute; top: 0; left: 0; width: 100%; height: 100%", src: "https://www.youtubeeducation.com/embed/#{default_video_key}?iv_load_policy=3&rel=0&autohide=1&showinfo=0", frameborder: "0", allowfullscreen: true}
  -unless custom_video_key
    %a.mobile-feature{href: default_download_url}
      %img{style: "width: 34px; padding-top: 2px;", src: "/images/download.png"}/

Fix EE video download link

-default_video_key = 'FC5FbmsH4fw'
-default_download_url = "http://s3.amazonaws.com/cdo-videos/HoC-video-15mb.mp4"

%div{style: "text-align:right"}
  %div{style: "width:100%; height: 100%; margin: 0 auto;"}
    %div{style: "position:relative"}
      %img{style: "display:block; width:100%; height:auto", src: "/images/16x9.png"}/
      -if custom_video_key
        %iframe{style: "position:absolute; top: 0; left: 0; width: 100%; height: 100%", src: "https://www.youtube.com/embed/#{custom_video_key}?iv_load_policy=3&rel=0&autohide=1&showinfo=0", frameborder: "0", allowfullscreen: true}
      -else
        %iframe{style: "position:absolute; top: 0; left: 0; width: 100%; height: 100%", src: "https://www.youtubeeducation.com/embed/#{default_video_key}?iv_load_policy=3&rel=0&autohide=1&showinfo=0", frameborder: "0", allowfullscreen: true}
  -unless custom_video_key
    %a.mobile-feature{href: default_download_url}
      %img{style: "width: 34px; padding-top: 2px;", src: "/images/download.png"}/


= form_for [:admin, @upload], multipart: true do |f|

  .form-group{ :class => ('gov-uk-field-error' if f.object.errors.include?(:group_id)) }
    = f.label :group_id, class: 'form-label-bold' do
      = t(:group_id, scope: 'helpers.person_uploads')
      - if f.object.errors.include?(:group_id)
        %span.error= f.object.errors[:group_id].first
    %p.form-hint
      = info_text('hint_person_upload_group')
    = f.collection_select :group_id,
      Group.all.sort_by { |g| g.path.map(&:to_s) },
      :id, :name_with_path, {}, class: 'form-control select-autocomplete team-select'
    %p
      = link_to t('person_uploads.add_new_team'), new_group_path

  = render partial: 'errors'

  .form-group{ :class => ('gov-uk-field-error' if f.object.errors.include?(:file)) }
    = f.label :file, class: 'form-label-bold' do
      = t(:file, scope: 'helpers.person_uploads')
      - if f.object.errors.include?(:file)
        %span.error= f.object.errors[:file].first
    %p.form-hint
      =info_text('hint_person_upload_file_html')
    = f.file_field :file

  %fieldset
    = f.submit class: 'button'

Use efficient group list in CSV upload form

= form_for [:admin, @upload], multipart: true do |f|

  .form-group{ :class => ('gov-uk-field-error' if f.object.errors.include?(:group_id)) }
    = f.label :group_id, class: 'form-label-bold' do
      = t(:group_id, scope: 'helpers.person_uploads')
      - if f.object.errors.include?(:group_id)
        %span.error= f.object.errors[:group_id].first
    %p.form-hint
      = info_text('hint_person_upload_group')
    = f.collection_select :group_id,
      GroupLister.new.list.sort_by { |g| g.path.map(&:to_s) },
      :id, :name_with_path, {}, class: 'form-control select-autocomplete team-select'
    %p
      = link_to t('person_uploads.add_new_team'), new_group_path

  = render partial: 'errors'

  .form-group{ :class => ('gov-uk-field-error' if f.object.errors.include?(:file)) }
    = f.label :file, class: 'form-label-bold' do
      = t(:file, scope: 'helpers.person_uploads')
      - if f.object.errors.include?(:file)
        %span.error= f.object.errors[:file].first
    %p.form-hint
      =info_text('hint_person_upload_file_html')
    = f.file_field :file

  %fieldset
    = f.submit class: 'button'


!!! 5
%html{ lang: 'en' }
  %head
    %title RubyBench - Long Running Ruby Benchmark
    %meta{ name: 'viewport', content: 'width=device-width, initial-scale-1' }
    = render 'layouts/typekit'
    = stylesheet_link_tag 'https://fonts.googleapis.com/css?family=Montserrat:400,700'
    = stylesheet_link_tag 'application', media: 'all'
    = render 'layouts/ga' if Rails.env.production?
    = csrf_meta_tags

  %body
    = render 'layouts/top_nav'
    = yield

    %footer
      = render 'layouts/footer'
      = javascript_include_tag 'application'
      = yield :footer if content_for(:footer)

Fix typo in meta tag

!!! 5
%html{ lang: 'en' }
  %head
    %title RubyBench - Long Running Ruby Benchmark
    %meta{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
    = render 'layouts/typekit'
    = stylesheet_link_tag 'https://fonts.googleapis.com/css?family=Montserrat:400,700'
    = stylesheet_link_tag 'application', media: 'all'
    = render 'layouts/ga' if Rails.env.production?
    = csrf_meta_tags

  %body
    = render 'layouts/top_nav'
    = yield

    %footer
      = render 'layouts/footer'
      = javascript_include_tag 'application'
      = yield :footer if content_for(:footer)


!!! 5
%html
  %head
    %title Photeasy
    = csrf_meta_tags
    = stylesheet_link_tag 'main'
    = javascript_include_tag 'vendor/requirejs/require', 'data-main' => '/assets/main.js'
    = javascript_include_tag '//use.typekit.net/ydd6wgd.js'
    :javascript
      try{Typekit.load();}catch(e){}
  %body
    #wrap
      %header#header
      %section#main
        #pages
          = yield
      %footer#footer
      #overlay

    = javascript_include_tag "//js.pusher.com/#{ENV['PUSHER_VERSION']}/pusher.min.js"
    - if Rails.env.development?
      :javascript
        // Enable pusher logging - don't include this in production
        Pusher.log = function(message) {
          if (window.console && window.console.log) window.console.log(message);
        };
    :javascript
      var pusher = new Pusher("#{Pusher.key}");
      // var channel = pusher.subscribe('test_channel');
      // channel.bind('greet', function(data) {
      //   alert(data.greeting);
      // });
    - if current_user.present?
      :javascript
        window.current_user = #{current_user.as_json}

Change user signed in conditional logic.

!!! 5
%html
  %head
    %title Photeasy
    = csrf_meta_tags
    = stylesheet_link_tag 'main'
    = javascript_include_tag 'vendor/requirejs/require', 'data-main' => '/assets/main.js'
    = javascript_include_tag '//use.typekit.net/ydd6wgd.js'
    :javascript
      try{Typekit.load();}catch(e){}
  %body
    #wrap
      %header#header
      %section#main
        #pages
          = yield
      %footer#footer
      #overlay

    = javascript_include_tag "//js.pusher.com/#{ENV['PUSHER_VERSION']}/pusher.min.js"
    - if Rails.env.development?
      :javascript
        // Enable pusher logging - don't include this in production
        Pusher.log = function(message) {
          if (window.console && window.console.log) window.console.log(message);
        };
    :javascript
      var pusher = new Pusher("#{Pusher.key}");
      // var channel = pusher.subscribe('test_channel');
      // channel.bind('greet', function(data) {
      //   alert(data.greeting);
      // });
    - if user_signed_in?
      :javascript
        window.current_user = #{current_user.as_json}


!!! 5
%html
  %head
    = display_meta_tags :site => 'Zangetsu', :reverse => true, :separator => '-'
    = stylesheet_link_tag 'application', :media => 'all', :'data-turbolinks-track' => true
    = javascript_include_tag 'application', :'data-turbolinks-track' => true
    = csrf_meta_tag
  %body
    %navbar.navbar.navbar-inverse.navbar-fixed-top
      .container
        .navbar-header
          %button.navbar-toggle{ :type => 'button', :data => { :toggle => 'collapse', :target => '#bs-example-navbar-collapse-1' }}
            %span.sr-only Toggle navigation
            %span.icon-bar
            %span.icon-bar
            %span.icon-bar

          = link_to 'Zangetsu', root_path, :class => 'navbar-brand'

        .collapse.navbar-collapse{ :id => '#bs-example-navbar-collapse-1' }
          %ul.nav.navbar-nav
            / primary navigation

    .container
      = yield :breadcrumbs
      = bootstrap_flash

    = yield

Fix a bug with collapsible navbar selector/id attribute

!!! 5
%html
  %head
    = display_meta_tags :site => 'Zangetsu', :reverse => true, :separator => '-'
    = stylesheet_link_tag 'application', :media => 'all', :'data-turbolinks-track' => true
    = javascript_include_tag 'application', :'data-turbolinks-track' => true
    = csrf_meta_tag
  %body
    %navbar.navbar.navbar-inverse.navbar-fixed-top
      .container
        .navbar-header
          %button.navbar-toggle{ :type => 'button', :data => { :toggle => 'collapse', :target => '#bs-example-navbar-collapse-1' }}
            %span.sr-only Toggle navigation
            %span.icon-bar
            %span.icon-bar
            %span.icon-bar

          = link_to 'Zangetsu', root_path, :class => 'navbar-brand'

        .collapse.navbar-collapse{ :id => 'bs-example-navbar-collapse-1' }
          %ul.nav.navbar-nav
            / primary navigation

    .container
      = yield :breadcrumbs
      = bootstrap_flash

    = yield


.login-box
  - if signin_enabled?
    .login-heading
      %h3 New user? Create an account
  - else
    .login-heading
      %h3 Create an account
  .login-body
    = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
      .devise-errors
        = devise_error_messages!
      %div
        = f.text_field :name, class: "form-control top", placeholder: "Name", required: true
      %div
        = f.text_field :username, class: "form-control middle", placeholder: "Username", required: true
      %div
        = f.email_field :email, class: "form-control middle", placeholder: "Email", required: true
      .form-group.append-bottom-20#password-strength
        = f.password_field :password, class: "form-control bottom", id: "user_password_sign_up", placeholder: "Password", required: true
      %div
        = f.submit "Sign up", class: "btn-create btn"

.clearfix.prepend-top-20
  %p
    %span.light Did not receive confirmation email?
    = link_to "Send again", new_confirmation_path(resource_name)

Improve wording below signup box

.login-box
  - if signin_enabled?
    .login-heading
      %h3 New user? Create an account
  - else
    .login-heading
      %h3 Create an account
  .login-body
    = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
      .devise-errors
        = devise_error_messages!
      %div
        = f.text_field :name, class: "form-control top", placeholder: "Name", required: true
      %div
        = f.text_field :username, class: "form-control middle", placeholder: "Username", required: true
      %div
        = f.email_field :email, class: "form-control middle", placeholder: "Email", required: true
      .form-group.append-bottom-20#password-strength
        = f.password_field :password, class: "form-control bottom", id: "user_password_sign_up", placeholder: "Password", required: true
      %div
        = f.submit "Sign up", class: "btn-create btn"

.clearfix.prepend-top-20
  %p
    %span.light Didn't receive a confirmation email?
    = succeed '.' do
      = link_to "Request a new one", new_confirmation_path(resource_name)


-# local 'response'
%dl
  %dt Status
  %dd
    =h response["status"].to_s
    =data.http_status_codes.definitions[response.delete("status")]
  - if response.has_key?("body")
    %dt Body
    %dd=partial("json_pretty_print", locals: { json_string: response.delete("body") } )
  - response.each do |k, v|
    %dt
      =k.to_s
    %dd
      =partial("dfs_dl", locals: { node: v })

Remove the arbitrary printing of endpoint response.

-# local 'response'
%dl
  %dt Status
  %dd
    =h response["status"].to_s
    =data.http_status_codes.definitions[response["status"]]
  - if response.has_key?("body")
    %dt Body
    %dd=partial("json_pretty_print", locals: { json_string: response["body"] } )


.row
  .small-6.columns
    %label #{organization_config.title} membership status
  .small-6.column.js--organization_member_status
    = render "/registrants/organization_membership_badge", organization_membership: organization_membership

.row.js--organization_member_status
  .small-6.columns
    %label #{organization_config.title} Details
  .small-6.columns
    = organization_membership.member_number
    %br
    = organization_membership.system_status
.row
  .small-12.columns
    - if organization_membership.organization_membership_confirmed?
      - button_class = "nonfocus_button"
    - else
      - button_class = "focus_button"
    = link_to "Go to the #{organization_config.title} Membership Site", organization_config.membership_site_url, target: :_blank, class: "#{button_class}"
    = link_to "Recheck #{organization_config.title} Status", refresh_organization_status_registrant_path(organization_membership.registrant.bib_number), remote: true, method: :put, class: "js--organization_member_status_refresh #{button_class}"
    .js--organization_member_refresh_notice.is--hidden
      Checking....page will refresh in 5 seconds.
      %br
      = link_to "Reload Now", "javascript:window.location.reload()", class: "focus_button"

Clean up instructions on membership site

.row
  .small-6.columns
    %label #{organization_config.title} membership status
  .small-6.column.js--organization_member_status
    = render "/registrants/organization_membership_badge", organization_membership: organization_membership

.row.js--organization_member_status
  .small-6.columns
    %label #{organization_config.title} Details
  .small-6.columns
    = organization_membership.member_number
    %br
    = organization_membership.system_status
.row
  .small-12.columns
    - if organization_membership.organization_membership_confirmed?
      - button_class = "nonfocus_button"
    - else
      - button_class = "focus_button"
    - recheck_status_label = "Recheck #{organization_config.title} Status"
    %p
      = link_to "Go to the #{organization_config.title} Membership Site", organization_config.membership_site_url, target: :_blank, class: "#{button_class}"
      Once you register for a membership, return to thise page and #{recheck_status_label}.

    = link_to recheck_status_label, refresh_organization_status_registrant_path(organization_membership.registrant.bib_number), remote: true, method: :put, class: "js--organization_member_status_refresh #{button_class}"
    .js--organization_member_refresh_notice.is--hidden
      Checking....page will refresh in 5 seconds.
      %br
      = link_to "Reload Now", "javascript:window.location.reload()", class: "focus_button"


= simple_form_for @recommendation, html: { class: "form-horizontal" } do |f|
  = f.error_notification class: "warning"

  .form-inputs
    = f.input :name, input_html: { class: "input-wide" }
    = f.input :link, input_html: { class: "input-wide" }
    = f.simple_fields_for :terms do |t|
      = t.input :_destroy, as: :hidden
      = t.input :name, hint: raw("Ta bort"), wrapper: :delete_item

  .control-group
    .controls
      = f.button :submit, :class => 'btn-primary'
      = link_to t('actions.cancel'), recommendations_path, class: "btn"

Remove field buttons for terms

= simple_form_for @recommendation, html: { class: "form-horizontal" } do |f|
  = f.error_notification class: "warning"

  .form-inputs
    = f.input :name, input_html: { class: "input-wide" }
    = f.input :link, input_html: { class: "input-wide" }
    = f.simple_fields_for :terms do |t|
      = t.input :_destroy, as: :hidden
      = f.input :name, wrapper: :append do
        = f.input_field :name
        %button.btn.add-on.icon-trash

  .control-group
    .controls
      = f.button :submit, :class => 'btn-primary'
      = link_to t('actions.cancel'), recommendations_path, class: "btn"


- if @is_summary_report
  %table.table.table-bordered
    %thead
      %tr
        %th= translate_helper("name")
        %th= translate_helper("inactivated_reason")
        %th= translate_helper("phone_number")
    %tbody
      - @drivers.each do |driver|
        %tr
          %td= driver.user_name
          %td= driver.inactivated_reason
          %td= format_phone_number(driver.phone_number)
- else
  %table.table.table-bordered
    %thead
      %tr
        %th= translate_helper("name")
        %th= translate_helper("permanent_inactive")
        %th= translate_helper("inactivated_start_date")
        %th= translate_helper("inactivated_end_date")
        %th= translate_helper("inactivated_reason")
        %th= translate_helper("phone_number")
    %tbody
      - @drivers.each do |driver|
        %tr
          %td= driver.user_name
          - if driver.permanent_inactivated?
            %td Permanent
            %td= format_date(driver.inactivated_date)
            %td
          - else
            %td
            %td= format_date(driver.inactivated_start_date)
            %td= format_date(driver.inactivated_end_date)
          %td= driver.active_status_changed_reason
          %td= format_phone_number(driver.phone_number)

Remove inactivated_date as current system doesnt track it for permnanent inactivated driver

- if @is_summary_report
  %table.table.table-bordered
    %thead
      %tr
        %th= translate_helper("name")
        %th= translate_helper("inactivated_reason")
        %th= translate_helper("phone_number")
    %tbody
      - @drivers.each do |driver|
        %tr
          %td= driver.user_name
          %td= driver.inactivated_reason
          %td= format_phone_number(driver.phone_number)
- else
  %table.table.table-bordered
    %thead
      %tr
        %th= translate_helper("name")
        %th= translate_helper("permanent_inactive")
        %th= translate_helper("inactivated_start_date")
        %th= translate_helper("inactivated_end_date")
        %th= translate_helper("inactivated_reason")
        %th= translate_helper("phone_number")
    %tbody
      - @drivers.each do |driver|
        %tr
          %td= driver.user_name
          - if driver.permanent_inactivated?
            %td Permanent
            %td
            %td
          - else
            %td
            %td= format_date(driver.inactivated_start_date)
            %td= format_date(driver.inactivated_end_date)
          %td= driver.active_status_changed_reason
          %td= format_phone_number(driver.phone_number)


!!! XML

- base_url = "http://www.alpine-lab.com/"
- pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) }

%urlset{xmlns: "http://www.sitemaps.org/schemas/sitemap/0.9"}
  - pages.each do |p|
    %url
      %loc= base_url + p.destination_path.gsub('index.html','')
      - if priority = p.metadata[:page]['priority']
        %priority= priority
      %lastmod= File.new(p.source_file).mtime.to_date

Remove /page/* pages from sitemap

!!! XML

- base_url = "http://www.alpine-lab.com/"
- pages = sitemap.resources.find_all { |p| p.source_file.match(/\.html/) and not p.destination_path.match(/\/page\/[0-9]+/) }

%urlset{xmlns: "http://www.sitemaps.org/schemas/sitemap/0.9"}
  - pages.each do |p|
    %url
      %loc= base_url + p.destination_path.gsub('index.html','')
      - if priority = p.metadata[:page]['priority']
        %priority= priority
      %lastmod= File.new(p.source_file).mtime.to_date


- i ||= 0

%table.email-table{ cellspacing: 0, cellpadding: 0 }
  %tbody
    %tr
      %td.email-body
        .email-container
          %table.content-section{ cellspacing: 0, cellpadding: 0 }
            %tbody
              %tr
                %td.content-cell{ class: i.zero? ? 'content-start' : nil }
                  .email-row
                    .col-6
                      %table.column{ cellspacing: 0, cellpadding: 0 }
                        %tbody
                          %tr
                            %td.column-cell.padded.status
                              %table.status-header{ cellspacing: 0, cellpadding: 0 }
                                %tbody
                                  %tr
                                    %td{ align: 'left', width: 48 }
                                      = image_tag url_to_image(status.account.avatar, host: "#{root_url}")
                                    %td{ align: 'left' }
                                      %bdi= display_name(status.account)
                                      = "@#{status.account.acct}"

                              = Formatter.instance.format(status)

                              %p.status-footer
                                = link_to l(status.created_at), web_url("statuses/#{status.id}")

Fix mailer avatar url (delete 'alt')

- i ||= 0

%table.email-table{ cellspacing: 0, cellpadding: 0 }
  %tbody
    %tr
      %td.email-body
        .email-container
          %table.content-section{ cellspacing: 0, cellpadding: 0 }
            %tbody
              %tr
                %td.content-cell{ class: i.zero? ? 'content-start' : nil }
                  .email-row
                    .col-6
                      %table.column{ cellspacing: 0, cellpadding: 0 }
                        %tbody
                          %tr
                            %td.column-cell.padded.status
                              %table.status-header{ cellspacing: 0, cellpadding: 0 }
                                %tbody
                                  %tr
                                    %td{ align: 'left', width: 48 }
                                      = image_tag url_to_image(status.account.avatar, host: "#{root_url}"), alt:''
                                    %td{ align: 'left' }
                                      %bdi= display_name(status.account)
                                      = "@#{status.account.acct}"

                              = Formatter.instance.format(status)

                              %p.status-footer
                                = link_to l(status.created_at), web_url("statuses/#{status.id}")


%p Use the following code snippet to get data from the API.

:coderay
  #!php
  <?php
  $morph_api_url = "https://api.morph.io/[USERNAME]/[SCRAPER NAME]/data.json";
  $morph_api_key="[API KEY]";

  $query="select * from 'data' limit 10";

  $response=file_get_contents($morph_api_url.'?key='.$morph_api_key.'&query='.urlencode($query));
  $js=json_decode($response,true);

  foreach ($js as $line){
    [DO WIZARDRY]
  }
  ?>

Make values in php example live updating

%p Use the following code snippet to get data from the API.

- block = capture do
  :coderay
    #!php
    <?php
    $morph_api_url = "[scraper_url]/data.json";
    $morph_api_key="[api_key]";

    $query="[query]";

    $response=file_get_contents($morph_api_url.'?key='.$morph_api_key.'&query='.urlencode($query));
    $js=json_decode($response,true);

    foreach ($js as $line){
      [DO WIZARDRY]
    }
    ?>

= 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


%table.social.white-bg{:width => "100%"}
  %tr
    %td
      %table.column{:align => "left"}
        %tr
          %td
            %h3
              = t :email_confirm_customer_greeting, name: @order.bill_address.firstname
            %h4
              = t :email_confirm_customer_intro_html, distributor: @order.distributor.name
      %table.column{:align => "left"}
        %tr
          %td{:align => "right"}
            %img.float-right{:src => "#{@order.distributor.logo.url(:medium)}"}/
      %span.clear

%p
%h4
  = t :email_confirm_customer_number_html, number: @order.number
%p
  = t :email_confirm_customer_details_html, distributor: @order.distributor.name

= render 'order_summary'
= render 'payment'
= render 'shipping'
= render 'special_instructions'
= render 'signoff'

Add connect with us footer to customer order confirmation email

%table.social.white-bg{:width => "100%"}
  %tr
    %td
      %table.column{:align => "left"}
        %tr
          %td
            %h3
              = t :email_confirm_customer_greeting, name: @order.bill_address.firstname
            %h4
              = t :email_confirm_customer_intro_html, distributor: @order.distributor.name
      %table.column{:align => "left"}
        %tr
          %td{:align => "right"}
            %img.float-right{:src => "#{@order.distributor.logo.url(:medium)}"}/
      %span.clear

%p
%h4
  = t :email_confirm_customer_number_html, number: @order.number
%p
  = t :email_confirm_customer_details_html, distributor: @order.distributor.name

= render 'order_summary'
= render 'payment'
= render 'shipping'
= render 'special_instructions'
= render 'signoff'
= render 'shared/mailers/social_and_contact'


%section.create
  = form_for(@translation, :url => translations_url, :method => :post) do|f|
    %fieldset
      %legend
        = "Create new #{locale} translation key"

      .clearfix
        - unless @translation.errors.empty?
          .alert-message.error
            = @translation.errors.full_messages.join('. ')

      = f.hidden_field :locale

      .clearfix
        = f.label :key
        .input
          = f.text_field :key

      .clearfix
        = f.label :value
        .input
          = f.text_field :value

      .actions
        = f.submit 'Create', :class => "btn primary"
%section
  %table#translations.zebra-striped
    %thead
      %tr
        %th.delete
        %th.key I18n Key
        %th.value Value
    %tbody
      - for translation in translations
        %tr{'data-key' => translation.key, 'data-url' => translation_url('x')}
          %td
            = link_to(image_tag('/assets/trash_can1.png'), '#', :class => 'destroy-translation')
          %td.key= translation.key
          %td.value
            %span.editable= translation.value

Fix busted trash can image

%section.create
  = form_for(@translation, :url => translations_url, :method => :post) do|f|
    %fieldset
      %legend
        = "Create new #{locale} translation key"

      .clearfix
        - unless @translation.errors.empty?
          .alert-message.error
            = @translation.errors.full_messages.join('. ')

      = f.hidden_field :locale

      .clearfix
        = f.label :key
        .input
          = f.text_field :key

      .clearfix
        = f.label :value
        .input
          = f.text_field :value

      .actions
        = f.submit 'Create', :class => "btn primary"
%section
  %table#translations.zebra-striped
    %thead
      %tr
        %th.delete
        %th.key I18n Key
        %th.value Value
    %tbody
      - for translation in translations
        %tr{'data-key' => translation.key, 'data-url' => translation_url('x')}
          %td
            = link_to(image_tag(asset_path("trash_can1.png")), '#', :class => 'destroy-translation')
          %td.key= translation.key
          %td.value
            %span.editable= translation.value


%h2 Sign in

= render 'users/auth/providers', flow: 'login', icons: true, color: true, prefix: 'Login in with '

= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
  %div
    = f.label :email
    %br/
    = f.email_field :email, :autofocus => true
  %div
    = f.label :password
    %br/
    = f.password_field :password
  - if devise_mapping.rememberable?
    %div
      = f.check_box :remember_me
      = f.label :remember_me
  %div= f.submit "Sign in"
= render "users/shared/links"

Convert login form to simple_form

%h2 Sign in

= render 'users/auth/providers', flow: 'login', icons: true, color: true, prefix: 'Login in with '

= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
  = f.input :email, placeholder: 'you@example.com', autofocus: true, required: true
  = f.input :password, hint: false, required: true
  - if devise_mapping.rememberable?
    = f.input :remember_me, as: :hidden, value: true
  = f.button :submit, 'Sign in'
= render "users/shared/links"


!!!
%html
  %head
    %title CMS
    = stylesheet_link_tag 'cms/application', media: 'all'
    = javascript_include_tag 'cms/application'
    = csrf_meta_tags
    %link{ :href => 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', :rel => 'stylesheet' }/
  %body
    .navbar.navbar-full.navbar-dark.bg-primary.m-b-3
      .container
        %ul.nav.navbar-nav
          - Cms::Configuration.resources.each do |resource|
            %li.nav-item
              = link_to resource[:name].capitalize, polymorphic_path(resource[:name]), class: 'nav-link'
    .container.p-b-3
      - if flash[:alert] || notice.present?
        .p-b-2
          - if flash[:alert]
            - flash[:alert].each do |alert|
              = render 'cms/shared/alert', message: alert, type: 'danger'
          - if notice.present?
            = render 'cms/shared/alert', message: notice, type: 'success'
      = yield

Change capitalize to titleize for navbar links

!!!
%html
  %head
    %title CMS
    = stylesheet_link_tag 'cms/application', media: 'all'
    = javascript_include_tag 'cms/application'
    = csrf_meta_tags
    %link{ :href => 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', :rel => 'stylesheet' }/
  %body
    .navbar.navbar-full.navbar-dark.bg-primary.m-b-3
      .container
        %ul.nav.navbar-nav
          - Cms::Configuration.resources.each do |resource|
            %li.nav-item
              = link_to resource[:name].titleize, polymorphic_path(resource[:name]), class: 'nav-link'
    .container.p-b-3
      - if flash[:alert] || notice.present?
        .p-b-2
          - if flash[:alert]
            - flash[:alert].each do |alert|
              = render 'cms/shared/alert', message: alert, type: 'danger'
          - if notice.present?
            = render 'cms/shared/alert', message: notice, type: 'success'
      = yield


%button.add_link Ajouter un lien

Debug JS for redaction space

%p.new_link{'data-url' => new_redaction_news_link_path(:news_id => @news)}
  %button.add_link Ajouter un lien


%tr
  %td
    = link_to domain.name, domain_path( domain )
  %td
  %td

Add domain links in the list of domains

%tr
  %td
    = link_to domain.name, domain_path( domain )
  %td
    = link_to prototip_info_icon('table_edit.png', 'zone-edit'), edit_domain_path(domain)
    = link_to prototip_info_icon('report_magnify.png', 'audits'), audits_path(:action => :domain, :id => domain)
    - unless domain.slave?
      = link_to prototip_info_icon('brick_go.png', 'macro'), apply_macro_domain_path( domain )
    - if current_user.admin? && domain.user
      = link_to_function prototip_info_icon('database_delete.png', 'delete-zone'), "deleteDomain();" , :id => "delete-link-buffer"
    - elsif !current_token
      = link_to prototip_info_icon('database_delete.png', 'delete-zone'), domain_path( domain ), :method => :delete, :confirm => "Are you sure you want to remove #{domain.name}?"


.footer-sponsors
  %ul.list-inline.footer-sponsors-list
    %li.footer-sponsors-list-item
      = link_to 'http://www.jollygoodcode.com/', target: '_blank' do
        %h4.l-align-center
          %i= t('footer.supported_by')

        = image_tag 'sponsors/jolly_good_code.png', class: 'footer-sponsors-list-item-image', alt: 'Jolly Good Code'

  %hr

  We are currently looking for the following sponsors in order to help us sustain
  RubyBench:

  %ol
    %li Hosting sponsor

    %li
      %strong
        Sponsor for bare metal server. We're currently running the bare metal
        server using a free one month trial from Softlayer. While the lowest
        bare metal server costs around USD170, we would prefer a bare metal
        server in the range of USD500 such that the benchmarks do not take forever
        to complete.

  For parties interested in sponsoring any of the above, please drop us a note
  at our
  = succeed '.' do
    = link_to ' discussion forum', 'http://community.miniprofiler.com/t/status-progress-cooperation/337', target: '_blank', class: 'alert-link'

%hr

.l-align-center
  %h5
    Built and maintained by
    = link_to '@tgxworld', 'https://github.com/tgxworld', target: '_blank'

Add missing class to %hr in footer.

.footer-sponsors
  %ul.list-inline.footer-sponsors-list
    %li.footer-sponsors-list-item
      = link_to 'http://www.jollygoodcode.com/', target: '_blank' do
        %h4.l-align-center
          %i= t('footer.supported_by')

        = image_tag 'sponsors/jolly_good_code.png', class: 'footer-sponsors-list-item-image', alt: 'Jolly Good Code'

  %hr.footer-hr

  We are currently looking for the following sponsors in order to help us sustain
  RubyBench:

  %ol
    %li Hosting sponsor

    %li
      %strong
        Sponsor for bare metal server. We're currently running the bare metal
        server using a free one month trial from Softlayer. While the lowest
        bare metal server costs around USD170, we would prefer a bare metal
        server in the range of USD500 such that the benchmarks do not take forever
        to complete.

  For parties interested in sponsoring any of the above, please drop us a note
  at our
  = succeed '.' do
    = link_to ' discussion forum', 'http://community.miniprofiler.com/t/status-progress-cooperation/337', target: '_blank', class: 'alert-link'

%hr.footer-hr

.l-align-center
  %h5
    Built and maintained by
    = link_to '@tgxworld', 'https://github.com/tgxworld', target: '_blank'


#masthead.header
  %div
    %h1#logo= link_to LONG_SITE_NAME, root_path
    #nav-primary
      -cache('primary_nav') do
        %ul.nav.site.alt.title-ideas
          %li= link_to "About", home_about_path
        %ul.nav.site
          %li= link_to "Ideas", ideas_path
          %li= link_to "Tags",  tags_path
          %li= link_to "Currents", currents_path
    %ul.nav.user
      - if user_signed_in?
        %li.first= link_to "#{h current_user.name}" , user_profile_path(current_user)
        %li= link_to 'Settings', edit_user_registration_path
        %li= link_to 'Log Out', destroy_user_session_path, method: :delete
      - else
        - cache('no_user_nav') do
          %li= link_to "Sign Up", new_user_registration_path
          %li= link_to 'Log in', new_user_session_path
      %li.last.search
        = form_tag search_ideas_path, :method => :get, :id => 'idea_search_box' do
          %label{ :for => "search_text" }
            Search:
          = text_field_tag 'search_text', params[:search_text]

Add header layout dashboard link for admins

#masthead.header
  %div
    %h1#logo= link_to LONG_SITE_NAME, root_path
    #nav-primary
      -cache('primary_nav') do
        %ul.nav.site.alt.title-ideas
          %li= link_to "About", home_about_path
        %ul.nav.site
          %li= link_to "Ideas", ideas_path
          %li= link_to "Tags",  tags_path
          %li= link_to "Currents", currents_path
    %ul.nav.user
      - if user_signed_in?
        - if current_user.admin?
          %li.first= link_to 'Admin', admin_dashboard_path
          %li= link_to "#{h current_user.name}" , user_profile_path(current_user)
        - else
          %li.first= link_to "#{h current_user.name}" , user_profile_path(current_user)
        %li= link_to 'Settings', edit_user_registration_path
        %li= link_to 'Log Out', destroy_user_session_path, method: :delete
      - else
        - cache('no_user_nav') do
          %li= link_to "Sign Up", new_user_registration_path
          %li= link_to 'Log in', new_user_session_path
      %li.last.search
        = form_tag search_ideas_path, :method => :get, :id => 'idea_search_box' do
          %label{ :for => "search_text" }
            Search:
          = text_field_tag 'search_text', params[:search_text]


/ Sidebar Menu
.ui.vertical.sidebar.menu
  %a.active.item{href: root_path} Home
  %a.item{href: new_user_session_path} Login
  %a.item{href: new_user_registration_path} Signup
/ Page Contents
.pusher
  .ui.vertical.center.aligned.segment
    .ui.container
      .ui.large.main.menu
        %a.toc.item
          %i.sidebar.icon
        %a.brand.item{href: root_path}= image_tag("logo/logo.png")
        %a.item{href: root_path} Home
        .right.item
          .item
            %a.ui.button{href: new_user_session_path} Log in
          .item
            %a.ui.green.button{href: new_user_registration_path} Sign Up

Add a conditional logout link in the header

/ Sidebar Menu
.ui.vertical.sidebar.menu
  %a.active.item{href: root_path} Home
  %a.item{href: new_user_session_path} Login
  %a.item{href: new_user_registration_path} Signup
/ Page Contents
.pusher
  .ui.vertical.center.aligned.segment
    .ui.container
      .ui.large.main.menu
        %a.toc.item
          %i.sidebar.icon
        %a.brand.item{href: root_path}= image_tag("logo/logo.png")
        %a.item{href: root_path} Home
        .right.item
          - if user_signed_in?
            .item
              %a.ui.button{href:destroy_user_session_path, 'data-method' => :delete} Log out
          - else
            .item
              %a.ui.button{href: new_user_session_path} Log in
            .item
              %a.ui.green.button{href: new_user_registration_path} Sign Up


%section

  %h1
    Show lockfile check results

  %p
    Checked
    = l @lockfile.created_at, format: :short
    ·
    = link_to 'Show content', '#', data: { toggle: 'modal', target: '#lockfile-content-modal' }

%section
  = render 'compats/table', gemmies: @lockfile.gemmies

%section
  =# render 'email_notifications/form', notifiable: @lockfile

#lockfile-content-modal.modal.fade
  .modal-dialog.modal-dialog-scrollable.modal-lg
    .modal-content
      .modal-header
        %h5.modal-title
          Lockfile content
        %button.close{ type: 'button', data: { dismiss: 'modal' } }
          %span
            ×
      .modal-body
        %pre
          = @lockfile.content
      .modal-footer
        = link_to 'Close', '#', class: 'btn btn-primary', data: { dismiss: 'modal' }

Revert "hide email notification form for now"

%section

  %h1
    Show lockfile check results

  %p
    Checked
    = l @lockfile.created_at, format: :short
    ·
    = link_to 'Show content', '#', data: { toggle: 'modal', target: '#lockfile-content-modal' }

%section
  = render 'compats/table', gemmies: @lockfile.gemmies

%section
  = render 'email_notifications/form', notifiable: @lockfile

#lockfile-content-modal.modal.fade
  .modal-dialog.modal-dialog-scrollable.modal-lg
    .modal-content
      .modal-header
        %h5.modal-title
          Lockfile content
        %button.close{ type: 'button', data: { dismiss: 'modal' } }
          %span
            ×
      .modal-body
        %pre
          = @lockfile.content
      .modal-footer
        = link_to 'Close', '#', class: 'btn btn-primary', data: { dismiss: 'modal' }


.grid-row
  .column-three-quarter
    %h1.page-title
      - if current_user.persona.admin?
        = t('.all_claims')
      - else
        = t('.your_claims')
    #summary
      = render partial: 'financial_summary', locals: { financial_summary: @financial_summary }
  .column-quarter
    = link_to t('link.add_claim'), new_advocates_claim_path, class: 'button button-get-started'
    .claims-importer#importer
      = render partial: 'json_document_importer'

%span#import_results.success
  %ul

%span#import_results.failure
  %ul

%span#import_results.schema_fails
  %ul

#report-options.container
  = render partial: 'search_form'

#search-summary
  - if params[:search].present?
    = render partial: 'shared/search_summary'

= render partial: 'claims', locals: { claims: @claims }

Use 'third' grid column for start/import claim rather than quarter

.grid-row
  .column-two-thirds
    %h1.page-title
      - if current_user.persona.admin?
        = t('.all_claims')
      - else
        = t('.your_claims')
    #summary
      = render partial: 'financial_summary', locals: { financial_summary: @financial_summary }
  .column-third
    = link_to t('link.add_claim'), new_advocates_claim_path, class: 'button button-get-started'
    .claims-importer#importer
      = render partial: 'json_document_importer'

%span#import_results.success
  %ul

%span#import_results.failure
  %ul

%span#import_results.schema_fails
  %ul

#report-options.container
  = render partial: 'search_form'

#search-summary
  - if params[:search].present?
    = render partial: 'shared/search_summary'

= render partial: 'claims', locals: { claims: @claims }


#modalTriggerText.modal
  .modal-dialog
    .modal-content
      .modal-header
        %h4.modal-title New Text Component
        %button.close{"data-dismiss" => "modal", :type => "button"}
          %span ×

      .modal-body
        %ul.nav.nav-justified.mb-4
          %li.nav-item
            %a.btn.btn-secondary.active{"data-toggle" => "pill", :href => "#textComponent-create-newTrigger"} Create with new trigger

          %li.btn or

          %li.nav-item
            %a.btn.btn-secondary{"data-toggle" => "pill", :href => "#textComponent-create-useTrigger"} use an existing trigger

        .tab-content
          .tab-pane.active#textComponent-create-newTrigger
            = render 'form', text_component: text_component, create_trigger: true
          .tab-pane#textComponent-create-useTrigger
            = render 'form', text_component: text_component

Create new tc with existing trigger by default

#modalTriggerText.modal
  .modal-dialog
    .modal-content
      .modal-header
        %h4.modal-title New Text Component
        %button.close{"data-dismiss" => "modal", :type => "button"}
          %span ×

      .modal-body
        %ul.nav.nav-justified.mb-4
          %li.nav-item
            %a.btn.btn-secondary.active{"data-toggle" => "pill", :href => "#textComponent-create-useTrigger"} use an existing trigger

          %li.btn or

          %li.nav-item
            %a.btn.btn-secondary{"data-toggle" => "pill", :href => "#textComponent-create-newTrigger"} Create with new trigger

        .tab-content
          .tab-pane.active#textComponent-create-useTrigger
            = render 'form', text_component: text_component
          .tab-pane#textComponent-create-newTrigger
            = render 'form', text_component: text_component, create_trigger: true


%h3{style:"color: #00c; border-bottom: 3px solid #00c"} Area Data
%br

.clearfix
  %label CO2 Price
  .input= number_field(:co2_price, :type => 'text')

.clearfix
  %label CO2 Free
  .input= number_field(:co2_percentage_free, :type => 'text')

%h3 Area Data Debugger
%code
  = Current.gql.tap{|g| g.prepare }.future_graph.area.object_dataset #rescue 'e'

Test on wizard form area data

%h3{style:"color: #00c; border-bottom: 3px solid #00c"} Area Data
%br

.clearfix
  %label CO2 Price
  .input= number_field(:co2_price, :type => 'text')

.clearfix
  %label CO2 Free
  .input= number_field(:co2_percentage_free, :type => 'text')

.clearfix
  %label Mark test
  .input= number_field(100)

%h3 Area Data Debugger
%code
  = Current.gql.tap{|g| g.prepare }.future_graph.area.object_dataset #rescue 'e'


%table.student_list
  %tr
    %th
      %div.progressbar_container

  %tr
    %th
      %div.progressbar_container
        ACTIVITY
  - students.each do |student|
    - student_name = student.user.last_name + ", " + student.user.first_name
    %tr
      %td.student_name{:title=>"#{student_name}"}
        %div.progressbar_container
          = student_name.truncate(15)

Fix table header in Full Status

%table.student_list
  %tr
    %th{:style=>"border-bottom:solid 1px #F9EEC1"}
      %div.progressbar_container

  %tr
    %th{:style=>"border-top:solid 1px #F9EEC1"}
      %div.progressbar_container
        ACTIVITY
  - students.each do |student|
    - student_name = student.user.last_name + ", " + student.user.first_name
    %tr
      %td.student_name{:title=>"#{student_name}"}
        %div.progressbar_container
          = student_name.truncate(15)


.four.columns.offset-by-one
  .row.classrooms-sidebar
    %h5
      = _('Your Classrooms')
      - if can? :create, current_user.created_classrooms.build
        = link_to('Start a Classroom', start_classroom_path, :class => 'tiny radius button')
    %hr
    %ul
      - current_user.created_classrooms.each do |classroom|
        %li.sidebar-classroom
          = link_to(classroom.title, root_url(:subdomain => classroom.slug))

Fix home dashboard sidebar classrooms list.

.four.columns.offset-by-one
  .row.classrooms-sidebar
    %h5
      = _('Your Classrooms')
      - if can? :create, current_user.created_classrooms.build
        = link_to('Start a Classroom', start_classroom_path, :class => 'tiny radius button')
    %hr
    %ul
      - current_user.classrooms.each do |classroom|
        - classroom_klass = current_user.created_classrooms.include?(classroom) ? 'created' : 'member'
        %li{:class => classroom_klass}
          = link_to(classroom.title, root_url(:subdomain => classroom.slug))


!!!
%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'
  %body
    = render 'navbar'
    .container-fluid
      .starter-template
        = bootstrap_flash
        = yield
    / /.container

Add meta tag to store widget remote rendering endpoint for javascript usage.

!!!
%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


.policy
  %h1.title= @edition.title
  %div.body
    = @edition.body.split("\n\n").collect{|paragraph| "<p>#{paragraph}</p>" }.join.html_safe
  %p.written_by
    Written by
    %span.author= @edition.author.name

%div
  = form_for([:admin, @edition, @fact_check_request]) do |fact_check_form|
    = fact_check_form.label :comments
    = fact_check_form.text_area :comments
    = fact_check_form.submit "Submit"

Add a bit of explanation.

.explanation
  %p You've been asked to review this policy for factual accuracy. Please read it, and then provide any comments in the form below

.policy
  %h1.title= @edition.title
  %div.body
    = @edition.body.split("\n\n").collect{|paragraph| "<p>#{paragraph}</p>" }.join.html_safe
  %p.written_by
    Written by
    %span.author= @edition.author.name

%div
  = form_for([:admin, @edition, @fact_check_request]) do |fact_check_form|
    = fact_check_form.label :comments
    = fact_check_form.text_area :comments
    = fact_check_form.submit "Submit"


%link{rel: 'stylesheet', href:'/mailer.css'}
%p.paragraph
  Suspected plagiarism from
  %a{href: "https://#{ENV['dashboard_url']}/users/#{@user.url_encoded_username}"}= "User:#{@user.username}"
%p.paragraph
  Course:
  %a{href: "https://#{ENV['dashboard_url']}/courses/#{@course.slug}"}= @course.title
%p.paragraph
  Article:
  %a{href: @article_url}= @article.title
%p.paragraph
  %a{href: @revision.url} diff
%p.paragraph
  %a{href: @report_url} iThenticate report
%table
  %tr
    %td.main-content.link-cell
      %a.button_link{:href => @talk_page_new_section_url}
        Warn user

Rewrite possible plagiarism email for sending to instructors

%link{rel: 'stylesheet', href:'/mailer.css'}
%table.row
  %tbody
    %tr
      %th
        %table
          %tr
            %td.main-content
              %h1.headline
                = "Possible plagiarism detected on Wikipedia"
              %p.paragraph
                Wikipedia's plagiarism detection system picked up an edit from one
                of the students enrolled in
                #{link_to @course.title, "https://#{ENV['dashboard_url']}/courses/#{@course.slug}"}.
              %p.paragraph
                #{link_to @user.username, "https://#{ENV['dashboard_url']}/users/#{@user.url_encoded_username}"}
                made
                #{link_to 'this change', @revision.url}
                to the article
                "#{link_to @article.full_title, @article_url}", which Turnitin/iThenticate matched to published
                text.
              %p.paragraph
                These reports are not 100% accurate. For example, a direct quote with proper attribution
                may trigger a false positive plagiarism report. Please review the student's contributions
                and the details of the report before taking any action. (If you find that the change — or
                the entire article — is not accessible, the content may have been deleted for copyright reasons.)
              %table
                %tr
                  %td.main-content.link-cell
                    %a.button_link{:href => @report_url}
                      View iThenticate report
                  %td.main-content.link-cell

                  %td.main-content.link-cell
                    %a.button_link{:href => @talk_page_new_section_url}
                      Leave a message for #{@user.username}


.row
  .margin-bottom-10 What is the inspection type?
  .field
    = f.hidden_field :inspection_type_id
  .max-width-px-400
    - supercategories = InspectionType.pluck(:inspection_supercategory_name, :inspection_supercategory).uniq
    %select.inspection-supercategories{ name: 'supercategory' }
      %option
      = options_for_select(supercategories)
  .max-width-px-400
    %select.inspection-categories{ name: 'category', style: "display:none;" }
      -# options are inserted here by JS
  .max-width-px-400
    %select.inspection-names{ style: "display:none;" }
      -# options are inserted here by JS
  .columns.small-12
    .inspection-type-comments.margin-bottom-10
.row
  .margin-bottom-10 Any further details on the type of inspection required? (e.g. gate access code)
  .max-width-px-400
    = f.text_field :inspection_notes

Move to custom inspection supercategories in public view to improve UX options

.row
  .margin-bottom-10 What is the inspection type?
  .field
    = f.hidden_field :inspection_type_id
  .max-width-px-400
    %select.inspection-supercategories{ name: 'supercategory' }
      %option
      = options_for_select([['Single-family / Duplex', 'residential'], ['Three or more units: Multi-family Residential / Condo', 'commercial'], ['Commercial', 'commercial']])
  .max-width-px-400
    %select.inspection-categories{ name: 'category', style: 'display:none;' }
      -# options are inserted here by JS
  .max-width-px-400
    %select.inspection-names{ style: 'display:none;' }
      -# options are inserted here by JS
  .columns.small-12
    .inspection-type-comments.margin-bottom-10
.row
  .margin-bottom-10 Any further details on the type of inspection required? (e.g. gate access code)
  .max-width-px-400
    = f.text_field :inspection_notes


!!!
%html
  %head
    %meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
    %title= content_for?(:title) ? yield(:title) : 'Happenin'
    %meta{:name => "description", :content => "#{content_for?(:description) ? yield(:description) : 'Happenin'}"}
    = stylesheet_link_tag 'application', media: 'all'
    = javascript_include_tag 'vendor/modernizr'
    = javascript_include_tag 'application'
    = csrf_meta_tags
  %body
    %header
      = render 'layouts/navigation'
    %main{:role => "main"}
      = render 'layouts/messages'
      = yield

Change 'layouts/application' strings to use single-quotes

!!!
%html
  %head
    %meta{ name: 'viewport', content: 'width=device-width, initial-scale=1.0' }
    %title= content_for?(:title) ? yield(:title) : 'Happenin'
    %meta{ name: 'description', content: "#{content_for?(:description) ? yield(:description) : 'Happenin'}" }
    = stylesheet_link_tag 'application', media: 'all'
    = javascript_include_tag 'vendor/modernizr'
    = javascript_include_tag 'application'
    = csrf_meta_tags
  %body
    %header
      = render 'layouts/navigation'
    %main{:role => "main"}
      = render 'layouts/messages'
      = yield


---
title: Alpine Lab, blog technique
description: On parle de développement web, d'entreprenariat, de Ruby, de Rails, de Haml, de CSS/Sass, de CoffeeScript et d'Ember.js, ...
priority: 0.5
pageable: true
per_page: 3
layout: blog
---

%section.posts-listing
  - page_articles.each do |article|
    %article{itemscope: true, itemtype: "http://schema.org/BlogPosting"}
      %meta{itemprop: "description", content: article.summary}
      %meta{itemprop: "url", content: "http://www.alpine-lab.com#{article.url}"}
      %meta{itemprop: "inLanguage", content: "fr"}

      %h2{itemprop: "name headline"}= link_to article.title, article.url
      .post-body{itemprop: "articleBody"}~ article.body

  - if paginate
    = partial 'layouts/pagination', locals: {page_number: page_number, num_pages: num_pages, prev_page: prev_page, next_page: next_page}

Change blog index to have priority 1.0 in sitemap

---
title: Alpine Lab, blog technique
description: On parle de développement web, d'entreprenariat, de Ruby, de Rails, de Haml, de CSS/Sass, de CoffeeScript et d'Ember.js, ...
priority: 1.0
pageable: true
per_page: 3
layout: blog
---

%section.posts-listing
  - page_articles.each do |article|
    %article{itemscope: true, itemtype: "http://schema.org/BlogPosting"}
      %meta{itemprop: "description", content: article.summary}
      %meta{itemprop: "url", content: "http://www.alpine-lab.com#{article.url}"}
      %meta{itemprop: "inLanguage", content: "fr"}

      %h2{itemprop: "name headline"}= link_to article.title, article.url
      .post-body{itemprop: "articleBody"}~ article.body

  - if paginate
    = partial 'layouts/pagination', locals: {page_number: page_number, num_pages: num_pages, prev_page: prev_page, next_page: next_page}


.landing-container

:javascript
  //
  // Would be nice to redirect to:
  // #{session[:omniauth_origin]}
  // but this is cleared out after logout.
  //
  if (!Portal.currentUser.isAnonymous) {
    PortalPages.renderSignupModal(
        {
            omniauth: true,
            omniauth_origin: "#{session[:omniauth_origin]}"
        }
    );
  } else {
    window.location.href = "/";
  }

Remove comment no longer applicable.

.landing-container

:javascript
  if (!Portal.currentUser.isAnonymous) {
    PortalPages.renderSignupModal(
        {
            omniauth: true,
            omniauth_origin: "#{session[:omniauth_origin]}"
        }
    );
  } else {
    window.location.href = "/";
  }


- stash(title => l('Password reset'));
.grd-grid-12.static_full
  %h1= stash->{title}
  %p= l('To reset your password, enter the e-mail address you registered in the field below and click "RESET PASSWORD".')
  %form
    %fieldset
      .grd-parent.grd-grid-12.grd-row-padding
        .grd-grid-4.form_label
          %label{:for => "lp_email"}= l('Email address')
        .grd-grid-8
          %input#lp_email{:type => 'text', :name => 'lp_email'}
          %p#email_error.errorfield.invisible= l("This field is required.")
      .grd-parent.grd-grid-12
        .grd-grid-4
        .grd-grid-8
          %span.button
            %button#submit.button{:name => "submit" :type => "button"}= l('Reset Password')
  %p= l("We'll then send you an e-mail asking you to verify your identity.")
  %p= l("If you don't receive the email within the next few minutes, please check your junk/spam mail folder.")

Remove form usage to prevent submit onenter

- stash(title => l('Password reset'));
.grd-grid-12.static_full
  %h1= stash->{title}
  %p= l('To reset your password, enter the e-mail address you registered in the field below and click "RESET PASSWORD".')
  %div
    %fieldset
      .grd-parent.grd-grid-12.grd-row-padding
        .grd-grid-4.form_label
          %label{:for => "lp_email"}= l('Email address')
        .grd-grid-8
          %input#lp_email{:type => 'text', :name => 'lp_email'}
          %p#email_error.errorfield.invisible= l("This field is required.")
      .grd-parent.grd-grid-12
        .grd-grid-4
        .grd-grid-8
          %span.button
            %button#submit.button{:name => "submit" :type => "button"}= l('Reset Password')
  %p= l("We'll then send you an e-mail asking you to verify your identity.")
  %p= l("If you don't receive the email within the next few minutes, please check your junk/spam mail folder.")


.login-box
  - if signin_enabled?
    .login-heading
      %h3 New user? Create an account
  - else
    .login-heading
      %h3 Create an account
  .login-body
    = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
      .devise-errors
        = devise_error_messages!
      %div
        = f.text_field :name, class: "form-control top", placeholder: "Name", required: true
      %div
        = f.text_field :username, class: "form-control middle", placeholder: "Username", required: true
      %div
        = f.email_field :email, class: "form-control middle", placeholder: "Email", required: true
      .form-group.append-bottom-20#password-strength
        = f.password_field :password, class: "form-control bottom", id: "user_password_sign_up", placeholder: "Password", required: true
      %div
      - if Gitlab.config.recaptcha.enabled
        = recaptcha_tags
      %div
        = f.submit "Sign up", class: "btn-create btn"

.clearfix.prepend-top-20
  %p
    %span.light Didn't receive a confirmation email?
    = succeed '.' do
      = link_to "Request a new one", new_confirmation_path(resource_name)

Make sign-up form retain fields after failed CAPTCHA test

.login-box
  - if signin_enabled?
    .login-heading
      %h3 New user? Create an account
  - else
    .login-heading
      %h3 Create an account
  .login-body
    - user = params[:user].present? ? params[:user] : {}
    = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
      .devise-errors
        = devise_error_messages!
      %div
        = f.text_field :name, class: "form-control top", value: user[:name], placeholder: "Name", required: true
      %div
        = f.text_field :username, class: "form-control middle", value: user[:username], placeholder: "Username", required: true
      %div
        = f.email_field :email, class: "form-control middle", value: user[:email], placeholder: "Email", required: true
      .form-group.append-bottom-20#password-strength
        = f.password_field :password, class: "form-control bottom", value: user[:password], id: "user_password_sign_up", placeholder: "Password", required: true
      %div
      - if Gitlab.config.recaptcha.enabled
        = recaptcha_tags
      %div
        = f.submit "Sign up", class: "btn-create btn"

.clearfix.prepend-top-20
  %p
    %span.light Didn't receive a confirmation email?
    = succeed '.' do
      = link_to "Request a new one", new_confirmation_path(resource_name)


%li{ class: ('active' if current_admin_path.start_with?('/projects')) }
  = link_to spina.admin_projects_path do
    = plugin.name

Update plugin name in CMS

%li{ class: ('active' if current_admin_path.start_with?('/projects')) }
  = link_to 'Projects', spina.admin_projects_path


%a{name: resource.id, id: resource.id}
.row.topic-reply
  .columns.show-for-large-up.medium-2.large-1.topic-user
    - if resource.user.present?
      = link_to main_app.user_path(resource.user), class: "th" do
        = user_image_tag(resource.user, {width: 60, height: 60})
  .columns.large-11.topic-content
    .topic-meta.clearfix
      - if resource.user.present?
        .left
          = link_to main_app.user_path(resource.user) do
            = user_image_tag(current_user, {width: 18, height: 18, class: "hide-for-large-up"})
            = resource.user.name
      .right
        %ul.no-bullet.inline-list{style: "overflow:visible;"}
          - if resource.created_at.present?
            %li
              = time_ago_in_words(resource.created_at) + " ago"
          - if current_user && can?(:edit, resource)
            %li= link_to "Edit", polymorphic_url(resource, :action => 'edit')
          %li
            = link_to "#", "##{resource.id}"
    = raw(resource.body)

Change avatar to use correct user's image

%a{name: resource.id, id: resource.id}
.row.topic-reply
  .columns.show-for-large-up.medium-2.large-1.topic-user
    - if resource.user.present?
      = link_to main_app.user_path(resource.user), class: "th" do
        = user_image_tag(resource.user, {width: 60, height: 60})
  .columns.large-11.topic-content
    .topic-meta.clearfix
      - if resource.user.present?
        .left
          = link_to main_app.user_path(resource.user) do
            = user_image_tag(resource.user, {width: 18, height: 18, class: "hide-for-large-up"})
            = resource.user.name
      .right
        %ul.no-bullet.inline-list{style: "overflow:visible;"}
          - if resource.created_at.present?
            %li
              = time_ago_in_words(resource.created_at) + " ago"
          - if current_user && can?(:edit, resource)
            %li= link_to "Edit", polymorphic_url(resource, :action => 'edit')
          %li
            = link_to "#", "##{resource.id}"
    = raw(resource.body)


%footer
  .copyright= raw(t 'footer.copyright')
  - if user_signed_in?
    = link_to((t 'footer.home_btn'), root_url)
    %span —
    = link_to(raw(t 'footer.settings_btn'), settings_path)
    %span —
    = link_to((t 'footer.feedback_btn'), feedback_path)
    %span —
    = link_to((t 'footer.logout_btn'), logout_path)
  - else
    = link_to((t 'footer.feedback_btn'), feedback_path)
    %span —
    = link_to((t 'footer.login_btn'), request_path)

Make settings footer link only available to non wait list users

%footer
  .copyright= raw(t 'footer.copyright')
  - if user_signed_in?
    = link_to((t 'footer.home_btn'), root_url)
    - unless current_user.waitlist?
      %span —
      = link_to(raw(t 'footer.settings_btn'), settings_path)
    %span —
    = link_to((t 'footer.feedback_btn'), feedback_path)
    %span —
    = link_to((t 'footer.logout_btn'), logout_path)
  - else
    = link_to((t 'footer.feedback_btn'), feedback_path)
    %span —
    = link_to((t 'footer.login_btn'), request_path)


%li
  = link_to archive[:name], month_url(archive[:year], archive[:month])
  = "\(#{archive[:article_count]}\)"

Revert "A small inconsitency between the ERb archives partial and the HAML version."

%li
  = link_to archive[:name], month_url(archive[:year], archive[:month])
  = archive[:article_count]


.row.animate-show{"ng-show" => "filtersActive"}
  .small-12.columns
    = render partial: 'shared/components/filter_controls_shopfront'

.row.filter-box.filter-box-shopfront.animate-hide{"ng-hide" => "filtersActive"}
  .small-12.columns
    .row.tdhead
      .small-12.medium-6.columns
        %h5
          .light Filter by
          Category
      .small-12.medium-6.columns.text-right
        = render partial: 'shared/components/filter_controls_shopfront'
        = render partial: 'shared/components/filter_box_shopfront'
    .row
      .small-12.columns
        %ul.small-block-grid-2.medium-block-grid-3.large-block-grid-4
          %taxon-selector{objects: "Products.products | products:query | products:showProfiles",
            results: "activeTaxons"}

Change markup because the boolean variable now works correctly

.row.animate-show{"ng-hide" => "filtersActive"}
  .small-12.columns
    = render partial: 'shared/components/filter_controls_shopfront'

.row.filter-box.filter-box-shopfront.animate-hide{"ng-show" => "filtersActive"}
  .small-12.columns
    .row.tdhead
      .small-12.medium-6.columns
        %h5
          .light Filter by
          Category
      .small-12.medium-6.columns.text-right
        = render partial: 'shared/components/filter_box_shopfront'
        = render partial: 'shared/components/filter_controls_shopfront'

    .row
      .small-12.columns
        %ul.small-block-grid-2.medium-block-grid-3.large-block-grid-4
          %taxon-selector{objects: "Products.products | products:query | products:showProfiles",
            results: "activeTaxons"}


%li.highlight
  / .strip
  /   ="test"

  .indentwide
    = all.name
    –
    = "Created by " + all.user.name
    = (", assigned to " + all.assignee.name) if all.assigned_to
  / - unless all.category.blank?
  /   .strip{:class => all.category}= t(all.category)
  / - else
  /   .strip.white #{t :other}

/   .tools

/   .indent
/     =all.name
/     –
/     %tt
/     - unless all.background_info.blank?
/       %div
/         %dt= all.background_info

Add better format and Due In notes for specific time sets. Needs work on non-specific time

%li.highlight[all]
  / - unless all.category.blank?
  /   .strip{:class => all.category}= t(all.category)
  / - else
  /   .strip.white #{t :other}

  .tools
    = "Hello."

  .indentwide
    = all.name
    = "| "
    %tt
      = link_to(all.user.name, user_path(all.user))
      - if all.assigned_to
        = ", assigned to"
        = link_to(all.assignee.name, user_path(all.assignee))
      = "| "

      - if all.bucket == "due_asap"
        %span.urgent= t(:task_due_now)

      - else
        - if all.at_specific_time?
          - if all.due_at < Time.now
            %span.urgent= t("Overdue")
          - else
            = t(:task_due_in, distance_of_time_in_words(Time.now, all.due_at))
            = '(' << l(all.due_at.localtime, :format => :mmddhhss) << ')'


.error
  %h1
    So... you don't know the password? Hmm... You can
    %a{ :href => "/login" } try again
    or
    = succeed "." do
      %a{ :href => "/", :rel => "home" } go back

  %dl
    %dt Er... So... I'm trying to login without a password...
    %dd
      Hey pal, sorry, but I can't let in no one that isn't
      = succeed "." do
        %strong on the list
      I could lose my job you know? You'll have to come up with
      a valid password :-(

    %dt What can I do?
    %dd
      This just means that you can't access some part of this Integrity
      server, but that shouldn't let you out of some of the
      %a{ :href => "/" } awesome projects
      hosted here. If this was just a misunderstanding and you
      %strong do
      have a password, then
      = succeed "." do
        %a{ :href => "/login" } click here to try again

    %dt
      So what the hell is
      = succeed "?" do
        %strong Integrity
    %dd
      Integrity is your friendly
      %a{ :href => "http://en.wikipedia.org/wiki/Continuous_integration" } Continuous Integration
      server. If you want to know more about us, check our website at
      = succeed "." do
        %a{ :href => "http://integrityapp.com" } integrityapp.com

Fix typo in 401 error screen

.error
  %h1
    So... you don't know the password? Hmm... You can
    %a{ :href => "/login" } try again
    or
    = succeed "." do
      %a{ :href => "/", :rel => "home" } go back

  %dl
    %dt Er... So... I'm trying to login without a password...
    %dd
      Hey pal, sorry, but I can't let in anyone that isn't
      = succeed "." do
        %strong on the list
      I could lose my job you know? You'll have to come up with
      a valid password :-(

    %dt What can I do?
    %dd
      This just means that you can't access some part of this Integrity
      server, but that shouldn't let you out of some of the
      %a{ :href => "/" } awesome projects
      hosted here. If this was just a misunderstanding and you
      %strong do
      have a password, then
      = succeed "." do
        %a{ :href => "/login" } click here to try again

    %dt
      So what the hell is
      = succeed "?" do
        %strong Integrity
    %dd
      Integrity is your friendly
      %a{ :href => "http://en.wikipedia.org/wiki/Continuous_integration" } Continuous Integration
      server. If you want to know more about us, check our website at
      = succeed "." do
        %a{ :href => "http://integrityapp.com" } integrityapp.com


%h1= Investigation.display_name.pluralize

%table
  %tr
    %th= Investigation.display_name.pluralize
    %th Usage Count
  - @investigations.each do |investigation|
    %tr{:style=>"background-color: #{cycle("#FFF", "#EEE")}"}
      %td= investigation.name
      %td= investigation.offerings_count

Hide usage count in print view

%h1= Investigation.display_name.pluralize

%table
  %tr
    %th= Investigation.display_name.pluralize
    %th Usage Count
  - @investigations.each do |investigation|
    %tr{:style=>"background-color: #{cycle("#FFF", "#EEE")}"}
      %td= investigation.name
      - unless session[:include_usage_count].blank?
        %td= investigation.offerings_count


%ul.nav.navbar-nav
  %li{:class => get_nav_link_class('dashboards') }
    = link_to dashboards_path do
      %i.fa.fa-home.fa-2x

  -# render the engine main nav components if there are any
  - SystemConfig.transam_module_names.each do |mod|
    = render :partial => "shared/#{mod}_main_nav" rescue nil

  -# render the application main nav components if there are any
  = render :partial => 'shared/app_main_nav' rescue nil

  = render 'shared/policy_nav'
  = render 'shared/forms_nav'
  = render 'shared/reports_nav'

  - if current_user.has_role? :admin
    = render 'shared/admin_nav'

Fix issue rendering main nav

%ul.nav.navbar-nav
  %li{:class => get_nav_link_class('dashboards') }
    = link_to dashboards_path do
      %i.fa.fa-home.fa-2x

  -# render the engine main nav components if there are any
  - SystemConfig.transam_module_names.each do |mod|
    - view_component = "#{mod}_main_nav"
    - Rails.logger.debug "Checking for #{view_component}: Results = #{lookup_context.template_exists?(view_component, 'shared', true)}"
    - if lookup_context.template_exists?(view_component, 'shared', true)
      = render :partial => "shared/#{view_component}"

  -# render the application main nav components if there are any
  - view_component = "app_main_nav"
  - Rails.logger.debug "Checking for #{view_component}: Results = #{lookup_context.template_exists?(view_component, 'shared', true)}"
  - if lookup_context.template_exists?(view_component, 'shared', true)
    = render :partial => "shared/#{view_component}"

  = render 'shared/policy_nav'
  = render 'shared/forms_nav'
  = render 'shared/reports_nav'

  - if current_user.has_role? :admin
    = render 'shared/admin_nav'


- content_for(:javascript) do
  :javascript
    $(function() {
      ko.applyBindings(new StaffPlanIndex())
    });

- content_for(:fixed_header_section) do
  .list-header
    .single-flexible-column
      %a{data: {bind: "click: sortByName"}} Name
      %a{data: {bind: "click: sortByWorkload"}} Workload
      %a{data: {bind: "attr: { href: nextPreviousWeeks().previous}"}} Previous

    .date-range-columns.width-filling-container{data: {bind: "foreach: weekRange"}}
      %date-range-column-header{params: "week: $data"}

    .assignment-totals
      %a{data: {bind: "attr: { href: nextPreviousWeeks().next}"}} Next

%ul.user-list.flexible-list{data: {bind: "foreach: users"}}
  %li.user.box{data: {bind: "component: {name: 'user-aggregate-chart', params: {user: $data, weekRange: $parent.weekRange}}"}}

%script{type: "application/json", id: "users"}
  = ActiveModel::ArraySerializer.new(@users, each_serializer: StaffplanListSerializer).to_json.html_safe

Add href attributes so browsers show the pointer mouse icon.

- content_for(:javascript) do
  :javascript
    $(function() {
      ko.applyBindings(new StaffPlanIndex())
    });

- content_for(:fixed_header_section) do
  .list-header
    .single-flexible-column
      %a{href: '#', data: {bind: "click: sortByName"}} Name
      %a{href: '#', data: {bind: "click: sortByWorkload"}} Workload
      %a{data: {bind: "attr: { href: nextPreviousWeeks().previous}"}} Previous

    .date-range-columns.width-filling-container{data: {bind: "foreach: weekRange"}}
      %date-range-column-header{params: "week: $data"}

    .assignment-totals
      %a{data: {bind: "attr: { href: nextPreviousWeeks().next}"}} Next

%ul.user-list.flexible-list{data: {bind: "foreach: users"}}
  %li.user.box{data: {bind: "component: {name: 'user-aggregate-chart', params: {user: $data, weekRange: $parent.weekRange}}"}}

%script{type: "application/json", id: "users"}
  = ActiveModel::ArraySerializer.new(@users, each_serializer: StaffplanListSerializer).to_json.html_safe


.row
  .span6
    %h1 Impressum
    .description Verantwortlich für den Inhalt dieser Seiten zeichnen sich:
    %br
    %address#jgraichen
      .name Jan Graichen
      .address Stahnsdorfer Str. 144a
      .city DE-14482 Potsdam
    %br
    %address#kfabian
      .name Kai Fabian
      .address Frankenhauser Str. 37
      .city DE-12249 Berlin
    %br
    %address#mspringer
      .name Matthias Springer
      .address Stahnsdorfer Str. 144c
      .city DE-14482 Potsdam
    %br
    %address#cnicolai
      .name Christian Nicolai

Add impressum in box; add info mail link

.row
  .span6.box
    %h1 Impressum
    .description Verantwortlich für den Inhalt dieser Seiten zeichnen sich:
    %br
    %address#jgraichen
      .name Jan Graichen
      .address Stahnsdorfer Str. 144a
      .city DE-14482 Potsdam
    %br
    %address#kfabian
      .name Kai Fabian
      .address Frankenhauser Str. 37
      .city DE-12249 Berlin
    %br
    %address#mspringer
      .name Matthias Springer
      .address Stahnsdorfer Str. 144c
      .city DE-14482 Potsdam
    %br
    %address#cnicolai
      .name Christian Nicolai

  .span6.box
    Du hast Kritik oder Anregung für uns? Dann schreib uns einfach ein Nachricht an
    %a(href="info@openmensa.org")


%tr[account]
  %td= account.code
  %td= account.title

  - for @date in @dates
    %td.currency
      = link_to currency_fmt(account.saldo(@date)), account_path(account, :by_value_period => @date.respond_to?(:first) ? {:from => @date.first.to_s(:db), :to => @date.last.to_s(:db)} : {:to => @date.to_s(:db)}), 'data-href-container' => 'tr'

Mark balance/profit sheet rows with .zero_balance class if needed.

- zero_balance_row = @dates.select{|date| account.saldo(@date) != 0.0}.empty?

%tr[account]{:class => (zero_balance_row ? 'zero_balance' : '')}
  %td= account.code
  %td= account.title

  - for @date in @dates
    %td.currency
      = link_to currency_fmt(account.saldo(@date)), account_path(account, :by_value_period => @date.respond_to?(:first) ? {:from => @date.first.to_s(:db), :to => @date.last.to_s(:db)} : {:to => @date.to_s(:db)}), 'data-href-container' => 'tr'


- content_for :head_javascripts do
  = javascript_include_tag "/control_center/javascripts/jquery.flot.js"
  = javascript_include_tag "/control_center/javascripts/jquery.flot.stack.js"
  = javascript_include_tag "/control_center/javascripts/jquery.flot.resize.js"
  = javascript_include_tag "/control_center/javascripts/statistics.js"

#content
  .panels.thick-border
    .panel.wide.border
      %h3
        Visits in Past 24 Hours
      .graph
        #recent-visits{:style => "width: 100%; height: 200px;"}

  .panels.clearfix
    .panel.visits-1-hour
      .thick-border
        .border
          %h3 Visits In Past Hour
          %p.big-number
    .panel.popular-pages
      .thick-border
        .border
          %h3 Popular Pages
          %ul
    .panel.server.edge
      .thick-border
        .border
          %h3 Server
          %ul

Include excanvas for IE8 and below.

- content_for :head_javascripts do
  /[if lte IE 8]
    = javascript_include_tag "/control_center/javascripts/excanvas.js"
  = javascript_include_tag "/control_center/javascripts/jquery.flot.js"
  = javascript_include_tag "/control_center/javascripts/jquery.flot.stack.js"
  = javascript_include_tag "/control_center/javascripts/jquery.flot.resize.js"
  = javascript_include_tag "/control_center/javascripts/statistics.js"

#content
  .panels.thick-border
    .panel.wide.border
      %h3
        Visits in Past 24 Hours
      .graph
        #recent-visits{:style => "width: 100%; height: 200px;"}

  .panels.clearfix
    .panel.visits-1-hour
      .thick-border
        .border
          %h3 Visits In Past Hour
          %p.big-number
    .panel.popular-pages
      .thick-border
        .border
          %h3 Popular Pages
          %ul
    .panel.server.edge
      .thick-border
        .border
          %h3 Server
          %ul


!!!
%html
%head
  %title DbdDataEngine
  = stylesheet_link_tag 'dbd_data_engine/application'
  = csrf_meta_tags
%body
  = yield

Fix the haml layout (silly bug ...)


.container-lg.container--main
  .row.justify-content-center
    .col-md-5.totp-setup__recovery-container
      .card
        .card-body
          .d-none.d-print-block.totp-setup__recovery-icon
            %i.fa.fa-comments
          %h1.totp-setup__recovery-title Your Retrospring recovery codes

          %ul.totp-setup__recovery-codes
            - @recovery_keys.each do |key|
              %li
                %code= key.code
          .d-none.d-print-block These codes were generated #{Time.now.strftime('%F at %T %Z')}
        .card-footer.d-print-none
          We recommend storing these in a password manager or printing them out on paper.
          %br
          %a.btn{ onclick: 'print()' }
            %i.fa.fa-print
            Print
        .d-none.d-print-block.text-success
          %i.fa.fa-tree
          Please consider the environment before printing this page.

Add translations for recovery key view

.container-lg.container--main
  .row.justify-content-center
    .col-md-5.totp-setup__recovery-container
      .card
        .card-body
          .d-none.d-print-block.totp-setup__recovery-icon
            %i.fa.fa-comments
          %h1.totp-setup__recovery-title= t(".heading", app_name: APP_CONFIG['site_name'])

          %ul.totp-setup__recovery-codes
            - @recovery_keys.each do |key|
              %li
                %code= key.code
          .d-none.d-print-block= t(".generated_at", time: l(Time.now))
        .card-footer.d-print-none
          = t(".recommendation")
          %br
          %a.btn{ onclick: "print()" }
            %i.fa.fa-print
            = t(".print")
        .d-none.d-print-block.text-success
          %i.fa.fa-tree
          = t(".consideration")


%h1= report.class.name.titleize

%table
  %thead
    %tr
      - report.results.headers.each do |header|
        %th= Dossier::Formatter.titleize(header)
  %tbody
    - report.results.body.each do |row|
      %tr
        - row.each do |value|
          %td= value

  - if report.results.footers.any?
    %tfoot
      - report.results.footers.each do |row|
        %tr
          - row.each do |value|
            %th= value

= link_to 'Download CSV', dossier_report_path(format: 'csv', options: report.options, report: report.class.report_name), class: 'download-csv'

Move 'Download CSV' to top of show view

%h1= report.class.name.titleize

= link_to 'Download CSV', dossier_report_path(format: 'csv', options: report.options, report: report.class.report_name), class: 'download-csv'

%table
  %thead
    %tr
      - report.results.headers.each do |header|
        %th= Dossier::Formatter.titleize(header)
  %tbody
    - report.results.body.each do |row|
      %tr
        - row.each do |value|
          %td= value

  - if report.results.footers.any?
    %tfoot
      - report.results.footers.each do |row|
        %tr
          - row.each do |value|
            %th= value


:markdown
  The [Poltergeist](https://github.com/teampoltergeist/poltergeist) Gem provides a PhantomJS driver for [Capybara](https://github.com/jnicklas/capybara).

  To install it, add `poltergeist` to your scraper Gemfile:
:coderay
  #!ruby
  gem "poltergeist"

:markdown
  Then in your scraper start a Capybara session using Poltergeist:
:coderay
  #!ruby
  require 'capybara/poltergeist'

  capybara = Capybara::Session.new(:poltergeist)
  # Start scraping
  capybara.visit("https://morph.io/")

Use double quotes by default

:markdown
  The [Poltergeist](https://github.com/teampoltergeist/poltergeist) Gem provides a PhantomJS driver for [Capybara](https://github.com/jnicklas/capybara).

  To install it, add `poltergeist` to your scraper Gemfile:
:coderay
  #!ruby
  gem "poltergeist"

:markdown
  Then in your scraper start a Capybara session using Poltergeist:
:coderay
  #!ruby
  require "capybara/poltergeist"

  capybara = Capybara::Session.new(:poltergeist)
  # Start scraping
  capybara.visit("https://morph.io/")


- if stack_item.topchoice or stack_item.prices
  .card__tags
    - if stack_item.prices
      - if stack_item.prices[currency.to_s].present? && stack_item.prices[currency.to_s] > 0
        .tag.tag--price
          .tag--price__inner
            .tag--price__values
              from
              .tag--price__amount<
                %span.tag--price__currency
                  = raw(currency.to_symbol)
                %span.js-price
                  = stack_item.prices[currency.to_s].ceil
            - if stack_item.on_sale?
              - if stack_item.retail_prices[currency.to_s].present? && stack_item.retail_prices[currency.to_s] > 0
                .tag--price__original<
                  = raw(currency.to_symbol)
                  = stack_item.retail_prices[currency.to_s].ceil
    - if stack_item.topchoice
      .tag.tag--badge.tag--top-choice
        %span.tag--badge__content
          Top Choice

Update TTD price tags to use new UI component

- if stack_item.topchoice or stack_item.prices
  .card__tags
    - if stack_item.prices

      - if stack_item.prices[currency.to_s].present? && stack_item.prices[currency.to_s] > 0
        - price = stack_item.prices[currency.to_s].ceil
      - if stack_item.on_sale?
        - if stack_item.retail_prices[currency.to_s].present? && stack_item.retail_prices[currency.to_s] > 0
          - retail_price = stack_item.retail_prices[currency.to_s].ceil
        - else
          - retail_price = nil

        = ui_component('price_tag', properties: { currency: raw(currency.to_symbol), price: price, retail_price: retail_price })

    - if stack_item.topchoice
      .tag.tag--badge.tag--top-choice
        %span.tag--badge__content
          Top Choice


= form.input :first_name, :disabled => @ldap_user
= form.input :last_name, :disabled => @ldap_user
= form.input :email, :disabled => @ldap_user, :required => @user.local_user?
= form.input :username, :disabled => @ldap_user
= form.input :password, :disabled => @ldap_user, :required => @user.check_password?
= form.input :password_confirmation, :disabled => @ldap_user, :required => @user.check_password?
- if check_privilege(Privilege::MODIFY, User)
  = form.fields_for :quota do |quota_form|
    = quota_form.input :maximum_running_instances

Use unlimited numeric input on users/form for quota

= form.input :first_name, :disabled => @ldap_user
= form.input :last_name, :disabled => @ldap_user
= form.input :email, :disabled => @ldap_user, :required => @user.local_user?
= form.input :username, :disabled => @ldap_user
= form.input :password, :disabled => @ldap_user, :required => @user.check_password?
= form.input :password_confirmation, :disabled => @ldap_user, :required => @user.check_password?
- if check_privilege(Privilege::MODIFY, User)
  = form.fields_for :quota do |quota_form|
    = quota_form.input :maximum_running_instances, :as => :numeric_input_with_unlimited_check_box


= javascript_include_tag "split_account_splits"

%h4 Subaccounts

%div{data: {subaccounts: true}}
  = f.nested_fields_for :splits, class_name: "SplitAccounts::Split" do |ff|
    .well
      = ff.input :subaccount_id, collection: SplitAccounts::Split.available_subaccounts, wrapper_html: {class: "input-inline"}
      = ff.input :percent, input_html: {min: 0, max: 100, data: {percent: true}}, wrapper_html: {class: "input-inline"}
      = ff.input :extra_penny, wrapper_html: {class: "input-inline"}
      = ff.remove_nested_fields_link "Remove", class: "btn", wrapper_html: {class: "input-inline"}

%p
  = f.add_nested_fields_link :splits, "Add another subaccount", class: "btn btn-success"

%br

Add chosen to split account dropdown

= javascript_include_tag "split_account_splits"

%h4 Subaccounts

%div{data: {subaccounts: true}}
  = f.nested_fields_for :splits, class_name: "SplitAccounts::Split" do |ff|
    .well
      = ff.input :subaccount_id, collection: SplitAccounts::Split.available_subaccounts, wrapper_html: {class: "input-inline"}, input_html: {class: "js--chosen"}
      = ff.input :percent, input_html: {min: 0, max: 100, data: {percent: true}}, wrapper_html: {class: "input-inline"}
      = ff.input :extra_penny, wrapper_html: {class: "input-inline"}
      = ff.remove_nested_fields_link "Remove", class: "btn", wrapper_html: {class: "input-inline"}

%p
  = f.add_nested_fields_link :splits, "Add another subaccount", class: "btn btn-success"

%br

:coffee
  $(document).on "fields_added.nested_form_fields", (event, param) ->
    $(event.target).find(".js--chosen").chosen()


.content{ "darker-background" => true }
  .row.footer-pad
    .small-12.columns
      %strong
        = t '.require_customer_login'
      %p
      - if spree_current_user.nil?
        %p
          = t('.require_login_html', login: ('' + t('.login') + '').html_safe, signup: ('' + t('.signup') + '').html_safe)
        %p
          = t('.require_login_2_html', contact: link_to(t('.contact'), '#contact'), enterprise: current_distributor.name)
      - else
        = t('.require_customer_html', contact: link_to(t('.contact'), '#contact'), enterprise: current_distributor.name)

Add LoginModal as controller + connect action to open login modal

.content{ "darker-background" => true }
  .row.footer-pad
    .small-12.columns{ "data-controller": "login-modal" }
      %strong
        = t '.require_customer_login'
      %p
      - if spree_current_user.nil?
        %p
          = t('.require_login_html', login: ('login-modal#call">' + t('.login') + '').html_safe, signup: ('login-modal#call">' + t('.signup') + '').html_safe)
        %p
          = t('.require_login_2_html', contact: link_to(t('.contact'), '#contact'), enterprise: current_distributor.name)
      - else
        = t('.require_customer_html', contact: link_to(t('.contact'), '#contact'), enterprise: current_distributor.name)


- display_name = field.association[:pretty_name]
- model_name   = field.association[:name]
- associations = [field.bindings[:object].send(model_name)].flatten.compact

%div.label= field.label
%div.value
  %ul
    - associations.each do |association|
      %li= link_to "#{display_name.singularize} ##{association.id}", rails_admin_show_path(:model_name => model_name.downcase, :id => association.id)

Fix 'undefined method downcase for Symbol' for Ruby 1.8.7/REE

- display_name = field.association[:pretty_name]
- model_name   = field.association[:name]
- associations = [field.bindings[:object].send(model_name)].flatten.compact

%div.label= field.label
%div.value
  %ul
    - associations.each do |association|
      %li= link_to "#{display_name.singularize} ##{association.id}", rails_admin_show_path(:model_name => model_name.to_s.downcase, :id => association.id)


.padding-for-small
  %h2 Sign up for company account
  = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { 'data-behavior' => 'turbolinks-form' }) do |f|
    = render partial: 'errors', locals: { object: f.object }
    .form-inputs
      = f.input :email, required: true, autofocus: true
      = f.input :password, required: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length)
      = f.input :password_confirmation, required: true
      = f.input :name, label: "Company name"
    .form-actions
      = f.button :submit, "Sign up"
  = render "devise/shared/links"

Add TOS acceptance to Company registration form

.padding-for-small
  %h2 Sign up for company account
  = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { 'data-behavior' => 'turbolinks-form' }) do |f|
    = render partial: 'errors', locals: { object: f.object }
    .form-inputs
      = f.input :email, required: true, autofocus: true
      = f.input :password, required: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length)
      = f.input :password_confirmation, required: true
      = f.input :name, label: "Company name"
    .form-actions
      = render 'acceptance_fields', f: f
      = f.submit t('registrations.step1.submit'), class: 'button primary expanded', id: 'submit_button', disabled: true
  = render "devise/shared/links"


- if item.product_subscription?
  - item_address_id = "#{item.id}-address"
  %fieldset{ id: item_address_id, class: 'js-shipping-address', data: { hook: '' } }
    = form.fields_for :line_items, item do |item_form|
      %legend{ align: 'center' }= "#{item.product.name} - #{item.id}"
      = check_box_tag "#{item_address_id}-checkbox", '1', true,
        class: 'same-as-billing'
      = label_tag "#{item_address_id}-checkbox",
        Spree.t(:use_billing_address),
        class: 'same-as-billing'
      = item_form.fields_for :ship_address, item.build_default_ship_address do |ship_form|
        = render partial: 'spree/address/form', locals: { form: ship_form,
                                                          address_type: 'shipping',
                                                          address: item.ship_address,
                                                          address_id: item_address_id }

Add gift fields on top on each subscription address

- if item.product_subscription?
  - item_address_id = "#{item.id}-address"
  %fieldset{ id: item_address_id, class: 'js-shipping-address', data: { hook: '' } }
    = form.fields_for :line_items, item do |item_form|
      %legend{ align: 'center' }= "#{item.product.name} - #{item.id}"
      = item_form.check_box :gift, class: 'is-a-gift'
      = item_form.label :gift, Spree.t(:is_it_a_gift?)
      .gift-fields{ style: "#{ is_a_gift(item.gift) }"}
        %p.field
          = item_form.label :gift_name
          %br
          = item_form.text_field :gift_name
        %p.field
          = item_form.label :gift_email
          %br
          = item_form.text_field :gift_email
        %p.field
          = item_form.label :gift_message
          %br
          = item_form.text_area :gift_message
      %br
      = check_box_tag "#{item_address_id}-checkbox", '1', true,
        class: 'same-as-billing'
      = label_tag "#{item_address_id}-checkbox",
        Spree.t(:use_billing_address),
        class: 'same-as-billing'
      = item_form.fields_for :ship_address, item.build_default_ship_address do |ship_form|
        = render partial: 'spree/address/form', locals: { form: ship_form,
                                                          address_type: 'shipping',
                                                          address: item.ship_address,
                                                          address_id: item_address_id }


- note = notes.first # example note
-# Check if line want not changed since comment was left
- if !defined?(line) || line == note.diff_line
  %tr.notes_holder
    %td.notes_line{ colspan: 2 }
      %span.discussion-notes-count
        %i.fa.fa-comment
        = notes.count
    %td.notes_content
      %ul.notes{ data: { discussion_id: note.discussion_id } }
        = render notes
      .discussion-reply-holder
        = link_to_reply_diff(note)

Remove comment count & icon

- note = notes.first # example note
-# Check if line want not changed since comment was left
- if !defined?(line) || line == note.diff_line
  %tr.notes_holder
    %td.notes_line{ colspan: 2 }
    %td.notes_content
      %ul.notes{ data: { discussion_id: note.discussion_id } }
        = render notes
      .discussion-reply-holder
        = link_to_reply_diff(note)


''%li.clearfix
  .avatar{:style => "background: url(#{gravatar_url_for_user(status.user, 48)});"}
  %div.activity
    %span.text= auto_link(status.text)
    %span= status.user.name if status.user
    %span= timeago(status.created_at)
    %span.white
      = link_to "via #{status.source}", status.link if status.link.present?

Revert "Auto link the status text." due to a typo.

%li.clearfix
  .avatar{:style => "background: url(#{gravatar_url_for_user(status.user, 48)});"}
  %div.activity
    %span.text= status.text
    %span= status.user.name if status.user
    %span= timeago(status.created_at)
    %span.white
      = link_to "via #{status.source}", status.link if status.link.present?


- if logged_in?
  %nav
    %ul.nav.nav-pills
      %li
        = link_to 'Dashboard', dashboard_path
      %li
        = link_to 'Profile', user_path(current_user)
      %li
        = link_to 'Preferences', email_path

      %li.pull-right
        = link_to 'Logout', logout_path

- else # Just for padding
  .faulx-nav

Add "All Projects" link to navigation

- if logged_in?
  %nav
    %ul.nav.nav-pills
      %li
        = link_to 'All Projects', projects_path
      %li
        = link_to 'Dashboard', dashboard_path
      %li
        = link_to 'Profile', user_path(current_user)
      %li
        = link_to 'Preferences', email_path

      %li.pull-right
        = link_to 'Logout', logout_path

- else # Just for padding
  .faulx-nav


#select_charts
  - @groups.each_pair do |group, charts|
    %h1= t("chart_group.#{group.downcase}")
    - if charts.is_a?(Array)
      = render 'chart_preview', charts: charts

    - elsif charts.is_a?(Hash)
      - charts.each_pair do |sub_group, charts|
        - if sub_group.present?
          %h2= t("chart_sub_group.#{sub_group.downcase}")
        = render 'chart_preview', charts: charts

Allow use of HTML in chart categories

#select_charts
  - @groups.each_pair do |group, charts|
    %h1= t("chart_group.#{group.downcase}").html_safe
    - if charts.is_a?(Array)
      = render 'chart_preview', charts: charts

    - elsif charts.is_a?(Hash)
      - charts.each_pair do |sub_group, charts|
        - if sub_group.present?
          %h2= t("chart_sub_group.#{sub_group.downcase}").html_safe
        = render 'chart_preview', charts: charts


- if controller_name != 'sessions'
  = link_to "Sign in", new_session_path(resource_name)
  %br/
- if devise_mapping.registerable? && controller_name != 'registrations'
  = link_to "Sign up", new_registration_path(resource_name)
  %br/
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
  = link_to "Forgot your password?", new_password_path(resource_name)
  %br/
- if devise_mapping.confirmable? && controller_name != 'confirmations'
  = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
  %br/
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
  = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
  %br/
- if devise_mapping.omniauthable?
  - resource_class.omniauth_providers.each do |provider|
    = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider)
    %br/

Check if provider is enabled before adding link

- if controller_name != 'sessions'
  = link_to "Sign in", new_session_path(resource_name)
  %br/
- if devise_mapping.registerable? && controller_name != 'registrations'
  = link_to "Sign up", new_registration_path(resource_name)
  %br/
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
  = link_to "Forgot your password?", new_password_path(resource_name)
  %br/
- if devise_mapping.confirmable? && controller_name != 'confirmations'
  = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
  %br/
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
  = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
  %br/
- if devise_mapping.omniauthable?
  - resource_class.omniauth_providers.each do |provider|
    - if eval("#{provider.upcase}_ENABLED")
      = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider)
    %br/