= form_for(@project, remote: true) do |f|
  - if @project.errors.any?
    .alert-message.block-message.error
      %span= @project.errors.full_messages.first
  .clearfix.project_name_holder
    = f.label :name do
      Project name is
    .input
      = f.text_field :name, placeholder: "Example Project", class: "xxlarge"
      = f.submit 'Create project', class: "btn success project-submit"

  - if current_user.can_select_namespace?
    .clearfix
      = f.label :namespace_id do
        %span Namespace
      .input
        = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'chosen'}

  %p.padded
    New projects are private by default. You choose who can see the project and commit to repository.
  %hr

  - if current_user.can_create_group?
    .clearfix
      .input.light
        Need a group for several dependent projects?
        = link_to new_group_path, class: "btn very_small" do
          Create a group
  - if current_user.can_create_team?
    .clearfix
      .input.light
        Want to share a team between projects?
        = link_to new_team_path, class: "btn very_small" do
          Create a team

Edit create new team text

= form_for(@project, remote: true) do |f|
  - if @project.errors.any?
    .alert-message.block-message.error
      %span= @project.errors.full_messages.first
  .clearfix.project_name_holder
    = f.label :name do
      Project name is
    .input
      = f.text_field :name, placeholder: "Example Project", class: "xxlarge"
      = f.submit 'Create project', class: "btn success project-submit"

  - if current_user.can_select_namespace?
    .clearfix
      = f.label :namespace_id do
        %span Namespace
      .input
        = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'chosen'}

  %p.padded
    New projects are private by default. You choose who can see the project and commit to repository.
  %hr

  - if current_user.can_create_group?
    .clearfix
      .input.light
        Need a group for several dependent projects?
        = link_to new_group_path, class: "btn very_small" do
          Create a group
  - if current_user.can_create_team?
    .clearfix
      .input.light
        Want to share a project between team?
        = link_to new_team_path, class: "btn very_small" do
          Create a team


%ul.nav.nav-tabs
  %li.active
    = link_to '#md-write-holder', class: 'js-md-write-button' do
      Write
  %li
    = link_to '#md-preview-holder', class: 'js-md-preview-button', data: { url: markdown_preview_project_path(@project) } do
      Preview
%div
  .md-write-holder
    = yield
  .md-preview-holder.hide
    .js-md-preview

Fix long line in view


.logo
  logstash.
.search
  %form.search{ :action => "/search" }
    %label{ :for => "q" } Query:
    %input.query{ :id => "query", :type => "text", :name => "q", :value => params[:q],
                  :size => 60 }
    %input{ :id => "searchbutton", :type => "submit" }

Add clear button and change label on Submit

.logo
  logstash.
.search
  %form.search{ :action => "/search" }
    %label{ :for => "q" } Query:
    %input.query{ :id => "query", :type => "text", :name => "q", :value => params[:q],
                  :size => 60 }
    %input{ :id => "searchbutton", :type => "submit", :value => "Search" }
    %input{ :id => "clearbutton", :type => "reset", :value => "Clear" }


- @title = "Spot.us - Fund A Story"
.block-spacer

#equalize
  .box_white
    .span-4.colborder
      = link_to 'All Networks', news_items_path(:subdomain => false)
      %br/
      - @networks.each do |network|
        = link_to network.display_name, news_items_path(:subdomain => network.name)
        %br/
    - form_tag(:search_news_items, :method => :get) do
      .span-3
        %h4 Search
      .span-7.search-check-box.colborder
        .div
          %label Type
          = select_tag "news_item_type", options_for_select([["Pitches", "pitches"],["Tips","tips"],["All", "news_items"]], params.fetch(:news_item_type, "pitches"))
        .div
          = label_tag     :sort_by, "Sort By"
          %select{:name => "sort_by"}
            = options_for_sorting(params.fetch(:news_item_type, "pitches"), params.fetch(:sort_by,"desc"))
      .span-4.search_field_button
        = image_submit_tag image_path('search_button.png')
    %hr.space
    .double_content_border.clear

    = render :partial => @news_items

    = will_paginate @news_items

.clear
.block-spacer

Add friendly error text when no news items are returned

- @title = "Spot.us - Fund A Story"
.block-spacer

#equalize
  .box_white
    .span-4.colborder
      = link_to 'All Networks', news_items_path(:subdomain => false)
      %br/
      - @networks.each do |network|
        = link_to network.display_name, news_items_path(:subdomain => network.name)
        %br/
    - form_tag(:search_news_items, :method => :get) do
      .span-3
        %h4 Search
      .span-7.search-check-box.colborder
        .div
          %label Type
          = select_tag "news_item_type", options_for_select([["Pitches", "pitches"],["Tips","tips"],["All", "news_items"]], params.fetch(:news_item_type, "pitches"))
        .div
          = label_tag     :sort_by, "Sort By"
          %select{:name => "sort_by"}
            = options_for_sorting(params.fetch(:news_item_type, "pitches"), params.fetch(:sort_by,"desc"))
      .span-4.search_field_button
        = image_submit_tag image_path('search_button.png')
    %hr.space
    .double_content_border.clear

    - if @news_items.blank?
      .box_white
        %p
          There were no results for your search.  Try different search terms.
    = render :partial => @news_items

    = will_paginate @news_items

.clear
.block-spacer


.page-header
  %h1 Hunker Down

.page-body
  %p Narrow down your followers and following to only mutuals - by unfollowing non-mutuals, and softblocking non-mutual followers

Add note about it being better with private accounts

.page-header
  %h1 Hunker Down

.page-body
  %p Narrow down your followers and following to only mutuals - by unfollowing non-mutuals, and softblocking non-mutual followers. Best used when making your account private!


/[if lt IE 9]
  :javascript
    document.createElement('header');
    document.createElement('nav');
    document.createElement('section');
    document.createElement('article');
    document.createElement('aside');
    document.createElement('footer');
    document.createElement('figure');
    document.createElement('figurecap');
    document.createElement('hgroup');
    document.createElement('time');

:javascript
  // Setup our namespace
  window.lp = {};

  // Switch no-js class for js
  (function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement);

  // Initialise a flamsteed buffer
  window.lp.fs = {
    buffer: [],
    log : function(x){this.buffer.push({e: x})},
    time: function(x){!!window.performance && !!window.performance.now && this.buffer.push({e: x, t: window.performance.now()})}
  };

= render 'layouts/core/snippets/grunticon'

Remove grunticon from head_js in core


%img(width="16" height="16" src="#{usericon.html_safe}")
%b= username.html_safe
- body.split("\n").each do |line|
  %br
  = line

Handle variables from Vein in a proper way

%img(width="16" height="16" src="#{usericon}")
%b= username
- body.split("\n").each do |line|
  %br
  = line


.card
  - unless smart_listing.empty?
    %table.table
      %thead
        %th.col-xs-4= smart_listing.sortable 'Email', :email
        %th.col-xs-4= smart_listing.sortable 'Date de dernière connexion', :last_sign_in_at
        %th.col-xs-2 Procédure active
        %th.col-xs-2 Dossier en cours

      - @admins.each do |admin|
        %tr
          %td
            = admin.email
          %td
            - unless admin.last_sign_in_at.nil?
              = time_ago_in_words(l(admin.last_sign_in_at, format: "%d/%m/%Y %H:%M UTC +02:00"))
              (
              = admin.last_sign_in_at.to_date.localtime.strftime('%d/%m/%Y')
              )
          %td
            = admin.procedures.where(published: true).count
          %td
            - total_dossier = 0
            - admin.procedures.each do |procedure| total_dossier += procedure.dossiers.where.not(state: :draft).count end
            = total_dossier
    = smart_listing.paginate
    = smart_listing.pagination_per_page_links

  - else
    %h4.center
      Aucun administrateur créé

Fix localtime on date object

.card
  - unless smart_listing.empty?
    %table.table
      %thead
        %th.col-xs-4= smart_listing.sortable 'Email', :email
        %th.col-xs-4= smart_listing.sortable 'Date de dernière connexion', :last_sign_in_at
        %th.col-xs-2 Procédure active
        %th.col-xs-2 Dossier en cours

      - @admins.each do |admin|
        %tr
          %td
            = admin.email
          %td
            - unless admin.last_sign_in_at.nil?
              = time_ago_in_words(l(admin.last_sign_in_at, format: "%d/%m/%Y %H:%M UTC +02:00"))
              (
              = admin.last_sign_in_at.localtime.strftime('%d/%m/%Y')
              )
          %td
            = admin.procedures.where(published: true).count
          %td
            - total_dossier = 0
            - admin.procedures.each do |procedure| total_dossier += procedure.dossiers.where.not(state: :draft).count end
            = total_dossier
    = smart_listing.paginate
    = smart_listing.pagination_per_page_links

  - else
    %h4.center
      Aucun administrateur créé


%h3.page-title
  %i.icon-code-fork
  New branch
= form_tag project_branches_path, method: :post, class: "form-horizontal" do
  .form-group
    = label_tag :branch_name, 'Name for new branch', class: 'control-label'
    .col-sm-10
      = text_field_tag :branch_name, nil, placeholder: 'feature/dashboard', required: true, tabindex: 1, class: 'form-control'
  .form-group
    = label_tag :ref, 'Create from', class: 'control-label'
    .col-sm-10
      = text_field_tag :ref, nil, placeholder: 'master', required: true, tabindex: 2, class: 'form-control'
      .light branch name or commit SHA
  .form-actions
    = submit_tag 'Create branch', class: 'btn btn-create', tabindex: 3
    = link_to 'Cancel', project_branches_path(@project), class: 'btn btn-cancel'

:javascript
  var availableTags = #{@project.repository.ref_names.to_json};

  $("#ref").autocomplete({
    source: availableTags,
    minLength: 1
  });

Replace hints with text that is obviously not valid.

%h3.page-title
  %i.icon-code-fork
  New branch
= form_tag project_branches_path, method: :post, class: "form-horizontal" do
  .form-group
    = label_tag :branch_name, 'Name for new branch', class: 'control-label'
    .col-sm-10
      = text_field_tag :branch_name, nil, placeholder: 'branch name, tag or commit SHA', required: true, tabindex: 1, class: 'form-control'
  .form-group
    = label_tag :ref, 'Create from', class: 'control-label'
    .col-sm-10
      = text_field_tag :ref, nil, placeholder: 'branch name, tag or commit SHA', required: true, tabindex: 2, class: 'form-control'
  .form-actions
    = submit_tag 'Create branch', class: 'btn btn-create', tabindex: 3
    = link_to 'Cancel', project_branches_path(@project), class: 'btn btn-cancel'

:javascript
  var availableTags = #{@project.repository.ref_names.to_json};

  $("#ref").autocomplete({
    source: availableTags,
    minLength: 1
  });


%footer
  .container
    .row
      .col-sm-12
        © <%= Time.now.strftime('%Y') %> #{ENV['COMPANY_NAME']} /
        =link_to 'Privacy Policy', page_path('privacy')
        \/
        =link_to 'Terms of Use', page_path('terms')

Make copyright date and company name haml friendly

%footer.section
  .container
    .row
      .col-sm-12
        ©
        =Time.now.strftime('%Y')
        #{ENV['COMPANY_NAME']}
        \/
        =link_to 'Privacy Policy', page_path('privacy')
        \/
        =link_to 'Terms of Use', page_path('terms')


- dropdown_toggle_text = @ref || @project.default_branch
= form_tag nil, method: :get, style: { display: 'none' }, class: "project-refs-target-form" do
  = hidden_field_tag :destination, destination
  - if defined?(path)
    = hidden_field_tag :path, path
  - @options && @options.each do |key, value|
    = hidden_field_tag key, value, id: nil
  .dropdown
    = dropdown_toggle dropdown_toggle_text, { toggle: "dropdown", selected: dropdown_toggle_text, ref: @ref, refs_url: refs_project_path(@project, find: ['branches']), field_name: 'ref', input_field_name: 'new-branch', submit_form_on_click: true, visit: false }, { toggle_class: "js-project-refs-dropdown" }
    %ul.dropdown-menu.dropdown-menu-selectable.git-revision-dropdown{ class: ("dropdown-menu-align-right" if local_assigns[:align_right]) }
      %li
        = dropdown_title _("Create a new branch")
      %li
        = dropdown_input _("Create a new branch")
      %li
        = dropdown_title _("Select existing branch"), options: {close: false}
      %li
        = dropdown_filter _("Search branches and tags")
        = dropdown_content
        = dropdown_loading

Fix target branch dropdown styling.

- dropdown_toggle_text = @ref || @project.default_branch
= form_tag nil, method: :get, class: "project-refs-form project-refs-target-form" do
  = hidden_field_tag :destination, destination
  - if defined?(path)
    = hidden_field_tag :path, path
  - @options && @options.each do |key, value|
    = hidden_field_tag key, value, id: nil
  .dropdown
    = dropdown_toggle dropdown_toggle_text, { toggle: "dropdown", selected: dropdown_toggle_text, ref: @ref, refs_url: refs_project_path(@project, find: ['branches']), field_name: 'ref', input_field_name: 'new-branch', submit_form_on_click: true, visit: false }, { toggle_class: "js-project-refs-dropdown" }
    .dropdown-menu.dropdown-menu-selectable.git-revision-dropdown{ class: ("dropdown-menu-align-right" if local_assigns[:align_right]) }
      = dropdown_title _("Create a new branch")
      = dropdown_input _("Create a new branch")
      = dropdown_title _("Select existing branch"), options: {close: false}
      = dropdown_filter _("Search branches and tags")
      = dropdown_content
      = dropdown_loading


.container
  %h1 Add scraper from your GitHub repository

  = render 'documentation/languages'
  = render 'documentation/format_intro'

  %ul.nav.nav-tabs
    %li.active
      = link_to "#owner_#{current_user.nickname}", data: {toggle: "tab"} do
        = owner_image(current_user, 30)
        = current_user.nickname
    - current_user.organizations.each do |org|
      %li
        = link_to "#owner_#{org.nickname}", data: {toggle: "tab"} do
          = owner_image(org, 30)
          = org.nickname

  .tab-content
    .tab-pane.active{id: "owner_#{current_user.nickname}"}
      = render partial: "github_form_loader", locals: {owner: current_user}
    - current_user.organizations.each do |org|
      .tab-pane{id: "owner_#{org.nickname}"}
        = render partial: "github_form_loader", locals: {owner: org}

Add title to new GitHub scraper page

- title "Add scraper from your GitHub repository"

.container
  %h1= title

  = render 'documentation/languages'
  = render 'documentation/format_intro'

  %ul.nav.nav-tabs
    %li.active
      = link_to "#owner_#{current_user.nickname}", data: {toggle: "tab"} do
        = owner_image(current_user, 30)
        = current_user.nickname
    - current_user.organizations.each do |org|
      %li
        = link_to "#owner_#{org.nickname}", data: {toggle: "tab"} do
          = owner_image(org, 30)
          = org.nickname

  .tab-content
    .tab-pane.active{id: "owner_#{current_user.nickname}"}
      = render partial: "github_form_loader", locals: {owner: current_user}
    - current_user.organizations.each do |org|
      .tab-pane{id: "owner_#{org.nickname}"}
        = render partial: "github_form_loader", locals: {owner: org}


.row
  .col-sx-6.col-sm-6.col-md-6.choice-1
    = button_to "#{@choices[@index_vaule][0]}", controller: 'learn_sessions', :action => 'check_answer', learn_session_id: @learn_session.id, index: @index_vaule,  :user_answer => @choices[@index_vaule][0]
  .col-sx-6.col-sm-6.col-md-6.choice-2
    = button_to "#{@choices[@index_vaule][1]}", controller: 'learn_sessions', :action => 'check_answer', learn_session_id: @learn_session.id, index: @index_vaule,  :user_answer => @choices[@index_vaule][1]
.row
  .col-sx-6.col-sm-6.col-md-6.choice-3
    = button_to "#{@choices[@index_vaule][2]}", controller: 'learn_sessions', :action => 'check_answer', learn_session_id: @learn_session.id, index: @index_vaule,  :user_answer => @choices[@index_vaule][2]
  .col-sx-6.col-sm-6.col-md-6.choice-4
    = button_to "#{@choices[@index_vaule][3]}", controller: 'learn_sessions', :action => 'check_answer', learn_session_id: @learn_session.id, index: @index_vaule,  :user_answer => @choices[@index_vaule][3]

Add link breaks for better reading


%ul.messages_layout
  - comments.order(:created_at).each do |comment|
    %li.comment.markdown{ class: choose_class_for(comment) }
      .message_wrap
        - if comment.user.present?
          .info{ title: comment.created_at.to_s }
            %p.name
              = commenter_name(comment)
            %span.time #{comment.created_at.to_s(:day_at_time)}
        .text
          =markdown(comment.body)

= form_for comments.new do |f|
  = f.hidden_field :proposal_id
  .form-group
    - input_class = internal?(f.object) ? 'form-control mention' : 'form-control'
    = f.text_area :body, class: input_class, placeholder: 'Add your comment', rows: 5, data: { mention_names: internal?(f.object) ? @mention_names : nil }
  .form-group
    %button.btn.btn-success.save-comment(type="submit")
      %span.glyphicon.glyphicon-ok
      Comment

Remove title from proposal comments

%ul.messages_layout
  - comments.order(:created_at).each do |comment|
    %li.comment.markdown{ class: choose_class_for(comment) }
      .message_wrap
        - if comment.user.present?
          .info
            %p.name
              = commenter_name(comment)
            %span.time #{comment.created_at.to_s(:day_at_time)}
        .text
          =markdown(comment.body)

= form_for comments.new do |f|
  = f.hidden_field :proposal_id
  .form-group
    - input_class = internal?(f.object) ? 'form-control mention' : 'form-control'
    = f.text_area :body, class: input_class, placeholder: 'Add your comment', rows: 5, data: { mention_names: internal?(f.object) ? @mention_names : nil }
  .form-group
    %button.btn.btn-success.save-comment(type="submit")
      %span.glyphicon.glyphicon-ok
      Comment


.classification_form
  =form_for Classification.new(:asset_id => @content.asset.id), :url => main_app.classifications_path do |f|
    %p
      %label{:for => 'catalog_id'} New:
      =select("classification", "catalog_id", Catalog.all.inject([]){|m,c| m << [c.title, c.id]})
    =hidden_field_tag "classification[asset_id]", @content.asset.id.to_s
    =submit_tag "Create", :class => "classification_create"

.classification_sidebar
  .title Classifications
  %ul.collection
    -catalogs = []
    -@content.asset.classifications.each do |classification|
      -catalogs << classification.catalog_id
      %li.classification
        .content
          =form_for classification, :remote => true , :url => main_app.classifications_path(classification) do |f|
            .classification_header
              =link_to classification.catalog.title, main_app.catalog_path(classification.catalog), :class => "classification_title"
              =submit_tag "Drop", :class => "classification_drop", :classification_id => classification.id
            .classification_facets
              -classification.catalog.facets.each do |facet|
                .facet{:class => "#{facet.color}_lite"}
                  .caption{:class => facet.color}
                    =facet.caption
                  %ul
                    -facet.labels.each do |label|
                      %li.label
                        =check_box_tag "labels[]", label.id, classification.label_ids.include?(label.id)
                        =link_to label.caption
                  =submit_tag "Save"

Fix typo in :url its classification not classifications

.classification_form
  =form_for Classification.new(:asset_id => @content.asset.id), :url => main_app.classifications_path do |f|
    %p
      %label{:for => 'catalog_id'} New:
      =select("classification", "catalog_id", Catalog.all.inject([]){|m,c| m << [c.title, c.id]})
    =hidden_field_tag "classification[asset_id]", @content.asset.id.to_s
    =submit_tag "Create", :class => "classification_create"

.classification_sidebar
  .title Classifications
  %ul.collection
    -catalogs = []
    -@content.asset.classifications.each do |classification|
      -catalogs << classification.catalog_id
      %li.classification
        .content
          =form_for classification, :remote => true , :url => main_app.classification_path(classification) do |f|
            .classification_header
              =link_to classification.catalog.title, main_app.catalog_path(classification.catalog), :class => "classification_title"
              =submit_tag "Drop", :class => "classification_drop", :classification_id => classification.id
            .classification_facets
              -classification.catalog.facets.each do |facet|
                .facet{:class => "#{facet.color}_lite"}
                  .caption{:class => facet.color}
                    =facet.caption
                  %ul
                    -facet.labels.each do |label|
                      %li.label
                        =check_box_tag "labels[]", label.id, classification.label_ids.include?(label.id)
                        =link_to label.caption
                  =submit_tag "Save"


:markdown
  # Webhooks

  You can use webhooks to trigger actions in external services
  every time one of your scrapers finishes a run.
  You can trigger all kind of fun actions:
  send emails when a scraper is finished;
  immediately pull fresh data from a scraper’s API;
  or run realtime analysis—anything you like.

  Add *webhook URLs* under the **Webhooks heading
  on your scraper’s Settings page**.
  Every time your scraper finishes a run
  we’ll make an [HTTP POST request](https://en.wikipedia.org/wiki/POST_(HTTP))
  to each URL you’ve added.
  Use this request to trigger your custom code.

  ## Payloads

  Webhooks currently just make an empty HTTP POST request
  to the specified url.
  If you'd like the webhooks to have some state
  you'll need to put that state in the webhook url,
  either as the path or as GET parameters.
  If there's something specific you'd like included in the webhook payload
  then please [ask a question on our help forum](https://help.morph.io/).

Use consistent formatting or URL throughout the Webhooks docs

:markdown
  # Webhooks

  You can use webhooks to trigger actions in external services
  every time one of your scrapers finishes a run.
  You can trigger all kind of fun actions:
  send emails when a scraper is finished;
  immediately pull fresh data from a scraper’s API;
  or run realtime analysis—anything you like.

  Add *webhook URLs* under the **Webhooks heading
  on your scraper’s Settings page**.
  Every time your scraper finishes a run
  we’ll make an [HTTP POST request](https://en.wikipedia.org/wiki/POST_(HTTP))
  to each URL you’ve added.
  Use this request to trigger your custom code.

  ## Payloads

  Webhooks currently just make an empty HTTP POST request
  to the specified URL.
  If you'd like the webhooks to have some state
  you'll need to put that state in the webhook URL,
  either as the path or as GET parameters.
  If there's something specific you'd like included in the webhook payload
  then please [ask a question on our help forum](https://help.morph.io/).


- cache ["v3", scraper] do
  = link_to scraper, class: "list-group-item" do
    %div.scraper-block
      - unless scraper.language.blank?
        %small.scraper-lang.pull-right= scraper.language.human
      .icon-box.pull-right= render partial: "scrapers/auto_clock", locals: {scraper: scraper}
      .icon-box.pull-right= render partial: "scrapers/running_indicator", locals: {scraper: scraper}
      - if scraper.last_run && scraper.last_run.finished_with_errors?
        %span.label.label-danger errored
      %strong.full_name= scraper.full_name
      %div
        - unless scraper.description.blank?
          = scraper.description

Add example scraped domains to scraper lists (static prototype)

- cache ["v3", scraper] do
  = link_to scraper, class: "list-group-item" do
    %div.scraper-block
      - unless scraper.language.blank?
        %small.scraper-lang.pull-right= scraper.language.human
      .icon-box.pull-right= render partial: "scrapers/auto_clock", locals: {scraper: scraper}
      .icon-box.pull-right= render partial: "scrapers/running_indicator", locals: {scraper: scraper}
      - if scraper.last_run && scraper.last_run.finished_with_errors?
        %span.label.label-danger errored
      %strong.full_name= scraper.full_name
      %div
        - unless scraper.description.blank?
          = scraper.description
        %p.text-muted
          Scrapes osom.cfa.vic.gov.au, ruralfire.qld.gov.au, sentinel.ga.gov.au, and 5 other domains.


- provide :title, 'Sweeps'

= render 'shared/breadcrumbs',
  crumbs: [[@project.name, @project],
           [Sweep.model_name.human(count: 2)]]

.page-header
  %h1
    = yield :title
    = start_new_sweep_button(@project)

= render 'sweeps/protip_curl'

%table.table.table-striped
  %thead
    %tr
      %th= Sweep.human_attribute_name(:title)
      %th= Sweep.human_attribute_name(:created_at)
      %th= t('.status')

  %tbody
    - @project.sweeps.each do |sweep|
      %tr{ data: { keyboard_focusable: true } }
        %td= link_to sweep.title, [@project, sweep], title: sweep.description
        %td
          = time_tag sweep.created_at do
            = t(:time_ago, time: time_ago_in_words(sweep.created_at))
        %td= sweep_progress_bar(sweep)

Use i18n for sweeps/index title

- provide :title, Sweep.model_name.human(count: 2)

= render 'shared/breadcrumbs',
  crumbs: [[@project.name, @project],
           [Sweep.model_name.human(count: 2)]]

.page-header
  %h1
    = yield :title
    = start_new_sweep_button(@project)

= render 'sweeps/protip_curl'

%table.table.table-striped
  %thead
    %tr
      %th= Sweep.human_attribute_name(:title)
      %th= Sweep.human_attribute_name(:created_at)
      %th= t('.status')

  %tbody
    - @project.sweeps.each do |sweep|
      %tr{ data: { keyboard_focusable: true } }
        %td= link_to sweep.title, [@project, sweep], title: sweep.description
        %td
          = time_tag sweep.created_at do
            = t(:time_ago, time: time_ago_in_words(sweep.created_at))
        %td= sweep_progress_bar(sweep)


%p
  = link_to 'Back', case_workers_claims_path, class: 'button'

  - if @claim.errors.any?
    .validation-summary
      %h4.heading-small= "#{pluralize(@claim.errors.count, 'error')} prohibited this claim from being updated:"
      %ul
        - @claim.errors.full_messages.each do |msg|
          %li= msg

%h1
  Claim
  = @claim.case_number

%P
  Created by:
  = @claim.creator.name

%p
  - if claim_ids
    = claim_position_and_count
    - unless last_claim?
      = next_claim_link 'Next claim >'.html_safe, class: 'next-claim'

#claim-accordion
  %h2
    Basic Claim Information
  = render partial: 'shared/claim', locals: { claim: @claim, hide_totals: true }
  %h2
    Claim summary
  = render partial: 'shared/summary'
  %h2
    Evidence list
  = render partial: 'shared/evidence_list'
  %h2
    Messages (#{@messages.count})
  = render partial: 'shared/messages'
  %h2
    Case worker notes
  = render partial: 'caseworker_notes'
  %h2#claim-status
    Update status of claim
  = render partial: 'shared/claim_status', locals: { disabled: false }
  %h2
    Claim history
  = render partial: 'shared/claim_history'

Check claim ids are present

%p
  = link_to 'Back', case_workers_claims_path, class: 'button'

  - if @claim.errors.any?
    .validation-summary
      %h4.heading-small= "#{pluralize(@claim.errors.count, 'error')} prohibited this claim from being updated:"
      %ul
        - @claim.errors.full_messages.each do |msg|
          %li= msg

%h1
  Claim
  = @claim.case_number

%P
  Created by:
  = @claim.creator.name

%p
  - if claim_ids.present?
    = claim_position_and_count
    - unless last_claim?
      = next_claim_link 'Next claim >'.html_safe, class: 'next-claim'

#claim-accordion
  %h2
    Basic Claim Information
  = render partial: 'shared/claim', locals: { claim: @claim, hide_totals: true }
  %h2
    Claim summary
  = render partial: 'shared/summary'
  %h2
    Evidence list
  = render partial: 'shared/evidence_list'
  %h2
    Messages (#{@messages.count})
  = render partial: 'shared/messages'
  %h2
    Case worker notes
  = render partial: 'caseworker_notes'
  %h2#claim-status
    Update status of claim
  = render partial: 'shared/claim_status', locals: { disabled: false }
  %h2
    Claim history
  = render partial: 'shared/claim_history'


%br
- section_id = "section_investigate_#{h(section.id)}"
- hide_id = section_id + "_hide"
- show_id = section_id + "_show"

%fieldset{:class => 'form_section vert-break'}
  %legend
    = h(strip_tags(section.name))
    - unless section.help_text.blank?
      = render_help_text(section) + " "
    %span{:id => hide_id, :onclick => "Element.hide('#{section_id}'); Element.hide('#{hide_id}'); Element.show('#{show_id}'); return false;\">"}
      = "[" + t('hide') + "]"

    %span{:id => show_id, :onclick => "Element.show('#{section_id}'); Element.hide('#{show_id }'); Element.show('#{hide_id}'); return false;", :style => "display: none;"}
      = "[" + t('show') + "]"

  %div{:id => section_id}
    - unless section.description.blank?
      %li
        %i= section.description.gsub("\n", '<br/>')
        %br
        %br

Disable Hide/Show for investigator sections

%br
- section_id = "section_investigate_#{h(section.id)}"
- hide_id = section_id + "_hide"
- show_id = section_id + "_show"

%fieldset{:class => 'form_section vert-break'}
  %legend
    = h(strip_tags(section.name))
    - unless section.help_text.blank?
      = render_help_text(section) + " "

    / Because of the way the investigator section elements are rendered
    / using form_builder_dsl.rb, it's not easy to show and hide sections

    /%span{:id => hide_id, :onclick => "Element.hide('#{section_id}'); Element.hide('#{hide_id}'); Element.show('#{show_id}'); return false;"}
    /  = "[" + t('hide') + "]"

    /%span{:id => show_id, :onclick => "Element.show('#{section_id}'); Element.hide('#{show_id }'); Element.show('#{hide_id}'); return false;", :style => "display: none;"}
    /  = "[" + t('show') + "]"

  %div{:id => section_id}
    - unless section.description.blank?
      %li
        %i= section.description.gsub("\n", '<br/>')
        %br
        %br


%li.commit.js-toggle-container
  .commit-row-title
    %strong.str-truncated
      = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message"
      - if commit.description?
        %a.text-expander.js-toggle-button ...

    .pull-right
      = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id"

    .notes_count
      - if @note_counts
        - note_count = @note_counts.fetch(commit.id, 0)
      - else
        - notes = commit.notes
        - note_count = notes.user.count

      - if note_count > 0
        %span.light
          %i.fa.fa-comments
          = note_count

  - if commit.description?
    .commit-row-description.js-toggle-content
      %pre
        = preserve(gfm(escape_once(commit.description)))

  .commit-row-info
    = commit_author_link(commit, avatar: true, size: 24)
    authored
    .committed_ago
      #{time_ago_with_tooltip(commit.committed_date)}
    = link_to_browse_code(project, commit)

Use `skip_js` for commit timestamps

%li.commit.js-toggle-container
  .commit-row-title
    %strong.str-truncated
      = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message"
      - if commit.description?
        %a.text-expander.js-toggle-button ...

    .pull-right
      = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id"

    .notes_count
      - if @note_counts
        - note_count = @note_counts.fetch(commit.id, 0)
      - else
        - notes = commit.notes
        - note_count = notes.user.count

      - if note_count > 0
        %span.light
          %i.fa.fa-comments
          = note_count

  - if commit.description?
    .commit-row-description.js-toggle-content
      %pre
        = preserve(gfm(escape_once(commit.description)))

  .commit-row-info
    = commit_author_link(commit, avatar: true, size: 24)
    authored
    .committed_ago
      #{time_ago_with_tooltip(commit.committed_date, skip_js: true)}
    = link_to_browse_code(project, commit)


-# Network or Storage Adpater Tree
- if x_active_tree == :sa_tree
  %div
    = render(:partial => 'shared/tree', :locals => {:tree => @sa_tree, :name => @sa_tree.name.to_s})
- else
  %div{:id => "#{session[:tree_name]}box", :style => "width: 100%"}
    = render(:partial => 'shared/tree', :locals => {:tree => @network_tree, :name => @network_tree.name.to_s})

Drop the id/styling wrapper from the network tree under hosts

-# Network or Storage Adpater Tree
%div
- if x_active_tree == :sa_tree
  = render(:partial => 'shared/tree', :locals => {:tree => @sa_tree, :name => @sa_tree.name.to_s})
- else
  = render(:partial => 'shared/tree', :locals => {:tree => @network_tree, :name => @network_tree.name.to_s})


.user-profile
  %h1= @user.name
  = link_to t(".edit"), action: :edit
  - if @profile.picture
    = image_tag @profile.picture.url
  .about
    = @profile.about

Add link to update account details, and only show them if you're viewing your own profile

.user-profile
  %h1= @user.name
  - if @user == current_user
    = link_to t(".edit"), action: :edit
    = link_to t(".update_account"), edit_user_registration_path
  - if @profile.picture
    = image_tag @profile.picture.url
  .about
    = @profile.about


= simple_form_for @course do |f|
  - if @course.errors.any?
    #error_explanation
      %h2= "#{pluralize(@course.errors.count, "error")} prohibited this course from being saved:"
      %ul
        - @course.errors.full_messages.each do |msg|
          %li= msg
  .row
    = f.input :title, wrapper_html: { class: "large-8 small-6 columns" }
    = f.input :language, collection: LanguageList::COMMON_LANGUAGES,
      wrapper_html: { class: "large-4 small-6 columns" }
  = f.input :description, input_html: { rows: 8 }
  = f.input :prerequisites, input_html: { rows: 6 }
  .row
    = f.input :starts_at, time_separator: '', datetime_separator: '',
      input_html: { class: "large-2 small-2 columns end" },
      wrapper_html: { class: "large-10 columns" },
      prompt: true,
      start_year: Time.now.year
    = f.input :duration, label: "Duration (hours)", type: "number",
      wrapper_html: {class: "large-2 columns" }
  = f.submit 'Save', class: "button"

Replace simple form with form_for

= form_for @course do |f|
  - if @course.errors.any?
    #error_explanation
      %h2= "#{pluralize(@course.errors.count, "error")} prohibited this course from being saved:"
      %ul
        - @course.errors.full_messages.each do |msg|
          %li= msg
  .row
    .columns.large-8.small-6
      = f.label :title
      = f.text_field :title
    .columns.large-4.small-6
      = f.label :language
      = f.select :language, LanguageList::COMMON_LANGUAGES.map{ |language| [language.name, language.iso_639_1] }
  = f.label :description
  = f.text_area :description, rows: 8
  = f.label :prerequisites
  = f.text_area :prerequisites, rows: 6
  .row
    .columns.large-10
      = f.label 'Starting Date'
      = datetime_select :course, :starts_at, {time_separator: '', datetime_separator: '',
        prompt: true}, {class: 'large-2 columns end'}
    .columns.large-2
      = f.label 'Duration (hours)'
      = f.text_field :duration, type: 'number'
  = f.submit 'Save', class: 'button'


- name = field[:name]
- title = field[:title] || name.humanize
- value = @service.send(name)
- type = field[:type]
- placeholder = field[:placeholder]
- required = field[:required]
- choices = field[:choices]
- default_choice = field[:default_choice]
- help = field[:help]

.form-group
  - if type == "password" && value.present?
    = form.label name, "Enter new #{title.downcase}", class: "control-label"
  - else
    = form.label name, title, class: "control-label"
  .col-sm-10
    - if type == 'text'
      = form.text_field name, class: "form-control", placeholder: placeholder
    - elsif type == 'textarea'
      = form.text_area name, rows: 5, class: "form-control", placeholder: placeholder
    - elsif type == 'checkbox'
      = form.check_box name
    - elsif type == 'select'
      = form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" }
    - elsif type == 'password'
      = form.password_field name, autocomplete: "new-password", class: "form-control"
    - if help
      %span.help-block= help

Add support for required input validation

- name = field[:name]
- title = field[:title] || name.humanize
- value = @service.send(name)
- type = field[:type]
- placeholder = field[:placeholder]
- required = field[:required]
- choices = field[:choices]
- default_choice = field[:default_choice]
- help = field[:help]

.form-group
  - if type == "password" && value.present?
    = form.label name, "Enter new #{title.downcase}", class: "control-label"
  - else
    = form.label name, title, class: "control-label"
  .col-sm-10
    - if type == 'text'
      = form.text_field name, class: "form-control", placeholder: placeholder, required: required
    - elsif type == 'textarea'
      = form.text_area name, rows: 5, class: "form-control", placeholder: placeholder, required: required
    - elsif type == 'checkbox'
      = form.check_box name
    - elsif type == 'select'
      = form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" }
    - elsif type == 'password'
      = form.password_field name, autocomplete: "new-password", class: "form-control", required: value.present? ? nil : :required
    - if help
      %span.help-block= help


= form_tag('/organizations', :method => :get, :id=>"search-form") do
  %section#search-box
    %div
      %section#keyword-search-box
        %label{:for => "keyword"}
          I need...
        = search_field_tag :keyword, params[:keyword], :placeholder => "what are you looking for?", :list => "search-keywords"
        - cache ['keywords-list', *cip_keywords] do
          %datalist#search-keywords
            - cip_keywords.each do |keyword|
              %option{:value=>keyword}

      %button{:type=>'submit',:id=>'find-btn', :title=>"Search"}
        %span{"data-icon"=>"🔍" , :class=>"search-button ohana-icon"}
        %span Search

Set SMC service area and Human Services kind filter as default on first search

= form_tag('/organizations', :method => :get, :id=>"search-form") do
  %section#search-box
    %div
      %section#keyword-search-box
        %label{:for => "keyword"}
          I need...
        = search_field_tag :keyword, params[:keyword], :placeholder => "what are you looking for?", :list => "search-keywords"
        = hidden_field_tag 'service_area',"smc"
        = hidden_field_tag 'kind[]',"Human Services"
        - cache ['keywords-list', *cip_keywords] do
          %datalist#search-keywords
            - cip_keywords.each do |keyword|
              %option{:value=>keyword}

      %button{:type=>'submit',:id=>'find-btn', :title=>"Search"}
        %span{"data-icon"=>"🔍" , :class=>"search-button ohana-icon"}
        %span Search


.hr.hr3.hr-full

%footer.clearfix

  .credits
    %div.copyright
      %span
        ©
        = Time.now.year
        #{link_to 'Digital Social Innovation', '/about'}. Built by #{link_to 'Swirrl', 'http://swirrl.com'}.

    %div.contact
      %span.twitter
        %i.icon-social-twitter
        %a{ href: "https://twitter.com/digi_si" }
          @digi_si

      %span.email
        %a{ href: "mailto:contact@digitalsocial.eu" }
          %i.icon-paper-plane
          contact@digitalsocial.eu

  %nav
    %div
      %a{ href: "/blog" }
        Blog

      %a{ href: "/about" }
        About

      %a{ href: "/events" }
        Events

      %a{ href: "http://data.digitalsocial.eu" }
        Open Data

    %div{style:'margin-top:14px; font-size:14px; float:right; '}
      %a{ href: "/terms" }
        Terms of Use

      %a{ href: "/privacy" }
        Privacy & Cookies

Remove redundany navigation elements from footer now that they're in the menu.

.hr.hr3.hr-full

%footer.clearfix

  .credits
    %div.copyright
      %span
        ©
        = Time.now.year
        #{link_to 'Digital Social Innovation', '/about'}. Built by #{link_to 'Swirrl', 'http://swirrl.com'}.

    %div.contact
      %span.twitter
        %i.icon-social-twitter
        %a{ href: "https://twitter.com/digi_si" }
          @digi_si

      %span.email
        %a{ href: "mailto:contact@digitalsocial.eu" }
          %i.icon-paper-plane
          contact@digitalsocial.eu

  %nav
    %div{style:'font-size:14px; float:right;'}
      %a{ href: "/terms" }
        Terms of Use

      %a{ href: "/privacy" }
        Privacy & Cookies


!!!
%html
  %head
    %title Bearden
    = csrf_meta_tags
    = stylesheet_link_tag 'application', media: 'all'
    = javascript_include_tag 'application'
  %body= yield

Add a basic container to the layout

!!!
%html
  %head
    %title Bearden
    = csrf_meta_tags
    = stylesheet_link_tag 'application', media: 'all'
    = javascript_include_tag 'application'
  %body
    .container= yield


!!!
%html
  %head
    %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}
      %title= content_for?(:title) ? yield(:title) : "Teikei"
      %meta{:content => content_for?(:description) ? yield(:description) : "Teikei", :name => "description"}
        = csrf_meta_tags
        = yield(:head)
        = stylesheet_link_tag "application", :media => "all"
        = javascript_include_tag "application"
        = javascript_include_tag "http://use.typekit.net/cuk4pxu.js"
        :javascript
          try{Typekit.load();}catch(e){}
  %body{:class => "#{controller_name} #{action_name}"}

    %header.container
      .row
        = render 'layouts/navigation'
    #main.row{:role => "main"}
      = render 'layouts/messages'
      = yield
    %footer

Remove map header from generic Rails views.

!!!
%html
  %head
    %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}
      %title= content_for?(:title) ? yield(:title) : "Teikei"
      %meta{:content => content_for?(:description) ? yield(:description) : "Teikei", :name => "description"}
        = csrf_meta_tags
        = yield(:head)
        = stylesheet_link_tag "application", :media => "all"
        = javascript_include_tag "application"
        = javascript_include_tag "http://use.typekit.net/cuk4pxu.js"
        :javascript
          try{Typekit.load();}catch(e){}
  %body{:class => "#{controller_name} #{action_name}"}
    #main.row{:role => "main"}
      = render 'layouts/messages'
      = yield
    %footer


!!!
%html
  %head
    %title Bearden
    = csrf_meta_tags
    = stylesheet_link_tag 'application', media: 'all'
    = javascript_include_tag 'application'
  %body
    .container
      %nav{ class: %w(navbar navbar-toggleable-md navbar-light bg-faded) }
        %a{ class: 'navbar-brand' }
          Bearden
        %div{ class: %w(collapse navbar-collapse) }
          %ul{ class: %w(navbar-nav mr-auto) }
            %li.nav-item= link_to 'Imports', imports_path, { class: nav_class(:imports) }
            %li.nav-item= link_to 'Syncs', tags_path, { class: nav_class(:syncs) }
            %li.nav-item= link_to 'Sources', sources_path, { class: nav_class(:sources) }
            %li.nav-item= link_to 'Tags', tags_path, { class: nav_class(:tags) }

      %section= yield

Add sign out link also

!!!
%html
  %head
    %title Bearden
    = csrf_meta_tags
    = stylesheet_link_tag 'application', media: 'all'
    = javascript_include_tag 'application'
  %body
    .container
      %nav{ class: %w(navbar navbar-toggleable-md navbar-light bg-faded) }
        %a{ class: 'navbar-brand' }
          Bearden
        %div{ class: %w(collapse navbar-collapse) }
          %ul{ class: %w(navbar-nav mr-auto) }
            %li.nav-item= link_to 'Imports', imports_path, { class: nav_class(:imports) }
            %li.nav-item= link_to 'Syncs', tags_path, { class: nav_class(:syncs) }
            %li.nav-item= link_to 'Sources', sources_path, { class: nav_class(:sources) }
            %li.nav-item= link_to 'Tags', tags_path, { class: nav_class(:tags) }
            %li.nav-item= link_to 'Sign Out', '/sign_out'

      %section= yield


.white-back
  %h3
    = @mail_template.class.const_get(:DISPLAYED_NAME)

  = simple_form_for @mail_template,
    as: 'mail_template',
    url: admin_procedure_mail_template_path(@procedure, @mail_template.class.slug),
    method: :put do |f|
    .row
      .col-md-6
        = f.input :object, label: "Objet de l'email"
    = f.input :body, label: "Corps de l'email", input_html: { class: 'wysihtml5' }
    .text-right
      = link_to "Annuler", admin_procedure_mail_templates_path(@procedure), class: "btn btn-default"
      = f.button :submit, 'Mettre à jour', class: "btn-success"

  .row
    .col-md-8
      %table.table
        %tr
          %th
            Balise
          %th
            Description
        - MailTemplateConcern::TAGS.each do |balise|
          %tr
            %td.center
              = "--#{balise.first}--"
            %td
              = balise.second[:description]

Make the email templates tags table occupy the whole width available

.white-back
  %h3
    = @mail_template.class.const_get(:DISPLAYED_NAME)

  = simple_form_for @mail_template,
    as: 'mail_template',
    url: admin_procedure_mail_template_path(@procedure, @mail_template.class.slug),
    method: :put do |f|
    .row
      .col-md-6
        = f.input :object, label: "Objet de l'email"
    = f.input :body, label: "Corps de l'email", input_html: { class: 'wysihtml5' }
    .text-right
      = link_to "Annuler", admin_procedure_mail_templates_path(@procedure), class: "btn btn-default"
      = f.button :submit, 'Mettre à jour', class: "btn-success"

  .row
    .col-md-12
      %table.table
        %tr
          %th.col-md-3
            Balise
          %th
            Description
        - MailTemplateConcern::TAGS.each do |balise|
          %tr
            %td.center
              = "--#{balise.first}--"
            %td
              = balise.second[:description]


= f.fields_for :memberships, child_index: child_index do |membership_f|
  .people.grey-panel

    - membership = membership_f.object

    - if membership.new_record?
      .form-group
        = membership_f.association :person, collection: @people,
          required: false,
          include_blank: "-- Select --",
          label: 'Name'
      .form-group
        = membership_f.input :role, as: :string, label: 'Title'
      .form-checkbox
        = membership_f.input :leader, label: 'Leader?'

    - else
      = link_to membership.person.name, membership.person
      = " (#{ 'Leader ' }) " if membership.leader?
      = membership.role  if membership.role.present?
      = link_to 'remove', membership_path(membership,
          referer: request.path),
          method: :delete,
          class: 'remove-link',
          data: {confirm: "Are you sure you want to remove #{ membership.person} from #{ membership.group }? " }

Change label text for leadership checkbox

= f.fields_for :memberships, child_index: child_index do |membership_f|
  .people.grey-panel

    - membership = membership_f.object

    - if membership.new_record?
      .form-group
        = membership_f.association :person, collection: @people,
          required: false,
          include_blank: "-- Select --",
          label: 'Name'
      .form-group
        = membership_f.input :role, as: :string, label: 'Title'
      .form-checkbox
        = membership_f.input :leader, label: 'This person is the Leader of this team'

    - else
      = link_to membership.person.name, membership.person
      = " (#{ 'Leader ' }) " if membership.leader?
      = membership.role  if membership.role.present?
      = link_to 'remove', membership_path(membership,
          referer: request.path),
          method: :delete,
          class: 'remove-link',
          data: {confirm: "Are you sure you want to remove #{ membership.person} from #{ membership.group }? " }


.col-md-3
  = dialog_tag("#{@user.name}", {:icon => "fa fa-user", :class => "form_part"}) do
    = render(:partial => "summary", :locals =>{:user => @user})

.col-md-6
  = simple_form_for(@user, :html => {:class => 'form-vertical' }, :wrapper => :vertical_form, :wrapper_mappings => {:boolean => :vertical_boolean}) do |f|
    = dialog_tag('System Settings', {:icon => 'fa fa-cog', :class => "form_part"}) do
      = f.input :notify_via_email, :label => "Notify via Email"
      = f.input :num_table_rows, :collection => [5,10,15,20,25,50,100], :include_blank => false, :label => "Number of table rows to display"
      = f.button :submit, :class => "btn btn-primary"

      .col-md-12
        = f.button :submit, :class => "btn btn-primary"
.col-md-3
  = dialog_tag("Info", {:icon => "fa fa-question-circle", :class => "form_part"}) do
    %p Uncheck Notify via Email to turn off email notifications
    %p Default Organization Filter sets the filter applied on login
    %p Table Rows controls the table rows displayed across the application.

Fix duplicated submit button in user settings form

.col-md-3
  = dialog_tag("#{@user.name}", {:icon => "fa fa-user", :class => "form_part"}) do
    = render(:partial => "summary", :locals =>{:user => @user})

.col-md-6
  = simple_form_for(@user, :html => {:class => 'form-vertical' }, :wrapper => :vertical_form, :wrapper_mappings => {:boolean => :vertical_boolean}) do |f|
    = dialog_tag('System Settings', {:icon => 'fa fa-cog', :class => "form_part"}) do
      = f.input :notify_via_email, :label => "Notify via Email"
      = f.input :num_table_rows, :collection => [5,10,15,20,25,50,100], :include_blank => false, :label => "Number of table rows to display"
      .col-md-12
        = f.button :submit, :class => "btn btn-primary"
.col-md-3
  = dialog_tag("Info", {:icon => "fa fa-question-circle", :class => "form_part"}) do
    %p Uncheck Notify via Email to turn off email notifications
    %p Default Organization Filter sets the filter applied on login
    %p Table Rows controls the table rows displayed across the application.


- content_for :subnav do
  %menu
    %ul.horizontal
      %li= link_to t(".edit"), current_user_profile_edit_path, class: "btn-grey"
      %li= link_to t(".update_account"), edit_user_registration_path, class: "btn-grey"
      %li= link_to t(".my_locations"), current_user_locations_path, class: "btn-grey"
      %li= link_to t(".edit_preferences"), current_user_prefs_edit_path, class: "btn-grey"

Use full url with mixed http tab content

- content_for :subnav do
  %menu
    %ul.horizontal
      %li= link_to t(".edit"), current_user_profile_edit_url, class: "btn-grey"
      %li= link_to t(".update_account"), edit_user_registration_url, class: "btn-grey"
      %li= link_to t(".my_locations"), current_user_locations_url, class: "btn-grey"
      %li= link_to t(".edit_preferences"), current_user_prefs_edit_url, class: "btn-grey"


%header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class }
  .container
    .header-logo
      = link_to explore_root_path, class: "home" do
        = brand_header_logo
        .gitlab-text-container
          %h3 GitLab
    .header-content
      - unless current_controller?('sessions')
        .pull-right
          = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in btn-success btn-sm'

      %h1.title= title

= render 'shared/outdated_browser'

Fix header for anonymous users too

%header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class }
  %div{ class: fluid_layout ? "container-fluid" : "container-fluid container-limited" }
    .header-content
      - unless current_controller?('sessions')
        .pull-right
          = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in btn-success btn-sm'

      %h1.title= title

= render 'shared/outdated_browser'


- if @info[:entries].empty?
  .muted
    This folder is empty
- else
  %table.table.table-condensed.table-hover.file-table{'data-id' => repository.path, 'data-path' => @path, 'data-oid' => @oid, 'data-ajax-path' => fancy_repository_path(repository, path: @path, ref: @oid, action: :entries_info), 'data-diff-path' => fancy_repository_path(repository, ref: '%s', action: :diff)}
    %tbody
      - @info[:entries].each do |name, entries|
        - entries.each_with_index do |entry, i|
          %tr{"data-id" => entry[:index]}
            - if i == 0
              %td.ontology{rowspan: entries.size}
                - unless entry[:type] == :dir || entry[:ontologies].empty?
                  %ul.ontology-list
                    - entry[:ontologies].each do |ontology|
                      %li= fancy_link ontology
            %td.icon
              - if entry[:type] == :dir
                %i.icon-folder-close
              - else
                %i.icon-file
            %td.name
              = link_to entry[:name].force_encoding('UTF-8'), fancy_repository_path(repository, path: entry[:path], oid: @oid) #FIXME force_encoding is needed due to errors in rugged
            %td.last-commit.muted
            %td.last-modified.muted

Mark failed ontologies in files view.

- if @info[:entries].empty?
  .muted
    This folder is empty
- else
  %table.table.table-condensed.table-hover.file-table{'data-id' => repository.path, 'data-path' => @path, 'data-oid' => @oid, 'data-ajax-path' => fancy_repository_path(repository, path: @path, ref: @oid, action: :entries_info), 'data-diff-path' => fancy_repository_path(repository, ref: '%s', action: :diff)}
    %tbody
      - @info[:entries].each do |name, entries|
        - entries.each_with_index do |entry, i|
          %tr{"data-id" => entry[:index]}
            - if i == 0
              %td.ontology{rowspan: entries.size}
                - unless entry[:type] == :dir || entry[:ontologies].empty?
                  %ul.ontology-list
                    - entry[:ontologies].each do |ontology|
                      %li
                        = fancy_link ontology
                        - if ontology.state=='failed'
                          %i.icon-bolt{ title: "processing #{ontology.state}" }
            %td.icon
              - if entry[:type] == :dir
                %i.icon-folder-close
              - else
                %i.icon-file
            %td.name
              = link_to entry[:name].force_encoding('UTF-8'), fancy_repository_path(repository, path: entry[:path], oid: @oid) #FIXME force_encoding is needed due to errors in rugged
            %td.last-commit.muted
            %td.last-modified.muted


%body
  - if @obj && !@obj.permalink.nil?

    / Set your background image for this header on the line below.
    %header.intro-header{class: 'lazyload', loading: 'lazy', style: "padding-top: 100px; background-image: url('img/kata-cover.png')"}
      .container
        .row
          .col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1
            .post-heading
              %h1 CoderDojo Kata
              %h2.subheading 道場情報まとめ

    / Post Content
    %article
      .container
        .row
          .col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1.fontsize-bigger
            / Navigator
            %p{:style => "margin-top: -35px; padding-bottom: 20px;"}
              %a{:href => "/"}トップ
              → Kata
            / Scrivito contents
            = scrivito_tag :div, @obj, :body
            %hr/
            %p{:align => "right", :style => "color: grey; padding-bottom: 50px;"}
              更新日: #{@obj.last_changed.strftime("%Y年%m月%d日")}
  - else
    = scrivito_tag :div, @obj, :body

Use abbr style of hash rocket: '=>' in View

%body
  - if @obj && !@obj.permalink.nil?

    / Set your background image for this header on the line below.
    %header.intro-header{class: 'lazyload', loading: 'lazy', style: "padding-top: 100px; background-image: url('img/kata-cover.png')"}
      .container
        .row
          .col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1
            .post-heading
              %h1 CoderDojo Kata
              %h2.subheading 道場情報まとめ

    / Post Content
    %article
      .container
        .row
          .col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1.fontsize-bigger
            / Navigator
            %p{style: "margin-top: -35px; padding-bottom: 20px;"}
              %a{href: "/"}トップ
              → Kata
            / Scrivito contents
            = scrivito_tag :div, @obj, :body
            %hr/
            %p{align: "right", style: "color: grey; padding-bottom: 50px;"}
              更新日: #{@obj.last_changed.strftime("%Y年%m月%d日")}
  - else
    = scrivito_tag :div, @obj, :body


.joyride-tip-guide.question-mark-tooltip{class: "{{ context }}", ng: {class: "{ in: tt_isOpen, fade: tt_animation", show: "tt_isOpen"}}
  .background{ng: {click: "tt_isOpen = false"}}
  .joyride-content-wrapper
    {{ "js.shopfront.unit_price_tooltip" | t }}
  %span.joyride-nub.bottom

Add missing closing curly bracket

.joyride-tip-guide.question-mark-tooltip{class: "{{ context }}", ng: {class: "{ in: tt_isOpen, fade: tt_animation }", show: "tt_isOpen"}}
  .background{ng: {click: "tt_isOpen = false"}}
  .joyride-content-wrapper
    {{ "js.shopfront.unit_price_tooltip" | t }}
  %span.joyride-nub.bottom


.event-list
  = collection_placeholder events, message: 'No events planned for this time.' do
    .panel-group{:id => id}
      - events.group_by(&:start_time).each do |start_time, events_by_time|
        %h5
          %i.fa.fa-clock-o
          = l start_time, format: '%H:%M'
        = render partial: 'panel', collection: events_by_time, as: :event, locals: { collapse_parent: '#%s' % id }

Align placeholder with event panels

.event-list
  - if events.empty?
    %h5= ' '.html_safe

  = collection_placeholder events, message: 'No events planned for this time.' do
    .panel-group{:id => id}
      - events.group_by(&:start_time).each do |start_time, events_by_time|
        %h5
          %i.fa.fa-clock-o
          = l start_time, format: '%H:%M'
        = render partial: 'panel', collection: events_by_time, as: :event, locals: { collapse_parent: '#%s' % id }


%h1 Listing <%= plural_table_name %>

%table
  %tr
<% for attribute in attributes -%>
    %th <%= attribute.human_name %>
<% end -%>
    %th
    %th
    %th

  - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
    %tr
<% for attribute in attributes -%>
      %td= <%= singular_table_name %>.<%= attribute.name %>
<% end -%>
      %td= link_to 'Show', <%= singular_table_name %>
      %td= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
      %td= link_to 'Destroy', <%= singular_table_name %>, <%= key_value :method, ":delete" %>, <%= key_value :data, "{ #{key_value :confirm, "'Are you sure?'"} }" %>

%br

= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path

Fix templates for Rails 4

%h1 Listing <%= plural_table_name %>

%table
  %tr
<% for attribute in attributes -%>
    %th <%= attribute.human_name %>
<% end -%>
    %th
    %th
    %th

  - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
    %tr
<% for attribute in attributes -%>
      %td= <%= singular_table_name %>.<%= attribute.name %>
<% end -%>
      %td= link_to 'Show', <%= singular_table_name %>
      %td= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
      %td= link_to 'Destroy', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' }

%br

= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path


%div.panel.panel-default
  %div.panel-heading.nav.nav-pills
    %li
      %h4#scenario-new-title
        New Scenario:

  %div.panel-body
    %h3 Default Scenarios:
    %ul
      - @templates.each do |template|
        %b Name:
        = template[:name]
        %br
        %b Description:
        = template[:description]
        %p
        = simple_form_for(@scenario) do |f|
          = f.hidden_field :template, :value => template[:filename]
          = f.button :submit, 'Create ' + template[:name], class: 'btn btn-primary'
        %p
        %br

    %h3 My Scenarios:
    %ul
      - @templates_user.each do |template|
        %div{ id: "scenario-custom-#{template[:filename]}" }
          %b Name:
          = template[:name]
          %br
          %b Description:
          = template[:description]
          %p
          %div.nav.nav-pills
            %li
              = simple_form_for(@scenario) do |f|
                = f.hidden_field :template, :value => template[:filename]
                = f.button :submit, 'Create ' + template[:name], class: 'btn btn-primary'
            %li

            %li
              = link_to 'Obliterate', scenarios_obliterate_custom_path(filename: template[:filename]), remote: true, method: :post, :data => { confirm: "This will completely erase the scenario. Are you sure?" }, class: 'btn btn-danger'

    = link_to 'Back', scenarios_path

Change scenario new page back button.

%div.panel.panel-default
  %div.panel-heading.nav.nav-pills
    %li
      %h4#scenario-new-title
        New Scenario:

  %div.panel-body
    %h3 Default Scenarios:
    %ul
      - @templates.each do |template|
        %b Name:
        = template[:name]
        %br
        %b Description:
        = template[:description]
        %p
        = simple_form_for(@scenario) do |f|
          = f.hidden_field :template, :value => template[:filename]
          = f.button :submit, 'Create ' + template[:name], class: 'btn btn-primary'
        %p
        %br

    %h3 My Scenarios:
    %ul
      - @templates_user.each do |template|
        %div{ id: "scenario-custom-#{template[:filename]}" }
          %b Name:
          = template[:name]
          %br
          %b Description:
          = template[:description]
          %p
          %div.nav.nav-pills
            %li
              = simple_form_for(@scenario) do |f|
                = f.hidden_field :template, :value => template[:filename]
                = f.button :submit, 'Create ' + template[:name], class: 'btn btn-primary'
            %li

            %li
              = link_to 'Obliterate', scenarios_obliterate_custom_path(filename: template[:filename]), remote: true, method: :post, :data => { confirm: "This will completely erase the scenario. Are you sure?" }, class: 'btn btn-danger'
  %p

= link_to 'Back', scenarios_path, class: 'btn btn-default'


%table.list
  %tr
    %th= t 'name'
    %th= t 'disposition'
    %th= t 'disposition_date'
    %th= t 'contact_type'
    %th= t 'phone'
    %th

  - person_entity = parent.interested_party.person_entity
  - person = person_entity.person
  - phone  = person_entity.primary_phone
  - contact_event_data = ParticipationsContact.find(contact.id)
  - if parent.deleted_at
    - style = {:class => 'struck-through'}
  - else
    - style = {}
  %tr
    %td{style}= h(person.last_comma_first)
    %td{style}= h(contact_event_data.disposition.code_description) if contact_event_data and contact_event_data.disposition
    %td{style}= ld(contact_event_data.disposition_date) if contact_event_data
    %td{style}= h(contact_event_data.contact_type.code_description) if contact_event_data and contact_event_data.contact_type

    %td{style}
      -unless phone.nil?
        = h(phone.simple_format)
    %td
      .tools
        = show_and_edit_event_links(parent)

Fix to promoted contacts. Hat tip to Kurt Liedtke.

%table.list
  %tr
    %th= t 'name'
    %th= t 'disposition'
    %th= t 'disposition_date'
    %th= t 'contact_type'
    %th= t 'phone'
    %th

  - person_entity = parent.interested_party.person_entity
  - person = person_entity.person
  - phone  = person_entity.primary_phone
  - contact_event_data = contact.participations_contact
  - if parent.deleted_at
    - style = {:class => 'struck-through'}
  - else
    - style = {}
  %tr
    %td{style}= h(person.last_comma_first)
    %td{style}= h(contact_event_data.disposition.code_description) if contact_event_data and contact_event_data.disposition
    %td{style}= ld(contact_event_data.disposition_date) if contact_event_data
    %td{style}= h(contact_event_data.contact_type.code_description) if contact_event_data and contact_event_data.contact_type

    %td{style}
      -unless phone.nil?
        = h(phone.simple_format)
    %td
      .tools
        = show_and_edit_event_links(parent)


%table.char
  %tbody
    %tr.line
      %td.tab Titles
    - if @character.current_title && @character.titles
      - @character.titles.each do |t|
        %tr
          %td
            - if t == @character.current_title
              %span.current_title= TitleHelper::get_title_name(t)
            - else
              %span= TitleHelper::get_title_name(t)

Handle case where char has no titles in titles pane

%table.char
  %tbody
    %tr.line
      %td.tab Titles
    - if @character.current_title && @character.titles
      - @character.titles.each do |t|
        %tr
          %td
            - if t == @character.current_title
              %span.current_title= TitleHelper::get_title_name(t)
            - else
              %span= TitleHelper::get_title_name(t)
    - else
      %tr
        %td No titles.


- if params[:page].nil?
  - page_title("Programas de La Venganza será Terrible")
- else
  - page_title("Programas de La Venganza será Terrible <small>Página #{params[:page]}</small>")

%h2.ribbon!= html_page_title

=render 'layouts/banners/b468x60'

.posts
  = render @posts

= paginate @posts, :window => 2

Change banner position in post index

- if params[:page].nil?
  - page_title("Programas de La Venganza será Terrible")
- else
  - page_title("Programas de La Venganza será Terrible <small>Página #{params[:page]}</small>")

%h2.ribbon!= html_page_title

.posts
  = render @posts

= paginate @posts, :window => 2

=render 'layouts/banners/b468x60'


= 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

Fix the group profile form to use the f.inputs properly

= 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


%h1 Blacklisted email addresses

= paginated_section @black_lists, renderer: PagerRenderer, previous_label: image_tag("pager/previous.png", size: "13x14"), next_label: image_tag("pager/next.png", size: "13x14"), text: "Address" do
  %p.count= page_entries_info @black_lists, model: "blacklisted email addresses"
  %table.table.table-striped
    %thead
      %tr
        %th Email address
        %th Reason blacklisted
        %th When
    %tbody
      - @black_lists.each do |black_list|
        %tr
          %td= black_list.address.text
          %td
            - unless black_list.caused_by_delivery.subject.blank?
              = link_to truncate(black_list.caused_by_delivery.postfix_log_lines.first.extended_status, length: 160), black_list.caused_by_delivery
          %td
            = time_ago_in_words(black_list.caused_by_delivery.postfix_log_lines.first.created_at)
            ago
          - if policy(black_list).destroy?
            %td
              = button_to "Remove", black_list, method: :delete, class: "btn btn-danger"

Use page header and don't show table header if no blacklisted emails

.page-header
  %h1 Blacklisted email addresses
  %p
    This list is auto-populated with any email addresses that bounce. Any further emails to addresses
    in this list will be "held back" and not sent.

= paginated_section @black_lists, renderer: PagerRenderer, previous_label: image_tag("pager/previous.png", size: "13x14"), next_label: image_tag("pager/next.png", size: "13x14"), text: "Address" do
  %p.count= page_entries_info @black_lists, model: "blacklisted email addresses"
  - if @black_lists.size > 0
    %table.table.table-striped
      %thead
        %tr
          %th Email address
          %th Reason blacklisted
          %th When
      %tbody
        - @black_lists.each do |black_list|
          %tr
            %td= black_list.address.text
            %td
              - unless black_list.caused_by_delivery.subject.blank?
                = link_to truncate(black_list.caused_by_delivery.postfix_log_lines.first.extended_status, length: 160), black_list.caused_by_delivery
            %td
              = time_ago_in_words(black_list.caused_by_delivery.postfix_log_lines.first.created_at)
              ago
            - if policy(black_list).destroy?
              %td
                = button_to "Remove", black_list, method: :delete, class: "btn btn-danger"


- current_nav ||= nil

%ul#customer-nav.nav.nav-tabs
  %li{:class => (current_nav == :overview ? 'active' : '')}
    = link_to 'Overview', customer

  %li{:class => (current_nav == :bookings ? 'active' : '')}
    = link_to 'Bookings', [customer, :bookings]

  %li{:class => (current_nav == :rentals ? 'active' : '')}
    = link_to 'Rentals', [customer, :rentals]

Add icons to customer tabs

- current_nav ||= nil

%ul#customer-nav.nav.nav-tabs
  %li{:class => (current_nav == :overview ? 'active' : '')}
    = link_to customer do
      = icon :eye, 'Details'

  %li{:class => (current_nav == :bookings ? 'active' : '')}
    = link_to [customer, :bookings] do
      = icon 'check-square-o', 'Bookings'

  %li{:class => (current_nav == :rentals ? 'active' : '')}
    = link_to [customer, :rentals] do
      = icon :gear, 'Rentals'


.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open()}"}
  .columns.small-4
    %strong {{ producer.name }}
  .columns.small-3
    {{ producer.address.city }}
  .columns.small-4
    {{ producer.address.state | uppercase }}
  .columns.small-1.text-right
    %i{"ng-class" => "{'fi-arrow-down' : !open(), 'fi-arrow-up' : open()}"}

Add producers icon to active table

.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open()}"}
  .columns.small-4
    %i.ofn-i_036-producers
    %strong {{ producer.name }}
  .columns.small-3
    {{ producer.address.city }}
  .columns.small-4
    {{ producer.address.state | uppercase }}
  .columns.small-1.text-right
    %i{"ng-class" => "{'ofn-i_005-caret-down' : !open(), 'ofn-i_006-caret-up' : open()}"}


= message.component.title
= link_to t(".download"), message.component.file.url

Add some paragraphs in attachment messages, for better layout.

%p= message.component.title
%p= link_to t(".download"), message.component.file.url


.panel-heading
  %h3 More Resources
.panel-body
  %p.resource If you need a basic refresher on SQL concepts, the Postgres Tutorial is a fantastic resource.
  %p.resource A good alternate tutorial is here, including some exercises of its own.
  %p.resource You should understand the basics of data normalization (up to the so-called "Third Normal Form"). Here's a decent primer with a minimum of unnecessary detail.
  %p.resource There is an emerging standard for APIs coming out of Rails; read about it in Designing Hypermedia APIs. Look for a copy in the library.
  %p.resource Come get you some Exercises Repo

= render partial: 'modules/exercises'

Add SQLBolt as a resource to the Data 1 Module

.panel-heading
  %h3 More Resources
.panel-body
  %p.resource If you need a basic refresher on SQL concepts, the Postgres Tutorial is a fantastic resource.
  %p.resource Good alternate tutorials include this tutorial, which has exercises of its own, and SQLBolt, which allows you to write SQL statements in your browser.
  %p.resource You should understand the basics of data normalization (up to the so-called "Third Normal Form"). Here's a decent primer with a minimum of unnecessary detail.
  %p.resource There is an emerging standard for APIs coming out of Rails; read about it in Designing Hypermedia APIs. Look for a copy in the library.
  %p.resource Come get you some Exercises Repo

= render partial: 'modules/exercises'


---
title: Timer
description: Timer for Mob Programming and just keeping time whether in Agile XP Retrospectives or any other situation.
scripts:
  - timer
no_footer: true
header:
  links:
    - icon: play
      classname: play
    - icon: pause
      classname: pause
    - icon: stop
      classname: stop
    - icon:  cog
      classname: settings
      modal: settingsModal

---

.middled.counter
  %div
    .counter-text
      Start
    %small.turn-text

.hidden
  %audio.alert{ src: './sounds/door-bell.wav', volume:'1' }

#settingsModal.reveal-modal{ data: {reveal: ''}, role: 'dialog' }
  %h2 Timer Settings
  .row.collapse
    .small-3.columns
      %label.prefix{for:'#period'} Duration
    .small-9.columns
      %input#period.period.text-center{ type:"time", placeholder:"Minutes", value:"10:00" }
  %h4 Mobsters
  %span.button.small.expand.add-mobster Add a Mobster
  .mobster-container

  %a.close-reveal-modal ×

Add notice for min two-person mobbing requirement.

---
title: Timer
description: Timer for Mob Programming and just keeping time whether in Agile XP Retrospectives or any other situation.
scripts:
  - timer
no_footer: true
header:
  links:
    - icon: play
      classname: play
    - icon: pause
      classname: pause
    - icon: stop
      classname: stop
    - icon:  cog
      classname: settings
      modal: settingsModal

---

.middled.counter
  %div
    .counter-text
      Start
    %small.turn-text

.hidden
  %audio.alert{ src: './sounds/door-bell.wav', volume:'1' }

#settingsModal.reveal-modal{ data: {reveal: ''}, role: 'dialog' }
  %h2 Timer Settings
  .row.collapse
    .small-3.columns
      %label.prefix{for:'#period'} Duration
    .small-9.columns
      %input#period.period.text-center{ type:"time", placeholder:"Minutes", value:"10:00" }
  %h4
    %span Mobsters
    %small You need at least two.
  %span.button.small.expand.add-mobster Add a Mobster
  .mobster-container

  %a.close-reveal-modal ×


!!! Strict
%html
  %head
    %meta{:content => "text/html;charset=UTF-8", "http-equiv" => "content-type"}
    = csrf_meta_tag
    = yield :head_meta
    %title= html_title
    = stylesheet_link_tag "reset", "base", "tabs", "hotkeys"
    = yield :head_css
    = javascript_include_tag :defaults
    = javascript_include_tag "hotkeys"
    = yield :head_javascript
  %body
    #container
      #top
        .auth-status
          - if user_signed_in?
            = raw "Logged in as %{user_name}" % {:user_name => link_to(h(current_user.name), current_user)}
            [
            = link_to "Logoff", destroy_user_session_path
            ]
          - else
            You are not logged in
            [
            = link_to "Login", new_user_session_path
            ]

        %h1.main-title O.S. PhoneBook
        #tabs
          = raw render_tabs
      #content
        = render :partial => "hotkeys/hotkeys"
        - unless title.blank?
          %h2= title
        - if notice
          %p.notice= notice
        - if alert
          %p.alert= alert
        = yield
      #footer
        %p
          O.S. PhoneBook
          %br
          - year = Time.now.year
          - year = (year == 2011 ? "" : "-" + year)
          = "Copyright © 2011#{year} O.S. Systems Softwares Ltda."

Fix copyright notice to work for years beyond 2011

!!! Strict
%html
  %head
    %meta{:content => "text/html;charset=UTF-8", "http-equiv" => "content-type"}
    = csrf_meta_tag
    = yield :head_meta
    %title= html_title
    = stylesheet_link_tag "reset", "base", "tabs", "hotkeys"
    = yield :head_css
    = javascript_include_tag :defaults
    = javascript_include_tag "hotkeys"
    = yield :head_javascript
  %body
    #container
      #top
        .auth-status
          - if user_signed_in?
            = raw "Logged in as %{user_name}" % {:user_name => link_to(h(current_user.name), current_user)}
            [
            = link_to "Logoff", destroy_user_session_path
            ]
          - else
            You are not logged in
            [
            = link_to "Login", new_user_session_path
            ]

        %h1.main-title O.S. PhoneBook
        #tabs
          = raw render_tabs
      #content
        = render :partial => "hotkeys/hotkeys"
        - unless title.blank?
          %h2= title
        - if notice
          %p.notice= notice
        - if alert
          %p.alert= alert
        = yield
      #footer
        %p
          O.S. PhoneBook
          %br
          - year = Time.now.year
          - year = (year == 2011 ? "" : "-#{year}")
          = "Copyright © 2011#{year} O.S. Systems Softwares Ltda."


!!!
%html
  %head
    %title= t ".title"
    = stylesheet_link_tag    "application"
    %script(src="/openlayers/OpenLayers.js" type="text/javascript")
    = javascript_include_tag "application"
    = csrf_meta_tags
  %body{class: controller_path.tr("/_", "-")}
    %header.top
      .inner
        = link_to image_tag("header_logo.png", alt: t(".title")), root_path
    %nav.bar
      .inner
        - if current_user
          .main-menu
            %ul
              %li= link_to t(".dashboard"), dashboard_path
              - if permitted_to? :view, :admin_home
                %li= link_to t(".admin"), admin_home_path
              %li= link_to t(".issues"), issues_path
              %li= link_to t(".threads"), threads_path
          .account-menu
            %ul
              %li.name= link_to_profile current_user
              %li.sign-out= link_to "Sign out", destroy_user_session_path, method: "delete"
        - else
          .public-menu
          .account-menu
            %ul
              %li= link_to "Sign up", new_user_registration_path
              %li= link_to "Sign in", new_user_session_path
    .flash-container
      - [:alert, :notice].each do |type|
        - if flash.key? type
          .flash{class: type}
            = flash[type]
    .content-container
      .content
        = yield
    %footer

Add jQuery tools from CDN for evaluative purposes.

!!!
%html
  %head
    %title= t ".title"
    = stylesheet_link_tag    "application"
    %script(src="/openlayers/OpenLayers.js" type="text/javascript")
    %script(src="http://cdn.jquerytools.org/1.2.6/jquery.tools.min.js" type="text/javascript")
    = javascript_include_tag "application"
    = csrf_meta_tags
  %body{class: controller_path.tr("/_", "-")}
    %header.top
      .inner
        = link_to image_tag("header_logo.png", alt: t(".title")), root_path
    %nav.bar
      .inner
        - if current_user
          .main-menu
            %ul
              %li= link_to t(".dashboard"), dashboard_path
              - if permitted_to? :view, :admin_home
                %li= link_to t(".admin"), admin_home_path
              %li= link_to t(".issues"), issues_path
              %li= link_to t(".threads"), threads_path
          .account-menu
            %ul
              %li.name= link_to_profile current_user
              %li.sign-out= link_to "Sign out", destroy_user_session_path, method: "delete"
        - else
          .public-menu
          .account-menu
            %ul
              %li= link_to "Sign up", new_user_registration_path
              %li= link_to "Sign in", new_user_session_path
    .flash-container
      - [:alert, :notice].each do |type|
        - if flash.key? type
          .flash{class: type}
            = flash[type]
    .content-container
      .content
        = yield
    %footer


= editing_alert
= simple_form_for @group do |f|
  %fieldset
    .form-group
      = f.input :name, as: :string, required: false, label: 'Team name'

    .form-group
      %label.form-label-bold{ for: :group_description } Team description
      %p.form-hint= info_text('hint_team_description')
      = f.input :description, label: false, input_html: { class: 'wider' }

    .form-group
      %label.form-label-bold{ for: :group_responsibilities } Team responsibilities (optional)
      %p.form-hint= info_text('hint_team_responsibilities')
      = f.input :responsibilities, label: false, input_html: { class: 'wider' }

    .form-group
      %label.form-label-bold Team parent
      %p.form-hint Use this to change where in the organisation this team is located.
      = f.input :parent_id, as: :hidden
      = render partial: 'home/org_browser'
      :javascript
        window.getOrgBrowserGroupId = function() {
          return parseInt($('#group_parent_id').attr('value'), 10);
        };
        window.setOrgBrowserGroupId = function(id) {
          $('#group_parent_id').attr('value', id);
        };

    .form-group
      = f.button :submit

Hide the org browser when creating a sub-team

= editing_alert
= simple_form_for @group do |f|
  %fieldset
    .form-group
      = f.input :name, as: :string, required: false, label: 'Team name'

    .form-group
      %label.form-label-bold{ for: :group_description } Team description
      %p.form-hint= info_text('hint_team_description')
      = f.input :description, label: false, input_html: { class: 'wider' }

    .form-group
      %label.form-label-bold{ for: :group_responsibilities } Team responsibilities (optional)
      %p.form-hint= info_text('hint_team_responsibilities')
      = f.input :responsibilities, label: false, input_html: { class: 'wider' }

    .form-group
      = f.input :parent_id, as: :hidden
      - unless params[:group_id]
        %label.form-label-bold Team parent
        %p.form-hint Use this to change where in the organisation this team is located.
        = render partial: 'home/org_browser'
        :javascript
          window.getOrgBrowserGroupId = function() {
            return parseInt($('#group_parent_id').attr('value'), 10);
          };
          window.setOrgBrowserGroupId = function(id) {
            $('#group_parent_id').attr('value', id);
          };

    .form-group
      = f.button :submit


%h1 People

= render :partial => 'people/new'

= render :partial => 'people/search'

%h2 List of people

%ul.pagination
  - Person.pagination_letters.each do |letter|
    %li= link_to letter, people_path(:letter => letter)

%ul.people
  - @people.each do |person|
    %li= render :partial => "people/person", :locals => {:person => person, :village => true, :date_of_birth => true}

Hide pagination and display back button when performing a search.

%h1 People

= render :partial => 'people/new'

= render :partial => 'people/search'

- if params[:search]
  %h2 Search results
  %p= link_to '« back', people_path
- else
  %h2 List of people

  %ul.pagination
    - Person.pagination_letters.each do |letter|
      %li= link_to letter, people_path(:letter => letter)

%ul.people
  - @people.each do |person|
    %li= render :partial => "people/person", :locals => {:person => person, :village => true, :date_of_birth => true}


- @attributes ||= collection.first.attribute_names - ['id', 'created_at', 'updated_at']
%table.list{:class => "#{collection.first.class.to_s.downcase.pluralize} collection"}
  %thead
    %tr
      - @attributes.each do |field|
        %th= t_attr field, collection.first.class
      %th.action-links

  - @attributes = @attributes - ['name', 'client_id', 'project_state_id']
  %tbody
    - collection.each do |r|
      %tr
        %td= link_to r.name, r, {'data-href-container' => 'tr'}
        - @attributes.each do |field|
          %td= r.send(field) if r.respond_to?(field)
        %td= r.client
        %td= r.project_state
        %td.action-links
          = list_link_for(:show, r)
          = list_link_for(:edit, r)
          = list_link_for(:delete, r)

Drop list link for show in projects list.

- @attributes ||= collection.first.attribute_names - ['id', 'created_at', 'updated_at']
%table.list{:class => "#{collection.first.class.to_s.downcase.pluralize} collection"}
  %thead
    %tr
      - @attributes.each do |field|
        %th= t_attr field, collection.first.class
      %th.action-links

  - @attributes = @attributes - ['name', 'client_id', 'project_state_id']
  %tbody
    - collection.each do |r|
      %tr
        %td= link_to r.name, r, {'data-href-container' => 'tr'}
        - @attributes.each do |field|
          %td= r.send(field) if r.respond_to?(field)
        %td= r.client
        %td= r.project_state
        %td.action-links
          = list_link_for(:edit, r)
          = list_link_for(:delete, r)


%nav.navbar.navbar-default.navbar-fixed-bottom{role:'navigation'}
  %div.content
    %ul.nav.navbar-nav
      - Settings.footer.each do |entry|
        %li>
          - if entry.href
            = link_to entry.text, entry.href
          - else
            = link_to entry.text, '#'

Add OOR Initiative to the footer

%nav.navbar.navbar-default.navbar-fixed-bottom{role:'navigation'}
  %div.content
    %ul.nav.navbar-nav
      - Settings.footer.each do |entry|
        %li>
          - if entry.href
            = link_to entry.text, entry.href
          - else
            = link_to entry.text, '#'
    %div.pull-right
      %ul.nav.navbar-nav
        %li
          = link_to 'Open Ontology Repository (OOR) Initiative', '#'


%h1= t ".title"
%p= t ".introduction"
%table
  %thead
    %th= t ".id"
    %th= t ".display_name"
    %th= t ".full_name"
    %th= t ".email"
    %th= t ".role"
    %th= t ".created"
    %th= t ".disabled"
    %th= t ".edit"
    %th= t ".preferences"
  %tbody
    - @users.each do |user|
      %tr
        %td= user.id
        %td= user.display_name
        %td= link_to user.full_name, user_profile_path(user)
        %td= user.email
        %td= user.role
        %td= t ".created_at", time_ago: time_ago_in_words(user.created_at)
        %td= t ".disabled_at", time_ago: time_ago_in_words(user.disabled_at) if user.disabled_at?
        %td= link_to t(".edit"), edit_admin_user_path(user)
        %td= link_to t(".preferences"), edit_user_prefs_path(current_user)

Fix wrong link in /admin/users

%h1= t ".title"
%p= t ".introduction"
%table
  %thead
    %th= t ".id"
    %th= t ".display_name"
    %th= t ".full_name"
    %th= t ".email"
    %th= t ".role"
    %th= t ".created"
    %th= t ".disabled"
    %th= t ".edit"
    %th= t ".preferences"
  %tbody
    - @users.each do |user|
      %tr
        %td= user.id
        %td= user.display_name
        %td= link_to user.full_name, user_profile_path(user)
        %td= user.email
        %td= user.role
        %td= t ".created_at", time_ago: time_ago_in_words(user.created_at)
        %td= t ".disabled_at", time_ago: time_ago_in_words(user.disabled_at) if user.disabled_at?
        %td= link_to t(".edit"), edit_admin_user_path(user)
        %td= link_to t(".preferences"), edit_user_prefs_path(user)


%h1 Users
%table.users
  %tr
    %th ID
    %th Username
    %th Admin?
  - @users.each do |user|
    %tr.user
      %td= user.id
      %td= user.username
      %td
        = form_for user, url: admin_user_path(user), remote: true, html: { class: 'js-submit-on-change' } do |f|
          = f.check_box :admin

Enhance users table for admins

%h1 Users
%table.table.table-hover.users
  %tr
    %th ID
    %th Username
    %th Email
    %th Name
    %th Admin?
  - @users.each do |user|
    %tr.user
      %td= user.id
      %td= user.username
      %td= user.email
      %td= "#{user.first_name} #{user.last_name}"
      %td
        = form_for user, url: admin_user_path(user), remote: true, html: { class: 'js-submit-on-change' } do |f|
          = f.check_box :admin


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

= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
  .omniauth
    - if %w(iPhone Safari).all? { |keyword| request.user_agent.include? keyword }
      - query = { return_to: user_pixiv_omniauth_authorize_url }.to_query
      - link = "#{ENV['ACCOUNT_PIXIV_LOGIN_URL']}?#{query}"
      = link_to t('simple_form.labels.omniauth_pixiv.signin'), link, class: 'block-button'
    - else
      .block-button.omniauth-pixiv
        = t('simple_form.labels.omniauth_pixiv.signin')

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

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

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

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

Use regexp to split iPhone & iPad

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

= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
  .omniauth
    - if request.user_agent =~ /Mac OS X.*Mobile/
      - query = { return_to: user_pixiv_omniauth_authorize_url }.to_query
      - link = "#{ENV['ACCOUNT_PIXIV_LOGIN_URL']}?#{query}"
      = link_to t('simple_form.labels.omniauth_pixiv.signin'), link, class: 'block-button'
    - else
      .block-button.omniauth-pixiv
        = t('simple_form.labels.omniauth_pixiv.signin')

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

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

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

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


%ul
  - @contractors.each do |c|
    %li= c.name

Add total company contracts value to index

%ul
  - @contractors.each do |c|
    %li
      = c.name
      = number_to_currency(c.total_est_contract_value)


.col-12.col-sm-6.col-lg-4.mb-3
  %section.card
    .card-body.d-flex.align-items-center
      .my-1
        = member.avatar_image_tag(:medium)
      .ml-2
        %h5.card-title
          = link_to member.short_name, member, class: 'stretched-link text-dark'
        .card-subtitle.text-muted
          = member.played_instruments.take(3).join(', ')

Use `.media` for member list item

.col-12.col-sm-6.col-lg-4.mb-3
  %section.card
    .card-body
      .media.align-items-center
        = member.avatar_image_tag(:medium, class: 'align-self-center mr-2')
        .media-body
          %h5.card-title
            = link_to member.short_name, member, class: 'stretched-link text-dark'
          .card-subtitle.text-muted
            = member.played_instruments.take(3).join(', ')


.grid_13
- form_tag do
  = restful_submit_tag "Remove Selected", 'destroy', remove_assemblies_image_factory_deployable_path(@deployable), 'DELETE', :id => 'delete_button'
  = link_to "Add Assembly...", pick_assemblies_image_factory_deployable_path(@deployable), :class => 'button', :id => 'add_assembly'

  %table#assemblies_table
    %thead
      %tr
        %th
        %th= "Name"
        %th= "Created"
    -@deployable.assemblies(:include => :templates).each do |assembly|
      %tr
        %td
          %input{:name => "assemblies_selected[]", :type => "checkbox", :value => assembly.id, :id => "assembly_checkbox_#{assembly.id}" }
        %td= assembly.name
        %td= assembly.created_at

:javascript
  $(document).ready(function () {
    $('#add_assembly').click(function(e) {
      e.preventDefault();
      var url = $(this).attr('href');
      $.get(url, function(data) {
        $('#ui-tabs-2').html(data);
      });
    });
  });

Fix ajax behaviour of deployables > assemblies tab

.grid_13
- form_tag do
  = restful_submit_tag "Remove Selected", 'destroy', remove_assemblies_image_factory_deployable_path(@deployable), 'DELETE', :id => 'delete_button'
  = link_to "Add Assembly...", pick_assemblies_image_factory_deployable_path(@deployable), :class => 'button', :id => 'add_assembly'

  %table#assemblies_table
    %thead
      %tr
        %th
        %th= "Name"
        %th= "Created"
    -@deployable.assemblies(:include => :templates).each do |assembly|
      %tr
        %td
          %input{:name => "assemblies_selected[]", :type => "checkbox", :value => assembly.id, :id => "assembly_checkbox_#{assembly.id}" }
        %td= assembly.name
        %td= assembly.created_at

:javascript
  $(document).ready(function () {
    $('#add_assembly').click(function(e) {
      e.preventDefault();
      var url = $(this).attr('href');
      $.get(url, function(data) {
        var selectedTabIndex = $("#details-view").tabs('option', 'selected');
        var $selectedTab = $("#details-view div.ui-tabs-panel").eq(selectedTabIndex);
        $selectedTab.html(data);
      });
    });
  });


- breadcrumb link_to("ETSource", etsource_root_path)

%h2 Commit imported, cache cleared.

%p
  %h4{style: "color: red"}
    Test that everything worked:
    = link_to "Verify that dashboard is working", etsource_commit_path(id: 'current')

Remove link to outdated commit page


#warrant_fee.mod-fees
  = f.anchored_without_label 'interim_fee.warrant'
  %h2.bold-medium
    = t('.warrant_fee')

  = f.fields_for :warrant_fee do |wf|

    .form-group.nested-fields
      .grid-row
        .column-one-half
          = wf.anchored_attribute 'warrant_issued_date'
          = wf.gov_uk_date_field :warrant_issued_date, legend_text: t('.date_issued')
          = validation_error_message(@error_presenter, :warrant_issued_date)

        .column-one-half
          = wf.anchored_attribute 'warrant_executed_date'
          = wf.gov_uk_date_field :warrant_executed_date, legend_text: t('.date_executed')
          = validation_error_message(@error_presenter, :warrant_executed_date)

      - if @claim.interim?
        .grid-row
          .column-one-half
            %label.form-label
              = t('.total')
            %a{name: "amount"}
            %span.currency-indicator>< £
            = wf.text_field :amount, value: number_with_precision(wf.object.amount, precision: 2), class: 'amount form-control', size: 10, maxlength: 8
            = validation_error_message(@error_presenter, 'warrant_fee.amount')

Fix translations not being found.

#warrant_fee.mod-fees
  = f.anchored_without_label 'interim_fee.warrant'
  %h2.bold-medium
    = t('.warrant_fee')

  = f.fields_for :warrant_fee do |wf|

    .form-group.nested-fields
      .grid-row
        .column-one-half
          = wf.gov_uk_date_field :warrant_issued_date, legend_text: t('.date_issued'), legend_class: 'govuk-legend',
            id: 'warrant_fee.warrant_issued_date', error_messages: gov_uk_date_field_error_messages(@error_presenter, 'warrant_fee.warrant_issued_date')

        .column-one-half
          = wf.gov_uk_date_field :warrant_executed_date, legend_text: t('.date_executed'), legend_class: 'govuk-legend',
            id: 'warrant_fee.warrant_executed_date', error_messages: gov_uk_date_field_error_messages(@error_presenter, 'warrant_fee.warrant_executed_date')

      - if @claim.interim?
        .grid-row
          .column-one-half
            %label.form-label
              = t('.total')
            %a{name: "amount"}
            %span.currency-indicator>< £
            = wf.text_field :amount, value: number_with_precision(wf.object.amount, precision: 2), class: 'amount form-control', size: 10, maxlength: 8
            = validation_error_message(@error_presenter, 'warrant_fee.amount')


!!! 5
%HTML
  %body
    = yield

Add boostrap CSS and JS

!!! 5
%HTML

  %link{rel:  "stylesheet",
        href: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"}

  %link{rel:  "stylesheet",
        href: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"}

  %script{src: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"}

  %body
    = yield


%checkout.row#checkout
  .small-12.medium-12.columns
    = render partial: "split_checkout/tabs"
    = render partial: "split_checkout/already_ordered" if @already_ordered
    = render partial: "split_checkout/form"

Add already ordered panel only on summary step

%checkout.row#checkout
  .small-12.medium-12.columns
    = render partial: "split_checkout/tabs"
    = render partial: "split_checkout/already_ordered" if @already_ordered && checkout_step?(:summary)
    = render partial: "split_checkout/form"


= form_tag(projects_path, :method => :post, :class => 'form-inline') do
  .form-group{:class => flash[:error] ? 'has-error' : nil}
    = text_field_tag "repo_url", params[:repo_url], :class => "form-control input-lg", :placeholder => t("welcome.project_placeholder")
    = submit_tag t("welcome.add_project"), :class => "btn btn-lg"
    - flash[:error].tap do |error_message|
      .error
        = error_message

Fix button style on homepage

= form_tag(projects_path, :method => :post, :class => 'form-inline') do
  .form-group{:class => flash[:error] ? 'has-error' : nil}
    = text_field_tag "repo_url", params[:repo_url], :class => "form-control input-lg", :placeholder => t("welcome.project_placeholder")
    = submit_tag t("welcome.add_project"), :class => "btn btn-lg btn-default"
    - flash[:error].tap do |error_message|
      .error
        = error_message


%p
  Welcome
  = @resource.email
  !

%p You can confirm your account email through the link below:

%p = link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token)

Make email work in production


- model_class = Email
.page-header
  %h1 Recent emails
= paginated_section @emails do
  %table.table.table-striped
    %thead
      %tr
        %th To
        %th Received
    %tbody(data-provides="rowlink")
      - @emails.each do |email|
        %tr
          %td= link_to email.to_as_string, email_path(email), :class => "rowlink"
          %td
            = time_ago_in_words(email.created_at)
            ago

Truncate the maximum length of the emails

- model_class = Email
.page-header
  %h1 Recent emails
= paginated_section @emails do
  %table.table.table-striped
    %thead
      %tr
        %th To
        %th Received
    %tbody(data-provides="rowlink")
      - @emails.each do |email|
        %tr
          %td= link_to truncate(email.to_as_string, length: 50), email_path(email), :class => "rowlink"
          %td
            = time_ago_in_words(email.created_at)
            ago