- if ldap_enable?
  = render :partial => 'devise/sessions/new_ldap'
- else
  = form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f|
    = image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo"
    = f.email_field :email, :class => "text top", :placeholder => "Email"
    = f.password_field :password, :class => "text bottom", :placeholder => "Password"
    - if devise_mapping.rememberable?
      .clearfix.inputs-list
        %label.checkbox.remember_me{:for => "user_remember_me"}
          = f.check_box :remember_me
          %span Remember me
    %br/
    = f.submit "Sign in", :class => "primary btn wide"
    .right
      = render :partial => "devise/shared/links"
    .clearfix
    - if devise_mapping.omniauthable? && resource_class.omniauth_providers.present?
      %div
        - resource_class.omniauth_providers.each do |provider|
          %span
            = link_to authbutton(provider, 32), omniauth_authorize_path(resource_name, provider)

Add autofocus attribute to sign-in email field

- if ldap_enable?
  = render :partial => 'devise/sessions/new_ldap'
- else
  = form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f|
    = image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo"
    = f.email_field :email, :class => "text top", :placeholder => "Email", :autofocus => "autofocus"
    = f.password_field :password, :class => "text bottom", :placeholder => "Password"
    - if devise_mapping.rememberable?
      .clearfix.inputs-list
        %label.checkbox.remember_me{:for => "user_remember_me"}
          = f.check_box :remember_me
          %span Remember me
    %br/
    = f.submit "Sign in", :class => "primary btn wide"
    .right
      = render :partial => "devise/shared/links"
    .clearfix
    - if devise_mapping.omniauthable? && resource_class.omniauth_providers.present?
      %div
        - resource_class.omniauth_providers.each do |provider|
          %span
            = link_to authbutton(provider, 32), omniauth_authorize_path(resource_name, provider)


%html
  %head
    %title= @page_title ? "#{t(:appname)} - #{@page_title}" : t(:appname)
    = stylesheet_link_tag    "application", media: "all"
    = stylesheet_link_tag    "//cloud.typography.com/7425452/678642/css/fonts.css", media: "all"
    = javascript_include_tag "application"
    = csrf_meta_tags
  %body{ style: 'padding  :0px;' }
    - if !phone? || !@script_level
      = render partial: 'layouts/header'
    - if @full_width
      .full_container
        = yield
    - else
      .container.main{ style: 'padding: 10px;'}
        - if notice
          %p#notice= notice
        - if alert
          %p#alert= alert

        = yield
    = render partial: 'layouts/footer'

    = yield :body_scripts

    = render partial: 'layouts/analytics'

Add viewport for mobile tweaking.

%html
  %head
    %title= @page_title ? "#{t(:appname)} - #{@page_title}" : t(:appname)
    = tag :meta, name: "viewport"
    = stylesheet_link_tag    "application", media: "all"
    = stylesheet_link_tag    "//cloud.typography.com/7425452/678642/css/fonts.css", media: "all"
    = javascript_include_tag "application"
    = csrf_meta_tags
  %body{ style: 'padding  :0px;' }
    - if !phone? || !@script_level
      = render partial: 'layouts/header'
    - if @full_width
      .full_container
        = yield
    - else
      .container.main{ style: 'padding: 10px;'}
        - if notice
          %p#notice= notice
        - if alert
          %p#alert= alert

        = yield
    = render partial: 'layouts/footer'

    = yield :body_scripts

    = render partial: 'layouts/analytics'


!!!
%html
  %head
    %title= title_content(yield(:title))
    %meta{:charset => "UTF-8"}
    -if controller.action_name == 'show' && controller.controller_name == "lessons"
      = yield :meta
    -else
      =render "social_media/meta"
    = stylesheet_link_tag    "application", :media => "all"
    = javascript_include_tag "application"
    %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}/
    = render "layouts/google_analytics"
    =csrf_meta_tags
  %body
    =render "social_media/fb_header"
    =render :partial => "layouts/header"
    .content
      .left-column
        = yield :left_column
      .center-column
        - flash.each do |name, msg|
          - if msg.is_a?(String)
            .flash{class: name}= msg
        -if controller.controller_name == "home" and controller.action_name == "index"
          = yield
        -else
          .announce
            = yield
      .right-column
        = yield :right_column
    = render :partial => "layouts/footer"
    = render :partial => "devise/login_modal"

    =yield :scripts

Add IDL campaign banner javascript

!!!
%html
  %head
    %title= title_content(yield(:title))
    %meta{:charset => "UTF-8"}
    -if controller.action_name == 'show' && controller.controller_name == "lessons"
      = yield :meta
    -else
      =render "social_media/meta"
    = stylesheet_link_tag    "application", :media => "all"
    = javascript_include_tag "application"
    %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}/
    = render "layouts/google_analytics"
    =csrf_meta_tags
  %body
    =render "social_media/fb_header"
    =render :partial => "layouts/header"
    .content
      .left-column
        = yield :left_column
      .center-column
        - flash.each do |name, msg|
          - if msg.is_a?(String)
            .flash{class: name}= msg
        -if controller.controller_name == "home" and controller.action_name == "index"
          = yield
        -else
          .announce
            = yield
      .right-column
        = yield :right_column
    = render :partial => "layouts/footer"
    = render :partial => "devise/login_modal"

    =yield :scripts
    :javascript
      window._idl={};_idl.variant="banner";(function(){var e=document.createElement("script");e.type="text/javascript";e.async=true;e.src=("https:"==document.location.protocol?"https://":"http://")+"members.internetdefenseleague.org/include/?url="+(_idl.url||"")+"&campaign="+(_idl.campaign||"")+"&variant="+(_idl.variant||"banner");document.getElementsByTagName("body")[0].appendChild(e)})()


- users_last_reservation = current_user.reservations.last
- if users_last_reservation && users_last_reservation.past?
  - if users_last_reservation.inactive_too_long?
    .row
      .col-md-12
        .alert.alert-danger
          %h4
            = link_to("Your previous reservation", reservation_path(users_last_reservation))
            expired due to inactivity. If you need more than #{users_last_reservation.inactive_minute_limit} minutes to get people on your server, press the "idle reset" button to keep your reservation open.

- if !donator?
  - if current_user.reservations.count.between?(10, 100)
    .row
      .col-md-12
        .donate.alert.alert-danger
          - duration = (current_user.total_reservation_seconds / 3600.0).round
          %h4
            Hi there! You've made #{duration} hours worth of reservations so far, have you considered buying premium to keep this service running?
            = render "shared/paypal_button"

  - if current_user.reservations.count > 100
    .row
      .col-md-12
        .donate.alert.alert-danger
          %h4
            Wow, you've made more than 100 reservations! You must really like us! Please buy PREMIUM to help us keep this service alive!
            = render "shared/paypal_button"

Change nag message a bit

- users_last_reservation = current_user.reservations.last
- if users_last_reservation && users_last_reservation.past?
  - if users_last_reservation.inactive_too_long?
    .row
      .col-md-12
        .alert.alert-danger
          %h4
            = link_to("Your previous reservation", reservation_path(users_last_reservation))
            expired due to inactivity. If you need more than #{users_last_reservation.inactive_minute_limit} minutes to get people on your server, press the "idle reset" button to keep your reservation open.

- if !donator?
  - if current_user.reservations.count.between?(10, 100)
    .row
      .col-md-12
        .donate.alert.alert-danger
          - duration = (current_user.total_reservation_seconds / 3600.0).round
          %h4
            Hi there! You've made #{duration} hours worth of reservations so far, have you considered buying premium to keep this service running?
            = render "shared/paypal_button"

  - if current_user.reservations.count > 100
    .row
      .col-md-12
        .donate.alert.alert-danger
          %h4
            Wow, you've made more than 100 reservations! Please buy PREMIUM to help us keep this service alive!
            = render "shared/paypal_button"


%p= "Hello #{@resource.email}!"
%p Someone has requested a link to change your password, and you can do this through the link below.
%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token)
%p If you didn't request this, please ignore this email.
%p Your password won't change until you access the link above and create a new one.

Fix reset password instructions e-mail

%p= "Hello #{@resource.email}!"
%p Someone has requested a link to change your password, and you can do this through the link below.
%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token)
%p If you didn't request this, please ignore this email.
%p Your password won't change until you access the link above and create a new one.


.container
  %h1= @alert.type

  %h3 Timestamp
  %p= @alert.created_at

  %h3 User
  %p= link_to @alert.user.username, "/users/#{@alert.user.url_encoded_username}" if @alert.user

  %h3 Subject
  %p= @alert.main_subject

  %h3 message
  %p= @alert.message

  -if @alert.resolvable?
    %h3 Resolve Status
    %p= @alert.resolved? ? 'Resolved' : link_to('Resolve', resolve_alert_path(@alert.id), method: :put)

Add link to article from Alert web view

.container
  %h1= @alert.type

  %h3 Timestamp
  %p= @alert.created_at

  %h3 User
  %p= link_to @alert.user.username, "/users/#{@alert.user.url_encoded_username}" if @alert.user

  %h3 Subject
  %p= @alert.main_subject

  - if @alert.article
    %h3 Article link
    %p= link_to @alert.article.title, article_url(@alert.article) if @alert.article

  %h3 message
  %p= @alert.message

  -if @alert.resolvable?
    %h3 Resolve Status
    %p= @alert.resolved? ? 'Resolved' : link_to('Resolve', resolve_alert_path(@alert.id), method: :put)


- if can? :destroy, @scraper
  .panel.panel-danger
    .panel-heading
      %h3.panel-title Here be dragons!
    .panel-body
      %p
        = button_to "Clear database", clear_scraper_path(@scraper), {class: "btn btn-danger", data: {confirm: "All your data will be gone!"}}
      %p
        = button_to "Delete scraper", @scraper, {method: :delete, class: "btn btn-danger", data: {confirm: "Delete #{@scraper.full_name}?"}}
      %p These can't be undone

Make sure users don't miss the important message

- if can? :destroy, @scraper
  .panel.panel-danger
    .panel-heading
      %h3.panel-title Here be dragons!
    .panel-body
      %p These can't be undone
      %p
        = button_to "Clear database", clear_scraper_path(@scraper), {class: "btn btn-danger", data: {confirm: "All your data will be gone!"}}
      %p
        = button_to "Delete scraper", @scraper, {method: :delete, class: "btn btn-danger", data: {confirm: "Delete #{@scraper.full_name}?"}}


#menu
  .pure-menu.pure-menu-open
    = link_to Setting.ctf_name, root_path, class: 'pure-menu-heading'
    %ul
      %li= link_to 'Announcements', posts_path
      %li= link_to 'Rules', rules_path
      %li= link_to 'Ranking', ranking_path
      %li= link_to 'Teams', teams_path
    - if player_signed_in?
      %ul
        %li= link_to 'Challenges', challenges_path
        %li= link_to 'Sign out', destroy_player_session_path, method: :delete
    - else
      %ul
        %li= link_to 'Sign up', new_player_registration_path
        %li= link_to 'Sign in', new_player_session_path
        %li= link_to 'Team Registration', new_team_path
    - if admin_signed_in?
      = link_to 'Admin', admin_path, class: 'pure-menu-heading'
      %ul#admin-menu
        %li= link_to 'Challenges', admin_challenges_path
        %li= link_to 'Players', admin_players_path
        %li= link_to 'Teams', admin_teams_path
        %li= link_to 'Posts', admin_posts_path
        %li= link_to 'Settings', admin_settings_path

Add 'Sign out' link to the menu for admin.

#menu
  .pure-menu.pure-menu-open
    = link_to Setting.ctf_name, root_path, class: 'pure-menu-heading'
    %ul
      %li= link_to 'Announcements', posts_path
      %li= link_to 'Rules', rules_path
      %li= link_to 'Ranking', ranking_path
      %li= link_to 'Teams', teams_path
    - if player_signed_in?
      %ul
        %li= link_to 'Challenges', challenges_path
        %li= link_to 'Sign out', destroy_player_session_path, method: :delete
    - else
      %ul
        %li= link_to 'Sign up', new_player_registration_path
        %li= link_to 'Sign in', new_player_session_path
        %li= link_to 'Team Registration', new_team_path
    - if admin_signed_in?
      = link_to 'Admin', admin_path, class: 'pure-menu-heading'
      %ul#admin-menu
        %li= link_to 'Challenges', admin_challenges_path
        %li= link_to 'Players', admin_players_path
        %li= link_to 'Teams', admin_teams_path
        %li= link_to 'Posts', admin_posts_path
        %li= link_to 'Settings', admin_settings_path
        %li= link_to 'Sign out', destroy_admin_session_path, method: :delete


- item_action ||= lambda{|object| url_for(object)}

%tr[booking.id]
  %td= booking.value_date
  %td
    = link_to booking.title, item_action.call(booking)
    - if booking.comments.present?
      %hr{:style => "height: 1px; margin: 0"}/
      %i= booking.comments
  %td= link_to booking.reference, booking.reference unless booking.reference.nil?
  %td= link_to booking.credit_account.code, account_path(booking.credit_account), :title => booking.credit_account.title unless booking.credit_account.nil?
  %td= link_to booking.debit_account.code, account_path(booking.debit_account), :title => booking.debit_account.title unless booking.debit_account.nil?
  %td.currency= currency_fmt(booking.amount)
  %td.action-links
    = icon_edit_link_to edit_booking_path(booking)
    = icon_delete_link_to booking, booking_path(booking)
    =# link_to image_tag('16x16/copy.png', :title => 'Copy'), copy_booking_path(booking), :remote => true

Fix class/id setting in bookings list item.

- item_action ||= lambda{|object| url_for(object)}

%tr[booking]
  %td= booking.value_date
  %td
    = link_to booking.title, item_action.call(booking)
    - if booking.comments.present?
      %hr{:style => "height: 1px; margin: 0"}/
      %i= booking.comments
  %td= link_to booking.reference, booking.reference unless booking.reference.nil?
  %td= link_to booking.credit_account.code, account_path(booking.credit_account), :title => booking.credit_account.title unless booking.credit_account.nil?
  %td= link_to booking.debit_account.code, account_path(booking.debit_account), :title => booking.debit_account.title unless booking.debit_account.nil?
  %td.currency= currency_fmt(booking.amount)
  %td.action-links
    = icon_edit_link_to edit_booking_path(booking)
    = icon_delete_link_to booking, booking_path(booking)
    =# link_to image_tag('16x16/copy.png', :title => 'Copy'), copy_booking_path(booking), :remote => true


- flash.each do |name, msg|
  - if msg.is_a?(String) and msg.present?
    .alert.alert-dismissable{class: "alert-#{name == :notice ? "success" : "danger"}"}
      %button.close{'data-dismiss' => 'alert', 'aria-hidden' => true} ×
      = msg

Change default alert css class to alert-info

- flash.each do |name, msg|
  - if msg.is_a?(String) and msg.present?
    - type = (['info', 'success', 'warning', 'danger'].include?(name.to_s) ? name : 'info')
    .alert.alert-dismissable{class: "alert-#{type}"}
      %button.close{'data-dismiss' => 'alert', 'aria-hidden' => true} ×
      = msg


%section.company_search.large-8.large-offset-2.medium-10.medium-offset-1.columns
  = form_for companies_path, method: :get, remote: true do |f|
    .row
      .input-group
        = f.text_field :q, name: 'q', id: "company_search_q", placeholder: t('.placeholder'), class: 'input-group-field', autocomplete: 'off', autofocus: !mobile?
        .input-group-button
          = f.button t('.submit'), class: 'button primary expanded search_bar__right'

:javascript
  var previousVal = '';
  document.getElementById('company_search_q').addEventListener('input', e => {
    let currentVal = e.target.value;
    if (currentVal == previousVal) return;
    previousVal = currentVal;
    if (!currentVal) {
      document.getElementById('companies').innerHTML = '';
      document.getElementById('pagination').innerHTML = '';
    }
    $(e.target.form).trigger('submit.rails');
  });

Add timeout before firing requests in company search

%section.company_search.large-8.large-offset-2.medium-10.medium-offset-1.columns
  = form_for companies_path, method: :get, remote: true do |f|
    .row
      .input-group
        = f.text_field :q, name: 'q', id: "company_search_q", placeholder: t('.placeholder'), class: 'input-group-field', autocomplete: 'off', autofocus: !mobile?
        .input-group-button
          = f.button t('.submit'), class: 'button primary expanded search_bar__right'

:javascript
  var previousVal, formTimeout;
  document.getElementById('company_search_q').addEventListener('input', e => {
    let currentVal = e.target.value;
    if (currentVal == previousVal) return;
    previousVal = currentVal;
    clearTimeout(formTimeout);
    formTimeout = setTimeout(function() {
      if (!currentVal) {
        document.getElementById('companies').innerHTML = '';
        document.getElementById('pagination').innerHTML = '';
      }
      $(this).trigger('submit.rails');
    }.bind(e.target.form), 100);
  });


.mid.wide
  .button= link_to 'New newsletter', new_newsletter_path
  %h1 Newsletters

  %table
    %tr
      %th Name
      %th State
      %th Entries
      %th Locale
      %th{:title => 'Subscribers(Deliveries)'}= 'S'
      %th

    - @newsletters.each do |n|
      %tr
        %td
          -# = link_to n.name, edit_newsletter_path(n), :target => 'semi_static_newsletter'
          = link_to n.name, edit_newsletter_path(n)
        %td= SemiStatic::Newsletter::STATE_CODES[n.state].to_s.humanize
        %td
          %ul
            - n.draft_entry_objects.each_with_index do |e, i|
              %li= link_to (i.to_s + ' ' + e.title), edit_entry_path(e)
        %td.number= n.locale.to_s
        %td.number= link_to "#{n.subscribers.count.to_s}(#{n.newsletter_deliveries.delivered.count.to_s})", newsletter_newsletter_deliveries_path(n)
        %td= link_to image_tag('/assets/bin.png'), n, :method => :delete, :data => { :confirm => 'Are you sure?' }

Add tag edit to newletter index

.mid.wide
  .button= link_to 'New newsletter', new_newsletter_path
  %h1 Newsletters

  %table
    %tr
      %th Name
      %th Tag
      %th State
      %th Entries
      %th Locale
      %th{:title => 'Subscribers(Deliveries)'}= 'S'
      %th

    - @newsletters.each do |n|
      %tr
        %td
          -# = link_to n.name, edit_newsletter_path(n), :target => 'semi_static_newsletter'
          = link_to n.name, edit_newsletter_path(n)
        %td
          - unless n.tag.nil?
            = link_to n.tag.name, edit_tag_path(n.tag)
        %td= SemiStatic::Newsletter::STATE_CODES[n.state].to_s.humanize
        %td
          %ul
            - n.draft_entry_objects.each_with_index do |e, i|
              %li= link_to (i.to_s + ' ' + e.title), edit_entry_path(e)
        %td.number= n.locale.to_s
        %td.number= link_to "#{n.subscribers.count.to_s}(#{n.newsletter_deliveries.delivered.count.to_s})", newsletter_newsletter_deliveries_path(n)
        %td= link_to image_tag('/assets/bin.png'), n, :method => :delete, :data => { :confirm => 'Are you sure?' }


!!!
%html{:lang => "en"}
  %head
    %meta{:charset => "utf-8"}/
    %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}/
    %title= content_for?(:title) ? "OS4W | #{yield(:title)}" : "OS4W: Open Source for Women"
    = stylesheet_link_tag "application"
    = stylesheet_link_tag "https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css"
    = javascript_include_tag "vendor/modernizr"
    = javascript_include_tag "application"
    = yield :css
    = yield :js
    = csrf_meta_tags
  %body
    %header
      = render "shared/navigation"
    = render "layouts/messages"
    .wrapper
      = yield
    = render 'shared/footer'

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

Move javascript to <body> scope


!!!
%html
  %head
    %title Web Dev Talks
    = favicon_link_tag
    = stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true
    = javascript_include_tag "application", "data-turbolinks-track" => true
    = javascript_tag '$.fx.off = true;' if Rails.env.test?
    = csrf_meta_tags
  %body
    = yield

Remove testing disabler jsanimation from layout head

!!!
%html
  %head
    %title Web Dev Talks
    = favicon_link_tag
    = stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true
    = javascript_include_tag "application", "data-turbolinks-track" => true
    = csrf_meta_tags
  %body
    = yield


.js-dialog-target.is-inactive{'data-dough-dialog-target' => 'scheduler'}
  .l-tab-panels.l-tab-panels--add-link
    .l-tab-panels__item.l-tab-panels__item--aside
      %h2.l-tab-panels__heading Schedule
      = date_field_tag 'scheduled_date', nil, data: {dough_scheduler_date: true}
      = time_field_tag 'scheduled_time', nil, data: {dough_scheduler_time: true}
      = button_tag "Schedule", value: 'schedule', type: 'submit', name: 'state_event', class: "button--action", data: { dough_scheduler_trigger: true } do
        %span.button__text
          schedule

Make the scheduled dialogue prepopulate with an existing scheduled time.

- article = object.object

.js-dialog-target.is-inactive{'data-dough-dialog-target' => 'scheduler'}
  .l-tab-panels.l-tab-panels--add-link
    .l-tab-panels__item.l-tab-panels__item--aside
      - if article.scheduled_on.present?
        %h2.l-tab-panels__heading Update scheduled post
        %p If desired you can adjust the scheduled time

      - else
        %h2.l-tab-panels__heading Schedule this post
        %p Set the time you wish for the article to go live

      = date_field_tag 'scheduled_date', article.scheduled_on.try(:strftime, '%Y-%m-%d'), data: {dough_scheduler_date: true}
      = time_field_tag 'scheduled_time', article.scheduled_on.try(:strftime, '%H:%M'), data: {dough_scheduler_time: true}
      = button_tag value: 'schedule', type: 'submit', name: 'state_event', class: "button--action", data: { dough_scheduler_trigger: true } do
        %span.button__text
          Save


- if current_user.timesheets.exists?
  %li.dropdown.purple
    %a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
      = fa_icon "clock-o 3x"
      %p Timesheets
    %ul.dropdown-menu
      %li
        = link_to "All your timesheets", user_timesheets_path(current_user)
      - if current_user.current_timesheet
        %li
          = link_to "Your current timesheet", [:edit, current_user, current_user.current_timesheet]
          .current-timesheet-ending-time.hidden= current_user.current_timesheet.end_date

Fix date format browser computability issue (using a supported date string format)

- if current_user.timesheets.exists?
  %li.dropdown.purple
    %a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
      = fa_icon "clock-o 3x"
      %p Timesheets
    %ul.dropdown-menu
      %li
        = link_to "All your timesheets", user_timesheets_path(current_user)
      - if current_user.current_timesheet
        %li
          = link_to "Your current timesheet", [:edit, current_user, current_user.current_timesheet]
          .current-timesheet-ending-time.hidden= current_user.current_timesheet.end_date.strftime("%Y/%m/%d")


- if can? :update, ali or can? :update_cost, ali
  .btn-group.pull-right.panel-action
    %button.btn.btn-primary.btn-xs.dropdown-toggle{:data => {:toggle => 'dropdown'}}
      %i.fa.fa-cog
      = " Actions"
      %span.caret
    %ul.dropdown-menu{:role => 'menu'}
      = render :partial => 'planning/activity_line_item_action_links', :locals => {:project => project, :ali => ali}

Make ALI action button the correct size

- if can? :update, ali or can? :update_cost, ali
  .btn-group.pull-right.panel-action
    %button.btn.btn-primary.dropdown-toggle{:data => {:toggle => 'dropdown'}}
      %i.fa.fa-cog
      = " Actions"
      %span.caret
    %ul.dropdown-menu{:role => 'menu'}
      = render :partial => 'planning/activity_line_item_action_links', :locals => {:project => project, :ali => ali}


=render partial: "public/shared/event_information_header", locals: {event: @event, organizer: @organizer}

%div.form_container
  %div
    %div

  %div
    %div
      %div
        - if @talks.empty?
          .button.radius.right=link_to "Submit Talk", new_public_event_talk_path(@event)
          %div No Talks Submitted! #{link_to "Be the first!", new_public_event_talk_path(@event)}
        - else
          %h5
            .button.radius.right=link_to "Submit Talk", new_public_event_talk_path(@event)
            %em.lightning Check out these awesome submitted talks!
          %hr.navy-blue
          %ol.talks
            -@talks.each do |talk|
              %li.talk-information
                .topic #{talk.presenter_name} - #{talk.topic}
                .details
                  .description=simple_format auto_link(talk.description)
          %hr.navy-blue
      .submission_guidelines{style: "clear:both"}
        %header Submission Guidelines
        = simple_format auto_link(@event.event_talk.talk_submission_guidelines, html: { target: "_blank"}), wrapper_tag: "div"
      .button.radius.right=link_to "Submit Talk", new_public_event_talk_path(@event)

Remove auto-linking from the talk description. Seems dangerous to allow anonymous-user-created text to have links like that.

=render partial: "public/shared/event_information_header", locals: {event: @event, organizer: @organizer}

%div.form_container
  %div
    %div

  %div
    %div
      %div
        - if @talks.empty?
          .button.radius.right=link_to "Submit Talk", new_public_event_talk_path(@event)
          %div No Talks Submitted! #{link_to "Be the first!", new_public_event_talk_path(@event)}
        - else
          %h5
            .button.radius.right=link_to "Submit Talk", new_public_event_talk_path(@event)
            %em.lightning Check out these awesome submitted talks!
          %hr.navy-blue
          %ol.talks
            -@talks.each do |talk|
              %li.talk-information
                .topic #{talk.presenter_name} - #{talk.topic}
                .details
                  .description=simple_format talk.description
          %hr.navy-blue
      .submission_guidelines{style: "clear:both"}
        %header Submission Guidelines
        = simple_format auto_link(@event.event_talk.talk_submission_guidelines, html: {target: "_blank"}), wrapper_tag: "div"
      .button.radius.right=link_to "Submit Talk", new_public_event_talk_path(@event)


%h2= t(:all_users)

= render 'admin/nav'

.right
  = link_to bootstrap_icon('plus') + t(:new_user), new_admin_user_path, :class => "add_new_button btn primary"

.btn-group
  = link_to "Unlocked", admin_users_path, :class => 'btn active'
  = link_to "Locked", admin_locked_users_path, :class => 'btn'
  = link_to "Unlocked Clients", admin_unlocked_clients_path, :class => 'btn'
  = link_to "Locked Clients", admin_locked_clients_path, :class => 'btn'

= render "users_table", users: @users

Fix 1.9-ism that broke travis builds for 1.8 mode

%h2= t(:all_users)

= render 'admin/nav'

.right
  = link_to bootstrap_icon('plus') + t(:new_user), new_admin_user_path, :class => "add_new_button btn primary"

.btn-group
  = link_to "Unlocked", admin_users_path, :class => 'btn active'
  = link_to "Locked", admin_locked_users_path, :class => 'btn'
  = link_to "Unlocked Clients", admin_unlocked_clients_path, :class => 'btn'
  = link_to "Locked Clients", admin_locked_clients_path, :class => 'btn'

= render "users_table", :users => @users


= semantic_form_for parent? ? [parent, resource] : resource do |f|
  = f.semantic_errors

  = f.inputs do
    = f.input :title
    = f.input :file, :as => :file
    = f.input :code, :collection => attachment_code_collection
    - if parent?
      - if parent
        - f.object.object = parent
        = f.input :object_id, :as => :hidden
        = f.input :object_type, :as => :hidden
      - else
        = f.input :object, :collection => parent_class.all

  = f.buttons do
    = f.commit_button

Use multi column form for attachments.

.well
  = semantic_form_for parent? ? [parent, resource] : resource, :class => 'well' do |f|
    = f.semantic_errors

    = f.inputs do
      .row-fluid
        = f.input :title, :input_html => {:class => 'span12'}

      .row-fluid
        .span6
          = f.input :file, :as => :file
        .span6
          = f.input :code, :collection => attachment_code_collection

        - if parent?
          - if parent
            - f.object.object = parent
            = f.input :object_id, :as => :hidden
            = f.input :object_type, :as => :hidden
          - else
            = f.input :object, :collection => parent_class.all

    .form-actions
      = f.buttons do
        = f.commit_button


%h1 Who profits from WestConnex?
%p.lede
  This is a list of companies and their contracts to build WestConnex.
%ul.contractors
  - @contractors.each do |contractor|
    %li.contractor
      %h2.contractor-name= contractor.name
      %span.contractor-value= number_to_currency(contractor.total_est_contract_value, precision: 0)
      %h3.contract-counter= pluralize(contractor.contracts.count, "contract")
      %ul.contracts
        - contractor.contracts.each do |contract|
          %li.contract
            %p
              #{number_to_currency(contract.value, precision: 0)}
              for
              “#{link_to(contract.description, contract.url, title: "View the contract listing at tenders.gov.nsw")}”.

Add totals to lede paragraph

%h1 Who profits from WestConnex?
%p.lede
  These #{@contractors.count} companies have been contracted by the NSW Government.
  So far, their #{pluralize(Contract.count, "contracts")} are worth #{number_to_currency(Contract.sum(:value))}.
%ul.contractors
  - @contractors.each do |contractor|
    %li.contractor
      %h2.contractor-name= contractor.name
      %span.contractor-value= number_to_currency(contractor.total_est_contract_value, precision: 0)
      %h3.contract-counter= pluralize(contractor.contracts.count, "contract")
      %ul.contracts
        - contractor.contracts.each do |contract|
          %li.contract
            %p
              #{number_to_currency(contract.value, precision: 0)}
              for
              “#{link_to(contract.description, contract.url, title: "View the contract listing at tenders.gov.nsw")}”.


%p
  %b Title:
  = @post.title
%p
  %b Body:
  = @post.body
- if current_site.credit_enabled?
  %p
    %b Partcipants
    %ul
      - @post.credits.with_ordered.each do |credit|
        %li
          [#{credit.role.name}]
          = link_to credit.participant.name, [:editor, credit.participant]
%p
  %b Category:
  = @post.category&.name
%p
  %b Serial:
  = @post.serial&.title

%p
  %b Thumbnail url:
  = image_tag @post.thumbnail_url, height: 80 if @post.thumbnail.present?

= link_to 'Preview', preview_editor_post_url, target: '_blank'
\|
= link_to 'Edit', edit_editor_post_url
\|
= link_to 'Back', editor_posts_url

Fix a label for thumbnail in posts editor

%p
  %b Title:
  = @post.title
%p
  %b Body:
  = @post.body
- if current_site.credit_enabled?
  %p
    %b Partcipants
    %ul
      - @post.credits.with_ordered.each do |credit|
        %li
          [#{credit.role.name}]
          = link_to credit.participant.name, [:editor, credit.participant]
%p
  %b Category:
  = @post.category&.name
%p
  %b Serial:
  = @post.serial&.title

%p
  %b Thumbnail:
  = image_tag @post.thumbnail_url, height: 80 if @post.thumbnail.present?

= link_to 'Preview', preview_editor_post_url, target: '_blank'
\|
= link_to 'Edit', edit_editor_post_url
\|
= link_to 'Back', editor_posts_url


%html
  %head
    %link{ :href => "/stylesheets/master.css", :rel => "stylesheet", :media => "screen", :type => "text/css", :charset => "utf-8" }/
    %script{ :src => "/javascripts/jquery-1.3.2.min.js",    :type => "text/javascript" }
    :javascript
      $(function() {
        $('#insertLink form').submit(function() {
          self.parent.document.execCommand('insertHTML', false, '\n' + $('input', this).val() + '\n');
          self.parent.tb_remove();
          return false;
        });

        $('a.cancel').click(function() {
          self.parent.tb_remove();
          return false;
        });
        // No idea why, but setting the focus only works in a timeout
        setTimeout(function() {
          $('#insertLink input').get(0).focus();
        }, 500);
      });
  %body
    #insertLink
      = form :action => '/' do
        %p
          %label{:for => 'insertLinkURL'} URL
          %input#insertLinkURL{:size => 50}
        %p.help
          For example http://twitter.com/til
        %p
          = submit 'OK'
          %a.cancel{:href=>"#"} Cancel

Add a   after links

%html
  %head
    %link{ :href => "/stylesheets/master.css", :rel => "stylesheet", :media => "screen", :type => "text/css", :charset => "utf-8" }/
    %script{ :src => "/javascripts/jquery-1.3.2.min.js",    :type => "text/javascript" }
    :javascript
      $(function() {
        $('#insertLink form').submit(function() {

          /* Append  , otherwise when the link is at the end and
             the user clicks into the wysiwyg div, the cursor is inside
             the link */
          self.parent.document.execCommand('insertHTML',
                                           false,
                                           '\n' + $('input', this).val() + '   ');
          self.parent.tb_remove();
          return false;
        });

        $('a.cancel').click(function() {
          self.parent.tb_remove();
          return false;
        });
        // No idea why, but setting the focus only works in a timeout
        setTimeout(function() {
          $('#insertLink input').get(0).focus();
        }, 500);
      });
  %body
    #insertLink
      = form :action => '/' do
        %p
          %label{:for => 'insertLinkURL'} URL
          %input#insertLinkURL{:size => 50}
        %p.help
          For example http://twitter.com/til
        %p
          = submit 'OK'
          %a.cancel{:href=>"#"} Cancel


/ Home non-logged-in
.jumbotron.center

  = fa_icon "home 5x"
  = fa_icon "truck 3x"

  %h1
    Moving Estimator

  %i.lead.clearfix
    estimates the volume of your moving

  %div{ style: "margin-top: 40px;" }
  = link_to "Sign up now!", new_user_registration_path, class: "btn btn-lg btn-success"

%hr/

= render "shared/about_author"

Add login form on landing page(ugly)

/ Home non-logged-in
.landing_page
  .row
    .col-md-7
      .langing_header
        = fa_icon "home 5x"
        = fa_icon "truck 3x"

        %h1 Moving Estimator

        %i.lead.clearfix
          estimates the volume of your moving

      .omniauth
        = link_to fa_icon("fw twitter", text: "Sign up / Log in with twitter"), user_omniauth_authorize_path(:twitter),
        class: "btn btn-info btn-block btn-lg"

      .alert.alert-warning
        New user?
        = link_to "Sign up now!", new_user_registration_path, class: "btn btn-success"

    .col-md-5
      = form_for(resource = User.new, url: user_session_path) do |f|

        .field.form-group
          = f.email_field :email, autofocus: false, class: 'form-control', placeholder: "Email"

        .field.form-group
          = f.password_field :password, autocomplete: "off", class: 'form-control', placeholder: "Password"

        %ul.list-inline
          %li
            %ul.list-inline
              %li= f.check_box :remember_me
              %li= f.label :remember_me
          %li= link_to fa_icon("fw question-circle", text: "Forgot your password?"), new_user_password_path

        .actions
          = f.button "Log in", class: "submit btn btn-success btn-lg btn-block",
            data: { disable_with: "<i class='fa fa-spinner fa-spin'></i> Processing..." }


%h2.title Player Counts

%p Mean, minimum, and maximum player counts by date.

%script{:src => '/js/d3.min.js'}
%script{:src => "/js/popchart.js?v=1"}

:css
  svg {
    background-color: black;
    border: 2px solid #AF7A30;
  }

  path {
    fill: none;
  }

  text {
    fill: white;
    font-weight: normal;
    font-size: 10px;
  }

  .x.axis line {
    stroke: white;
  }

  .axis label {
    fill: #CCC;
  }

  .x.axis .minor {
    stroke-opacity: 1;
  }

  .x.axis path {
    fill: none;
    stroke: white;
  }

  .y.axis line, .y.axis path {
    fill: none;
    stroke: white;
  }

:javascript
  d3.json("/player_counts.json", function(error, json) {
    popchart.add("#content", json);
  });

Increment version on popchart js to force cache update

%h2.title Player Counts

%p Mean, minimum, and maximum player counts by date.

%script{:src => '/js/d3.min.js'}
%script{:src => "/js/popchart.js?v=2"}

:css
  svg {
    background-color: black;
    border: 2px solid #AF7A30;
  }

  path {
    fill: none;
  }

  text {
    fill: white;
    font-weight: normal;
    font-size: 10px;
  }

  .x.axis line {
    stroke: white;
  }

  .axis label {
    fill: #CCC;
  }

  .x.axis .minor {
    stroke-opacity: 1;
  }

  .x.axis path {
    fill: none;
    stroke: white;
  }

  .y.axis line, .y.axis path {
    fill: none;
    stroke: white;
  }

:javascript
  d3.json("/player_counts.json", function(error, json) {
    popchart.add("#content", json);
  });


.row
  .columns.small-offset-1.small-10
    = simple_form_for [@topic, @post] do |f|
      = f.error :base
      ~ f.input :content
      = f.button :submit

Add textarea size when editing

.row
  .columns.small-offset-1.small-10
    = simple_form_for [@topic, @post] do |f|
      = f.error :base
      = f.input :content, input_html: {rows: 25}
      = f.button :submit


.container
  %h1 All Scrapers

  = paginate @scrapers
  = render partial: "sync/scrapers/scraper", collection: @scrapers
  = paginate @scrapers

Add title to all scrapers page

- title "All Scrapers"

.container
  %h1= title

  = paginate @scrapers
  = render partial: "sync/scrapers/scraper", collection: @scrapers
  = paginate @scrapers


%style
  = Diffy::CSS

- content_for :title do
  Division Description Changes —
  = @division.original_name
  —
  = formatted_date(@division.date)

.page-header
  %h1= yield :title

%p
  All changes made to the description and title of this
  division.

%p
  Or
  = link_to "see all the recent changes", history_path

%p
  = link_to "View division", @division
  |
  = link_to "Edit description", edit_division_path(@division)

%table.table
  %thead
    %tr
      %th Change
      %th Division
  %tbody
    - @division.wiki_motions.each_with_index do |wiki_motion, index|
      %tr
        %td{width: "16%"}
          = link_to "#{@division.australian_house} vote #{@division.date}##{@division.number}", @division
          %p
            Edited by
            = link_to wiki_motion.user.name, wiki_motion.user
          %p
            on
            = wiki_motion.edit_date.strftime('%F %T')
        %td
          %p Title
          = Diffy::Diff.new(wiki_motion.previous_title.strip, wiki_motion.title.strip).to_s(:html).html_safe
          %p Description
          = Diffy::Diff.new(wiki_motion.previous_description, wiki_motion.description).to_s(:html).html_safe

Add meta description to division history page

%style
  = Diffy::CSS

- content_for :title do
  Division Description Changes —
  = @division.original_name
  —
  = formatted_date(@division.date)
- set_meta_tags description: "All changes made to the description and title of the division: #{@division.name}"

.page-header
  %h1= yield :title

%p
  All changes made to the description and title of this
  division.

%p
  Or
  = link_to "see all the recent changes", history_path

%p
  = link_to "View division", @division
  |
  = link_to "Edit description", edit_division_path(@division)

%table.table
  %thead
    %tr
      %th Change
      %th Division
  %tbody
    - @division.wiki_motions.each_with_index do |wiki_motion, index|
      %tr
        %td{width: "16%"}
          = link_to "#{@division.australian_house} vote #{@division.date}##{@division.number}", @division
          %p
            Edited by
            = link_to wiki_motion.user.name, wiki_motion.user
          %p
            on
            = wiki_motion.edit_date.strftime('%F %T')
        %td
          %p Title
          = Diffy::Diff.new(wiki_motion.previous_title.strip, wiki_motion.title.strip).to_s(:html).html_safe
          %p Description
          = Diffy::Diff.new(wiki_motion.previous_description, wiki_motion.description).to_s(:html).html_safe


!!! 5
%html
  %head
    %title= t("meta.title")
    %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type" }
    %meta{:description => "#{t('meta.description')}" }
    = csrf_meta_tag

    /[if lte IE 8]
      = stylesheet_link_tag 'ie'

    = stylesheet_link_tag 'application'
    = stylesheet_link_tag 'form_only'
    = javascript_include_tag 'application'

    = yield :head

    - if ipad?
      %meta{:name=>"viewport", :content=>"width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"}

  %body#form-only{ class: I18n.locale }
    %header#top
      %a{ href: root_path }
        %img(src="/assets/header/logo400-blue@2x.png" width="400" height="49" alt="Energy Transition Model")

    #content
      = content_for?(:content) ? yield(:content) : yield

    :javascript
      I18n.defaultLocale = "#{I18n.default_locale}";
      I18n.locale = "#{I18n.locale}";

    = yield :scripts

Include I18n messages in form_only layout

!!! 5
%html
  %head
    %title= t("meta.title")
    %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type" }
    %meta{:description => "#{t('meta.description')}" }
    = csrf_meta_tag

    /[if lte IE 8]
      = stylesheet_link_tag 'ie'

    = stylesheet_link_tag 'application'
    = stylesheet_link_tag 'form_only'
    = javascript_include_tag 'application'
    = javascript_include_tag "i18n/#{ I18n.locale }"

    = yield :head

    - if ipad?
      %meta{:name=>"viewport", :content=>"width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"}

  %body#form-only{ class: I18n.locale }
    %header#top
      %a{ href: root_path }
        %img(src="/assets/header/logo400-blue@2x.png" width="400" height="49" alt="Energy Transition Model")

    #content
      = content_for?(:content) ? yield(:content) : yield

    :javascript
      I18n.defaultLocale = "#{I18n.default_locale}";
      I18n.locale = "#{I18n.locale}";

    = yield :scripts


%li.ListItem.Grid.u-mb-3
  .Grid-cell.1-of-4.u-t-align-right
    %a.ListItem-imageLink.u-mr-2{ href: list_item.image_large_url }
      %img.ListItem-image{ src: list_item.image_thumb_url }/
  .Grid-cell.3-of-4
    %h3=list_item.title
    %p.ListItem-desciption
      =raw list_item.description
    =link_to "Link", list_item.link

Add counter and desing changes to list items on show page.

%li.List-item.Grid.u-mb-3
  .Grid-cell.1-of-4.u-t-align-right
    %p.List-itemCounter.u-fw-700=list_item_counter+1
    %a.List-itemImageLink.u-mr-2{ href: list_item.image_large_url, target: "_blank" }
      %img.List-itemImage{ src: list_item.image_thumb_url }/
  .Grid-cell.3-of-4
    %h3.List-itemTitle.u-fw-700=list_item.title
    .List-itemDescription
      =raw list_item.description
    -#=link_to "Link", list_item.link


- desc = []
- altname = ignore_nil {agent[:dbpedia][:birthName].first} || ignore_nil {agent[:foaf][:name].first}

- comments = ignore_nil {agent[:rdfs][:comment]} || ignore_nil {agent[:dbpedia][:abstract]} || []

- if comments.empty?
  - desc.push altname unless agent[:heading].include? altname

  - birth = ignore_nil {agent[:dbpedia][:birthYear].first} || ignore_nil {agent[:dbpedia][:birthDate].first} || ignore_nil {agent[:foaf][:birthday].first}
  - birth = Date.parse(birth).year.to_s if ! birth.nil? and birth.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}.*$/)
  - death = ignore_nil {agent[:dbpedia][:deathYear].first} || ignore_nil {agent[:dbpedia][:deathDate].first}
  - death = Date.parse(death).year.to_s if ! death.nil? and death.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}.*$/)

  - life_dates = "#{birth}-" unless birth.nil?
  - life_dates += "#{death}" unless death.nil?
  - desc.push life_dates

.description= desc.compact.join('; ')

= comments.first.truncate(250, :separator => '. ', :omission => '.')

Add summaries to Concept, Agent results

- desc = []
- altname = ignore_nil {agent[:dbpedia][:birthName].first} || ignore_nil {agent[:foaf][:name].first}

- comments = ignore_nil {agent[:rdfs][:comment]} || ignore_nil {agent[:dbpedia][:abstract]} || []

- if comments.empty?
  - desc.push altname unless agent[:heading].include? altname

  - birth = ignore_nil {agent[:dbpedia][:birthYear].first} || ignore_nil {agent[:dbpedia][:birthDate].first} || ignore_nil {agent[:foaf][:birthday].first}
  - birth = Date.parse(birth).year.to_s if ! birth.nil? and birth.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}.*$/)
  - death = ignore_nil {agent[:dbpedia][:deathYear].first} || ignore_nil {agent[:dbpedia][:deathDate].first}
  - death = Date.parse(death).year.to_s if ! death.nil? and death.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}.*$/)

  - life_dates = "#{birth}-" unless birth.nil?
  - life_dates += "#{death}" unless death.nil?
  - desc.push life_dates

.description= desc.compact.join('; ')

= ignore_nil {comments.first.truncate(250, :separator => '. ', :omission => '.')}


%h1 #{@submission.team.name} / #{@submission.problem}
%h2 Edit submission
= render partial: 'form', object: @submission

%h2 Delete submission
= button_to 'Delete submission', submission_path(@submission), :method => :delete, :confirm => 'Are you sure?'

%h2= link_to 'Edit team', team_path(@submission.team)
%h2= link_to 'Submissions', submissions_path
%h2= link_to 'Rankings', rankings_path

Remove redundant links on submissions/edit view

%h1 #{@submission.team.name} / #{@submission.problem}
%h2 Edit submission
= render partial: 'form', object: @submission

%h2 Delete submission
= button_to 'Delete submission', submission_path(@submission), :method => :delete, :confirm => 'Are you sure?'

%h2= link_to 'Edit team...', team_path(@submission.team)


%form.poll-count-vote-form
  .poll-common-vote-form__reason
    %md-input-container.md-block
      %input.lmo-primary-form-input{type: "text", placeholder: "{{'poll_count_vote_form.reason_placeholder' | translate}}", ng-model: "stance.reason", md-maxlength: "250"}
      %validation_errors{subject: "stance", field: "reason"}

    %poll_common_participant_form{stance: "stance"}

    .poll-count-vote-form__options
      %md-button.poll-count-vote-form__option.poll-count-vote-form__option--yes{ng-click: "submit(yes)", ng-style: "{background: yes.color}"}
        %i.material-icons done
      %md-button.poll-count-vote-form__option.poll-count-vote-form__option--no{ng-click: "submit(no)", ng-style: "{'border-color': no.color}"}
        %i.material-icons{ng-style: "{color: no.color}"} remove

Make 'no' on count a cross instead of a dash

%form.poll-count-vote-form
  .poll-common-vote-form__reason
    %md-input-container.md-block
      %input.lmo-primary-form-input{type: "text", placeholder: "{{'poll_count_vote_form.reason_placeholder' | translate}}", ng-model: "stance.reason", md-maxlength: "250"}
      %validation_errors{subject: "stance", field: "reason"}

    %poll_common_participant_form{stance: "stance"}

    .poll-count-vote-form__options
      %md-button.poll-count-vote-form__option.poll-count-vote-form__option--yes{ng-click: "submit(yes)", ng-style: "{background: yes.color}"}
        %i.material-icons done
      %md-button.poll-count-vote-form__option.poll-count-vote-form__option--no{ng-click: "submit(no)", ng-style: "{'border-color': no.color}"}
        %i.material-icons{ng-style: "{color: no.color}"} clear


.container
  .backoffice-title
    Résultat de la recherche :
    = pluralize(@dossiers.count, "dossier trouvé", "dossiers trouvés")

  - if @dossiers.present?
    %table.table.dossiers-table.hoverable
      %thead
        %tr
          %th Nº
          %th Procédure
          %th Demandeur
          %th Statut
      %tbody
      - @dossiers.each do |dossier|
        %tr
          %td.number-col
            = link_to(dossier_path(dossier.procedure, dossier), class: 'cell-link') do
              .icon.folder>
              = dossier.id
          %td= link_to(dossier.procedure.libelle, dossier_path(dossier.procedure, dossier), class: 'cell-link')
          %td= link_to(dossier.user.email, dossier_path(dossier.procedure, dossier), class: 'cell-link')
          %td.status-col
            = link_to(dossier_path(dossier.procedure, dossier), class: 'cell-link') do
              = render partial: 'new_gestionnaire/procedures/status', locals: { dossier: dossier }
  - else
    %h2 Aucun dossier correspondant à votre recherche n'a été trouvé

Add missing title to the recherche page

- content_for(:title, "Recherche : #{@search_terms}")

.container
  .backoffice-title
    Résultat de la recherche :
    = pluralize(@dossiers.count, "dossier trouvé", "dossiers trouvés")

  - if @dossiers.present?
    %table.table.dossiers-table.hoverable
      %thead
        %tr
          %th Nº
          %th Procédure
          %th Demandeur
          %th Statut
      %tbody
      - @dossiers.each do |dossier|
        %tr
          %td.number-col
            = link_to(dossier_path(dossier.procedure, dossier), class: 'cell-link') do
              .icon.folder>
              = dossier.id
          %td= link_to(dossier.procedure.libelle, dossier_path(dossier.procedure, dossier), class: 'cell-link')
          %td= link_to(dossier.user.email, dossier_path(dossier.procedure, dossier), class: 'cell-link')
          %td.status-col
            = link_to(dossier_path(dossier.procedure, dossier), class: 'cell-link') do
              = render partial: 'new_gestionnaire/procedures/status', locals: { dossier: dossier }
  - else
    %h2 Aucun dossier correspondant à votre recherche n'a été trouvé


!!!html
%html
  %head
    %title
      CleRB - The Cleveland Ruby Brigade - Home
    %meta(name="sitemap" content="#{base_url}/sitemap.xml")
    %link(href="/css/master.css" media="screen" rel="stylesheet" type="text/css")
    %link(href="#{base_url}/articles.xml" rel="alternate" type="application/atom+xml")
  %body
    %header
      .container
        != haml :nav, :layout => false
    #container
      #wrapper
        != yield
    %footer.row
      != haml :nav, :layout => false
      != haml :sponsors, :layout => false
    != haml :analytics, :layout => false

Use partial helper to abstract call to haml

!!!html
%html
  %head
    %title
      CleRB - The Cleveland Ruby Brigade - Home
    %meta(name="sitemap" content="#{base_url}/sitemap.xml")
    %link(href="/css/master.css" media="screen" rel="stylesheet" type="text/css")
    %link(href="#{base_url}/articles.xml" rel="alternate" type="application/atom+xml")
  %body
    %header
      .container
        != partial :nav
    #container
      #wrapper
        != yield
    %footer.row
      != partial :nav
      != partial :sponsors
    != partial :analytics


= simple_form_for(@payment, :as => :credit_card, :url => @config[:url]) do |f|
  - unless @payment.errors.empty?
    .validation-error
      %p There was a problem processing your payment details. See below for more detail.
      - unless @payment.errors.messages[:base].blank?
        - @payment.errors.messages[:base].each do |message|
          %p.message-detail= message

  - @config[:hidden_fields].each do |name, value|
    = hidden_field_tag(name, value)

  = f.input(:number, input_opts(:number, :label => 'Card number'))
  = f.input(:name, input_opts(:name))
  = f.input(:cvv, input_opts(:cvv, :label => 'Security code'))
  .inline-group
    = f.input(:expiration_month, select_opts(:expiration_month, 'Month', @months, :label => 'Expiry'))
    = f.input(:expiration_year, select_opts(:expiration_year, 'Year', @years, :label => '/'))

  .button-bar
    %button(type="submit") Place order & Pay

Use more appropriate field types in the checkout and payment form

= simple_form_for(@payment, :as => :credit_card, :url => @config[:url]) do |f|
  - unless @payment.errors.empty?
    .validation-error
      %p There was a problem processing your payment details. See below for more detail.
      - unless @payment.errors.messages[:base].blank?
        - @payment.errors.messages[:base].each do |message|
          %p.message-detail= message

  - @config[:hidden_fields].each do |name, value|
    = hidden_field_tag(name, value)

  = f.input(:number, input_opts(:number, :label => 'Card number', :pattern => '[0-9]*', :type => 'tel'))
  = f.input(:name, input_opts(:name))
  = f.input(:cvv, input_opts(:cvv, :label => 'Security code', :pattern => '[0-9]*', :type => 'tel'))
  .inline-group
    = f.input(:expiration_month, select_opts(:expiration_month, 'Month', @months, :label => 'Expiry'))
    = f.input(:expiration_year, select_opts(:expiration_year, 'Year', @years, :label => '/'))

  .button-bar
    %button(type="submit") Place order & Pay


- report_title = capture do
  - section = (@offering.clazz.section && @offering.clazz.section.length > 0) ? @offering.clazz.section : nil
  - section = (section ? "(#{section})" : "")
  = "Report for: #{@offering.clazz.name} #{section}"
- report_summary = capture do
  = offering_report_summary(@offering)

!= use_contentflow
= render :partial => '/portal/reports/report', :locals => {:report_context => @offering,
    :offering => @offering, :learners => @learners, :page_elements => @page_elements,
    :report_title => report_title, :report_summary => report_summary }

Hide All and None links for activity report

- report_title = capture do
  - section = (@offering.clazz.section && @offering.clazz.section.length > 0) ? @offering.clazz.section : nil
  - section = (section ? "(#{section})" : "")
  = "Report for: #{@offering.clazz.name} #{section}"
- if @activity_report_id == nil
  - report_summary = capture do
    = offering_report_summary(@offering)
- else
  - report_summary = capture do
    = offering_report_summary(@offering,{:show_selection_controls => false})
!= use_contentflow
= render :partial => '/portal/reports/report', :locals => {:report_context => @offering,
    :offering => @offering, :learners => @learners, :page_elements => @page_elements,
    :report_title => report_title, :report_summary => report_summary }


%h1 Home

%h2
  = "Welcome #{current_user.first_name + ' ' + current_user.last_name}"

- if current_user.school_deputy
  %h3 Current Assigned Students
  %table
    %tr
      %th First name
      %th Last name
      %th School
      %th Updated school
      %th Grade
      %th
      %th

    - @students.each do |student|
      %tr
        %td= student.first_name
        %td= student.last_name
        %td= student.school.name unless student.school.nil?
        %td= student.updated_school.name unless student.updated_school.nil?
        %td= student.grade
        %td= link_to 'Show', student
        %td= link_to 'Edit', edit_student_path(student)
  = will_paginate @students

= link_to('Account Settings', edit_user_registration_path)

Add minimum height on home index

%h1 Home

%h2
  = "Welcome #{current_user.first_name + ' ' + current_user.last_name}"

%div{:style => 'min-height:400px;'}

- if current_user.school_deputy
  %h3 Current Assigned Students
  %table
    %tr
      %th First name
      %th Last name
      %th School
      %th Updated school
      %th Grade
      %th
      %th

    - @students.each do |student|
      %tr
        %td= student.first_name
        %td= student.last_name
        %td= student.school.name unless student.school.nil?
        %td= student.updated_school.name unless student.updated_school.nil?
        %td= student.grade
        %td= link_to 'Show', student
        %td= link_to 'Edit', edit_student_path(student)
  = will_paginate @students


.login-register-card
  .row
    .large-8.columns.large-centered
      .panel.login-box.signup
        - if @beta_invite.invited?
          .login-title
            You have already been invited to the beta.
          .no-account.large-12.columns
            %p We have sent an email to #{@beta_invite.email} with registration instructions.
            %p= link_to "Resend Registration Instructions", resend_beta_invite_path(email: @beta_invite.email), method: :post, class: 'button'
        - else
          .login-title
            You are currently in the waiting list.
          .login-title
            There are
            %strong= pluralize @beta_invite.before_count, "person"
            ahead of you and
            %strong= pluralize @beta_invite.after_count, "person"
            after you.
          .no-account.large-12.columns
            %p= @beta_invite.email
            %p
              :javascript
                function showInviteCodeForm() {
                  $(".invite-code").show();
                }
              %a(href="javascript: showInviteCodeForm();") Have an invite code?
              .invite-code.hide
                %form(method="get" action="/beta_invites/invite_code")
                  %input(name="invite_code" placeholder="Invite Code")
                  %input(name="email" type="hidden"){:value => @beta_invite.email}
                  %input(type="submit")

Fix button on beta page

.login-register-card
  .row
    .large-8.columns.large-centered
      .panel.login-box.signup
        - if @beta_invite.invited?
          .login-title
            You have already been invited to the beta.
          .no-account.large-12.columns
            %p We have sent an email to #{@beta_invite.email} with registration instructions.
            %p= link_to "Resend Registration Instructions", resend_beta_invite_path(email: @beta_invite.email), method: :post, class: 'button padded'
        - else
          .login-title
            You are currently in the waiting list.
          .login-title
            There are
            %strong= pluralize @beta_invite.before_count, "person"
            ahead of you and
            %strong= pluralize @beta_invite.after_count, "person"
            after you.
          .no-account.large-12.columns
            %p= @beta_invite.email
            %p
              :javascript
                function showInviteCodeForm() {
                  $(".invite-code").show();
                }
              %a(href="javascript: showInviteCodeForm();") Have an invite code?
              .invite-code.hide
                %form(method="get" action="/beta_invites/invite_code")
                  %input(name="invite_code" placeholder="Invite Code")
                  %input(name="email" type="hidden"){:value => @beta_invite.email}
                  %input(type="submit")


!!!
%html
  %head
    %title
      One Click Organisations
    = css_include_tag :one_click
  %body
    %div.control_bar
      - if current_user
        =link_to 'profile', url(:controller => :members, :action => :edit, :id => current_user.id)
        |
        =link_to 'logout', url('logout')
    %div#doc
      %div#hd
        %h1.header One Click Organisations

      %div#bd
        - if current_user
          %ul#nav
            %li#navitem= link_to 'Members', url(:controller => :members)
            %li#navitem= link_to 'Proposals', url('proposals')
            %li#navitem= link_to 'Decisions', url(:controller => :decisions)
            %li#navitem= link_to 'Constitution', url('constitution')

        %div#notice
          = h(message[:notice])
        %div#error
          = h(message[:error])

        = catch_content :for_layout
      %div.footer
        = "One Click Organisations - version 0.1 - running on merb #{Merb::VERSION}"

Update global nav to use Control Centre and Timeline pages instead of the Proposals and Decisions pages.

!!!
%html
  %head
    %title
      One Click Organisations
    = css_include_tag :one_click
  %body
    %div.control_bar
      - if current_user
        =link_to 'profile', url(:controller => :members, :action => :edit, :id => current_user.id)
        |
        =link_to 'logout', url('logout')
    %div#doc
      %div#hd
        %h1.header One Click Organisations

      %div#bd
        - if current_user
          %ul#nav
            %li#navitem= link_to 'My Control Centre', url(:controller => :one_click, :action => :control_centre)
            %li#navitem= link_to 'My Member Page', url(:controller => :members, :action => :show, :id => current_user.id)
            %li#navitem= link_to 'Timeline', url(:controller => :one_click, :action => :timeline)
            %li#navitem= link_to 'Members', url(:controller => :members)
            %li#navitem= link_to 'Constitution', url('constitution')

        %div#notice
          = h(message[:notice])
        %div#error
          = h(message[:error])

        = catch_content :for_layout
      %div.footer
        = "One Click Organisations - version 0.1 - running on merb #{Merb::VERSION}"


%ul.nav.navbar-nav
  %li.visible-lg
    = image_tag gravatar_url(current_user), class: 'profile-image'
  - if current_leader
    %li= link_to 'Logout', destroy_session_path, method: :delete

Fix page loading error caused by gravatar

%ul.nav.navbar-nav
  - if current_leader
    %li.visible-lg
      = image_tag gravatar_url(current_user), class: 'profile-image'
    %li= link_to 'Logout', destroy_session_path, method: :delete


- item_action ||= lambda{|object| url_for(object)}

%tr[booking]
  %td= booking.value_date
  %td
    = link_to booking.title, item_action.call(booking), 'data-href-container' => 'tr'
    - if booking.comments.present?
      %hr{:style => "height: 1px; margin: 0"}/
      %i= booking.comments
  %td= link_to booking.reference.to_s(:reference), booking.reference unless booking.reference.nil?
  %td= link_to booking.debit_account.code, account_path(booking.debit_account), :title => booking.debit_account.title unless booking.debit_account.nil?
  %td= link_to booking.credit_account.code, account_path(booking.credit_account), :title => booking.credit_account.title unless booking.credit_account.nil?
  %td.currency= currency_fmt(booking.amount)
  %td.action-links
    = list_link_for(:edit, booking)
    = list_link_for(:delete, booking, :remote => true)
    = list_link_for(:copy, booking)

Drop seperator line between subject and comment in booking lists.

- item_action ||= lambda{|object| url_for(object)}

%tr[booking]
  %td= booking.value_date
  %td
    = link_to booking.title, item_action.call(booking), 'data-href-container' => 'tr'
    - if booking.comments.present?
      %div
        %i= booking.comments
  %td= link_to booking.reference.to_s(:reference), booking.reference unless booking.reference.nil?
  %td= link_to booking.debit_account.code, account_path(booking.debit_account), :title => booking.debit_account.title unless booking.debit_account.nil?
  %td= link_to booking.credit_account.code, account_path(booking.credit_account), :title => booking.credit_account.title unless booking.credit_account.nil?
  %td.currency= currency_fmt(booking.amount)
  %td.action-links
    = list_link_for(:edit, booking)
    = list_link_for(:delete, booking, :remote => true)
    = list_link_for(:copy, booking)


%section.motion{class: division.motion_edited? ? "motion-edited" : "motion-raw"}
  - if division.motion_edited?
    %p.division-edit-notice.bg-info.col-md-12
      Last edited #{relative_time division.wiki_motion.edit_date}
      by #{link_to division.wiki_motion.user.real_name, division.wiki_motion.user}
  .row
    - if division.motion_edited?
      %nav.header-actions.col-md-3
        = link_to "Edit motion", edit_division_path2(division), title: "Edit and improve this description", class: "btn btn-default btn-xs"
    %h2.col-md-9 Motion
    - if !division.motion_edited?
      %p.division-edit-notice.alert-warning.col-md-12
        %strong Unedited text
        automatically extracted from the debate.
        = link_to "Improve the page providing a summary.", edit_division_path2(division)

  -# The motion can include html.
  -# TODO Need to check what happens when the user edits the motion. What can they add?
  .motion-text
    = division.formatted_motion_text
  %p
    %b= link_to "Debate in Parliament", division.oa_debate_url, title: "Links to debate shown at www.openaustralia.org"
    |
    %b= link_to "Source", division.source_url, title: "The original record of vote as reported by Hansard"

Remove interpoliation here to make it clearer to read

%section.motion{class: division.motion_edited? ? "motion-edited" : "motion-raw"}
  - if division.motion_edited?
    %p.division-edit-notice.bg-info.col-md-12
      Last edited
      = relative_time division.wiki_motion.edit_date
      by
      = link_to division.wiki_motion.user.real_name, division.wiki_motion.user
  .row
    - if division.motion_edited?
      %nav.header-actions.col-md-3
        = link_to "Edit motion", edit_division_path2(division), title: "Edit and improve this description", class: "btn btn-default btn-xs"
    %h2.col-md-9 Motion
    - if !division.motion_edited?
      %p.division-edit-notice.alert-warning.col-md-12
        %strong Unedited text
        automatically extracted from the debate.
        = link_to "Improve the page providing a summary.", edit_division_path2(division)

  -# The motion can include html.
  -# TODO Need to check what happens when the user edits the motion. What can they add?
  .motion-text
    = division.formatted_motion_text
  %p
    %b= link_to "Debate in Parliament", division.oa_debate_url, title: "Links to debate shown at www.openaustralia.org"
    |
    %b= link_to "Source", division.source_url, title: "The original record of vote as reported by Hansard"


= simple_form_for resource, html: {class: 'form-horizontal', id: 'repository_form' } do |f|
  = f.input :name, input_html: { class: 'input-xlarge' }, required: true, disabled: resource.persisted?, as: :string
  = f.input :description, input_html: { rows: 8 }
  = f.input :access, collection: resource.mirror? ? access_options_mirror : access_options, include_blank: false, hint: access_change_hint
  .access-options.hide
    = select_tag :access_options_non_mirror, options_for_select(access_options)
    = select_tag :access_options_mirror, options_for_select(access_options_mirror)

  - if resource.new_record?
    = f.input :source_address, as: :url

    #remote_type.form-group
      = f.input :remote_type, collection: Repository::REMOTE_TYPES, as: :radio_buttons, hint: t('repository.remote_type.text')

  - if !resource.new_record? && resource.mirror?
    .form-group
      = f.label t('repository.un_mirror.label')
      .col-lg-10
        = check_box_tag :un_mirror
        = t 'repository.un_mirror.text'

  = f.button :wrapped

Move access select box down.

= simple_form_for resource, html: {class: 'form-horizontal', id: 'repository_form' } do |f|
  = f.input :name, input_html: { class: 'input-xlarge' }, required: true, disabled: resource.persisted?, as: :string
  = f.input :description, input_html: { rows: 8 }

  - if resource.new_record?
    = f.input :source_address, as: :url

    #remote_type.form-group
      = f.input :remote_type, collection: Repository::REMOTE_TYPES, as: :radio_buttons, hint: t('repository.remote_type.text')

  - if !resource.new_record? && resource.mirror?
    .form-group
      = f.label t('repository.un_mirror.label')
      .col-lg-10
        = check_box_tag :un_mirror
        = t 'repository.un_mirror.text'

  = f.input :access, collection: resource.mirror? ? access_options_mirror : access_options, include_blank: false, hint: access_change_hint
  .access-options.hide
    = select_tag :access_options_non_mirror, options_for_select(access_options)
    = select_tag :access_options_mirror, options_for_select(access_options_mirror)

  = f.button :wrapped


= title _('Manage classroom members')

= head_embed javascript_include_tag('jquery_ujs')

#memberships
  .eight.columns

    = render('shared/classroom_customization_tabs')

    = form_tag(memberships_path, :id => 'new_membership') do
      %p
        = _('Add a new member by typing his email address below.')

      = email_field_tag :email, nil, :required => true

      %p
        = submit_tag _('Add member'), :id => 'submit_membership', :class => 'button primary'

    %h4
      = _('%d members') % @classroom.memberships_count
    %hr

    %ul#members-list.inline-list
      - @classroom.memberships.each do |mem|
        %li
          .avatar.left
            = gravatar_image_tag(mem.user.email, :alt => mem.user.name, :gravatar => {:size => 30})
          %p
            - if can?(:destroy, mem)
              %a.icon-remove.right{:href => membership_path(mem), 'data-method' => :delete, :id => "remove-membership-#{mem.id}"}
            = mem.user.name
            %br
            %span.smaller
              - if mem.user.id == current_user.id
                = _('You own this classroom.')
              - else
                = mem.user.email

  = render(:partial => 'sidebar')

Update collaborators email help string.

= title _('Manage classroom members')

= head_embed javascript_include_tag('jquery_ujs')

#memberships
  .eight.columns

    = render('shared/classroom_customization_tabs')

    = form_tag(memberships_path, :id => 'new_membership') do
      %p
        = _('Add members by typing their email address below. They will receive an email to join.')

      = email_field_tag :email, nil, :required => true

      %p
        = submit_tag _('Add member'), :id => 'submit_membership', :class => 'button primary'

    %h4
      = _('%d members') % @classroom.memberships_count
    %hr

    %ul#members-list.inline-list
      - @classroom.memberships.each do |mem|
        %li
          .avatar.left
            = gravatar_image_tag(mem.user.email, :alt => mem.user.name, :gravatar => {:size => 30})
          %p
            - if can?(:destroy, mem)
              %a.icon-remove.right{:href => membership_path(mem), 'data-method' => :delete, :id => "remove-membership-#{mem.id}"}
            = mem.user.name
            %br
            %span.smaller
              - if mem.user.id == current_user.id
                = _('You own this classroom.')
              - else
                = mem.user.email

  = render(:partial => 'sidebar')


= title [@classroom.title, _('Timeline')].join(' ')

#activities
  .eight.columns

    - if can?(:contribute, @classroom)
      = form_tag(announce_classroom_path, :id => :announce) do
        = text_area_tag(:announcement, nil, :required => true, :placeholder => _('Post an announcement for this classroom...'))
        .row
          .four.columns
            = submit_tag(_('Publish'), :class => 'button small primary', :id => :submit_announcement)
          .eight.columns
            = check_box_tag(:email_all, nil, false, :class => 'right')
            = label_tag(:email_all, _('Email this announcement to everyone'), :class => 'smaller right')

    - @timeline.each do |event|
      .row
        .two.columns.author.avatar
          = gravatar_image_tag(event.owner.email, :alt => event.owner.name)

        .ten.columns.end.activity
          = render_activity(event, :current_user => current_user)

  = render(:partial => 'sidebar')

Remove email checkbox, gonna move it to profile email privacy options.

= title [@classroom.title, _('Timeline')].join(' ')

#activities
  .eight.columns

    - if can?(:contribute, @classroom)
      = form_tag(announce_classroom_path, :id => :announce) do
        = text_area_tag(:announcement, nil, :required => true, :placeholder => _('Post an announcement for this classroom...'))
        .row
          .twelve.columns
            = submit_tag(_('Publish'), :class => 'button small primary', :id => :submit_announcement)

    - @timeline.each do |event|
      .row
        .two.columns.author.avatar
          = gravatar_image_tag(event.owner.email, :alt => event.owner.name)

        .ten.columns.end.activity
          = render_activity(event, :current_user => current_user)

  = render(:partial => 'sidebar')


%h3
  -if attachments["service_logo.png"]
    =image_tag(attachments["service_logo.png"].url)
  =itinerary.service.name
  %span{style: "padding: 0px 12px; color: #b1b1b1;"}=' | '
  -unless itinerary.service.url.blank?
    =link_to(itinerary.service.url, itinerary.service.url)
    %span{style: "padding: 0px 12px; color: #b1b1b1;"}=' | '
  -unless itinerary.service.email.blank?
    =mail_to(itinerary.service.email, itinerary.service.email)
    %span{style: "padding: 0px 12px; color: #b1b1b1;"}=' | '
  -unless itinerary.service.phone.blank?
    =itinerary.service.phone

Use formatted phone number in emails

%h3
  -if attachments["service_logo.png"]
    =image_tag(attachments["service_logo.png"].url)
  =itinerary.service.name
  %span{style: "padding: 0px 12px; color: #b1b1b1;"}=' | '
  -unless itinerary.service.url.blank?
    =link_to(itinerary.service.url, itinerary.service.url)
    %span{style: "padding: 0px 12px; color: #b1b1b1;"}=' | '
  -unless itinerary.service.email.blank?
    =mail_to(itinerary.service.email, itinerary.service.email)
    %span{style: "padding: 0px 12px; color: #b1b1b1;"}=' | '
  -unless itinerary.service.phone.blank?
    =itinerary.service.formatted_phone


%h2=@page_title = 'Users'
= render :partial => 'filter'

%p
  = pluralize collection.total_count, resource_class.to_s
  found

= pagination do
  %table
    %thead
      %th ID
      %th Name
      %th Email
      %th Admin
      %th
    %tbody
      = render collection

Add id to list user table.

%h2=@page_title = 'Users'
= render :partial => 'filter'

%p
  = pluralize collection.total_count, resource_class.to_s
  found

= pagination do
  %table#list_users
    %thead
      %th ID
      %th Name
      %th Email
      %th Admin
      %th
    %tbody
      = render collection


- content_for :page_title do
  = t('auth.login')

= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
  .omniauth
    / FIXME: SFSafariViewの場合、pixivSignupSDKが使えないのでaccounts.pixiv.netでログインし、return_toでリダイレクトしてくる
    - if ios_safari?
      - query = { return_to: user_pixiv_omniauth_authorize_url }.to_query
      - link = "#{ENV['ACCOUNTS_PIXIV_URL']}/login?#{query}"
      = link_to t('simple_form.labels.omniauth_pixiv.signin'), link, class: 'block-button'
    - else
      .block-button.omniauth-pixiv
        = t('simple_form.labels.omniauth_pixiv.signin')

  .separate= t('simple_form.labels.omniauth.or')

  = f.input :email, autofocus: true, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email') }
  = f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password') }

  .actions
    = f.button :button, t('auth.login'), type: :submit

.form-footer= render "auth/shared/links"

Modify pixiv auth button style

- content_for :page_title do
  = t('auth.login')

= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
  .omniauth
    / FIXME: SFSafariViewの場合、pixivSignupSDKが使えないのでaccounts.pixiv.netでログインし、return_toでリダイレクトしてくる
    - if ios_safari?
      - query = { return_to: user_pixiv_omniauth_authorize_url }.to_query
      - link = "#{ENV['ACCOUNTS_PIXIV_URL']}/login?#{query}"
      = link_to t('simple_form.labels.omniauth_pixiv.signin'), link, class: 'block-button', style: 'text-transform:none;line-height:27px'
    - else
      .block-button.omniauth-pixiv
        = t('simple_form.labels.omniauth_pixiv.signin')

  .separate= t('simple_form.labels.omniauth.or')

  = f.input :email, autofocus: true, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email') }
  = f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password') }

  .actions
    = f.button :button, t('auth.login'), type: :submit

.form-footer= render "auth/shared/links"


- form_tag do
  - if form_header
    = form_header
  %p
    Viewing
    = select_tag("select_pools", saved_searches.join.html_safe,:disabled => true)
    = object_count.to_s + " results"
    = text_field_tag :q, search_term || "Search result for...", :disabled => true
    = link_to('Filters', '#')
  %p
    = link_to('Share this view', '#')
    = link_to('Add/Remove Columns', '#')
  %table(id="#{lower_class}_table")
    %thead
      %tr
      - columns.each do |column|
        %th
          = column[:name]
    = rows.collect {|row| capture_haml(row, &block)}.to_s

Allow multiple filter_tables to share a page

- form_tag do
  - if form_header
    = form_header
  %p
    Viewing
    = select_tag("select_#{lower_class}", saved_searches.join.html_safe,:disabled => true)
    = object_count.to_s + " results"
    = text_field_tag :q, search_term || "Search result for...", :disabled => true
    = link_to('Filters', '#')
  %p
    = link_to('Share this view', '#')
    = link_to('Add/Remove Columns', '#')
  %table(class="#{lower_class}_table")
    %thead
      %tr
      - columns.each do |column|
        %th
          = column[:name]
    = rows.collect {|row| capture_haml(row, &block)}.to_s


%h3 Stock Alerts

- if @alerts.empty?
  %p#dashboard-no-stock-alerts No stock alerts
- else
  %ul#dashboard-stock-alerts
    - @alerts.each do |sku|
      %li
        - if sku.out_of_stock?
          %span.value.indicator.warning= sku.stock_level
        - else
          %span.value.indicator.neutral= sku.stock_level
        %span.key= link_to(sku.long_desc, admin_product_path(:id => sku.product_id))

Improve the display of low stock levels

%h3 Stock Alerts

- if @alerts.empty?
  %p#dashboard-no-stock-alerts No stock alerts
- else
  %table#dashboard-stock-alerts
    %tbody
      - @alerts.each do |sku|
        %tr
          %td
            - if sku.out_of_stock?
              %span.value.indicator.warning= sku.stock_level
            - else
              %span.value.indicator.neutral= sku.stock_level
          %td
            %span.key= link_to(sku.long_desc, admin_product_path(:id => sku.product_id))


%h3.page_title
  Groups
  %small
    allows you to keep projects organized.
    Use groups for uniting related projects.

  = link_to 'New Group', new_admin_group_path, class: "btn btn-small pull-right"
%br
= form_tag admin_groups_path, method: :get, class: 'form-inline' do
  = text_field_tag :name, params[:name], class: "xlarge"
  = submit_tag "Search", class: "btn submit btn-primary"

%table
  %thead
    %tr
      %th
        Name
        %i.icon-sort-down
      %th Path
      %th Description
      %th Projects
      %th Owner
      %th.cred Danger Zone!

  - @groups.each do |group|
    %tr
      %td
        %strong= link_to group.name, [:admin, group]
      %td= truncate group.description
      %td= group.path
      %td= group.projects.count
      %td
        = link_to group.owner_name, admin_user_path(group.owner)
      %td.bgred
        = link_to 'Edit', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn btn-small"
        = link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove"
= paginate @groups, theme: "admin"

Fix column heading order in group admin view

%h3.page_title
  Groups
  %small
    allows you to keep projects organized.
    Use groups for uniting related projects.

  = link_to 'New Group', new_admin_group_path, class: "btn btn-small pull-right"
%br
= form_tag admin_groups_path, method: :get, class: 'form-inline' do
  = text_field_tag :name, params[:name], class: "xlarge"
  = submit_tag "Search", class: "btn submit btn-primary"

%table
  %thead
    %tr
      %th
        Name
        %i.icon-sort-down
      %th Description
      %th Path
      %th Projects
      %th Owner
      %th.cred Danger Zone!

  - @groups.each do |group|
    %tr
      %td
        %strong= link_to group.name, [:admin, group]
      %td= truncate group.description
      %td= group.path
      %td= group.projects.count
      %td
        = link_to group.owner_name, admin_user_path(group.owner)
      %td.bgred
        = link_to 'Edit', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn btn-small"
        = link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove"
= paginate @groups, theme: "admin"


%h1 Listing posts

= link_to 'New Post', new_editor_post_url, class: 'btn btn-default'

%table.table
  %thead
    %tr
      %th Public ID
      %th Title
      %th Category
      %th Published at
      %th Thumbnail
      %th
      %th
      %th

  %tbody
    - @posts.each do |post|
      %tr
        %td= post.public_id
        %td= post.title
        %td= post.category&.name
        %td= l post.published_at  if post.published_at
        %td= image_tag post.thumbnail_url, height: 80 if post.thumbnail.present?
        %td= link_to 'Show', editor_post_url(post)
        %td= link_to 'Preview', preview_editor_post_url(post), target: '_blank'
        %td= link_to 'Edit', edit_editor_post_url(post)
        %td= link_to 'Destroy', editor_post_url(post), method: :delete, data: { confirm: 'Are you sure?' }

- if @posts.total_pages > 1
  .text-center
    %nav.pagination
      = paginate @posts, views_prefix: 'editor'
      %p.pagination__entries= page_entries_info @posts

Remove a garbage white space


.nav-block.activity-filter-block
  - if current_user
    .controls
      = link_to namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "Feed", class: 'btn rss-btn' do
        %i.fa.fa-rss

  = render 'shared/event_filter'

.content_list.project-activity{:"data-href" => activity_project_path(@project)}
= spinner

:javascript
  var activity = new Activities();
  $(document).on('page:restore', function (event) {
    activity.reloadActivities()
  })

Remove contianer from last push widget

- @no_container = true

%div{ class: container_class }
  .nav-block.activity-filter-block
    - if current_user
      .controls
        = link_to namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "Feed", class: 'btn rss-btn' do
          %i.fa.fa-rss

    = render 'shared/event_filter'

  .content_list.project-activity{:"data-href" => activity_project_path(@project)}
  = spinner

:javascript
  var activity = new Activities();
  $(document).on('page:restore', function (event) {
    activity.reloadActivities()
  })


%h2.group-title Anhöriga
- if @refugee.relationships.empty? && @refugee.inverse_relationships.empty?
  = "Har inte angivits som anhörig till någon annan i systemet"

- if @refugee.relationships.present?
  %h3= "#{@refugee.name} är anhörig till:"
  %ul.related
    - @refugee.relationships.each  do |r|
      %li
        = link_to r.related.name, refugee_path(r.related)
        = "(#{r.type_of_relationship.name})"

.actions
  - if can? :edit, @refugee
    = link_to "Ny anhörig", new_refugee_relationship_path(@refugee), class: "btn btn-default btn-sm"
    = link_to "Redigera anhöriga", refugee_relationships_path(@refugee), class: "btn btn-default btn-sm"

- if @refugee.inverse_relationships.present?
  %h3= "#{@refugee.name} är uppgiven som anhörig av:"
  %ul.related
    - @refugee.inverse_relationships.each  do |r|
      %li
        = link_to r.refugee.name, refugee_path(r.refugee)
        = "(#{r.type_of_relationship.name})"

= show_attribute('refugee.other_relateds', @refugee.other_relateds)

Hide button when no relatives are avialable

%h2.group-title Anhöriga
- no_relatives = @refugee.relationships.empty? && @refugee.inverse_relationships.empty?
- if no_relatives
  = "Har inte angivits som anhörig till någon annan i systemet"

- if @refugee.relationships.present?
  %h3= "#{@refugee.name} är anhörig till:"
  %ul.related
    - @refugee.relationships.each  do |r|
      %li
        = link_to r.related.name, refugee_path(r.related)
        = "(#{r.type_of_relationship.name})"

.actions
  - if can? :edit, @refugee
    = link_to "Ny anhörig", new_refugee_relationship_path(@refugee), class: "btn btn-default btn-sm"
    - unless no_relatives
      = link_to "Redigera anhöriga", refugee_relationships_path(@refugee), class: "btn btn-default btn-sm"

- if @refugee.inverse_relationships.present?
  %h3= "#{@refugee.name} är uppgiven som anhörig av:"
  %ul.related
    - @refugee.inverse_relationships.each  do |r|
      %li
        = link_to r.refugee.name, refugee_path(r.refugee)
        = "(#{r.type_of_relationship.name})"

= show_attribute('refugee.other_relateds', @refugee.other_relateds)


%div{ class: container_class }
  .nav-block.d-none.d-sm-block.activities
    = render 'shared/event_filter'
    .controls
      = link_to project_path(@project, rss_url_options), title: s_("ProjectActivityRSS|Subscribe"), class: 'btn d-none d-sm-inline-block has-tooltip' do
        = icon('rss')

  .content_list.project-activity{ :"data-href" => activity_project_path(@project) }
  = spinner

Fix excessive blank space in project activity view

%div{ class: container_class }
  .nav-block.d-none.d-sm-flex.activities
    = render 'shared/event_filter'
    .controls
      = link_to project_path(@project, rss_url_options), title: s_("ProjectActivityRSS|Subscribe"), class: 'btn d-none d-sm-inline-block has-tooltip' do
        = icon('rss')

  .content_list.project-activity{ :"data-href" => activity_project_path(@project) }
  = spinner


%section#banner
  .row
    .medium-12.columns
      %h2 Edit Meeting

      = simple_form_for [:admin, @meeting] do |f|
        .row
          .large-12.columns
            .row
              .large-4.columns
                = f.input :name
              .large-4.columns
                = f.input :slug
        .row
          .large-6.columns
            = f.input :date_and_time, as: :datetime, required: true, label: "Date"

        .row
          .large-12.columns
            = f.input :description, as: :text

        .row
          .large-3.columns
            = f.input :spaces, as: :integer

        .row
          .large-3.columns
            = f.association :venue, input_html: { data: { placeholder: "Select venue" }}, required: true
        .row
          .large-6.columns
            %br
            %label Organisers
            = f.collection_select :organisers, Member.all, :id, :full_name, { selected: @meeting.organisers.map(&:id) }, { multiple: true }

        .row
          .large-6.columns
            %br
            = f.input :invitable, as: :boolean, hint: "Allow members to RSVP"

        .row
          .large-12.columns.text-right
            = f.submit "Update", class: "button"

%br

Make datetime fields sit in one line

%section#banner
  .row
    .medium-12.columns
      %h2 Edit Meeting

      = simple_form_for [:admin, @meeting] do |f|
        .row
          .large-12.columns
            .row
              .large-4.columns
                = f.input :name
              .large-4.columns
                = f.input :slug
        .row
          .large-12.columns
            = f.input :date_and_time, as: :datetime, required: true, label: "Date", input_html: { style: "width: 120px;" }

        .row
          .large-12.columns
            = f.input :description, as: :text

        .row
          .large-3.columns
            = f.input :spaces, as: :integer

        .row
          .large-3.columns
            = f.association :venue, input_html: { data: { placeholder: "Select venue" }}, required: true
        .row
          .large-6.columns
            %br
            %label Organisers
            = f.collection_select :organisers, Member.all, :id, :full_name, { selected: @meeting.organisers.map(&:id) }, { multiple: true }

        .row
          .large-6.columns
            %br
            = f.input :invitable, as: :boolean, hint: "Allow members to RSVP"

        .row
          .large-12.columns.text-right
            = f.submit "Update", class: "button"

%br


%h1 Who profits from WestConnex?
%ul
  - @contractors.each do |c|
    %li
      = c.name
      = number_to_currency(c.total_est_contract_value)

Add class for styling contractors list

%h1 Who profits from WestConnex?
%ul.contractors
  - @contractors.each do |c|
    %li
      = c.name
      = number_to_currency(c.total_est_contract_value)


-# navigation styled for Bootstrap 3.0

- search_query = content_for?(:search_query) ? yield(:search_query) : ''

%nav.navbar.navbar-default.navbar-fixed
  .container
    .navbar-header
      %button.navbar-toggle.float-left{ type: 'button', data: { target: '.navbar-collapse', toggle: 'collapse' } }
        %span.sr-only Toggle navigation
        %span.icon-bar
        %span.icon-bar
        %span.icon-bar

      = link_to 'Panlexicon', root_path, class: 'navbar-brand hidden-xs'

    %form.navbar-form.navbar-right{ role: 'search', method: 'GET', action: '/' }
      .form-group
        %label.sr-only{ for: 'search' } Search
        %input#search.form-control{ name: 'q', value: search_query, placeholder: 'Search Panlexicon', type: 'text' }
        %button.btn.btn-default.hidden-xs{ type: 'submit' } Search

    .collapse.navbar-collapse.navbar-left
      %p
        .row
          .col-xs-12.visible-xs-block
            Panlexicon is a unique thesaurus that provides a quicker
            and more intuitive process for finding the words you want.

Disable autocapitalize in search form on iOS

-# navigation styled for Bootstrap 3.0

- search_query = content_for?(:search_query) ? yield(:search_query) : ''

%nav.navbar.navbar-default.navbar-fixed
  .container
    .navbar-header
      %button.navbar-toggle.float-left{ type: 'button', data: { target: '.navbar-collapse', toggle: 'collapse' } }
        %span.sr-only Toggle navigation
        %span.icon-bar
        %span.icon-bar
        %span.icon-bar

      = link_to 'Panlexicon', root_path, class: 'navbar-brand hidden-xs'

    %form.navbar-form.navbar-right{ role: 'search', method: 'GET', action: '/' }
      .form-group
        %label.sr-only{ for: 'search' } Search
        %input#search.form-control{ name: 'q', value: search_query, placeholder: 'Search Panlexicon', type: 'text' autocapitalize: 'off' }
        %button.btn.btn-default.hidden-xs{ type: 'submit' } Search

    .collapse.navbar-collapse.navbar-left
      %p
        .row
          .col-xs-12.visible-xs-block
            Panlexicon is a unique thesaurus that provides a quicker
            and more intuitive process for finding the words you want.


= stylesheet_link_tag 'admin/assets'
= render_region :top

- render_region :main do |main|
  - main.edit_header do
    %h1= t("clipped_extension.asset_edit_title")

  - main.edit_form do
    - form_for :asset, :url => admin_asset_path(@asset), :html => { :method => "put", :multipart => true } do |f|
      .form_area
        = render :partial => "form", :locals => { :f => f }

        %div.content
          %fieldset
            %label.filename
              = "#{t("clipped_extension.filename")}: #{@asset.asset_file_name unless @asset.new_record?}"
            %br
            %label.url
              = "#{t("clipped_extension.asset_url")}: #{image_path @asset.asset.url unless @asset.new_record?}"
            %br
            %label.id
              = "#{t("clipped_extension.asset_id")}: #{@asset.asset.id unless @asset.new_record?}"
          %p.asset
            = image_tag @asset.thumbnail("normal"), :class => 'preview'

          = updated_stamp @asset

        %fieldset.upload
          %label.custom-file-upload.upload
            = t("clipped_extension.replace_file")
            = f.file_field :asset, :class => "", :style => "width: 100%"

        .buttons
          = save_model_button(@asset)
          = save_model_and_continue_editing_button(@asset)
          = t("or")
          = link_to t("cancel"), admin_assets_path

Fix incorrect asset id showing Instead of using the blob id, use the asset id

= stylesheet_link_tag 'admin/assets'
= render_region :top

- render_region :main do |main|
  - main.edit_header do
    %h1= t("clipped_extension.asset_edit_title")

  - main.edit_form do
    - form_for :asset, :url => admin_asset_path(@asset), :html => { :method => "put", :multipart => true } do |f|
      .form_area
        = render :partial => "form", :locals => { :f => f }

        %div.content
          %fieldset
            %label.filename
              = "#{t("clipped_extension.filename")}: #{@asset.asset_file_name unless @asset.new_record?}"
            %br
            %label.url
              = "#{t("clipped_extension.asset_url")}: #{image_path @asset.asset.url unless @asset.new_record?}"
            %br
            %label.id
              = "#{t("clipped_extension.asset_id")}: #{@asset.id unless @asset.new_record?}"
          %p.asset
            = image_tag @asset.thumbnail("normal"), :class => 'preview'

          = updated_stamp @asset

        %fieldset.upload
          %label.custom-file-upload.upload
            = t("clipped_extension.replace_file")
            = f.file_field :asset, :class => "", :style => "width: 100%"

        .buttons
          = save_model_button(@asset)
          = save_model_and_continue_editing_button(@asset)
          = t("or")
          = link_to t("cancel"), admin_assets_path


- page_title "Commits", @ref
= content_for :meta_tags do
  - if current_user
    = auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, format: :atom, private_token: current_user.private_token), title: "#{@project.name}:#{@ref} commits")

= render "head"

.tree-ref-holder
  = render 'shared/ref_switcher', destination: 'commits'

.commits-feed-holder.hidden-xs.hidden-sm
  - if create_mr_button?(@repository.root_ref, @ref)
    = link_to create_mr_path(@repository.root_ref, @ref), class: 'btn btn-success' do
      = icon('plus')
      Create Merge Request

  - if current_user && current_user.private_token
    = link_to namespace_project_commits_path(@project.namespace, @project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed", class: 'prepend-left-10 btn' do
      = icon("rss")
      Commits Feed

%ul.breadcrumb.repo-breadcrumb
  = commits_breadcrumbs

%div{id: dom_id(@project)}
  #commits-list= render "commits", project: @project
.clear
= spinner

- if @commits.count == @limit
  :javascript
    CommitsList.init("#{@ref}", #{@limit});

Make commits atom feed button smaller

- page_title "Commits", @ref
= content_for :meta_tags do
  - if current_user
    = auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, format: :atom, private_token: current_user.private_token), title: "#{@project.name}:#{@ref} commits")

= render "head"

.tree-ref-holder
  = render 'shared/ref_switcher', destination: 'commits'

.commits-feed-holder.hidden-xs.hidden-sm
  - if create_mr_button?(@repository.root_ref, @ref)
    = link_to create_mr_path(@repository.root_ref, @ref), class: 'btn btn-success' do
      = icon('plus')
      Create Merge Request

  - if current_user && current_user.private_token
    = link_to namespace_project_commits_path(@project.namespace, @project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed", class: 'prepend-left-10 btn' do
      = icon("rss")

%ul.breadcrumb.repo-breadcrumb
  = commits_breadcrumbs

%div{id: dom_id(@project)}
  #commits-list= render "commits", project: @project
.clear
= spinner

- if @commits.count == @limit
  :javascript
    CommitsList.init("#{@ref}", #{@limit});


- if @location
  - content_for :title, "Members near #{@location}"
- else content_for :title, "Find nearby members"

%p
  = form_tag(nearby_members_path, :method => :get, :class => 'form-inline') do
    = label_tag :distance, "Find members within", :class => 'control-label'
    = text_field_tag :distance, @distance, :class => 'input-mini'
    = select_tag :units, options_for_select({"miles" => :mi, "km" => :km}, @units), :width => "2em", :class => 'input-mini'
    = label_tag :location, "miles of", :class => 'control-label'
    = text_field_tag :location, @location
    = submit_tag "Search", :class => 'btn btn-primary'

- if can? :update, current_member
  %p
    = link_to "Edit your location", edit_member_registration_path(current_member)

- if !@nearby_members.empty?
  %h3 Results found
  %ul.thumbnails
    - @nearby_members.each do |member|
      %li.span2
        = render :partial => "members/thumbnail", :locals => { :member => member }
- elsif @location
  %h3 No results found

Make units dropdown wide enough to contain "miles".

- if @location
  - content_for :title, "Members near #{@location}"
- else content_for :title, "Find nearby members"

%p
  = form_tag(nearby_members_path, :method => :get, :class => 'form-inline') do
    = label_tag :distance, "Find members within", :class => 'control-label'
    = text_field_tag :distance, @distance, :class => 'input-mini'
    = select_tag :units, options_for_select({"miles" => :mi, "km" => :km}, @units), :class => 'input-small'
    = label_tag :location, "miles of", :class => 'control-label'
    = text_field_tag :location, @location
    = submit_tag "Search", :class => 'btn btn-primary'

- if can? :update, current_member
  %p
    = link_to "Edit your location", edit_member_registration_path(current_member)

- if !@nearby_members.empty?
  %h3 Results found
  %ul.thumbnails
    - @nearby_members.each do |member|
      %li.span2
        = render :partial => "members/thumbnail", :locals => { :member => member }
- elsif @location
  %h3 No results found