.group.navform.wat-cf
  %button.button{:type => "submit", :name => "_save"}
    = image_tag "/assets/rails_admin/theme/activo/images/icons/tick.png", :alt => t("admin.new.save")
    = t("admin.new.save")
  %span.extra_buttons
    - if authorized? :new, @abstract_model
      %button.button{:type => "submit", :name => "_add_another"}
        = image_tag "/assets/rails_admin/theme/activo/images/icons/add.png", :alt => t("admin.new.save_and_add_another")
        = t("admin.new.save_and_add_another")
    %button.button{:type => "submit", :name => "_add_edit"}
      = image_tag "/assets/rails_admin/theme/activo/images/icons/edit.png", :alt => t("admin.new.save_and_edit")
      = t("admin.new.save_and_edit")
    %button.button{:type => "submit", :name => "_continue"}
      = image_tag "/assets/rails_admin/theme/activo/images/icons/delete.png", :alt => t("admin.new.cancel")
      = t("admin.new.cancel")

Fix submit buttons' icon paths in production

.group.navform.wat-cf
  %button.button{:type => "submit", :name => "_save"}
    = image_tag(image_path("rails_admin/theme/activo/images/icons/tick.png"), :alt => t("admin.new.save"))
    = t("admin.new.save")
  %span.extra_buttons
    - if authorized? :new, @abstract_model
      %button.button{:type => "submit", :name => "_add_another"}
        = image_tag(image_path("rails_admin/theme/activo/images/icons/add.png"), :alt => t("admin.new.save_and_add_another"))
        = t("admin.new.save_and_add_another")
    %button.button{:type => "submit", :name => "_add_edit"}
      = image_tag(image_path("rails_admin/theme/activo/images/icons/edit.png"), :alt => t("admin.new.save_and_edit"))
      = t("admin.new.save_and_edit")
    %button.button{:type => "submit", :name => "_continue"}
      = image_tag(image_path("rails_admin/theme/activo/images/icons/delete.png"), :alt => t("admin.new.cancel"))
      = t("admin.new.cancel")


%section
  %h2 Editing Video
  = simple_form_for @video do |f|
    = f.error_notification
    = f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present?
    .form-inputs
      = f.input :name
      = f.input :air_date
      = f.input :external_id, label: 'External ID'
    .form-actions
      = f.button :submit, class: 'btn-primary'

Use string input field for date editing video.

%section
  %h2 Editing Video
  = simple_form_for @video do |f|
    = f.error_notification
    = f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present?
    .form-inputs
      = f.input :name
      = f.input :air_date, as: :string, input_html: { value: localize(f.object.air_date, format: "%Y.%m.%d") }
      = f.input :external_id, label: 'External ID'
    .form-actions
      = f.button :submit, class: 'btn-primary'


%h2 Search results

.row
  .col-md-12
    %table.table.table-condensed
      %thead
        %tr
          %th Reservation ID
          %th Start time
          %th End time
          %th IP
          %th Name
          %th Steam ID
          %th ETF2L
          %th RGL.gg
          %th logs.tf
      - @results.each do |result|
        %tr
          %td= link_to(result.reservation_id, player_statistics_path(reservation_id: result.reservation_id))
          %td= I18n.l(result.reservation.starts_at,  :format => :long)
          %td= I18n.l(result.reservation.ends_at,  :format => :long)
          %td
            - if result.ip.present?
              = link_to(result.ip, league_request_path(ip: result.ip))
          %td= result.name
          %td= link_to(result.steam_uid, league_request_path(steam_uid: result.steam_uid))
          %td= link_to("ETF2L search", "http://etf2l.org/search/#{result.steam_uid}/")
          %td= link_to("RGL profile", "http://rgl.gg/Public/PlayerProfile.aspx?p=#{result.steam_uid}")
          %td= link_to("logs.tf", "http://logs.tf/profile/#{result.steam_uid}")

Use short notation for end time

%h2 Search results

.row
  .col-md-12
    %table.table.table-condensed
      %thead
        %tr
          %th Reservation ID
          %th Start time
          %th End time
          %th IP
          %th Name
          %th Steam ID
          %th ETF2L
          %th RGL.gg
          %th logs.tf
      - @results.each do |result|
        %tr
          %td= link_to(result.reservation_id, player_statistics_path(reservation_id: result.reservation_id))
          %td= I18n.l(result.reservation.starts_at,  :format => :long)
          %td= I18n.l(result.reservation.ends_at,  :format => :short)
          %td
            - if result.ip.present?
              = link_to(result.ip, league_request_path(ip: result.ip))
          %td= result.name
          %td= link_to(result.steam_uid, league_request_path(steam_uid: result.steam_uid))
          %td= link_to("ETF2L search", "http://etf2l.org/search/#{result.steam_uid}/")
          %td= link_to("RGL profile", "http://rgl.gg/Public/PlayerProfile.aspx?p=#{result.steam_uid}")
          %td= link_to("logs.tf", "http://logs.tf/profile/#{result.steam_uid}")


.tn-tc-row{:style => ("display: none;" if f.object._destroy)}
  = f.hidden_field :item_method, value: field
  .tn-tc-topbar
    .actions
      %i.fa.fa-arrows.drag-anchor

      = link_to '#', class: 'tn-tc-open-library above', data: { modal_target: ".tenon-library", modal_closest: '.tn-tc', modal_title: "Insert Content", modal_handler: 'Tenon.features.tenonContent.Library', modal_clone: 'true', tooltip: '' }, title: 'Insert Content' do
        = fa_icon('plus-circle')

      = link_to_remove_association(fa_icon('trash-o'), f, {'data-confirm' => 'Are you sure?', 'data-wrapper-class' => 'tn-tc-row'})

    .spacer

  .tn-tc-fields= render row_partial, f: f

  .tn-tc-bottombar
    .actions
      = link_to '#', class: 'tn-tc-open-library below', data: { modal_target: ".tenon-library", modal_closest: '.tn-tc', modal_title: "Insert Content", modal_handler: 'Tenon.features.tenonContent.Library', modal_clone: 'true', modal_closest: '.tn-tc', tooltip: ''}, title: 'Insert Content' do
        = fa_icon('plus-circle')

Fix the broken plus circle on tenon rows

.tn-tc-row{:style => ("display: none;" if f.object._destroy)}
  = f.hidden_field :item_method, value: field
  .tn-tc-topbar
    .actions
      %i.fa.fa-arrows.drag-anchor

      = link_to '#', class: 'tn-tc-open-library above', data: { modal_target: ".tenon-library", modal_closest: '.tn-tc', modal_title: "Insert Content", modal_handler: 'Tenon.features.tenonContent.Library', modal_clone: 'true', tooltip: '' }, title: 'Insert Content' do
        %i.fa.fa-fw.fa-plus-circle

      = link_to_remove_association(fa_icon('trash-o'), f, {'data-confirm' => 'Are you sure?', 'data-wrapper-class' => 'tn-tc-row'})

    .spacer

  .tn-tc-fields= render row_partial, f: f

  .tn-tc-bottombar
    .actions
      = link_to '#', class: 'tn-tc-open-library below', data: { modal_target: ".tenon-library", modal_closest: '.tn-tc', modal_title: "Insert Content", modal_handler: 'Tenon.features.tenonContent.Library', modal_clone: 'true', modal_closest: '.tn-tc', tooltip: ''}, title: 'Insert Content' do
        %i.fa.fa-fw.fa-plus-circle


= simple_form_for resource do |f|
  = f.input :file, :as => :file

  = f.button :submit

Use proper bootstrap markup for esr file upload form.

= simple_form_for resource do |f|
  .row-fluid
    = f.input :file, :as => :file

  .form-actions
    = f.button :submit


!!!
%html
  %head
    %title
      - if yield(:title).length > 0
        #{yield(:title)} | Hummingbird
      - else
        Hummingbird
    = stylesheet_link_tag    "application", :media => "all"
    = javascript_include_tag "application"
    = csrf_meta_tags
    %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}
    %script{:src => "//use.typekit.net/nlt2ped.js", :type => "text/javascript"}
    :javascript
      try{Typekit.load();}catch(e){}

  = render 'shared/header'
  %body#page.off-canvas.slide-nav
    = yield
  = render 'shared/footer'

Comment out code in header so that iphone don't see broken mobile styles

!!!
%html
  %head
    %title
      - if yield(:title).length > 0
        #{yield(:title)} | Hummingbird
      - else
        Hummingbird
    = stylesheet_link_tag    "application", :media => "all"
    = javascript_include_tag "application"
    = csrf_meta_tags
    / %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}
    %script{:src => "//use.typekit.net/nlt2ped.js", :type => "text/javascript"}
    :javascript
      try{Typekit.load();}catch(e){}

  = render 'shared/header'
  %body#page.off-canvas.slide-nav
    = yield
  = render 'shared/footer'


%div#burndownChart{ :style => "height:300px; " }
:javascript
  $(function() {
    $.jqplot('burndownChart', <%= burndown_data(@sprint) %>, { axes: { yaxis: { min: 0 } } });
  });

Fix problem with sprint burndown chart - missed this when migrating to HAML

%div#burndownChart{ :style => "height:300px; " }
:javascript
  $(function() {
    $.jqplot('burndownChart', #{burndown_data(@sprint)}, { axes: { yaxis: { min: 0 } } });
  });


:css
- if big_iframe
  :css
    @media (min-width: 1080px) {
      .navbar-pf ul > li.active { margin-bottom: 0 !important; }
      .navbar-nav ul > li > ul { display:none }
      body { padding-top: #{padding_top}px !important }
    }

Fix some style problems with UI plugins.


- unless planting.finished?
  // Finish times
  - if planting.finish_is_predicatable?
    - if planting.super_late?
      %span.badge.badge-super-late= t('.super_late')
      = render 'shared/buttons/finish_planting', planting: planting
    - elsif planting.late?
      %span.badge.badge-late= t('.late_finishing')
    - else
      %span.badge
        = days_from_now_to_finished(planting)
        = t('.days_until_finished')

  // Harvest times
  - unless planting.super_late?
    - if planting.harvest_time?
      %span.badge.badge-harvest= t('.harvesting_now')
    - elsif planting.before_harvest_time?
      %span.badge
        = days_from_now_to_first_harvest(planting)
        = t('.days_until_harvest')

Use new finish button on planting badges

- unless planting.finished?
  // Finish times
  - if planting.finish_is_predicatable?
    - if planting.super_late?
      %span.badge.badge-super-late= t('.super_late')
      = planting_finish_button(planting)
    - elsif planting.late?
      %span.badge.badge-late= t('.late_finishing')
    - else
      %span.badge
        = days_from_now_to_finished(planting)
        = t('.days_until_finished')

  // Harvest times
  - unless planting.super_late?
    - if planting.harvest_time?
      %span.badge.badge-harvest= t('.harvesting_now')
    - elsif planting.before_harvest_time?
      %span.badge
        = days_from_now_to_first_harvest(planting)
        = t('.days_until_harvest')


= inject_enterprises

.darkswarm
  - content_for :order_cycle_form do
    %strong.avenir
      Order ready on
      - if @order.order_cycle
        = @order.order_cycle.pickup_time_for(@order.distributor)
      - else
        = @order.distributor.next_collection_at

  = render partial: "shopping_shared/details"

  %fieldset#order_summary{"data-hook" => ""}
    .row
      .columns.large-12.text-center
        %h2
          Order confirmation
          = " #" + @order.number

    #order{"data-hook" => ""}
      - if params.has_key? :checkout_complete
        %h1= t(:thank_you_for_your_order)

      = render :partial => 'spree/shared/order_details', :locals => { :order => @order }

      .row
        .columns.large-12
          = link_to t(:back_to_store), main_app.shop_path, :class => "button"
          - unless params.has_key? :checkout_complete
            - if try_spree_current_user && respond_to?(:spree_account_path)
              = link_to t(:my_account), spree_account_path, :class => "button"

Use short syntax for rendering partials

= inject_enterprises

.darkswarm
  - content_for :order_cycle_form do
    %strong.avenir
      Order ready on
      - if @order.order_cycle
        = @order.order_cycle.pickup_time_for(@order.distributor)
      - else
        = @order.distributor.next_collection_at

  = render "shopping_shared/details"

  %fieldset#order_summary{"data-hook" => ""}
    .row
      .columns.large-12.text-center
        %h2
          Order confirmation
          = " #" + @order.number

    #order{"data-hook" => ""}
      - if params.has_key? :checkout_complete
        %h1= t(:thank_you_for_your_order)

      = render 'spree/shared/order_details', order: @order

      .row
        .columns.large-12
          = link_to t(:back_to_store), main_app.shop_path, :class => "button"
          - unless params.has_key? :checkout_complete
            - if try_spree_current_user && respond_to?(:spree_account_path)
              = link_to t(:my_account), spree_account_path, :class => "button"


%h1= values[:list_title]

%script{:type => 'text/javascript'}
  = File.read(File.join(@templatedir, "prototype-1.6.0.3.js"))
  = build_javascript_search_index(values[:methods] + values[:attributes])
  = File.read(File.join(@templatedir, "method_search.js"))
%form{:onsubmit => 'return performSearch()'}
  %input{:type => 'text', :id => 'search', :class => 'untouched', :value => 'Enter search terms...'}
%ol#search-results{ :class => 'methods', :style => 'display: none' }

%ol#index-entries{ :class => 'methods' }
  - values[:attributes].each do |entry|
    %li= link_to_method entry, [classfile(entry.parent), "method-#{entry.html_name}"].join('#')
  - values[:methods].each do |entry|
    %li= link_to_method entry, [classfile(entry.parent), entry.aref].join('#')

Remove duplicate entries in the method index, fix attribute links

%h1= values[:list_title]

%script{:type => 'text/javascript'}
  = File.read(File.join(@templatedir, "prototype-1.6.0.3.js"))
  = build_javascript_search_index(values[:methods] + values[:attributes])
  = File.read(File.join(@templatedir, "method_search.js"))
%form{:onsubmit => 'return performSearch()'}
  %input{:type => 'text', :id => 'search', :class => 'untouched', :value => 'Enter search terms...'}
%ol#search-results{ :class => 'methods', :style => 'display: none' }

%ol#index-entries{ :class => 'methods' }
  - (values[:attributes] + values[:methods]).uniq.each do |entry|
    %li= link_to_method entry, [classfile(entry.parent), entry.aref].join('#')


- cache "income_payment_form-#{today_key}" do
  %h3 Hola
  = simple_form_for income.income_payment, url: income_payment_path(income.id),
    html: {id: 'income-payment-form'} do |f|
    = bonsai_form_error(f)
    = f.hidden_field :account_id

    = render 'payments/default_form', f: f, transaction: income

    .form-actions
      = f.submit "Cobrar", class: 'btn b btn-success'
      %a#cancel-payment-link.btn(hre='javascript:;') Cancelar

-#binding.pry
:javascript
  $(function() {
    var cur = currencies["#{income.currency}"];
      temp = _.template('{{code}}', cur);
    console.log("#{income.currency}", cur);
    $('#currency-label').append(temp);

    var p = new App.IncomePayment({
      accountsTo: #{AccountQuery.new.income_payment_options(income).to_json},
      baseCurrency: "#{income.currency}"
    });
  })

Remove typo in incomes payment form

- cache "income_payment_form-#{today_key}" do
  = simple_form_for income.income_payment, url: income_payment_path(income.id),
    html: {id: 'income-payment-form'} do |f|
    = bonsai_form_error(f)
    = f.hidden_field :account_id

    = render 'payments/default_form', f: f, transaction: income

    .form-actions
      = f.submit "Cobrar", class: 'btn b btn-success'
      %a#cancel-payment-link.btn(hre='javascript:;') Cancelar

-#binding.pry
:javascript
  $(function() {
    var cur = currencies["#{income.currency}"];
      temp = _.template('{{code}}', cur);
    console.log("#{income.currency}", cur);
    $('#currency-label').append(temp);

    var p = new App.IncomePayment({
      accountsTo: #{AccountQuery.new.income_payment_options(income).to_json},
      baseCurrency: "#{income.currency}"
    });
  })


= render "projects/issues/head"

- if can? current_user, :admin_label, @project
  = link_to new_project_label_path(@project), class: "pull-right btn btn-new" do
    New label
%h3.page-title
  Labels
%hr

- if @labels.present?
  %ul.bordered-list.manage-labels-list
    = render @labels

- else
  .light-well
    .nothing-here-block Add first label to your issues or #{link_to 'generate', generate_project_labels_path(@project), method: :post} default set of labels

Add pagination to labels page

= render "projects/issues/head"

- if can? current_user, :admin_label, @project
  = link_to new_project_label_path(@project), class: "pull-right btn btn-new" do
    New label
%h3.page-title
  Labels
%hr

- if @labels.present?
  %ul.bordered-list.manage-labels-list
    = render @labels
  = paginate @labels, theme: 'gitlab'

- else
  .light-well
    .nothing-here-block Add first label to your issues or #{link_to 'generate', generate_project_labels_path(@project), method: :post} default set of labels


%header
  %nav.top-bar{ data: { topbar: true } }
    %ul.title-area
      %li.name
        %h1= link_to 'hacken.in', :root

    %section.top-bar-section
      %ul.right
        %li
          %a.left-off-canvas-toggle.menu-icon
            %span
        %li
          %a.right-off-canvas-toggle
            Search

Fix for the sidebar – for now

%header
  %nav.top-bar{ data: { topbar: true } }
    %ul.title-area
      %li.name
        %h1= link_to 'hacken.in', :root

    %section.top-bar-section
      %ul.right
        %li
          %a.left-off-canvas-toggle
            %span Sidebar
        %li
          %a.right-off-canvas-toggle
            Search


= content_for :page_title do
  Order Cycles

= content_for :page_actions do
  %li#new_order_cycle_link
    = button_link_to "New Order Cycle", main_app.new_admin_order_cycle_path, :icon => 'icon-plus', :id => 'admin_new_order_cycle_link'
  - if @show_more
    %li
      = button_link_to "Show less", main_app.admin_order_cycles_path
  - else
    %li
      = button_link_to "Show more", main_app.admin_order_cycles_path(params: { show_more: true })

= form_for @order_cycle_set, :url => main_app.bulk_update_admin_order_cycles_path do |f|
  %table.index#listing_order_cycles
    %colgroup
      %col
      %col{'style' => 'width: 20%;'}
      %col{'style' => 'width: 20%;'}
      - unless order_cycles_simple_index
        %col
        %col
        %col
      %col
      %col
      %col

    %thead
      %tr
        %th Name
        %th Open
        %th Close
        - unless order_cycles_simple_index
          %th Supplier
          %th Coordinator
          %th Distributors
        %th Products
        %th.actions
        %th.actions

    %tbody
      = f.fields_for :collection do |order_cycle_form|
        = render 'admin/order_cycles/row', order_cycle_form: order_cycle_form

  = f.submit 'Update'

Add column header for extra action column

= content_for :page_title do
  Order Cycles

= content_for :page_actions do
  %li#new_order_cycle_link
    = button_link_to "New Order Cycle", main_app.new_admin_order_cycle_path, :icon => 'icon-plus', :id => 'admin_new_order_cycle_link'
  - if @show_more
    %li
      = button_link_to "Show less", main_app.admin_order_cycles_path
  - else
    %li
      = button_link_to "Show more", main_app.admin_order_cycles_path(params: { show_more: true })

= form_for @order_cycle_set, :url => main_app.bulk_update_admin_order_cycles_path do |f|
  %table.index#listing_order_cycles
    %colgroup
      %col
      %col{'style' => 'width: 20%;'}
      %col{'style' => 'width: 20%;'}
      - unless order_cycles_simple_index
        %col
        %col
        %col
      %col
      %col
      %col
      %col

    %thead
      %tr
        %th Name
        %th Open
        %th Close
        - unless order_cycles_simple_index
          %th Supplier
          %th Coordinator
          %th Distributors
        %th Products
        %th.actions
        %th.actions
        %th.actions

    %tbody
      = f.fields_for :collection do |order_cycle_form|
        = render 'admin/order_cycles/row', order_cycle_form: order_cycle_form

  = f.submit 'Update'


%nav.navbar.navbar-default{:role=>"navigation"}
%div.container
  %div.page-header
    %h1 12/#{@advent_calendar_item.date}のAdventCalendarに参加登録しますか？
    %hr
  = form_for @advent_calendar_item do |f|
    %fieldset
      %div.form-group
        = f.label :user_name, "お名前"
        %div
          = f.text_field :user_name, class:"form-control"
      %div.form-group
        = f.label :comment, "コメント(カレンダーに表示されます)"
        %div
          = f.text_area :comment, class:"form-control"
      = f.hidden_field :date, value: @advent_calendar_item.date
      %div
        = link_to "キャンセル", root_path, class:"btn btn-default"
        = f.submit "登録する", class:"btn btn-primary"

Fix title of AdventCalendarItem new

%nav.navbar.navbar-default{:role=>"navigation"}
%div.container
  %div.page-header
    %h1 #{@advent_calendar_item.date}日目(12/#{@advent_calendar_item.date})のAdventCalendarに参加登録しますか？
    %hr
  = form_for @advent_calendar_item do |f|
    %fieldset
      %div.form-group
        = f.label :user_name, "お名前"
        %div
          = f.text_field :user_name, class:"form-control"
      %div.form-group
        = f.label :comment, "コメント(カレンダーに表示されます)"
        %div
          = f.text_area :comment, class:"form-control"
      = f.hidden_field :date, value: @advent_calendar_item.date
      %div
        = link_to "キャンセル", root_path, class:"btn btn-default"
        = f.submit "登録する", class:"btn btn-primary"


.widget__promo.context--content

  %h2.copy--h1{ class: properties[:extra_class_title] || false }
    = properties[:title]
    %span.copy--feature
      = properties[:description]

  .nav--inline
    - 3.times do
      .nav__item
        = ui_component("ads/mpu")

Switch properties name for promo widget

.widget__promo.context--content

  %h2.copy--h1{ class: properties[:title_class] || false }
    = properties[:title]
    %span.copy--feature
      = properties[:description]

  .nav--inline
    - 3.times do
      .nav__item
        = ui_component("ads/mpu")


- if @location != current_member.location
  - content_for :title, "Members near #{@location}"
- else
  - content_for :title, "Members near you"

= link_to "Edit your location", edit_member_registration_path(current_member)

= form_tag(nearby_members_path(current_member), :html => { :method => :get, :class => 'form-horizontal' }) do

  .control-group
    = label_tag :location, "Location", :class => 'control-label'
    .controls
      = text_field_tag :location, @location

  .form-actions
    = submit_tag "Search", :class => 'btn btn-primary'

%ul
  - @nearby_members.each do |member|
    %li
      = link_to(member.login_name, member)
      - if member.location
        , #{@member.location}

Fix bug in nearby members view.

- if @location != current_member.location
  - content_for :title, "Members near #{@location}"
- else
  - content_for :title, "Members near you"

= form_tag(nearby_members_path, :method => :get, :class => 'form-inline') do

  .control-group
    = label_tag :location, "Find members near", :class => 'control-label'
    .controls
      = text_field_tag :location, @location

  .form-actions
    = submit_tag "Search", :class => 'btn btn-primary'

= link_to "Edit your location", edit_member_registration_path(current_member)

%ul
  - @nearby_members.each do |member|
    %li
      = link_to(member.login_name, member)
      - if member.location
        , #{member.location}


%header.page-header
  - if @date > Time.zone.now.to_date.beginning_of_week
    = link_to canteen_path(@canteen, date: (@date - 1.day)), remote: true, 'data-push' => 'true', class: :prev do
      %span
  - if @date < (Time.zone.now.to_date + 2.days).end_of_week
    = link_to canteen_path(@canteen, date: (@date + 1.day)), remote: true, 'data-push' => 'true', class: :next do
      %span
  %h2.centered
    - if @date.to_date == Time.zone.now.to_date
      = "Today"
    - else
      = l @date.to_date, format: :with_weekday
%ul.meals
  - if @meals.any?
    - @meals.group_by(&:category).each do |category, meals|
      %li
        %h3= category
        - meals.each do |meal|
          %p= meal.name
  - else
    %li
      %h3 Kein Angebot
      %p Leider liegen uns für diesen Tag keine Angebote vor.

Remove canteen view date limits

%header.page-header
  = link_to canteen_path(@canteen, date: (@date - 1.day)), remote: true, 'data-push' => 'true', class: :prev do
    %span
  = link_to canteen_path(@canteen, date: (@date + 1.day)), remote: true, 'data-push' => 'true', class: :next do
    %span
  %h2.centered
    - if @date.to_date == Time.zone.now.to_date
      = "Today"
    - else
      = l @date.to_date, format: :with_weekday
%ul.meals
  - if @meals.any?
    - @meals.group_by(&:category).each do |category, meals|
      %li
        %h3= category
        - meals.each do |meal|
          %p= meal.name
  - else
    %li
      %h3 Kein Angebot
      %p Leider liegen uns für diesen Tag keine Angebote vor.


.item-preview
  .container-fluid
    .row.no-gutter
      %div{:class => (defined? large) ? 'item-picture col-sm-8' : 'item-picture col-sm-5'}
        %p.item-type Visualization
      %div{:class => (defined? large) ? 'item-info col-sm-4' : 'item-info col-sm-7'}
        %a{:href => visualization_path(item), :title => item.name}
          %h3= item.name
        - if item.description?
          %p= item.description
        %hr
        %p
          %i.glyphicon.glyphicon-user
          = item.author.name

Add user link to item preview

.item-preview
  .container-fluid
    .row.no-gutter
      %div{:class => (defined? large) ? 'item-picture col-sm-8' : 'item-picture col-sm-5'}
        %p.item-type Visualization
      %div{:class => (defined? large) ? 'item-info col-sm-4' : 'item-info col-sm-7'}
        %a{:href => visualization_path(item), :title => item.name}
          %h3= item.name
        - if item.description?
          %p= item.description
        %hr
        %p
          %a{href: user_path(item.author_id), title: item.author.name}
            %i.glyphicon.glyphicon-user
            = item.author.name


= page_header resource_name.pluralize do
  = link_to("New #{resource_name}", new_resource_url, :class => 'btn')
= page_range
= scope_nav
= table_for(controller_namespaces + [resource_class], collection, :class => 'table') do |t|
  = render 'table', :t => t
= paginate collection, :theme => 'app_frame'

Use default table styling in index

= page_header resource_name.pluralize do
  = link_to("New #{resource_name}", new_resource_url, :class => 'btn')
= page_range
= scope_nav
= table_for(controller_namespaces + [resource_class], collection) do |t|
  = render 'table', :t => t
= paginate collection, :theme => 'app_frame'


- content_for_title('Edit Fungi Sample')
- content_for(:subnav) do
  = button_to('« Samples', fungi_samples_path, class: 'button primary', method: 'get')
= render partial: 'form'

Fix link pointing to wrong path

- content_for_title('Edit Fungi Sample')
- content_for(:subnav) do
  = button_to('« Back', @fungi_sample, class: 'button primary', method: 'get')
= render partial: 'form'


- cache member do
  .member-thumbnail.panel
    %div
      = render partial: "members/avatar", locals: { member: member }
    %div
      %p.login-name
        = link_to member.login_name, member
        - unless member.location.blank?
          %small
            %br/
            %i= member.location
        - unless member.plantings.empty?
          %small
            %br/
            Recently planted:
            != member.plantings.first(3).map { |p| link_to p.crop_name, p }.join(", ")
      %p
        %small
          Joined
          = distance_of_time_in_words(member.created_at, Time.zone.now)
          ago.
      %p
        %small
          = [localize_plural(member.gardens, Garden),
          localize_plural(member.plantings, Planting),
          localize_plural(member.seeds, Seed)].join(", ")

Order recent plantings by when they were planted

- cache member do
  .member-thumbnail.panel
    %div
      = render partial: "members/avatar", locals: { member: member }
    %div
      %p.login-name
        = link_to member.login_name, member
        - unless member.location.blank?
          %small
            %br/
            %i= member.location
        - unless member.plantings.empty?
          %small
            %br/
            Recently planted:
            != member.plantings.order(created_at:desc).first(3).map { |p| link_to p.crop_name, p }.join(", ")
      %p
        %small
          Joined
          = distance_of_time_in_words(member.created_at, Time.zone.now)
          ago.
      %p
        %small
          = [localize_plural(member.gardens, Garden),
          localize_plural(member.plantings, Planting),
          localize_plural(member.seeds, Seed)].join(", ")


.heading
  %h2 Publish a stream to the network
  %span You'll have the chance to preview it before it goes live.
#upload
  %form#new_stream{:method => "POST", :action => "/streams"}
    %p
      %label{:for => "stream_title"} Title
      %input{:type => "text", :id => "stream_title", :name => "name"}
    %p
      %label{:for => "stream_description"} Description
      %input{:type => "text", :id => "stream_description", :name => "description"}
    %p
      %input{:type => "submit"}

Add description to create stream form submit button.

.heading
  %h2 Publish a stream to the network
  %span You'll have the chance to preview it before it goes live.
#upload
  %form#new_stream{:method => "POST", :action => "/streams"}
    %p
      %label{:for => "stream_title"} Title
      %input{:type => "text", :id => "stream_title", :name => "name"}
    %p
      %label{:for => "stream_description"} Description
      %input{:type => "text", :id => "stream_description", :name => "description"}
    %p
      %input{:type => "submit", :value => "Create Stream"}


%h2 Previously planted in this garden

- if @finished_plantings.size.positive?
  - year = nil
  - @finished_plantings.order(planted_at: :desc).each do |planting|
    - if year != planting.planted_at.year
      - year = planting.planted_at.year
      %h4= year
    = render "plantings/tiny",  planting: planting
- else
  .col-md-12
    %p Nothing has been planted here.

Fix bug showing plantings with no planted_at

%h2 Previously planted in this garden

- if @finished_plantings.any?
  - year = nil
  - @finished_plantings.where.not(planted_at: nil).order(planted_at: :desc).each do |planting|
    - if year != planting.planted_at.year
      - year = planting.planted_at.year
      %h4= year
    = render "plantings/tiny",  planting: planting

  - if @finished_plantings.where(planted_at: nil).any?
    %h4 Unknown year
    - @finished_plantings.where(planted_at: nil).each do |planting|
      = render "plantings/tiny",  planting: planting
- else
  .col-md-12
    %p Nothing has been planted here.


- cache ["v1", Machine.last_updated_at] do
- title "Machines"

  .row.top
    .col-lg-12
    %h2 Machines
  .row.row-no-padding
    .col-md-8.main-info
      %p
      All Fab Labs share common tools and processes in order to build a global network, a distributed laboratory for research and invention. Here you can find and add all the Machines available in the global Fab Lab Network, a global database of technologies locally available.

    .col-md-4
      %h4 Expand the Network
      %p Here you can add new Machines to the list.
      - if current_or_null_user.can_create?(Machine)
        = link_to new_machine_path, class: "btn btn-success" do
          = fa_icon "plus", text: t("views.labs.index.add_a_machine", default: "Add a new Machine")
      - else
        = link_to new_machine_path, class: "btn btn-success", data: {toggle: "tooltip", placement: "bottom" }, title: "You need to be signed in to add a Machine" do
          = fa_icon "plus", text: t("views.labs.index.add_a_machine", default: "Add a new Machine")

  .row.row-no-padding
    .col-lg-12
      = render "breadcrumbs"

  - @machines.in_groups_of(4, false) do |group|
    .row
      - group.each do |machine|
        .col-lg-3
          = render 'machine', machine: machine

Fix bug in indexes UI, user

- cache ["v1", Machine.last_updated_at] do
- title "Machines"

  .row.top
    .col-lg-12
    %h2 Machines
  .row.row-no-padding
    .col-md-8.main-info
      %p
      All Fab Labs share common tools and processes in order to build a global network, a distributed laboratory for research and invention. Here you can find and add all the Machines available in the global Fab Lab Network, a global database of technologies locally available.

    .col-md-4
      %h4 Expand the Network
      %p Here you can add new Machines to the list.
      - if current_user
        = link_to new_machine_path, class: "btn btn-success" do
          = fa_icon "plus", text: t("views.labs.index.add_a_machine", default: "Add a new Machine")
      - else
        = link_to new_machine_path, class: "btn btn-success", data: {toggle: "tooltip", placement: "bottom" }, title: "You need to be signed in to add a Machine" do
          = fa_icon "plus", text: t("views.labs.index.add_a_machine", default: "Add a new Machine")

  .row.row-no-padding
    .col-lg-12
      = render "breadcrumbs"

  - @machines.in_groups_of(4, false) do |group|
    .row
      - group.each do |machine|
        .col-lg-3
          = render 'machine', machine: machine


%table{:id => "matrices", :class => "table table-striped"}
  %thead
    %tr
      %th Group/Name
      %th Num Rows
      %th Num Cols
      %th Nonzeros
      %th Kind
      %th Symmetric
      %th Date
      %th Author
      %th Editor
      %th Notes
      %th Matlab URL
      %th Rutherford Boeing URL
      %th Matrix Market URL
      %th Type
  %tbody
    - @matrices.each do |matrix|
      %tr
        %td= link_to "#{matrix.group}/#{matrix.name}", matrix_path(matrix)
        %td= matrix.num_rows
        %td= matrix.num_cols
        %td= matrix.nonzeros
        %td= matrix.kind
        %td= matrix.symmetric
        %td= matrix.date
        %td= matrix.author
        %td= matrix.editor
        %td= matrix.notes
        %td= matrix.matlab_url
        %td= matrix.rutherford_boeing_url
        %td= matrix.matrix_market_url
        %td= matrix.type

Add download buttons to index listing

%table{:id => "matrices", :class => "table table-striped"}
  %thead
    %tr
      %th Group/Name
      %th Num Rows
      %th Num Cols
      %th Nonzeros
      %th Kind
      %th Symmetric
      %th Date
      %th Author
      %th Editor
      %th Notes
      %th Download File
  %tbody
    - @matrices.each do |matrix|
      %tr
        %td= link_to "#{matrix.group}/#{matrix.name}", matrix_path(matrix)
        %td= matrix.num_rows
        %td= matrix.num_cols
        %td= matrix.nonzeros
        %td= matrix.kind
        %td= matrix.symmetric
        %td= matrix.date
        %td= matrix.author
        %td= matrix.editor
        %td= matrix.notes
        %td
          = link_to "MATLAB", matrix.matlab_url, class: "btn btn-default"
          = link_to "Rutherford Boeing", matrix.rutherford_boeing_url, class: "btn btn-default"
          = link_to "Matrix Market", matrix.matrix_market_url, class: "btn btn-default"


#redaction_box.box
  %h1 Rédaction
  = link_to "Tribune de rédaction", '/redaction'
  - if (news = News.draft.sorted).any?
    %ul
      = list_of(news) do |news|
        = link_to news.title, [:redaction, news]

Add icon to notify new message for news in the redaction space

#redaction_box.box
  %h1 Rédaction
  = link_to "Tribune de rédaction", '/redaction'
  - if (news = News.draft.sorted).any?
    %ul
      = list_of(news) do |news|
        = link_to news.title, [:redaction, news]
        - if news.node.board_status(current_account) == :new_board
          = image_tag "/images/icones/chat.png", :alt => "Nouveaux !", :title => "Il y a de l'activité sur cette dépêche"


%section
  %h1 My #{convention.name} Profile

  %dl.row
    = render 'user_con_profiles/common_profile_data', user_con_profile: @user_con_profile

  = link_to "Edit my profile", edit_my_profile_path, class: "btn btn-secondary"

- if @user_con_profile.can_have_bio?
  %section.mt-4
    %h2 My Bio

    .card.mb-2
      .card-body
        .media
          .mr-3
            %img{src: "#{@user_con_profile.gravatar_url}?s=64&r=pg&d=mm", alt: "#{@user_con_profile.bio_name}'s Gravatar"}
          .media-body
            %h5.mt-0= @user_con_profile.bio_name
            = MarkdownPresenter.new("No bio provided").render(@user_con_profile.bio)

    .mb-4
      - if @user_con_profile.bio.present?
        = link_to "Edit bio/avatar settings", edit_bio_my_profile_path, class: "btn btn-secondary"
      - else
        = link_to "Add bio/avatar", edit_bio_my_profile_path, class: "btn btn-primary"

Clean up the design a little

%section
  %h1 My #{convention.name} Profile

  %dl.row
    = render 'user_con_profiles/common_profile_data', user_con_profile: @user_con_profile

  = link_to "Edit my profile", edit_my_profile_path, class: "btn btn-secondary"

- if @user_con_profile.can_have_bio?
  %hr

  %section.mt-4
    %h2 My Bio

    .media
      .mr-3
        %img{src: "#{@user_con_profile.gravatar_url}?s=64&r=pg&d=mm", alt: "#{@user_con_profile.bio_name}'s Gravatar"}
      .media-body
        %h5.mt-0= @user_con_profile.bio_name
        = MarkdownPresenter.new("No bio provided").render(@user_con_profile.bio)

    .mb-4
      - if @user_con_profile.bio.present?
        = link_to "Edit bio/avatar settings", edit_bio_my_profile_path, class: "btn btn-secondary"
      - else
        = link_to "Add bio/avatar", edit_bio_my_profile_path, class: "btn btn-primary"


-content_for :header do
  %h5.highlighted
    =link_to 'CONTROLS', flow_controls_path
    %span.divider /
    =@control.slug
  %h1.location=@control.title

.row
  .span8
    =render :partial => 'controls/show',
            :layout => 'layouts/widget_box',
            :locals => { :control => @control }

Add 'Edit Control' button to Control page

-content_for :header do
  %h5.highlighted
    =link_to 'CONTROLS', flow_controls_path
    %span.divider /
    =@control.slug
  %h1.location=@control.title

-content_for :subheader_extras do
  .btn-group.fltrt
    %a.btn.btn-warning{ :'data-toggle' => 'modal-form', :href => '#edit-control-modal' }
      Edit Control

.row
  .span8
    =render :partial => 'controls/show',
            :layout => 'layouts/widget_box',
            :locals => { :control => @control }

#edit-control-modal.modal.fade
  =form_for @control, :url => flow_control_path(@control), :method => :put, :remote => true, :html => {:class => :form} do |f|
    .modal-header
      %button.close{"data-dismiss" => "modal"} x
      %h1 Edit control
    .modal-body
      =render :partial => 'controls/form',
              :locals  => { :f => f }
    .modal-footer
      =f.submit pat(:save)
      =f.submit pat(:cancel), :type => 'reset'


- if grants.empty?
  %p There are no grants associated with this account.
-else
  %table.table.table-hover#grants_datatable
    %thead
      %tr
        %th.left Grant
        %th.center Fiscal Year
        %th.left Source
        %th.right Amount
        %th.right Expenditures
        %th.right Total Expended
        %th.center

    %tbody
      - total = 0
      - spent = 0
      - grants.each do |grant|
        - total += grant.amount
        -# spent += grant.spent
        %tr{:data => {:action_path => grant_path(grant)}}
          %td.left= grant.grant_number
          %td.center= format_as_fiscal_year(grant.fy_year)
          %td.left= grant.funding_source
          %td.right= format_as_currency(grant.amount)
          %td.right= format_as_integer(grant.grant_purchases.count)
          %td.right= format_as_currency(grant.spent)
          %td.center
            = render :partial => "grants/popup_table", :locals => {:grant => grant}
    %tfoot
      %tr
        %td{:colspan => 3}
        %td.right= format_as_currency(total)
        %td.right
        %td.right= format_as_currency(spent)
        %td

= render :partial => 'shared/datatable_javascript', :locals => {:id => 'grants_datatable'}

Fix missing summary value on grants index table

- if grants.empty?
  %p There are no grants associated with this account.
-else
  %table.table.table-hover#grants_datatable
    %thead
      %tr
        %th.left Grant
        %th.center Fiscal Year
        %th.left Source
        %th.right Amount
        %th.right Expenditures
        %th.right Total Expended
        %th.center

    %tbody
      - total = 0
      - spent = 0
      - grants.each do |grant|
        - total += grant.amount
        - spent += grant.spent
        %tr{:data => {:action_path => grant_path(grant)}}
          %td.left= grant.grant_number
          %td.center= format_as_fiscal_year(grant.fy_year)
          %td.left= grant.funding_source
          %td.right= format_as_currency(grant.amount)
          %td.right= format_as_integer(grant.grant_purchases.count)
          %td.right= format_as_currency(grant.spent)
          %td.center
            = render :partial => "grants/popup_table", :locals => {:grant => grant}
    %tfoot
      %tr
        %td{:colspan => 3}
        %td.right= format_as_currency(total)
        %td.right
        %td.right= format_as_currency(spent)
        %td

= render :partial => 'shared/datatable_javascript', :locals => {:id => 'grants_datatable'}


%ul
  - @backup_files.each do |file|
    %li
      = link_to(file.name, daemon_setting_history_path(id: file.file_id))
      %label= t('terms.backup_time')
      = file.ctime.strftime(I18n.t 'time.formats.default')

Add form to update a note of a history.

%ul
  - @backup_files.each do |file|
    %li
      = link_to(file.name, daemon_setting_history_path(id: file.file_id))
      %label= t('terms.backup_time')
      = file.ctime.strftime(I18n.t 'time.formats.default')
      = form_for :note, url: daemon_setting_note_path(id: file.note.file_id), method: :patch, id: "note-#{file.note.file_id}" do |f|
        = f.text_field :content, value: file.note.content
        = submit_tag t('terms.save'), class: 'btn'


%div#bitbucket_import_modal.modal.hide
  .modal-dialog
    .modal-content
      .modal-header
        %a.close{href: "#", "data-dismiss" => "modal"} ×
        %h3 Import projects from Bitbucket
      .modal-body
        To enable importing projects from Bitbucket,
        - if current_user.admin?
          you need to
        - else
          your GitLab administrator needs to
        == #{link_to 'setup OAuth integration', 'https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/integration/butbucket.md'}.

Fix link to bitbucket import documentation

%div#bitbucket_import_modal.modal.hide
  .modal-dialog
    .modal-content
      .modal-header
        %a.close{href: "#", "data-dismiss" => "modal"} ×
        %h3 Import projects from Bitbucket
      .modal-body
        To enable importing projects from Bitbucket,
        - if current_user.admin?
          you need to
        - else
          your GitLab administrator needs to
        == #{link_to 'setup OAuth integration', 'https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/integration/bitbucket.md'}.


.inner
  #nav_logo
    =link_to image_tag("icons/leap-logo.png"), search_people_url
  - form_tag search_people_url, :method => :get, :id=> "search_form" do
    /*=link_to image_tag("icons/search.png", :class => "icon"), search_people_url*/
    = text_field_tag :q, params[:q]
    = submit_tag "Search", :class => "styled_button", :id => "top_nav_search"
  #multi-view
    - if controller.controller_name == "views"
      = link_to :class => "search", :all => true do
        .block_border
          .block
            .left
              = image_tag "icons/multi.png"
            .right
              Everyone
    - else

  #notice= Settings.top_bar_notice
  #login_name
    .left
      = image_tag("#{url_for(@user)}.jpg")
    .right
      = link_to @user.forename, person_url(@user)
      %br
      = link_to @user.surname, person_url(@user)

Make the image on the top bar a link, too

.inner
  #nav_logo
    =link_to image_tag("icons/leap-logo.png"), search_people_url
  - form_tag search_people_url, :method => :get, :id=> "search_form" do
    /*=link_to image_tag("icons/search.png", :class => "icon"), search_people_url*/
    = text_field_tag :q, params[:q]
    = submit_tag "Search", :class => "styled_button", :id => "top_nav_search"
  #multi-view
    - if controller.controller_name == "views"
      = link_to :class => "search", :all => true do
        .block_border
          .block
            .left
              = image_tag "icons/multi.png"
            .right
              Everyone
    - else

  #notice= Settings.top_bar_notice
  #login_name
    .left
      = link_to image_tag("#{url_for(@user)}.jpg"), person_url(@user)
    .right
      = link_to @user.forename, person_url(@user)
      %br
      = link_to @user.surname, person_url(@user)


!!! 5
%html
  %head
    %meta{ charset: "utf-8" }
    %title= @title ? "#{@title} - Garage" : "Garage"
    = csrf_meta_tags
    = stylesheet_link_tag "garage/application", :media => "all"
    = javascript_include_tag "garage/application"
    = favicon_link_tag "favicon.ico"

  %body{ class: action_classes }
    .navbar.navbar-default.navbar-static-top
      .container
        .navbar-header
          .navbar-brand
            = link_to "Garage", resources_path
        .navbar-collapse.collapse
          %ul.nav.navbar-nav
            %li= link_to "Console", console_resources_path
          %ul.nav.navbar-nav.navbar-right
            - if _current_user
              %li= link_to "Signout", Garage.configuration.docs.signout_path, method: Garage.configuration.docs.signout_request_method

    .main
      .container
        = yield

Add skip_pipeline option to suppress deprecation worning

!!! 5
%html
  %head
    %meta{ charset: "utf-8" }
    %title= @title ? "#{@title} - Garage" : "Garage"
    = csrf_meta_tags
    = stylesheet_link_tag "garage/application", :media => "all"
    = javascript_include_tag "garage/application"
    = favicon_link_tag "favicon.ico", skip_pipeline: true

  %body{ class: action_classes }
    .navbar.navbar-default.navbar-static-top
      .container
        .navbar-header
          .navbar-brand
            = link_to "Garage", resources_path
        .navbar-collapse.collapse
          %ul.nav.navbar-nav
            %li= link_to "Console", console_resources_path
          %ul.nav.navbar-nav.navbar-right
            - if _current_user
              %li= link_to "Signout", Garage.configuration.docs.signout_path, method: Garage.configuration.docs.signout_request_method

    .main
      .container
        = yield


-content_for :title, 'FitBit Stats : Activities : Dashboard : Matt Rayner'

.jumbotron
  %h1
    FitBit Stats
    %small
      = distance_of_time_in_words_to_now(@fit_bit_stats.created_at)
      ago.

.row
  %h2 Current Stats:
  .col-xs-6.text-center
    %h3 Steps
    .well.lead= @fit_bit_stats.steps
  .col-xs-6.text-center
    %h3 Floors
    .well.lead= @fit_bit_stats.floors

.row
  %h2 History:
  %table.table.table-hover
    %thead
      %tr
        %th Age
        %th Steps
        %th Floors
    %tbody
      - @fit_bit_history.each do |stat|
        %tr
          %td
            = distance_of_time_in_words_to_now(stat.created_at)
          %td= stat.steps
          %td= stat.floors

Fix FitBit Stats 500 Bug * If the user has no stats, visiting the page will cause a 500

-content_for :title, 'FitBit Stats : Activities : Dashboard : Matt Rayner'

.jumbotron
  %h1
    FitBit Stats
    %small
      = distance_of_time_in_words_to_now(@fit_bit_stats.created_at) - unless @fit_bit_stats.created_at.nil?
      ago.

.row
  %h2 Current Stats:
  .col-xs-6.text-center
    %h3 Steps
    .well.lead= @fit_bit_stats.steps || 0
  .col-xs-6.text-center
    %h3 Floors
    .well.lead= @fit_bit_stats.floors || 0

.row
  %h2 History:
  %table.table.table-hover
    %thead
      %tr
        %th Age
        %th Steps
        %th Floors
    %tbody
      - @fit_bit_history.each do |stat|
        %tr
          %td
            = distance_of_time_in_words_to_now(stat.created_at)
          %td= stat.steps
          %td= stat.floors


- content_for(:title, "Annotations privées · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")

= render partial: "header", locals: { dossier: @dossier }

#dossier-annotations-privees.container
  - if @dossier.champs_private.present?
    %section
      = form_for @dossier, url: annotations_gestionnaire_dossier_path(@dossier.procedure, @dossier), html: { class: 'form' } do |f|
        = f.fields_for :champs_private, f.object.champs_private do |champ_form|
          - champ = champ_form.object
          = render partial: "shared/dossiers/editable_champs/editable_champ",
            locals: { champ: champ, form: champ_form, seen_at: @annotations_privees_seen_at }

        .send-wrapper
          = f.submit 'Sauvegarder', class: 'button send', data: { disable: true }

  - else
    %h2.empty-text Aucune annotation privée

Make the annotations privées submit button more visible

- content_for(:title, "Annotations privées · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")

= render partial: "header", locals: { dossier: @dossier }

#dossier-annotations-privees.container
  - if @dossier.champs_private.present?
    %section
      = form_for @dossier, url: annotations_gestionnaire_dossier_path(@dossier.procedure, @dossier), html: { class: 'form' } do |f|
        = f.fields_for :champs_private, f.object.champs_private do |champ_form|
          - champ = champ_form.object
          = render partial: "shared/dossiers/editable_champs/editable_champ",
            locals: { champ: champ, form: champ_form, seen_at: @annotations_privees_seen_at }

        .send-wrapper
          = f.submit 'Sauvegarder', class: 'button primary send', data: { disable: true }

  - else
    %h2.empty-text Aucune annotation privée


.form-view
  = render "form"

= render 'show_invoices'
= render 'show_attachments'

Add a tab navigation to the customer show view.

%ul.tabs
  %li.active= link_to t_model, '#tab-customer'
  %li= link_to t_model(Invoice), '#tab-invoices'
  %li= link_to t_model(Attachment), '#tab-attachments'

.tab-content
  #tab-customer.active= render "form"
  #tab-invoices= render 'show_invoices'
  #tab-attachments= render 'show_attachments'


%li.list-group-item
  %h5.list-group-item-heading
    %strong= link_to record.date.strftime("%A %B %d %Y"), [card, record]

    %ul.list-inline.pull-right.text-muted
      %li
        %span.fa.fa-clock-o
        %strong= format_hours(record.hours)
      %li
        = link_to [:edit, card, record], remote: true do
          %span.fa.fa-pencil
      %li
        = link_to [card, record], method: :delete do
          %span.fa.fa-trash

  %p.list-group-item-text.small
    = truncate(record.description.html_safe, length: 40)

Truncate records descriptions to 100 chars

%li.list-group-item
  %h5.list-group-item-heading
    %strong= link_to record.date.strftime("%A %B %d %Y"), [card, record]

    %ul.list-inline.pull-right.text-muted
      %li
        %span.fa.fa-clock-o
        %strong= format_hours(record.hours)
      %li
        = link_to [:edit, card, record], remote: true do
          %span.fa.fa-pencil
      %li
        = link_to [card, record], method: :delete do
          %span.fa.fa-trash

  %p.list-group-item-text.small
    = truncate(record.description.html_safe, length: 100)


-load memopol_tags
-load search_tags

%ul.nav-bar
  %li
    %a{href: "{% simple_search_shortcut 'is_active:1' %}"}
      By name
  %li
    %a{href: "{% simple_search_shortcut 'total_score>0 is_active:1' sort='-total_score' %}"}
      By total score
  %li
    %a{href: "{% url meps:index_floor %}"}
      By floor
  -for menu in menus
    %li.has-flyout
      %a{href: "#"}
        =menu.name
      .flyout.large{style: "display: none;", id: "{{ menu.id }}"}
        .row
          -include "blocks/menu_item.html"
  %li
    %a{href: "{% simple_search_shortcut 'is_active:0' %}"}
      Former MEPs

Move "by floor" in the top menu

-load memopol_tags
-load search_tags

%ul.nav-bar
  %li
    %a{href: "{% simple_search_shortcut 'is_active:1' %}"}
      By name
  %li
    %a{href: "{% simple_search_shortcut 'total_score>0 is_active:1' sort='-total_score' %}"}
      By total score
  -for menu in menus
    %li.has-flyout
      %a{href: "#"}
        =menu.name
      .flyout.large{style: "display: none;", id: "{{ menu.id }}"}
        .row
          -include "blocks/menu_item.html"
  %li
    %a{href: "{% url meps:index_floor %}"}
      By floor
  %li
    %a{href: "{% simple_search_shortcut 'is_active:0' %}"}
      Former MEPs


= image_tag('fully_funded.png')
.small.uppcased_button_text
  .fully_funded_no_text This News Item is Fully Funded!
  .double_content_border

Clean up layout of fully-funded donation widget

= image_tag('fully_funded.png', :alt => 'This News Item is Fully Funded!')


#main_div
  - if Container.any?
    = render :partial => 'layouts/gtl'
  - else
    = render :partial => 'layouts/empty',
             :locals => {:add_message => _("Add a new Containers Provider"),
                         :documentation => 'http://manageiq.org/docs/reference/latest/doc-Managing_Providers/miq/#containers-providers'}

Fix check to check for providers not containers

#main_div
  - if ManageIQ::Providers::ContainerManager.any?
    = render :partial => 'layouts/gtl'
  - else
    = render :partial => 'layouts/empty',
             :locals => {:add_message => _("Add a new Containers Provider"),
                         :documentation => 'http://manageiq.org/docs/reference/latest/doc-Managing_Providers/miq/#containers-providers'}


#new-photo-message
  = semantic_form_for PhotoMessage.new, url: thread_photos_path(@thread), html: {multipart: true} do |f|
    = f.inputs do
      = f.input :photo, as: :file
      = f.input :retained_photo, as: :hidden
      = f.input :caption
      = semantic_fields_for Message.new do |f2|
        = f2.input :body
    = f.buttons do
      = f.commit_button

Remove message field from photo message, prefer caption.

#new-photo-message
  = semantic_form_for PhotoMessage.new, url: thread_photos_path(@thread), html: {multipart: true} do |f|
    = f.inputs do
      = f.input :photo, as: :file
      = f.input :retained_photo, as: :hidden
      = f.input :caption
    = f.buttons do
      = f.commit_button


#client_message.rbox.errorbox
  .rbox-wrap
    #client_message_content.rbox-content.grd-grid-12
      %p!= $error

Change error messages display style

#client_message.rbox.errorbox
  .rbox-wrap
    #client_message_content.rbox-content.grd-grid-12
      %p.center.error-msg!= $error


- if @commits.any?
  .ci_widget.ci-success{style: "display:none"}
    %i.icon-ok
    %strong CI build passed
    for #{@merge_request.last_commit_short_sha}.
    = link_to "Build page", ci_build_details_path(@merge_request)

  .ci_widget.ci-failed{style: "display:none"}
    %i.icon-remove
    %strong CI build failed
    for #{@merge_request.last_commit_short_sha}.
    = link_to "Build page", ci_build_details_path(@merge_request)

  - [:running, :pending].each do |status|
    .ci_widget{class: "ci-#{status}", style: "display:none"}
      %i.icon-time
      %strong CI build #{status}
      for #{@merge_request.last_commit_short_sha}.
      = link_to "Build page", ci_build_details_path(@merge_request)

  .ci_widget
    %strong
      %i.icon-spinner
      Checking for CI status for #{@merge_request.last_commit_short_sha}

  .ci_widget.ci-error{style: "display:none"}
    %i.icon-remove
    %strong Cannot connect to the CI server. Please check your settings and try again.

Use normal font instead of strong for ci status widget

- if @commits.any?
  .ci_widget.ci-success{style: "display:none"}
    %i.icon-ok
    %span CI build passed
    for #{@merge_request.last_commit_short_sha}.
    = link_to "Build page", ci_build_details_path(@merge_request)

  .ci_widget.ci-failed{style: "display:none"}
    %i.icon-remove
    %span CI build failed
    for #{@merge_request.last_commit_short_sha}.
    = link_to "Build page", ci_build_details_path(@merge_request)

  - [:running, :pending].each do |status|
    .ci_widget{class: "ci-#{status}", style: "display:none"}
      %i.icon-time
      %span CI build #{status}
      for #{@merge_request.last_commit_short_sha}.
      = link_to "Build page", ci_build_details_path(@merge_request)

  .ci_widget
    %strong
      %i.icon-spinner
      Checking for CI status for #{@merge_request.last_commit_short_sha}

  .ci_widget.ci-error{style: "display:none"}
    %i.icon-remove
    %span Cannot connect to the CI server. Please check your settings and try again.


%p Hi #{@resource.name}!
%p Thanks for signing up for an account on #{t("titles.main", :brand => t("titles.brand"))} Admin.
%p Please confirm your account email through the link below:
%p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token)

Remove extra "Admin" text from confirmation email.

%p Hi #{@resource.name}!
%p Thanks for signing up for an account on #{t("titles.main", :brand => t("titles.brand"))}.
%p Please confirm your account email through the link below:
%p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token)


!!! html
%html
  %head
    %meta(name="viewport" content="width=device-width, initial-scale=1")
    %link{ href: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css', type: 'text/css', rel: 'stylesheet' }

  %body
    %nav.navbar.navbar-default
      .container-fluid
        .navbar-header
          %button(type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#primary-navigation")
            %span.sr-only Toggle navigation
            %span.icon-bar
            %span.icon-bar
            %span.icon-bar
          %a.navbar-brand(href="/") Brand

        %div.collapse.navbar-collapse#primary-navigation
          %ul.nav.navbar-nav
            %li
              %a(href="/history") History

    .container
      = yield

    %script{ type: 'text/javascript', src: '/jquery.js'}
    %script{ type: 'text/javascript', src: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js'}
    %script{ type: 'text/javascript', src: '/jquery-ujs.js'}
    %script{ type: 'text/javascript', src: '/script.js'}

Change "Brand" to "Daily Activities".

!!! html
%html
  %head
    %meta(name="viewport" content="width=device-width, initial-scale=1")
    %link{ href: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css', type: 'text/css', rel: 'stylesheet' }

  %body
    %nav.navbar.navbar-default
      .container-fluid
        .navbar-header
          %button(type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#primary-navigation")
            %span.sr-only Toggle navigation
            %span.icon-bar
            %span.icon-bar
            %span.icon-bar
          %a.navbar-brand(href="/") Daily Activities

        %div.collapse.navbar-collapse#primary-navigation
          %ul.nav.navbar-nav
            %li
              %a(href="/history") History

    .container
      = yield

    %script{ type: 'text/javascript', src: '/jquery.js'}
    %script{ type: 'text/javascript', src: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js'}
    %script{ type: 'text/javascript', src: '/jquery-ujs.js'}
    %script{ type: 'text/javascript', src: '/script.js'}


-# Not all inputs are ng inputs, they don't make the ng-form dirty on change.
-# ng-change is only valid for inputs, not for a form.
-# So we use onchange and have to get the scope to access the ng controller
= form_for [main_app, :admin, @enterprise], html: { name: "enterprise_form",
  "ng-controller" => 'enterpriseCtrl',
  'onchange' => 'angular.element(enterprise_form).scope().setFormDirty()',
  } do |f|

  %save-bar{ dirty: "enterprise_form.$dirty", persist: "true" }
    %input.red{ type: "button", value: t(:update), ng: { click: "submit()", disabled: "!enterprise_form.$dirty" } }
    %input{ type: "button", ng: { value: "enterprise_form.$dirty ? '#{t(:cancel)}' : '#{t(:close)}'", click: "cancel('#{main_app.admin_enterprises_path}')" } }

  .row
    .sixteen.columns.alpha
      .four.columns.alpha
        = render 'admin/shared/side_menu'
      .one.column
      .eleven.columns.omega.fullwidth_inputs
        = render 'form', f: f

Use ng-cloak for admin/enterprises/edit form

-# Not all inputs are ng inputs, they don't make the ng-form dirty on change.
-# ng-change is only valid for inputs, not for a form.
-# So we use onchange and have to get the scope to access the ng controller
= form_for [main_app, :admin, @enterprise], html: { name: "enterprise_form",
  "ng-controller" => 'enterpriseCtrl',
  'onchange' => 'angular.element(enterprise_form).scope().setFormDirty()',
  "ng-cloak" => true } do |f|

  %save-bar{ dirty: "enterprise_form.$dirty", persist: "true" }
    %input.red{ type: "button", value: t(:update), ng: { click: "submit()", disabled: "!enterprise_form.$dirty" } }
    %input{ type: "button", ng: { value: "enterprise_form.$dirty ? '#{t(:cancel)}' : '#{t(:close)}'", click: "cancel('#{main_app.admin_enterprises_path}')" } }

  .row
    .sixteen.columns.alpha
      .four.columns.alpha
        = render 'admin/shared/side_menu'
      .one.column
      .eleven.columns.omega.fullwidth_inputs
        = render 'form', f: f


.comment.row
  .span6
    %h3= comment.teaser
    %blockquote
      = simple_format(comment.body)
      = link_to "Attachment", comment.attachment.url
      %small= authorship_details_for(comment)
    %small.pull-right= link_to "Edit",
      edit_activation_comment_path(@activation, comment.id)

Fix file attachment link bug and showing filename.

.comment.row
  .span6
    %h3= comment.teaser
    %blockquote
      = simple_format(comment.body)
      - if comment.attachment.present?
        = link_to comment.attachment_identifier, comment.attachment.url
      %small= authorship_details_for(comment)
    %small.pull-right= link_to "Edit",
      edit_activation_comment_path(@activation, comment.id)


%h1 Who profits from WestConnex?
%ul.contractors
  - @contractors.each do |c|
    %li.contractor
      %h2.contractor-name= c.name
      %span.contractor-value= number_to_currency(c.total_est_contract_value, precision: 0)
      %h3.contract-counter= pluralize(c.contracts.count, "contract")

Add list of contracts of each contractor

%h1 Who profits from WestConnex?
%ul.contractors
  - @contractors.each do |c|
    %li.contractor
      %h2.contractor-name= c.name
      %span.contractor-value= number_to_currency(c.total_est_contract_value, precision: 0)
      %h3.contract-counter= pluralize(c.contracts.count, "contract")
      %ul.contracts
        - c.contracts.each do |contract|
          %li.contract
            %p= contract.description


-if offering.runnable
  .item
    %ul.quiet_list
      %li
        - if offering.resource_page?
          = link_to "View #{offering.name}", offering.runnable
        - else
          = run_link_for(offering,nil,{:link_text=>"run #{offering.name}"})
      %li
        .tiny= offering.description

Hide resource page description from index

-if offering.runnable
  .item
    %ul.quiet_list
      - if offering.resource_page?
        %li= link_to "View #{offering.name}", offering.runnable
      - else
        %li
          = run_link_for(offering,nil,{:link_text=>"run #{offering.name}"})
        %li
          .tiny= offering.description


- if @message.scraped
  %p The following grocery receipt has been scraped and the data saved in your Pushcart account.
- else
  %p We recently received the following message for you, but did not determine it was a scrapable grocery receipt. If we were wrong in that determination, please let us know: michael.carroll@cornell.edu

%p ~ The Pushcart Team

%p ******

= @message.raw_html.html_safe

Update pass-through copy for scraped e-mails

- if @message.scraped
  %p The following grocery receipt has been processed and the data saved in your Pushcart account. Each Sunday you’ll receive an email summarizing your week’s purchases with some suggestions for the next week.
- else
  %p We recently received the following message for you, but did not determine it was a scrapable grocery receipt. If we were wrong in that determination, please let us know: michael.carroll@cornell.edu

%p ~ The Pushcart Team

%p ******

= @message.raw_html.html_safe


%h3= h @tag.name
%div
  %div
    = render :partial => 'ideas/idea_teaser', :collection => @ideas, :as => :idea

Make Tag 'show' view prettier

%div
  .main.panel.section
    .header
      %h2.icon.tags= h @tag.name
    .body
      = render :partial => 'ideas/idea_teaser', :collection => @ideas, :as => :idea


.banner-search.banner
  .container
    %h1.label-heading
      %small.pre-heading Find data and code you can use
      Search over #{pluralize(floor_to_hundreds(Scraper.count), "scraper")}
    = render partial: "search_form"

- if current_user.scrapers.empty?
  .banner-add-scraper.banner
    .container
      %h2 Unlock the data you need
      = link_to "Create your first scraper", new_scraper_path, class: "btn btn-primary btn-lg"

.container
  = render "broken_scrapers"

  .row
    .col-xs-12
      %h2 Recent New Users
      %ul.list-unstyled
        - User.all.order(created_at: :desc).limit(10).each do |user|
          %li
            = link_to user do
              = owner_image(user, 20)
      %p
        = link_to users_path do
          See more of the #{pluralize(User.count, "user")}…
    .col-md-6
      %h2 Recently Active Scrapers
      %p
        = link_to scrapers_path do
          See more of the #{pluralize(Scraper.count, "scraper")}…
      .list-group= sync partial: "scraper", collection: Scraper.order(:updated_at => :desc).limit(10)

Increase the avatar size to be consistent with other lists of users

.banner-search.banner
  .container
    %h1.label-heading
      %small.pre-heading Find data and code you can use
      Search over #{pluralize(floor_to_hundreds(Scraper.count), "scraper")}
    = render partial: "search_form"

- if current_user.scrapers.empty?
  .banner-add-scraper.banner
    .container
      %h2 Unlock the data you need
      = link_to "Create your first scraper", new_scraper_path, class: "btn btn-primary btn-lg"

.container
  = render "broken_scrapers"

  .row
    .col-xs-12
      %h2 Recent New Users
      %ul.list-unstyled
        - User.all.order(created_at: :desc).limit(10).each do |user|
          %li
            = link_to user do
              = owner_image(user, 60)
      %p
        = link_to users_path do
          See more of the #{pluralize(User.count, "user")}…
    .col-md-6
      %h2 Recently Active Scrapers
      %p
        = link_to scrapers_path do
          See more of the #{pluralize(Scraper.count, "scraper")}…
      .list-group= sync partial: "scraper", collection: Scraper.order(:updated_at => :desc).limit(10)


-# = render "spree/admin/payments/source_forms/gateway", payment_method: payment_method
.stripe
  %script{:src => "https://js.stripe.com/v3/", :type => "text/javascript"}
  - if Stripe.publishable_key
    :javascript
      angular.module('admin.payments').value("stripeObject", Stripe("#{Stripe.publishable_key}"))

  .row
    .three.columns
      = label_tag :cardholder_name, t(:cardholder_name)
    .six.columns
      = text_field_tag :cardholder_name, nil, {size: 40, "ng-model" => 'form_data.name'}
  %stripe-elements

Add label for card field

-# = render "spree/admin/payments/source_forms/gateway", payment_method: payment_method
.stripe
  %script{:src => "https://js.stripe.com/v3/", :type => "text/javascript"}
  - if Stripe.publishable_key
    :javascript
      angular.module('admin.payments').value("stripeObject", Stripe("#{Stripe.publishable_key}"))

  .row
    .three.columns
      = label_tag :cardholder_name, t(:cardholder_name)
    .six.columns
      = text_field_tag :cardholder_name, nil, {size: 40, "ng-model" => 'form_data.name'}
  .row
    .three.columns
      = label_tag :card_details, t(:card_details)
    .six.columns
      %stripe-elements


= form_for(qualification, :url => event, :remote => true, :method => :put, :html => {:class => "form edit-event-form"}) do |f|
  = hidden_field_tag :person_id, @topic.mis_id
  .span2
    %h4 Qualification
    = f.text_field :qual_type, :class => "span2", :placeholder => "e.g. GCSE"
  .span3
    %h4 Subject
    = f.text_field :title, :class => "span3", :placeholder => "e.g. Maths"
  .span1
    %h4 Grade
    = f.text_field :grade, :class => "span1"
  .span1
    %h4 Predicted?
    = f.check_box :predicted
  .span1
    %h4 Seen?
    = f.check_box :seen
  .span1
    %h4
    = f.submit "save", :class => "btn btn-primary"

Make qual edit non-ajaxy 'cos it breaks in IE atm

= form_for(qualification, :url => event, :method => :put, :html => {:class => "form edit-event-form"}) do |f|
  = hidden_field_tag :person_id, @topic.mis_id
  .span2
    %h4 Qualification
    = f.text_field :qual_type, :class => "span2", :placeholder => "e.g. GCSE"
  .span3
    %h4 Subject
    = f.text_field :title, :class => "span3", :placeholder => "e.g. Maths"
  .span1
    %h4 Grade
    = f.text_field :grade, :class => "span1"
  .span1
    %h4 Predicted?
    = f.check_box :predicted
  .span1
    %h4 Seen?
    = f.check_box :seen
  .span1
    %h4
    = f.submit "save", :class => "btn btn-primary"


.box
  .box-body-xs.clearfix
    .avatar-wrap
      %img.admin-pic{src: current_user.gravatar_url(:size =>96, :rating => 'G', :secure => true, :default => 'mm')}
    .admin-info
      %h5 #{current_user.full_name}
      %p.email #{current_user.email}
  .account-nav
    .list-group
      %a.list-group-item{:class => active_tab("registrations"), :href => edit_user_registration_path} Your Account
      %a.list-group-item{:class => active_tab("spaces"), :href =>  spaces_path} Spaces
      %a.list-group-item{:class => active_tab("payment_methods"), :href =>  payment_methods_path} Billing

Comment out the billing page for now

.box
  .box-body-xs.clearfix
    .avatar-wrap
      %img.admin-pic{src: current_user.gravatar_url(:size =>96, :rating => 'G', :secure => true, :default => 'mm')}
    .admin-info
      %h5 #{current_user.full_name}
      %p.email #{current_user.email}
  .account-nav
    .list-group
      %a.list-group-item{:class => active_tab("registrations"), :href => edit_user_registration_path} Your Account
      %a.list-group-item{:class => active_tab("spaces"), :href =>  spaces_path} Spaces
      =#%a.list-group-item{:class => active_tab("payment_methods"), :href =>  payment_methods_path} Billing


#body_content.clearfix
  #body_content_left.clearfix
    = @page[:body].html_safe
    - if @page[:spotlight_top]
      .spotlight.top
        = @page[:spotlight_top]
    - if @page[:spotlight_left]
      .spotlight.left
        = @page[:spotlight_left]
    - if @page[:spotlight_right]
      .spotlight.right
        = @page[:spotlight_right]

  #body_content_right.clearfix
    %h1 The Magnetic Theatre
    %p
      %a{:href=>'/pages/the-magnetic-theatre'} The Magnetic Theatre
      in The Magnetic Field presents theatre, music, comedy, and spoken word evenings throughout the week.
    %h3 Upcoming Shows
    %ul.sidebar_events
      - Shovelpunks::Events.upcoming.each do |event|
        %li
          %a{:href=>"##{event.id}", :rel=>'facebox'}
            %span.event_title= event.title
            %span.event_date= short_date event
          %span.description{:id=>event.id, :style=>'display:none'}
            = event.description
            %a{:href=>event.url, :title=>"Tickets for #{event.title}"} Buy Tix →
    %hr{:style=>'margin-top:30px'}
    - if @page[:side_body]
      .side_body= @page[:side_body]

Truncate home page listing titles

#body_content.clearfix
  #body_content_left.clearfix
    = @page[:body].html_safe
    - if @page[:spotlight_top]
      .spotlight.top
        = @page[:spotlight_top]
    - if @page[:spotlight_left]
      .spotlight.left
        = @page[:spotlight_left]
    - if @page[:spotlight_right]
      .spotlight.right
        = @page[:spotlight_right]

  #body_content_right.clearfix
    %h1 The Magnetic Theatre
    %p
      %a{:href=>'/pages/the-magnetic-theatre'} The Magnetic Theatre
      in The Magnetic Field presents theatre, music, comedy, and spoken word evenings throughout the week.
    %h3 Upcoming Shows
    %ul.sidebar_events
      - Shovelpunks::Events.upcoming.each do |event|
        %li
          %a{:href=>"##{event.id}", :rel=>'facebox'}
            %span.event_title= truncate(event.title, :length=>30)
            »
            %span.event_date= short_date event
          %span.description{:id=>event.id, :style=>'display:none'}
            = event.description
            %a{:href=>event.url, :title=>"Tickets for #{event.title}"} Buy Tix →
    %hr{:style=>'margin-top:30px'}
    - if @page[:side_body]
      .side_body= @page[:side_body]


%script(charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js")
:javascript
  new TWTR.Widget({
    version: 2,
    type: 'profile',
    rpp: 2,
    interval: 30000,
    width: 'auto',
    height: 300,
    theme: {
      shell: {
        background: '#dedede',
        color: '#000000'
      },
      tweets: {
        background: '#ffffff',
        color: '#000000',
        links: '#005e00'
      }
    },
    features: {
      scrollbar: false,
      loop: false,
      live: false,
      behavior: 'all'
    }
  }).render().setUser('Cyclescape').start();

Update twitter widget to https

%script(charset="utf-8" src="https://widgets.twimg.com/j/2/widget.js")

:javascript
  new TWTR.Widget({
    version: 2,
    type: 'profile',
    rpp: 2,
    interval: 30000,
    width: 'auto',
    height: 300,
    theme: {
      shell: {
        background: '#dedede',
        color: '#000000'
      },
      tweets: {
        background: '#ffffff',
        color: '#000000',
        links: '#005e00'
      }
    },
    features: {
      scrollbar: false,
      loop: false,
      live: false,
      behavior: 'all'
    }
  }).render().setUser('Cyclescape').start();


!!!
%html
  %body
    .container{ style: 'max-width: 600px; margin: auto;' }
      .banner{ style: 'background: #0b0c0c; vertical-align: bottom;' }
        = image_tag("https://www.prisonvisits.service.gov.uk/mailers/govuk-header-logo.png", alt: "GOV.UK")
      .content{ style: 'padding: 16px 30px 0;' }
        - if content_for? :copy_notice
          %p{ style: 'margin:1em 0; padding: 8px 16px; background: #dee0e2; font: 16px Helvetica, Arial, sans-serif' }
            %strong= yield :copy_notice
        = yield

Correct spacing around GOV.UK logo on mailers

!!!
%html
  %body
    .container{ style: "max-width:600px;margin:auto" }
      .banner{ style: "background:#0b0c0c" }
        = image_tag("https://www.prisonvisits.service.gov.uk/mailers/govuk-header-logo.png", alt: "GOV.UK", style: "vertical-align:bottom")
      .content{ style: "padding:16px 30px 0" }
        - if content_for? :copy_notice
          %p{ style: "margin:1em 0;padding:8px 16px;background:#dee0e2;font:16px Helvetica, Arial, sans-serif" }
            %strong= yield :copy_notice
        = yield


.gitlab-promo
  = link_to 'Homepage', promo_url
  = link_to "Blog", promo_url + '/blog/'
  = link_to "@gitlabhq", "https://twitter.com/gitlabhq"
  = link_to "Requests", "http://feedback.gitlab.com/"

Change twitter handle from gitlabhq -> gitlab

.gitlab-promo
  = link_to 'Homepage', promo_url
  = link_to "Blog", promo_url + '/blog/'
  = link_to "@gitlab", "https://twitter.com/gitlab"
  = link_to "Requests", "http://feedback.gitlab.com/"


%ul.nav-links.new-session-tabs.nav-tabs.nav{ class: ('custom-provider-tabs' if form_based_providers.any?) }
  - if crowd_enabled?
    %li.nav-item
      = link_to "Crowd", "#crowd", class: 'nav-link active', 'data-toggle' => 'tab'
  - @ldap_servers.each_with_index do |server, i|
    %li.nav-item{ class: active_when(i.zero? && !crowd_enabled?) }
      = link_to server['label'], "##{server['provider_name']}", class: 'nav-link', 'data-toggle' => 'tab'
  - if password_authentication_enabled_for_web?
    %li.nav-item
      = link_to 'Standard', '#login-pane', class: 'nav-link', 'data-toggle' => 'tab'
  - if allow_signup?
    %li.nav-item
      = link_to 'Register', '#register-pane', class: 'nav-link', 'data-toggle' => 'tab'

Fix multiple active tabs when Crowd or LDAP is in use

%ul.nav-links.new-session-tabs.nav-tabs.nav{ class: ('custom-provider-tabs' if form_based_providers.any?) }
  - if crowd_enabled?
    %li.nav-item
      = link_to "Crowd", "#crowd", class: 'nav-link active', 'data-toggle' => 'tab'
  - @ldap_servers.each_with_index do |server, i|
    %li.nav-item
      = link_to server['label'], "##{server['provider_name']}", class: "nav-link #{active_when(i.zero? && !crowd_enabled?)}", 'data-toggle' => 'tab'
  - if password_authentication_enabled_for_web?
    %li.nav-item
      = link_to 'Standard', '#login-pane', class: 'nav-link', 'data-toggle' => 'tab'
  - if allow_signup?
    %li.nav-item
      = link_to 'Register', '#register-pane', class: 'nav-link', 'data-toggle' => 'tab'


%nav.navbar.navbar-default.navbar-fixed-top
	.container
		.navbar-header
			%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", :type => "button"}
				%span.sr-only Toggle navigation
				%span.icon-bar
				%span.icon-bar
				%span.icon-bar
			= link_to image_tag('BitParrot_logo_GrayFont.png', width: 150, height: 50, align: 'left', style: 'margin: 0px 0px 10px 0px'), root_path
			= link_to 'Home', root_path, class: 'navbar-brand', style: 'margin: 0px 0px 0px 15px'
			= link_to 'About', about_path, class: 'navbar-brand'
			= link_to 'FAQ', faq_path, class: 'navbar-brand'
			= link_to 'Sign In', new_user_session_path, class: 'navbar-brand'
			= link_to 'Sign Up', new_user_registration_path, class: 'navbar-brand'
		.collapse.navbar-collapse
			%ul.nav.navbar-nav
				= render 'layouts/navigation_links'

Comment out the sign in sign up nav links until that section can be fixed.

%nav.navbar.navbar-default.navbar-fixed-top
	.container
		.navbar-header
			%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", :type => "button"}
				%span.sr-only Toggle navigation
				%span.icon-bar
				%span.icon-bar
				%span.icon-bar
			= link_to image_tag('BitParrot_logo_GrayFont.png', width: 150, height: 50, align: 'left', style: 'margin: 0px 0px 10px 0px'), root_path
			= link_to 'Home', root_path, class: 'navbar-brand', style: 'margin: 0px 0px 0px 15px'
			= link_to 'About', about_path, class: 'navbar-brand'
			= link_to 'FAQ', faq_path, class: 'navbar-brand'
			-#= link_to 'Sign In', new_user_session_path, class: 'navbar-brand'
			-#= link_to 'Sign Up', new_user_registration_path, class: 'navbar-brand'
		.collapse.navbar-collapse
			%ul.nav.navbar-nav
				= render 'layouts/navigation_links'


!!!
%html
%head
  %title IncomeKeeper | Your Wallet Application
  = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
  = javascript_include_tag 'application', 'data-turbolinks-track' => true
  = csrf_meta_tags
%body
  %header
    .header_inner
      = link_to image_tag('logo.svg'), root_path, id: 'logo'
      %nav
        - if user_signed_in?
          = link_to "New Transaction", new_transaction_path
          = link_to "Sign Out", destroy_user_session_path, method: :delete
        - else
          = link_to "Log In", new_user_session_path
  %p.notice= notice
  %p.alert= alert

  = yield

Fix weird multiple confirm delete error

!!!
%html
%head
  %title IncomeKeeper | Your Wallet Application
  = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
  -# This resolves the weird multiple confirm errors:
  = javascript_include_tag 'application', 'data-turbolinks-eval' => false
  -# This needs to be commented out as well for the aforementioned reason:
  -#= javascript_include_tag 'application', 'data-turbolinks-track' => true
  = csrf_meta_tags
%body
  %header
    .header_inner
      = link_to image_tag('logo.svg'), root_path, id: 'logo'
      %nav
        - if user_signed_in?
          = link_to "New Transaction", new_transaction_path
          = link_to "Sign Out", destroy_user_session_path, method: :delete
        - else
          = link_to "Log In", new_user_session_path
  %p.notice= notice
  %p.alert= alert

  = yield


.container.form-container
  %h1 Feedback
  %p Thank you for submitting feedback. Your feedback is helpful for us in the process of improving your experience.

  = simple_form_for @feedback_form_response do |f|
    = f.input :subject,  as: :hidden, input_html: { value: @subject }
    = f.input :body, label: 'Feedback:'
    = f.submit 'Submit', class: 'button dark'

Improve copy for feedback form

.container.form-container
  %h1 Training module feedback
  %p How was the training module you just completed? What did you like? What didn't you like?
  %p Was there something you wanted to know about that was missing? Did anything feel unnecessary?
  %p Any feedback you have will be very helpful!

  = simple_form_for @feedback_form_response do |f|
    = f.input :subject,  as: :hidden, input_html: { value: @subject }
    = f.input :body, label: false
    = f.submit 'Submit', class: 'button dark'


%nav.navbar.navbar-dark.navbar-expand-lg.bg-primary.fixed-top{ role: :navigation }
  .container{ class: ios_web_app? ? 'ios-web-app' : '' }
    %a.navbar-brand{ href: '/' }= APP_CONFIG['site_name']
    %button.navbar-toggler{ data: { target: '#j2-main-navbar-collapse', toggle: :collapse }, type: :button }
      %span.sr-only Toggle navigation
      %span.navbar-toggler-icon
    .collapse.navbar-collapse#j2-main-navbar-collapse
      %ul.nav.navbar-nav.ml-auto
        = nav_entry t('views.sessions.create'), new_user_session_path
        = nav_entry t('views.sessions.new'), new_user_registration_path

Fix theme color application on guest navbar

%nav.navbar.navbar-themed.navbar-expand-lg.bg-primary.fixed-top{ role: :navigation }
  .container{ class: ios_web_app? ? 'ios-web-app' : '' }
    %a.navbar-brand{ href: '/' }= APP_CONFIG['site_name']
    %button.navbar-toggler{ data: { target: '#j2-main-navbar-collapse', toggle: :collapse }, type: :button }
      %span.sr-only Toggle navigation
      %span.navbar-toggler-icon
    .collapse.navbar-collapse#j2-main-navbar-collapse
      %ul.nav.navbar-nav.ml-auto
        = nav_entry t('views.sessions.create'), new_user_session_path
        = nav_entry t('views.sessions.new'), new_user_registration_path


%fieldset
  %legend
    Selected Probeware Interface:

  = f.collection_select(:vendor_interface_id, Probe::VendorInterface.all, :id, :name, :html => { :id => "vendor_interface_id" })

  #vendor_interface
    = render :partial => 'probe/vendor_interfaces/vendor_interface', :locals => { :vendor_interface => vendor_interface }

= observe_field(:user_vendor_interface_id, :function => "new Ajax.Updater('vendor_interface', '/probe/vendor_interfaces/'+value, {asynchronous:true, evalScripts:true, method:'get'})" )

Use projects enabled vendor interfaces for select.

%fieldset
  %legend
    Selected Probeware Interface:

  = f.collection_select(:vendor_interface_id, Admin::Project.default_project.enabled_vendor_interfaces, :id, :name, :html => { :id => "vendor_interface_id" })

  #vendor_interface
    = render :partial => 'probe/vendor_interfaces/vendor_interface', :locals => { :vendor_interface => vendor_interface }

= observe_field(:user_vendor_interface_id, :function => "new Ajax.Updater('vendor_interface', '/probe/vendor_interfaces/'+value, {asynchronous:true, evalScripts:true, method:'get'})" )


- if @sb[:active_tab] == "diagnostics_workers"
  - if x_node.split('-').first == "root"
    = render :partial => "diagnostics_database_tab"
  - else
    #main_div
      = render :partial => 'layouts/x_gtl'
  %div{:style => "padding-bottom: 20px"}

Fix duplicate main_div elements in server diagnostics workers tab

- if @sb[:active_tab] == "diagnostics_workers"
  - if x_node.split('-').first == "root"
    = render :partial => "diagnostics_database_tab"
  - else
    = render :partial => 'layouts/x_gtl'
  %div{:style => "padding-bottom: 20px"}


- last_timestamp = nil

- @timeline.each do |event|
  - @icon_name = ''
  - activity_content = render_activity(event, :current_user => current_user)
  - if last_timestamp != event.created_at.to_date
    - last_timestamp = event.created_at.to_date
    .row
      .twelve.columns
        %h4
          - if last_timestamp.today?
            = _('Today')
          - elsif last_timestamp == Date.yesterday
            = _('Yesterday')
          - else
            = event.created_at.to_s(:pretty_date)
        %hr

  .row
    .two.columns.timestamp.smaller.align-left
      = event.created_at.to_s(:pretty_time)

    .one.columns.align-right.backgroundify
      %span{:class => @icon_name}

    .nine.columns.end.activity
      = activity_content
      %hr

= paginate(@timeline, {:run_as_xhr => true, :next_title => _('More') })

Use smaller headings for dates.

- last_timestamp = nil

- @timeline.each do |event|
  - @icon_name = ''
  - activity_content = render_activity(event, :current_user => current_user)
  - if last_timestamp != event.created_at.to_date
    - last_timestamp = event.created_at.to_date
    .row
      .twelve.columns
        %h5
          - if last_timestamp.today?
            = _('Today')
          - elsif last_timestamp == Date.yesterday
            = _('Yesterday')
          - else
            = event.created_at.to_s(:pretty_date)
        %hr

  .row
    .two.columns.timestamp.smaller.align-left
      = event.created_at.to_s(:pretty_time)

    .one.columns.align-right.backgroundify
      %span{:class => @icon_name}

    .nine.columns.end.activity
      = activity_content
      %hr

= paginate(@timeline, {:run_as_xhr => true, :next_title => _('More') })


%section#team.container
  %h3.section__title.section__title--blue= I18n.t("corporate.team.title")
  .row
    - %w{mike thibault yann sylvain}.each do |member|
      .col-4.col.col--centered
        %img{src: gravatar_for(I18n.t("corporate.team.#{member}.email")), class: "avatar", alt: I18n.t("corporate.team.#{member}.email")}
        %h4= I18n.t("corporate.team.#{member}.name")
        %ul.social-networks
          %li
            %a{href: "https://github.com/#{I18n.t("corporate.team.#{member}.github")}", target: "_blank"} Github
          %li
            %a{href: "https://twitter.com/#{I18n.t("corporate.team.#{member}.twitter")}", target: "_blank"} Twitter

Change commitments title underline color

%section#team.container
  %h3.section__title= I18n.t("corporate.team.title")
  .row
    - %w{mike thibault yann sylvain}.each do |member|
      .col-4.col.col--centered
        %img{src: gravatar_for(I18n.t("corporate.team.#{member}.email")), class: "avatar", alt: I18n.t("corporate.team.#{member}.email")}
        %h4= I18n.t("corporate.team.#{member}.name")
        %ul.social-networks
          %li
            %a{href: "https://github.com/#{I18n.t("corporate.team.#{member}.github")}", target: "_blank"} Github
          %li
            %a{href: "https://twitter.com/#{I18n.t("corporate.team.#{member}.twitter")}", target: "_blank"} Twitter


%li= link_to t('admin.dashboard.name'), dashboard_path
- if main_app_root_path = (main_app.root_path rescue false)
  %li= link_to t('home.name').capitalize, main_app_root_path
- if _current_user
  - if authorized?(:edit, _current_user.class, _current_user) && _current_user.respond_to?(:email)
    %li= link_to _current_user.email, edit_path(_current_user.class.name.underscore.pluralize, _current_user)
  - if defined?(Devise) && (devise_scope = request.env["warden"].config[:default_scope] rescue false) && (logout_path = main_app.send("destroy_#{devise_scope}_session_path") rescue false)
    %li= link_to content_tag('span', t('admin.credentials.log_out'), :class => 'label important'), logout_path, :method => Devise.sign_out_via
  %li= image_tag "#{(request.ssl? ? 'https://secure' : 'http://www')}.gravatar.com/avatar/#{Digest::MD5.hexdigest _current_user.email}?s=30", :style => 'padding-top:5px'

Check that the current user responds to email before rendering Gravatar

%li= link_to t('admin.dashboard.name'), dashboard_path
- if main_app_root_path = (main_app.root_path rescue false)
  %li= link_to t('home.name').capitalize, main_app_root_path
- if _current_user
  - if authorized?(:edit, _current_user.class, _current_user) && _current_user.respond_to?(:email)
    %li= link_to _current_user.email, edit_path(_current_user.class.name.underscore.pluralize, _current_user)
  - if defined?(Devise) && (devise_scope = request.env["warden"].config[:default_scope] rescue false) && (logout_path = main_app.send("destroy_#{devise_scope}_session_path") rescue false)
    %li= link_to content_tag('span', t('admin.credentials.log_out'), :class => 'label important'), logout_path, :method => Devise.sign_out_via
  - if _current_user.respond_to?(:email)
    %li= image_tag "#{(request.ssl? ? 'https://secure' : 'http://www')}.gravatar.com/avatar/#{Digest::MD5.hexdigest _current_user.email}?s=30", :style => 'padding-top:5px'


- content_for :after_title, " - #{t(Features.wiki_ed? ? 'application.explore' : 'courses_generic.explore')}"

%header.main-page
  .container
    %h1= t("#{Features.default_course_string_prefix}.unsubmitted")

.container
  %section#courses
    .section-header
      .sort-select
        %select.sorts{:rel => "courses"}
          %option{:rel => "asc", :value => "title"}= t("courses.title")
          %option{:rel => "desc", :value => "creation-date"}= t("courses.creation_date")
    %table.table.table--hoverable.table--sortable
      %thead
        %tr
          %th.sort.sortable.asc{"data-default-order" => "asc", "data-sort" => "title"}
            = t("#{@presenter.course_string_prefix}.courses")
            %span.sortable-indicator
          %th.sort.sortable{"data-default-order" => "asc", "data-sort" => "creation-date"}
            = t("courses.creation_date")
            %span.sortable-indicator
          %th{:style => "width: 165px;"}
            = t("courses.instructor.one")
          %th{:style => "width: 200px;"}
            = t("courses.expected_students")
          %th{:style => "width: 125px;"}
            = t("metrics.tags")
      %tbody.list
        - @presenter.courses_by_recent_edits.each do |c|
          = render 'unsubmitted_courses/row', course: c, admin: false, user: false

Fix table header message, tweak layout

- content_for :after_title, " - #{t(Features.wiki_ed? ? 'application.explore' : 'courses_generic.explore')}"

%header.main-page
  .container
    %h1= t("#{Features.default_course_string_prefix}.unsubmitted")

.container
  %section#courses
    .section-header
      .sort-select
        %select.sorts{:rel => "courses"}
          %option{:rel => "asc", :value => "title"}= t("courses.title")
          %option{:rel => "desc", :value => "creation-date"}= t("courses.creation_date")
    %table.table.table--hoverable.table--sortable
      %thead
        %tr
          %th.sort.sortable.asc{"data-default-order" => "asc", "data-sort" => "title"}
            = t("courses.title")
            %span.sortable-indicator
          %th.sort.sortable{"data-default-order" => "asc", "data-sort" => "creation-date"}
            = t("courses.creation_date")
            %span.sortable-indicator
          %th{:style => "width: 165px;"}
            = t("courses.instructor.one")
          %th{:style => "width: 150px;"}
            = t("courses.expected_students")
          %th{:style => "width: 175px;"}
            = t("metrics.tags")
      %tbody.list
        - @presenter.courses_by_recent_edits.each do |c|
          = render 'unsubmitted_courses/row', course: c, admin: false, user: false


= semantic_form_for @profile, url: [@profile.group, :profile] do |f|
  = f.input :description
  = f.input :loc_json, as: :hidden
  = render partial: "shared/edit_map", locals: { thing: @profile }
  = f.buttons

Tidy up group profile form.

= semantic_form_for @profile, url: [@profile.group, :profile] do |f|
  = f.inputs do
    = f.input :description
    = f.input :loc_json, as: :hidden
    = render partial: "shared/edit_map", locals: { thing: @profile }
  = f.buttons


.container.graphpaper
  %header.jumbotron.masthead
    .clearfix
      %p.fltlft.highlighted Welcome to
    %h1 Google Compliance Management
    %p
      %a.btn.btn-large{"data-toggle" => "modal", :href => "#tour-modal"} Take the Tour
      %a.btn.btn-large{"data-toggle" => "modal", :href => "#about-modal"} About this Project
      %a.btn.btn-primary.btn-large{:href => login_path} Login

#tour-modal.modal.hide.fade
  .modal-header
    %button.close{"data-dismiss" => "modal"} ×
    %h1 This content/function is coming soon
  .modal-body
    %p We are working on it!
  .modal-footer
    %a.close{"data-dismiss" => "modal", :href => "#"} Close

#about-modal.modal.hide.fade
  .modal-header
    %button.close{"data-dismiss" => "modal"} ×
    %h1 This content/function is coming soon
  .modal-body
    %p We are working on it!
  .modal-footer
    %a.close{"data-dismiss" => "modal", :href => "#"} Close

Remove 'tour' button and link 'About this Project' to the official repo

.container.graphpaper
  %header.jumbotron.masthead
    .clearfix
      %p.fltlft.highlighted Welcome to
    %h1 Google Compliance Management
    %p
      %a.btn.btn-large{:href => "https://code.google.com/p/compliance-management/"} About this Project
      %a.btn.btn-primary.btn-large{:href => login_path} Login


- if offerings.length > 0 and active_offerings.nil? and active_offerings.length > 0
- offerings.sort! {|a,b| a.position <=> b.position}
  = render :partial => 'shared/offering_for_student', :collection => offerings, :as => :offering
- else
  .item
    %ul.quiet_list
      %li
        .tiny= "No offerings available."

Fix student class view of offerings.

- if offerings.length > 0 and (active_offerings.nil? == false) and active_offerings.length > 0
- offerings.sort! {|a,b| a.position <=> b.position}
  = render :partial => 'shared/offering_for_student', :collection => offerings, :as => :offering
- else
  .item
    %ul.quiet_list
      %li
        .tiny= "No offerings available."


.page-title Route #{@route.number} Bus Stops

- if @stops.empty?
  No stops on this route
- else
  - @inc_and_comp.each_pair do |complete, stops|
    - if complete
      %ul
        Completed Stops
    - else
      %ul
        Incomplete Stops
    - stops.each do |stop|
      %li
        = link_to edit_bus_stop_path(stop.hastus_id) do
          - stop.name

Change 'inc_and_comp' to plain old 'stops'

.page-title Route #{@route.number} Bus Stops

- if @stops.empty?
  No stops on this route
- else
  - @stops.each_pair do |complete, stops|
    - if complete
      %ul
        Completed Stops
    - else
      %ul
        Incomplete Stops
    - stops.each do |stop|
      %li
        = link_to edit_bus_stop_path(stop.hastus_id) do
          - stop.name


- content_for :title do
  Search result for: #{params[:q]}

.col-sm-12
  %ul.nav.nav-tabs
    %li.active
      = link_to "#projects", "data-toggle"=>"tab" do
        Projects
        = "(#{@projects.length})"
    %li
      = link_to "#users", "data-toggle"=>"tab" do
        People
        = "(#{@users.length})"

  .tab-content
    .tab-pane.active#projects
      - unless @projects.empty?
        %table.table#project_table
          %thead
          - @projects.each_with_index do |project, index|
            %tr
              %td{:class => "#{project.aasm_state}"}
                = render :partial => "projects/list_item", :locals => {:project => project, :index => index }
      - else
        %h4 No projects found
    .tab-pane#users
      - unless @users.empty?
        - @users.each do |user|
          %table.table#users_table
            - @users.each do |user|
              %tr
                - user_class = "busy"
                - if user.projects.empty?
                  - user_class = "free"
                %td{:class => user_class }
                  = link_to user_path(user) do
                    = image_tag(user.gravatar_url(:size => "24"), :class => "img-thumbnail", :title => "#{user.name}", :alt => user.name)
                    = user.name
      - else
        %h4 No users found

Fix double rendering of the user results

- content_for :title do
  Search result for: #{params[:q]}

.col-sm-12
  %ul.nav.nav-tabs
    %li.active
      = link_to "#projects", "data-toggle"=>"tab" do
        Projects
        = "(#{@projects.length})"
    %li
      = link_to "#users", "data-toggle"=>"tab" do
        People
        = "(#{@users.length})"

  .tab-content
    .tab-pane.active#projects
      - unless @projects.empty?
        %table.table#project_table
          %thead
          - @projects.each_with_index do |project, index|
            %tr
              %td{:class => "#{project.aasm_state}"}
                = render :partial => "projects/list_item", :locals => {:project => project, :index => index }
      - else
        %h4 No projects found
    .tab-pane#users
      - unless @users.empty?
        %table.table#users_table
          - @users.each do |user|
            %tr
              - user_class = "busy"
              - if user.projects.empty?
                - user_class = "free"
              %td{:class => user_class }
                = link_to user_path(user) do
                  = image_tag(user.gravatar_url(:size => "24"), :class => "img-thumbnail", :title => "#{user.name}", :alt => user.name)
                  = user.name
      - else
        %h4 No users found