.panel.panel-default.dashboard-panel
  .panel-heading
    Capital Projects
    .pull-right
      = select_tag(:capital_projects_fy, options_for_select(get_fiscal_years, :selected => params[:capital_projects_fy] || current_fiscal_year_year ), :class => "form-control", :style => 'margin-top: -5px;')
  #capital-projects-widget.panel-body

:javascript

  $('#capital_projects_fy').change(function() {
    $("#spinner").show();
    update_capital_projects_widget();
    $("#spinner").hide();
  });

  function update_capital_projects_widget () {
    $.ajax({
      url: "/capital_projects/get_dashboard_summary",
      type: 'GET',
      dataType: 'json',
      data: {fy_year: $('#capital_projects_fy').val()},
      complete: function(response, status) {
        if (response.status == 200) {
          $('#capital-projects-widget').html(response.responseText);
        } else {
          $('#capital-projects-widget').html(response.statusText);
        }
      }
    });
  }

Add current fiscal year to capital projects widget.

.panel.panel-default.dashboard-panel
  .panel-heading
    Capital Projects
    .pull-right
      = select_tag(:capital_projects_fy, options_for_select(get_fiscal_years.unshift(fiscal_year(current_fiscal_year_year)), :selected => params[:capital_projects_fy] || current_planning_year_year ), :class => "form-control", :style => 'margin-top: -5px;')
  #capital-projects-widget.panel-body

:javascript

  $('#capital_projects_fy').change(function() {
    $("#spinner").show();
    update_capital_projects_widget();
    $("#spinner").hide();
  });

  function update_capital_projects_widget () {
    $.ajax({
      url: "/capital_projects/get_dashboard_summary",
      type: 'GET',
      dataType: 'json',
      data: {fy_year: $('#capital_projects_fy').val()},
      complete: function(response, status) {
        if (response.status == 200) {
          $('#capital-projects-widget').html(response.responseText);
        } else {
          $('#capital-projects-widget').html(response.statusText);
        }
      }
    });
  }


- user = @cached_users[user_activity[0]]
%div.activityUser
  %div.activityUserAvatar
    %img{:src => user.gravatar_url(:size => 30)}
    = user.id == @logged_user.id ? :you.l : user.display_name

  %div.activityUserEntries
    %ul
    - user_activity[1].each do |log|
      %li.activityEntry
        -# "#{log.action} (#{log.rel_object_id} #{log.rel_object_type}) | p:#{log.page_id} by #{log.created_by_id}"
        - if !log.page_id.nil?
          = "activity_edit_Page".to_sym.l_with_args(:object_name => log.page.object_name, :previous_name => log.previous_name, :url => !log.page.nil? ? url_for(log.page) : '#')
          -# "(#{log.created_on.to_s})"
        - elsif !log.rel_object_id.nil?
          = "activity_#{log.action}_#{log.rel_object_type}".to_sym.l_with_args(:object_name => log.object_name, :previous_name => log.previous_name, :url => !log.rel_object.nil? ? url_for(log.rel_object) : '#')
          -# "(#{log.created_on.to_s})"
        - else
          = '???'

Correct the display for nullified objects in overview

- user = @cached_users[user_activity[0]]
%div.activityUser
  %div.activityUserAvatar
    %img{:src => user.gravatar_url(:size => 30)}
    = user.id == @logged_user.id ? :you.l : user.display_name

  %div.activityUserEntries
    %ul
    - user_activity[1].each do |log|
      %li.activityEntry
        -# "#{log.action} (#{log.rel_object_id} #{log.rel_object_type}) | p:#{log.page_id} by #{log.created_by_id}"
        - if !log.page_id.nil?
          = "activity_edit_Page".to_sym.l_with_args(:object_name => log.page.object_name, :previous_name => log.previous_name, :url => !log.page.nil? ? url_for(log.page) : '#')
          -# "(#{log.created_on.to_s})"
        - else
          = "activity_#{log.action}_#{log.rel_object_type}".to_sym.l_with_args(:object_name => log.object_name, :previous_name => log.previous_name, :url => !log.rel_object.nil? ? url_for(log.rel_object) : '#')
          -# "(#{log.created_on.to_s})"


=stylesheet_link_tag 'kebapress/medium-editor.css'
=javascript_include_tag 'kebapress/medium-editor'

= form_for [:hq, @post] do |f|

  = f.label :title
  = f.text_field :title, value: 'Test'

  = f.hidden_field :body, html: { id: 'body' }
  .body.editable{data: {field: {id: 'body'}}}
    = f.label 'Body'

  = f.label :tags
  = f.text_field :tag_list

  .checkbox
  = check_box :post, :published, {}, true, false
  %label= 'Publish Now'

  %br
  = check_box :post, :commentable, {}, true, false
  %label= 'Commentable'

  %br
  - @categories.each do |category|
    .categories
      =check_box_tag 'post[category_ids][]', category.id, @post.categories.include?(category)
      =category.title
  = f.submit

=javascript_include_tag 'kebapress/posts'

Add empty placeholder for editor

=stylesheet_link_tag 'kebapress/medium-editor.css'
=javascript_include_tag 'kebapress/medium-editor'

= form_for [:hq, @post] do |f|

  .post-title
    = f.label :title
    %br
    = f.text_field :title

  .post-body
    %br
    = f.label :body
    = f.hidden_field :body, html: { id: 'body' }
    .body.editable{data: {field: {id: 'body'}, placeholder: ' '}}
  %br
  .post-tags
    = f.label :tags
    %br
    = f.text_field :tag_list

  %br
  .checkbox
    = check_box :post, :published, {}, true, false
    %label= 'Publish Now'

    %br
    = check_box :post, :commentable, {}, true, false
    %label= 'Commentable'

  %br
  = f.label 'Categories'
  - @categories.each do |category|
    .categories.checkbox
      =check_box_tag 'post[category_ids][]', category.id, @post.categories.include?(category)
      =category.title
  = f.submit

=javascript_include_tag 'kebapress/posts'


%ul.nav-links.sub-nav
  %div{ class: (container_class) }
    - if project_nav_tab? :pipelines
      = nav_link(controller: :pipelines) do
        = link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do
          %span
            Pipelines
            %span.badge.count.ci_counter= number_with_delimiter(@project.pipelines.running_or_pending.count)

    - if project_nav_tab? :builds
      = nav_link(controller: %w(builds)) do
        = link_to project_builds_path(@project), title: 'Builds', class: 'shortcuts-builds' do
          %span
            Builds
            %span.badge.count.builds_counter= number_with_delimiter(@project.running_or_pending_build_count)

Remove counters from Pipeline navigation

%ul.nav-links.sub-nav
  %div{ class: (container_class) }
    - if project_nav_tab? :pipelines
      = nav_link(controller: :pipelines) do
        = link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do
          %span
            Pipelines

    - if project_nav_tab? :builds
      = nav_link(controller: %w(builds)) do
        = link_to project_builds_path(@project), title: 'Builds', class: 'shortcuts-builds' do
          %span
            Builds


-#
  Parameters:
    widget      MiqWidget object
= link_to("",
  {:controller => "report", :action => "db_widget_remove", :id => @db.id || 'new', :widget => widget.id},
  "data-miq_sparkle_on" => true,
  :remote               => true,
  :id                   => "w_#{widget.id}_close",
  :title                => _("Remove this widget"),
  :class                => "delbox")

Convert .delbox to fontawesome and display it in the widget editor

-#
  Parameters:
    widget      MiqWidget object
= link_to({:controller => "report", :action => "db_widget_remove", :id => @db.id || 'new', :widget => widget.id},
  "data-miq_sparkle_on" => true,
  :remote               => true,
  :id                   => "w_#{widget.id}_close",
  :title                => _("Remove this widget"),
  :class                => "pull-right") do
  %i.fa.fa-remove


- set_meta_tags description: 'Search morph.io for scrapers and users'

.container
  %h1.label-heading
    Search
  = render partial: "search_form"
  - if @q
    - if @all_scrapers.total_count.zero? && @owners.empty?
      %h2 No results found
      %p= no_search_results_message("scrapers or users", @q)
      %p
        Suggestions:
      %ul
        %li check the spelling
        %li try some more general or alternate terms
      %p You could also try browsing all #{link_to "scrapers", scrapers_path} or #{link_to "users", users_path}.
    - else
      .search-results.row
        .col-xs-12
          = render partial: "search_type_nav"

        - if @type == "users"
          = render "results_owners"
        - else
          = render "results_scrapers"

Add the query to the description

- set_meta_tags description: "Search morph.io for scrapers and users #{"relating to ‘" + @q + "’" if @q}"

.container
  %h1.label-heading
    Search
  = render partial: "search_form"
  - if @q
    - if @all_scrapers.total_count.zero? && @owners.empty?
      %h2 No results found
      %p= no_search_results_message("scrapers or users", @q)
      %p
        Suggestions:
      %ul
        %li check the spelling
        %li try some more general or alternate terms
      %p You could also try browsing all #{link_to "scrapers", scrapers_path} or #{link_to "users", users_path}.
    - else
      .search-results.row
        .col-xs-12
          = render partial: "search_type_nav"

        - if @type == "users"
          = render "results_owners"
        - else
          = render "results_scrapers"


- pathways = Hash[Settings.pathways.split(";").map{|x| x.split(":")}.map{|x| [x.first,x.last.split(",")]}]
= create_event_form Pathway do |f|
  %h2 Log an English or Maths Pathway
  .span1= image_tag("#{url_for(Person.user)}.jpg", :size => "48x48")
  .span3= f.select :subject, pathways.keys, {}, :class => "span3"
  - first = true
  - pathways.each do |k,v|
    .span4{:class => [k,"pathway_select_div"]}
      - first = false
      = f.select :pathway, pathways[k], {}, {:class => "span4"}

  = add_event_button

:coffeescript
  $('.pathway_select_div').hide().find("select").attr("disabled",true)
  $('.pathway_select_div').first().show().find("select").removeAttr("disabled")

  $('#pathway_subject').change ->
    $('.pathway_select_div').hide().find("select").attr("disabled",true)
    $('.pathway_select_div.' + $(this).val()).show().find("select").removeAttr("disabled")

Correct icon on pathway creation box

- pathways = Hash[Settings.pathways.split(";").map{|x| x.split(":")}.map{|x| [x.first,x.last.split(",")]}]
= create_event_form Pathway do |f|
  %h2 Log an English or Maths Pathway
  .span1= image_tag "events/pathways.png"
  .span3= f.select :subject, pathways.keys, {}, :class => "span3"
  - first = true
  - pathways.each do |k,v|
    .span4{:class => [k,"pathway_select_div"]}
      - first = false
      = f.select :pathway, pathways[k], {}, {:class => "span4"}

  = add_event_button

:coffeescript
  $('.pathway_select_div').hide().find("select").attr("disabled",true)
  $('.pathway_select_div').first().show().find("select").removeAttr("disabled")

  $('#pathway_subject').change ->
    $('.pathway_select_div').hide().find("select").attr("disabled",true)
    $('.pathway_select_div.' + $(this).val()).show().find("select").removeAttr("disabled")


%section
  .page-header
    .pull-right
      = action_button "primary", "Edit", edit_call_for_papers_path, :hint => "Edit this call for paper's data."
    %h1 Call for Papers
  .row
    .span16
      %p
        The interface for submitters is available at:
        =link_to cfp_root_url
  .row
    .span16
      #submission_graph{:style => "width: 800px; height: 300px;"}

:javascript
  var data = #{@conference.submission_data.inspect};

  $.plot($("#submission_graph"), [data], { xaxis: { mode: "time" } });

Remove link to public interface, as it links to the wrong URL. The public URL is now displayed as text

%section
  .page-header
    .pull-right
      = action_button "primary", "Edit", edit_call_for_papers_path, :hint => "Edit this call for paper's data."
    %h1 Call for Papers
  .row
    .span16
      %p
        The interface for submitters is available at:
        = new_cfp_session_url
  .row
    .span16
      #submission_graph{:style => "width: 800px; height: 300px;"}

:javascript
  var data = #{@conference.submission_data.inspect};

  $.plot($("#submission_graph"), [data], { xaxis: { mode: "time" } });


{% extends "base.html" %}
{% load crispy_forms_tags %}
{% block content %}
.row
	.span11.offset1
		%h2 Add/edit multiple images
		.lead Tell us about these images.
<form class="form-horizontal" enctype="multipart/form-data" method="post" action="">{% csrf_token %}
	{{ formset.management_form }}
	{% for form in formset %}
    	{% crispy form %}
    	{% if not forloop.last %}
    	<hr width="89%" color="black" size=6 />
    	{% endif %}
	{% endfor %}
	%input.btn.btn-large.btn-primary{type:"submit", value:"Save", style:"margin-left: 180px"}
</form>
{% endblock %}

Revert "Added divider for the formsets"

{% extends "base.html" %}
{% load crispy_forms_tags %}
{% block content %}
.row
	.span11.offset1
		%h2 Edit image
		.lead Tell us about this image.
<form class="form-horizontal" enctype="multipart/form-data" method="post" action="">{% csrf_token %}
	{% crispy formset formset.form.helper %}
	%input.btn.btn-large.btn-primary{type:"submit", value:"Save", style:"margin-left: 180px"}
</form>
{% endblock %}


- if @project.pages_deployed?
  .card
    .card-header
      Access pages
    .card-body
      %p
        %strong
          = _("Your pages are served under:")

      %p= link_to @project.pages_url, @project.pages_url

      - @project.pages_domains.each do |domain|
        %p= link_to domain.url, domain.url
    .card-footer.alert-primary
      = _("It may take up to 30 minutes before the site is available after the first deployment.")

Add attributes to open deployed pages in new tab

- if @project.pages_deployed?
  .card
    .card-header
      Access pages
    .card-body
      %p
        %strong
          = _("Your pages are served under:")

      %p
        = link_to @project.pages_url, target: :_blank, rel: 'noopener noreferrer' do
          = @project.pages_url
          = icon('external-link')

      - @project.pages_domains.each do |domain|
        %p
          = link_to domain.url, target: :_blank, rel: 'noopener noreferrer' do
            = domain.url
            = icon('external-link')
    .card-footer.alert-primary
      = _("It may take up to 30 minutes before the site is available after the first deployment.")


%h1
  %img.dc{:src => '/images/dc_logo.png'}
  Cloud Aggregator
- unless @current_user.nil?
  %ul
    %li.about
      %a{:href => ""}
        = t(:about)
    %li.configure
      %a{:href => ""}
        = t(:configure)
    %li.hello
      - link_to account_path do
        = t(:hello) + " "
        %b
          = "#{@current_user.first_name} #{@current_user.last_name}"
    %li.logout
      = link_to t(:logout), logout_url

Hide header items that are not implemented yet

%h1
  %img.dc{:src => '/images/dc_logo.png'}
  Cloud Aggregator
- unless @current_user.nil?
  %ul
    /
      FIXME: commented out because these links don't do anything yet
      %li.about
        %a{:href => ""}
          = t(:about)
      %li.configure
        %a{:href => ""}
          = t(:configure)

    %li.hello
      - link_to account_path do
        = t(:hello) + " "
        %b
          = "#{@current_user.first_name} #{@current_user.last_name}"
    %li.logout
      = link_to t(:logout), logout_url


!!! 5
%html
  %head
    %title= [@page_title, settings.blog_title].compact.join(" | ")
    %link{href: '/schreihals.css', media: "screen", rel: "stylesheet", type: "text/css"}
    %link{ href: '/atom.xml', title: "Subscribe via Atom Feed", rel: 'alternate', type: 'application/atom+xml' }
    / %script{ src: asset_path('application.js') }
  %body
    %header
      .container
        %h1
          = link_to settings.blog_title, '/'

    = yield

    %footer
      .container
        ~ markdown settings.blog_description

    - if production? && settings.google_analytics_id.present?
      = partial 'google_analytics'

Remove obsolete JavaScript include directive.

!!! 5
%html
  %head
    %title= [@page_title, settings.blog_title].compact.join(" | ")
    %link{href: '/schreihals.css', media: "screen", rel: "stylesheet", type: "text/css"}
    %link{ href: '/atom.xml', title: "Subscribe via Atom Feed", rel: 'alternate', type: 'application/atom+xml' }
  %body
    %header
      .container
        %h1
          = link_to settings.blog_title, '/'

    = yield

    %footer
      .container
        ~ markdown settings.blog_description

    - if production? && settings.google_analytics_id.present?
      = partial 'google_analytics'


%nav#site
  .go_to_content
    %a(href="#contents") Aller au contenu
    %a(href="#sidebar") Aller au menu
  %ul
    %li= link_to "Accueil", '/'
    %li= link_to "Dépêches", '/news'
    %li= link_to "Journaux", '/journaux'
    %li= link_to "Forums", '/forums'
    %li= link_to "Sondages", '/sondages'
    %li= link_to "Wiki", '/wiki'
    %li= link_to "Suivi", '/suivi'
    %li= link_to "Plan", '/plan'
  = form_tag '/recherche', :method => :get, :target => "_blank" do
    <label for="query" id="label_query">Recherche :</label>
    <input id="query" name="q" type="search" placeholder="Entrer un mot-clé" />
    = submit_tag "Rechercher", :name => nil

Add an id to the search button

%nav#site
  .go_to_content
    %a(href="#contents") Aller au contenu
    %a(href="#sidebar") Aller au menu
  %ul
    %li= link_to "Accueil", '/'
    %li= link_to "Dépêches", '/news'
    %li= link_to "Journaux", '/journaux'
    %li= link_to "Forums", '/forums'
    %li= link_to "Sondages", '/sondages'
    %li= link_to "Wiki", '/wiki'
    %li= link_to "Suivi", '/suivi'
    %li= link_to "Plan", '/plan'
  = form_tag '/recherche', :method => :get, :target => "_blank" do
    <label for="query" id="label_query">Recherche :</label>
    <input id="query" name="q" type="search" placeholder="Entrer un mot-clé" />
    = submit_tag "Rechercher", :name => nil, :id => "search_submit"


= form_for :idea, :url => ideas_path do |f|
  = f.hidden_field :owner_id, :value => current_user.id
  #idea-title.form-group.inline
    = f.label :title, "Idea"
    = f.text_field :title, :example => "My ideas is...", :maxlength => 120, :id => "new-idea-title"
  #idea-description.form-group.inline
    = f.label :description, "Description"
    = f.text_area :description, :example => "It would be great if...", :id => "new-idea-description", :rows => "7", :columns => "20"
  #idea-tags.form-group.inline
    %label{:for => "tags"} Tags
    = render :partial => 'tags/tag_editor', :locals => { :f => f }
    = submit_tag 'Share my idea', :class => 'input-submit'
  %p
    %strong<>
      Remember, please keep it constructive!

Fix placholder text in 'idea/new' form

= form_for :idea, :url => ideas_path do |f|
  = f.hidden_field :owner_id, :value => current_user.id
  #idea-title.form-group.inline
    = f.label :title, "Idea"
    = f.text_field :title, :placeholder => "My ideas is...", :maxlength => 120, :id => "new-idea-title"
  #idea-description.form-group.inline
    = f.label :description, "Description"
    = f.text_area :description, :placeholder => "It would be great if...", :id => "new-idea-description", :rows => "7", :columns => "20"
  #idea-tags.form-group.inline
    %label{:for => "tags"} Tags
    = render :partial => 'tags/tag_editor', :locals => { :f => f }
    = submit_tag 'Share my idea', :class => 'input-submit'
  %p
    %strong<>
      Remember, please keep it constructive!


-if current_user == @user
  %p=link_to 'Edit this list', user_list_edit_path(current_user.name, @list)
-if @list
  %ul
    -@list.list_items.each do |list_item|
      %li
        %p=list_item.title
        %P=list_item.description
        %br/
        %a{:href => "#{list_item.link}"}<>
          %img{:src => "#{list_item.image_url}", :alt => "product image"}/
        %hr/

-else
  %p No list found.

Add clickable tags to list detail spage.

-if current_user == @user
  %p=link_to 'Edit this list', user_list_edit_path(current_user.name, @list)
-if @list
  -@list.tags.each do |tag|
    .Tag=link_to tag, tag_path(tag)
  %ul
    -@list.list_items.each do |list_item|
      %li
        %p=list_item.title
        %P=list_item.description
        %br/
        %a{:href => "#{list_item.link}"}<>
          %img{:src => "#{list_item.image_url}", :alt => "product image"}/
        %hr/

-else
  %p No list found.


%h3 Order Overview

%table.series-graph
  %thead
    %tr
      %th Day
      %th Order Value
      %th Order Volume
      %th SKU Volume

  %tbody
    - @series.each do |entry|
      %tr
        %th= entry['day']
        %td= entry['value']
        %td= entry['volume']
        %td= entry['sku_volume']

%ul#dashboard-order-counts
  %li
    %span.value.indicator.neutral= @counts[:billing]
    %span.key to Bill
  %li
    %span.value.indicator.neutral= @counts[:packing]
    %span.key to Pack
  %li
    %span.value.indicator.neutral= @counts[:shipping]
    %span.key to Ship

Make the billing/packing/shipping summaries clickable

%h3 Order Overview

%table.series-graph
  %thead
    %tr
      %th Day
      %th Order Value
      %th Order Volume
      %th SKU Volume

  %tbody
    - @series.each do |entry|
      %tr
        %th= entry['day']
        %td= entry['value']
        %td= entry['volume']
        %td= entry['sku_volume']

%ul#dashboard-order-counts
  %li
    %a{:href => billing_admin_order_processes_url}
      %span.value.indicator.neutral= @counts[:billing]
      %span.key to Bill
  %li
    %a{:href => packing_admin_order_processes_url}
      %span.value.indicator.neutral= @counts[:packing]
      %span.key to Pack
  %li
    %a{:href => shipping_admin_order_processes_url}
      %span.value.indicator.neutral= @counts[:shipping]
      %span.key to Ship


- content_for :title, 'Policies'

%h1= yield :title
%p
  Policies are stated positions on a particular issue. For example
  "Process asylum seekers offshore", or "Legalise same sex marriage".
  Each policy has a definition and a way to vote in relevant
  divisions in Parliament.
%ul
  %li
    %a{:href => "account/addpolicy.php"} Make a new policy
%p
  This table summarises all policies, including how many times
  they have "voted". Click on their name to get a comparison of a
  policy to all MPs.
  %b
    You can get a policy to the top by editing
    and correcting motion text for its divisions.
%table.mps
  %tr.odd
    %td{:colspan => "4"}
      No policies match this person's votes. You can
      %a{:href => "/policies.php"} edit or make a policy
      that will appear
      here.
  %tr.headings
    %td
      Votes
      %i (unedited)
    %td Policy
= "That makes #{@policies.size} policies which have voted in at least one division."

Tidy up and improve the HTML formatting

- content_for :title, 'Policies'

%h1= yield :title
%p
  Policies are stated positions on a particular issue. For example
  "Process asylum seekers offshore", or "Legalise same sex marriage".
  Each policy has a definition and a way to vote in relevant
  divisions in Parliament.
%ul
  %li
    %a{:href => "account/addpolicy.php"} Make a new policy
%p
  This table summarises all policies, including how many times
  they have "voted". Click on their name to get a comparison of a
  policy to all MPs.
  %b
    You can get a policy to the top by editing
    and correcting motion text for its divisions.
%table.mps
  %tr.headings
    %td
      Votes
      %i (unedited)
    %td Policy
  %tr{:class => cycle('odd', 'even')}
    %td{:colspan => "4"}
      No policies match this person's votes. You can
      %a{:href => "/policies.php"} edit or make a policy that will appear here.
= "That makes #{@policies.size} policies which have voted in at least one division."


!!! 5
%html
  %head
    / Title
    %title= "Watch Tower - #{@title}"

    / Meta tags
    %meta{:charset => "utf-8"}/
    %meta{:content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}/
    %meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/

    / Link tags
    %link{:href => asset_path('application.css'), :rel => "stylesheet"}/

    / Script tahs
    %script{:src => asset_path('application.js')}
  %body
    %section#wrapper

      %header
        #logo
          %a{href: "/"}
            %h1 Watch Tower

      %section#main
        %aside#date
          %input{type: 'text'}
        .page= yield

      %section#footer
        WatchTower
        -
        %a{href: 'http://www.technogate.fr'}
          TechnoGate

Add two meta tags to allow the client side to parse the meta and determine dates.

!!! 5
%html
  %head
    / Title
    %title= "Watch Tower - #{@title}"

    / Meta tags
    %meta{:charset => "utf-8"}/
    %meta{:content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}/
    %meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/
    %meta{name: 'date_filtering_from', content: session[:date_filtering][:from_date] }/
    %meta{name: 'date_filtering_to', content: session[:date_filtering][:to_date]}/

    / Link tags
    %link{:href => asset_path('application.css'), :rel => "stylesheet"}/

    / Script tahs
    %script{:src => asset_path('application.js')}
  %body
    %section#wrapper

      %header
        #logo
          %a{href: "/"}
            %h1 Watch Tower

      %section#main
        %aside#date
          %input{type: 'text'}
        .page= yield

      %section#footer
        WatchTower
        -
        %a{href: 'http://www.technogate.fr'}
          TechnoGate


.row
  .col-md-12
    - if @project.comments.empty?
      %p There are no comments for this project.
      = link_to "Add a comment", "#", :class => "btn btn-primary"
    - else
      %ul.media.list
        - @project.notes.comments do |c|
          .media
            .pull-left
              %i.fa.fa-comment.fa-2x
            .media-body
              %h4.media-heading
                = #{c.created_by.name} at #{format_as_date_time(c.created_at)}
              = c.comment.html_safe

Update capital projects comments view

.row
  .col-md-12{:style => 'height: 200px;overflow-y: scroll;'}
    - if @project.comments.empty?
      %p There are no comments for this project.
    - else
      = render :partial => 'shared/comments', :locals => {:comments => @project.comments}

.row
  .col-md-12
    %fieldset
      %legend Add Comment
      = form_for [@project, Comment.new], :role => 'form' do |f|
        .form-group
          = f.text_area :comment, :class => 'form-control', :placeholder => 'Enter a new comment...'
        = f.submit :class => 'btn btn-primary'


%ul.nav
  %li.dropdown
    = link_to @project.github_project_name, '#', :class => "dropdown-toggle"
    %ul.dropdown-menu
      %li
        = link_to 'Edit project', github_project_edit_path(@project)

Add a link to the project page in the dropdown from the Edit project page.

%ul.nav
  %li.dropdown
    = link_to @project.github_project_name, '#', :class => "dropdown-toggle"
    %ul.dropdown-menu
      %li
        = link_to 'See project', github_project_path(@project)
      %li
        = link_to 'Edit project', github_project_edit_path(@project)


.visualization-edit-info.container
  .row
    .page-header.text-center
      %h2 Edit Visualization Info
    .col-sm-6.col-sm-offset-3
      = form_for @visualization, url: {action: "update"} , method: "patch", html: {:class => 'form-default'} do |f|
        .form-group
          = f.label "visualization-input-title", "Title"
          = f.text_field :name, class: "form-control"
        .form-group
          = f.label "visualization-input-description", "Description"
          = f.text_area :description, rows: 5, class: "form-control"
        = f.submit "Save", class: "btn btn-default btn-primary"
        %a.btn.btn-default{href: edit_visualization_path(@visualization)} Cancel

Add description toolbar to Visualization Edit Info form

.visualization-edit-info.container
  .row
    .page-header.text-center
      %h2 Edit Visualization Info
    .col-sm-6.col-sm-offset-3
      = form_for @visualization, url: {action: "update"} , method: "patch", html: {:class => 'form-default'} do |f|
        .form-group
          = f.label "visualization-input-title", "Title"
          = f.text_field :name, class: "form-control"
        .form-group
          = f.label "visualization-input-description", "Description"
          = f.text_field :description, type: "hidden"
          %trix-toolbar{ id: "wysiwig-toolbar", input: "visualization_description" }
          %trix-editor{ input: "visualization_description", toolbar: "wysiwig-toolbar", class: "form-control" }
        = f.submit "Save", class: "btn btn-default btn-primary"
        %a.btn.btn-default{href: edit_visualization_path(@visualization)} Cancel


- if @incidents.present?
  %table.incidents
    %thead
      %tr
        %th Driver
        %th Occurred at
        %th Run
        %th Bus
        %th Location
        %th Complete?
        - if current_user.staff?
          %th Reviewed?
          %th{ colspan: 4 }
        - else
          %th{ colspan: 3 }
    %tbody
      - @incidents.each do |incident|
        %tr
          %td= incident.driver.name
          %td= incident.occurred_at_readable
          %td= incident.driver_incident_report.run
          %td= incident.driver_incident_report.bus
          %td= incident.driver_incident_report.location
          %td= yes_no_image incident.completed?
          - if current_user.staff?
            %td= yes_no_image incident.reviewed?
          %td
            = link_to incident do
              %button.btn.btn-default
                - if current_user.staff?
                  View / Review
                - else
                  View
          %td
            = link_to incident_path(incident, format: :pdf) do
              %button.btn.btn-default Print
          %td
            - if current_user.staff? || !incident.reviewed?
              = link_to edit_incident_path(incident) do
                %button.btn.btn-default
                  - if incident.completed?
                    Edit
                  - else
                    Complete
          - if current_user.staff?
            %td
              = link_to incident, method: :delete do
                %button.btn.btn-default.delete Delete
- else
  %h2 No incidents found.

Add supervisor name to incidents table

- if @incidents.present?
  %table.incidents
    %thead
      %tr
        %th Driver
        %th Supervisor
        %th Occurred at
        %th Run
        %th Bus
        %th Location
        %th Complete?
        - if current_user.staff?
          %th Reviewed?
          %th{ colspan: 4 }
        - else
          %th{ colspan: 3 }
    %tbody
      - @incidents.each do |incident|
        %tr
          %td= incident.driver.name
          %td= incident.supervisor.name
          %td= incident.occurred_at_readable
          %td= incident.driver_incident_report.run
          %td= incident.driver_incident_report.bus
          %td= incident.driver_incident_report.location
          %td= yes_no_image incident.completed?
          - if current_user.staff?
            %td= yes_no_image incident.reviewed?
          %td
            = link_to incident do
              %button.btn.btn-default
                - if current_user.staff?
                  View / Review
                - else
                  View
          %td
            = link_to incident_path(incident, format: :pdf) do
              %button.btn.btn-default Print
          %td
            - if current_user.staff? || !incident.reviewed?
              = link_to edit_incident_path(incident) do
                %button.btn.btn-default
                  - if incident.completed?
                    Edit
                  - else
                    Complete
          - if current_user.staff?
            %td
              = link_to incident, method: :delete do
                %button.btn.btn-default.delete Delete
- else
  %h2 No incidents found.


- if company_signed_in?
  - breadcrumb :order, @order
- else
  - breadcrumb :admin_order, @order

%h1= t('.heading', id: @order.id)

= render @order.cart, currency: @order.currency, view_format: :order, total: @order.total

- if @order.invoice?
  %p= t('orders.show.invoice.true')
  %h4= t('orders.show.billing_address')
  = render @order.billing_address

- else
  %p= t('orders.show.invoice.false')

%p= t("orders.show.polish_taxpayer.#{@order.polish_taxpayer}")

- unless @order.paid?
  = link_to fa_icon('credit-card', text: 'Przejdź do płatności'), order_payment_path(@order), class: 'button'
  = link_to fa_icon('ban', text: 'Anuluj zamówienie'), @order, method: :delete, class: 'button dark-red-bg'
  - if admin_user_signed_in?
    = link_to fa_icon('lock', text: "Oznacz jako opłacone"), mark_paid_admin_order_path(@order), class: 'button dark-green-bg', method: :patch
- else
  Zamówienie opłacone — nie możesz go zmodyfikować ani anulować.

Fix error in orders/show view

- if company_signed_in?
  - breadcrumb :order, @order
- else
  - breadcrumb :admin_order, @order

%h1= t('.heading', id: @order.id)

= render @order.cart, currency: @order.currency, view_format: :order, total: @order.total

- if @order.invoice?
  %p= t('orders.show.invoice.true')
  - if @order.billing_address
    %h4= t('orders.show.billing_address')
    = render @order.billing_address

- else
  %p= t('orders.show.invoice.false')

%p= t("orders.show.polish_taxpayer.#{@order.polish_taxpayer}")

- unless @order.paid?
  = link_to fa_icon('credit-card', text: 'Przejdź do płatności'), order_payment_path(@order), class: 'button'
  = link_to fa_icon('ban', text: 'Anuluj zamówienie'), @order, method: :delete, class: 'button dark-red-bg'
  - if admin_user_signed_in?
    = link_to fa_icon('lock', text: "Oznacz jako opłacone"), mark_paid_admin_order_path(@order), class: 'button dark-green-bg', method: :patch
- else
  Zamówienie opłacone — nie możesz go zmodyfikować ani anulować.


- content_for :title, "Data Feeds and API"

:markdown
  # Data Feeds and API

  ## MP attendance and rebelliousness rates

  You can open XML files in any text editor, XML viewer or some
  spreadsheets. In the files there are comments with more
  information.

  [mp-info.xml](#{mp_info_feed_path(format: :xml)}) - list of division
  attendance rate and rebelliousness for MPs in the all-members.xml
  file. This is a live file, correct to the latest division in the
  Public Whip database. The field data_date shows the date it applies
  up to. For members who have left the house it says "complete".

  [mp-info.xml?house=lords](#{mp_info_feed_path(format: :xml, house: :lords)}) -
  likewise for the House of Lords.

  ## MP Policy Agreement

  Each #{link_to 'policy', policies_path} has an XML representation of how much
  each MP agrees with it, e.g. [mpdream-info.xml?id=1](#{mpdream_info_feed_path(id: 1, format: :xml)}).

  Hey, you should [help document this better](https://github.com/openaustralia/publicwhip/blob/test/app/views/static/data.html.haml)!

Put XML in the title so you know what you're dealing with

- content_for :title, "Data Feeds and API"

:markdown
  # Data Feeds and API

  ## MP Attendance and Rebelliousness Rates XML

  You can open XML files in any text editor, XML viewer or some
  spreadsheets. In the files there are comments with more
  information.

  [mp-info.xml](#{mp_info_feed_path(format: :xml)}) - list of division
  attendance rate and rebelliousness for MPs in the all-members.xml
  file. This is a live file, correct to the latest division in the
  Public Whip database. The field data_date shows the date it applies
  up to. For members who have left the house it says "complete".

  [mp-info.xml?house=lords](#{mp_info_feed_path(format: :xml, house: :lords)}) -
  likewise for the House of Lords.

  ## MP Policy Agreement XML

  Each #{link_to 'policy', policies_path} has an XML representation of how much
  each MP agrees with it, e.g. [mpdream-info.xml?id=1](#{mpdream_info_feed_path(id: 1, format: :xml)}).

  Hey, you should [help document this better](https://github.com/openaustralia/publicwhip/blob/test/app/views/static/data.html.haml)!


%table.table.table-inverse
  %thead
    %tr
      %th Student Name
      %th Grade
      %th Gender
      %th GPA
      %th Detention Count
  %tbody.rowlink{"data-link" => "row"}
    - @students.each do |student|
      %tr
        %td
          %strong= link_to student.full_name, student_path(student)
        %td= student.grade_level
        %td= student.gender
        %td= student.gpa
        %td= student.detention_count
        - if not_assigned?(student)
          %td.rowlink-skip
            %button= link_to 'Add', student_teacher_path(student, current_teacher), class: "btn btn-secondary",  method: :patch
        - else
          %td.rowlink-skip
            %button= link_to "Remove", "#", class: "btn btn-secondary",  method: :delete

Add css class to each gpa cell to visual indicate grade range

%table.table.table-inverse
  %thead
    %tr
      %th Student Name
      %th Grade
      %th Gender
      %th GPA
      %th Detention Count
  %tbody.rowlink{"data-link" => "row"}
    - @students.each do |student|
      %tr
        %td
          %strong= link_to student.full_name, student_path(student)
        %td= student.grade_level
        %td= student.gender
        %td{:class => color_indicate_gpa_range(student)}= student.gpa
        %td= student.detention_count
        - if not_assigned?(student)
          %td.rowlink-skip
            %button= link_to 'Add', student_teacher_path(student, current_teacher), class: "btn btn-secondary",  method: :patch
        - else
          %td.rowlink-skip
            %button= link_to "Remove", "#", class: "btn btn-secondary",  method: :delete


- form_for([:admin, @site_option]) do |f|
  = f.label :value
  = fckeditor_textarea("site_option", "value", :toolbarSet => 'Spotus')
  %br/
  = f.submit

Increase width of site options text box

- form_for([:admin, @site_option]) do |f|
  = f.label :value
  = fckeditor_textarea("site_option", "value", :toolbarSet => 'Spotus', :width => '500')
  %br/
  = f.submit


%table.table.table-hover#assets_datatable
  %thead
    %tr
      - SystemConfig.transam_module_names.each do |mod|
        - if lookup_context.template_exists?("#{mod}_asset_dt_head", 'assets', true)
          = render :partial => "assets/#{mod}_asset_dt_head"

      %th.sorting_disabled.icon-column Flags
      %th.sorting_disabled.icon-column

  %tbody
    - assets.includes(:organization, :asset_subtype).each do |a|
      %tr{:data => {:action_path => inventory_path(a)}}
        - SystemConfig.transam_module_names.each do |mod|
          - if lookup_context.template_exists?("#{mod}_asset_dt_columns", "assets")
            = render :partial => "assets/#{mod}_asset_dt_columns", :locals => {:a => a }

        %td.center.icon-column.nowrap
          = format_as_boolean(a.needs_attention?, 'fa-flag', 'text-warning')
          = format_as_boolean((a.documents.count > 0), 'fa-files-o')
          = format_as_boolean((a.comments.count > 0), 'fa-comments')
        %td.center.icon-column
          = render :partial => 'assets/asset_info_detail_popup', :locals => {:asset => a}

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

Fix template_exists? call to correctly find partials

%table.table.table-hover#assets_datatable
  %thead
    %tr
      - SystemConfig.transam_module_names.each do |mod|
        - if lookup_context.template_exists?("#{mod}_asset_dt_head", 'assets', true)
          = render :partial => "assets/#{mod}_asset_dt_head"

      %th.sorting_disabled.icon-column Flags
      %th.sorting_disabled.icon-column

  %tbody
    - assets.includes(:organization, :asset_subtype).each do |a|
      %tr{:data => {:action_path => inventory_path(a)}}
        - SystemConfig.transam_module_names.each do |mod|
          - if lookup_context.template_exists?("#{mod}_asset_dt_columns", "assets", true)
            = render :partial => "assets/#{mod}_asset_dt_columns", :locals => {:a => a }

        %td.center.icon-column.nowrap
          = format_as_boolean(a.needs_attention?, 'fa-flag', 'text-warning')
          = format_as_boolean((a.documents.count > 0), 'fa-files-o')
          = format_as_boolean((a.comments.count > 0), 'fa-comments')
        %td.center.icon-column
          = render :partial => 'assets/asset_info_detail_popup', :locals => {:asset => a}

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


= content_tag_for :tr, proposal, :class => "row" do
  %td= proposal.title
  - if proposal.can_be_seen_by?(current_user)
    %td= link_to t('actions.show'), proposal_path(proposal)
  - if proposal.can_be_edited_by?(current_user)
    %td
      = link_to t('actions.edit'), edit_proposal_path(proposal)
    %td
      = link_to t('actions.delete'), proposal_path(proposal), :method => :delete, :confirm => t('actions.sure')
  - else
    %td
    %td
  - if current_user.can_review?
    %td
      = proposal.user_name
    %td
      = proposal.average_ranking
    %td
      = link_to t('actions.discuss'), proposal_comments_path(proposal)

Remove deprecation wanring deleting confirm info

= content_tag_for :tr, proposal, :class => "row" do
  %td= proposal.title
  - if proposal.can_be_seen_by?(current_user)
    %td= link_to t('actions.show'), proposal_path(proposal)
  - if proposal.can_be_edited_by?(current_user)
    %td
      = link_to t('actions.edit'), edit_proposal_path(proposal)
    %td
      = link_to t('actions.delete'), proposal_path(proposal), :method => :delete, :data => t('actions.sure')
  - else
    %td
    %td
  - if current_user.can_review?
    %td
      = proposal.user_name
    %td
      = proposal.average_ranking
    %td
      = link_to t('actions.discuss'), proposal_comments_path(proposal)


#alert_list_div
  #main_div
    = render :partial => 'layouts/gtl', :locals  => {:action_url => "alert_get_all", :button_div => 'policy_bar'}

Remove duplicate main_div from alerts list view

#alert_list_div
  = render :partial => 'layouts/gtl', :locals  => {:action_url => "alert_get_all", :button_div => 'policy_bar'}


%n1:individual{"xmlns:n1" => "http://openhbx.org/api/terms/1.0", "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation" => "http://openhbx.org/api/terms/1.0 individual.xsd"}
  %n1:person
    %n1:id
      %n1:id= person.authority_member.hbx_member_id
    %n1:is_authoratative= person.is_authoritative?
    %n1:alias_ids
    - person.members.each do |member|
      %n1:alias_id
        %n1:id= member.hbx_member_id
    %n1:person_name
      = render 'shared/v2/name', object: person
    - unless person.addresses.empty?
      %n1:addresses
        - person.addresses.each do |address|
          = render 'shared/v2/address', address: address
    - unless person.emails.empty?
      %n1:emails
        - person.emails.each do |email|
          = render 'shared/v2/email', email: email
    - unless person.phones.empty?
      %n1:phones
        - person.phones.each do |phone|
          = render 'shared/v2/phone', phone: phone
      = render 'shared/v2/timestamp', record: person
  = render 'shared/v2/person_demographics', member: member

Revert "Fixing issue with bogus member ID in person match."

%n1:individual{"xmlns:n1" => "http://openhbx.org/api/terms/1.0", "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation" => "http://openhbx.org/api/terms/1.0 individual.xsd"}
  %n1:person
    %n1:id
      %n1:id= person.authority_member.id
    %n1:is_authoratative= person.is_authoritative?
    %n1:alias_ids
    - person.members.each do |member|
      %n1:alias_id
        %n1:id= member.hbx_member_id
    %n1:person_name
      = render 'shared/v2/name', object: person
    - unless person.addresses.empty?
      %n1:addresses
        - person.addresses.each do |address|
          = render 'shared/v2/address', address: address
    - unless person.emails.empty?
      %n1:emails
        - person.emails.each do |email|
          = render 'shared/v2/email', email: email
    - unless person.phones.empty?
      %n1:phones
        - person.phones.each do |phone|
          = render 'shared/v2/phone', phone: phone
      = render 'shared/v2/timestamp', record: person
  = render 'shared/v2/person_demographics', member: member


= render "issues/head"
.milestones_content
  %h3.page_title
    Milestones
    - if can? current_user, :admin_milestone, @project
      = link_to new_project_milestone_path(@project), class: "pull-right btn btn-primary", title: "New Milestone" do
        %i.icon-plus
        New Milestone
  %br

  .row
    .span3
      %ul.nav.nav-pills.nav-stacked
        %li{class: ("active" if (params[:f] == "active" || !params[:f]))}
          = link_to project_milestones_path(@project, f: "active") do
            Active
        %li{class: ("active" if params[:f] == "closed")}
          = link_to project_milestones_path(@project, f: "closed") do
            Closed
        %li{class: ("active" if params[:f] == "all")}
          = link_to project_milestones_path(@project, f: "all") do
            All
    .span9
      %div.ui-box
        %ul.well-list
          = render @milestones

          - if @milestones.present?
            %li.bottom= paginate @milestones, theme: "gitlab"
          - else
            %li
              %h3.nothing_here_message Nothing to show here

Fix milestones list pagination style

= render "issues/head"
.milestones_content
  %h3.page_title
    Milestones
    - if can? current_user, :admin_milestone, @project
      = link_to new_project_milestone_path(@project), class: "pull-right btn btn-primary", title: "New Milestone" do
        %i.icon-plus
        New Milestone
  %br

  .row
    .span3
      %ul.nav.nav-pills.nav-stacked
        %li{class: ("active" if (params[:f] == "active" || !params[:f]))}
          = link_to project_milestones_path(@project, f: "active") do
            Active
        %li{class: ("active" if params[:f] == "closed")}
          = link_to project_milestones_path(@project, f: "closed") do
            Closed
        %li{class: ("active" if params[:f] == "all")}
          = link_to project_milestones_path(@project, f: "all") do
            All
    .span9
      .ui-box
        %ul.well-list
          = render @milestones

          - if @milestones.blank?
            %li
              %h3.nothing_here_message Nothing to show here

      = paginate @milestones, theme: "gitlab"


- unless smart_listing.empty?
  %table.table
    %thead
      %th.col-md-4.col-lg-4= smart_listing.sortable 'Email', :email
      %th.col-md-4.col-lg-4= smart_listing.sortable 'Date de dernière connexion', :last_sign_in_at
      %th.col-md-2.col-lg-2 Procédure active
      %th.col-md-2.col-lg-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.strftime('%d/%m/%Y')
            )
        %td
          = admin.procedures.where(published: true).count
        %td
          - total_dossier = 0
          - admin.procedures.each do |procedure| total_dossier += procedure.dossiers.count end
          = total_dossier
  = smart_listing.paginate
  = smart_listing.pagination_per_page_links

- else
  %h4.center
    Aucun administrateur créé

Change count on administrations page

- unless smart_listing.empty?
  %table.table
    %thead
      %th.col-md-4.col-lg-4= smart_listing.sortable 'Email', :email
      %th.col-md-4.col-lg-4= smart_listing.sortable 'Date de dernière connexion', :last_sign_in_at
      %th.col-md-2.col-lg-2 Procédure active
      %th.col-md-2.col-lg-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.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éé


%table.table
  %thead
    %tr
      %th ID
      %th Name
      %th Last build
      %th Access
      %th Builds
      %th

  - @projects.each do |project|
    = render "ci/admin/projects/project", project: @projects

= paginate @projects

Fix CI admin projects page

%table.table
  %thead
    %tr
      %th ID
      %th Name
      %th Last build
      %th Access
      %th Builds
      %th

  - @projects.each do |project|
    = render "ci/admin/projects/project", project: project

= paginate @projects


.action_menu
  .action_menu_header
    .action_menu_header_left
      %ul.menu
        %li.menu=link_to 'Account Report', users_account_report_url
      = form_tag url_for(:action => "index", :page => session[:page] || 1 ), :method => 'get' do
        = content_tag :label do
          = text_field_tag :search, params[:search], :size => 25
        %input{ :type => "submit", :value => "Search"}
      - if @users
        %p= page_entries_info @users
      %p.paginator
        = will_paginate @users
    .action_menu_header_right
      %ul.menu
        %li= toggle_all 'user descriptions'
.item_collection
  %ul.quiet_list
    = render :partial => 'user', :collection => @users

Add checkboxes to user search form.

.action_menu
  .action_menu_header
    .action_menu_header_left
      %ul.menu
        %li.menu=link_to 'Account Report', users_account_report_url
    .action_menu_header_right
      %ul.menu
        %li= toggle_all 'user descriptions'
    %div{ :style => "clear: both; margin-bottom: 20px;"}
      = form_tag url_for(:action => "index", :page => session[:page] || 1 ), :method => 'get' do
        = content_tag :label do
          = text_field_tag :search, params[:search], :style => "width: 97%;"
        %div{ :style => "clear: both; margin-bottom: 10px; width: 100%;" }
          = content_tag :label do
            = check_box_tag 'project_researcher', 1, params[:project_researcher] == '1' ? true : false
            Project Researcher
          = content_tag :label do
            = check_box_tag 'project_admin', 1, params[:project_admin] == '1' ? true : false
            Project Admin
          = content_tag :label do
            = check_box_tag 'portal_admin', 1, params[:portal_admin] == '1' ? true : false
            Portal Admin
        %input{ :type => "submit", :value => "Search"}
    - if @users
      %p= page_entries_info @users
    %p.paginator
      = will_paginate @users
.item_collection
  %ul.quiet_list
    = render :partial => 'user', :collection => @users


- if user_signed_in?
  - if @user_vote
    - if @user_vote.value == 1
      = link_to 'Delete Vote', remove_idea_vote_path(@idea), :method => :delete
    - else
      = link_to 'Vote Up', change_idea_vote_path(@idea, :value => 1), :method => :patch
  - else
    = link_to 'Vote Up', create_idea_vote_path(@idea, :value => 1), :method => :post
  - if @user_vote
    - if @user_vote.value == -1
      = link_to 'Delete Vote', remove_idea_vote_path(@idea), :method => :delete
    - else
      = link_to 'Vote Down', change_idea_vote_path(@idea, :value => -1), :method => :patch
  - else
    = link_to 'Vote Down', create_idea_vote_path(@idea, :value => -1), :method => :post

Change '_vote' partial to use buttons

- if user_signed_in?
  - if @user_vote
    - if @user_vote.value == 1
      = button_to 'Delete Vote', remove_idea_vote_path(@idea), :method => :delete
    - else
      = button_to 'Vote Up', change_idea_vote_path(@idea, :value => 1), :method => :patch
  - else
    = button_to 'Vote Up', create_idea_vote_path(@idea, :value => 1), :method => :post
  - if @user_vote
    - if @user_vote.value == -1
      = button_to 'Delete Vote', remove_idea_vote_path(@idea), :method => :delete
    - else
      = button_to 'Vote Down', change_idea_vote_path(@idea, :value => -1), :method => :patch
  - else
    = button_to 'Vote Down', create_idea_vote_path(@idea, :value => -1), :method => :post


%h1= @event.title

!= precede "Presented by " do
  %strong= @event.presenter_name
!= precede "– " do
  != @event.body
.event-date
  != succeed " @ " do
    = pretty_date(@event.date)
  = @event.location
%h2
  != precede "About " do
    = @event.presenter_name
  = @event.presenter_bio

Add link to get directions

%h1= @event.title

!= precede "Presented by " do
  %strong= @event.presenter_name
!= precede "– " do
  != @event.body
.event-date
  != succeed " @ " do
    = pretty_date(@event.date)
  = @event.location
  %a{ :href => "http://maps.google.com/?q=#{ @event.location_address}", :title => "Get directions" } Get Directions
%h2
  != precede "About " do
    = @event.presenter_name
  = @event.presenter_bio


%div.request-message.card
  %div.card-body
	  %p
	    - if status == 'success'
	      %i.fa.fa-check
	    - else
	      %i.fa.fa-exclamation-triangle
	    %span#request-message
	      = message

Fix bug in BD view spacing


%dt
  %dd{role: "menuitem"}
    = link_to "ClinSumm", clinical_summary_patient_path(@patient), title: "Clinical Summary"
  %dd{role: "menuitem"}
    = link_to "Admin", demographics_patient_path(@patient), title: "Demographics"
  %dd{role: "menuitem"}
    = link_to "Modal", patient_modalities_path(@patient), title: "Patient Modality"
  %dd{role: "menuitem"}
    = link_to "Problems (#{@patient.problems.length})", problems_patient_path(@patient), title: "Manage Problems"
  %dd{role: "menuitem"}
    = link_to "Meds (#{@patient.medications.length})", manage_medications_patient_path(@patient), title: "Manage Medications"
  %dd{role: "menuitem"}
    = link_to "Events (#{@patient.events.length})", patient_events_path(@patient), title: "Patient Events"
  %dd{role: "menuitem"}
    = link_to "Clinic Visits (#{@patient.clinic_visits.length})", patient_clinic_visits_path(@patient), title: "Clinic Visits"

Make 'Modals' link plural on patient subnav

%dt
  %dd{role: "menuitem"}
    = link_to "ClinSumm", clinical_summary_patient_path(@patient), title: "Clinical Summary"
  %dd{role: "menuitem"}
    = link_to "Admin", demographics_patient_path(@patient), title: "Demographics"
  %dd{role: "menuitem"}
    = link_to "Modals", patient_modalities_path(@patient), title: "Patient Modality"
  %dd{role: "menuitem"}
    = link_to "Problems (#{@patient.problems.length})", problems_patient_path(@patient), title: "Manage Problems"
  %dd{role: "menuitem"}
    = link_to "Meds (#{@patient.medications.length})", manage_medications_patient_path(@patient), title: "Manage Medications"
  %dd{role: "menuitem"}
    = link_to "Events (#{@patient.events.length})", patient_events_path(@patient), title: "Patient Events"
  %dd{role: "menuitem"}
    = link_to "Clinic Visits (#{@patient.clinic_visits.length})", patient_clinic_visits_path(@patient), title: "Clinic Visits"


%nav.navbar.navbar-inverse.navbar-static-top{role: "navigation", style: "margin-bottom: 0"}
  = link_to "西口", root_path, id: 'logo', class: 'navbar-brand'
  .navbar-header
    %button.navbar-toggle{ type: 'button', data: { toggle: 'collapse', target: '.navbar-collapse' } }
      %span.sr-only Navigation toggle
      - 3.times do
        %span.icon-bar

    -if user_signed_in?
      = render 'layouts/dropdown_logged_in'
    - else
      %ul.nav.top-links.pull-right
        %li= link_to "Sign up", new_user_registration_path
        %li= link_to "Log in", new_user_session_path
        %li= link_to "Contact", contact_path

:coffee
  jQuery ->
    if $('#side-menu').length == 0
      $('button.navbar-toggle').remove()

Add script for positioning the navbar

%nav.navbar.navbar-inverse.navbar-static-top{role: "navigation", style: "margin-bottom: 0"}
  .container
    = link_to "西口", root_path, id: 'logo', class: 'navbar-brand'
    .navbar-header
      %button.navbar-toggle{ type: 'button', data: { toggle: 'collapse', target: '.navbar-collapse' } }
        %span.sr-only Navigation toggle
        - 3.times do
          %span.icon-bar

      -if user_signed_in?
        = render 'layouts/dropdown_logged_in'
      - else
        %ul.nav.top-links.pull-right
          %li= link_to "Sign up", new_user_registration_path
          %li= link_to "Log in", new_user_session_path
          %li= link_to "Contact", contact_path

:coffee
  jQuery ->
    if $('#side-menu').length == 0
      # For Static pages
      # Removes toggle button.
      $('button.navbar-toggle').remove()
    else
      # For SB-admin pages
      # Removes navbar container.
      $('.container').replaceWith($('.container').html())


- [:professional_experiences, :voluntary_experiences, :language_experiences, :project_experiences, :notable_experiences, :publication_experiences, :course_experiences].each do |att|
  %h2=t att, scope: "resumes.form"
  - @resume.method(att).().each do |e|
    %hr
    %dl.dl-horizontal
      - e.attributes.each do |a, v|
        - unless a == "_id"
          %dt=t a, scope: "activemodel.attributes.#{att}"
          - unless v.nil? || v.empty?
            %dd= v
          - else
            %dd
  %hr.dark

Fix for when dates are tried.

- [:professional_experiences, :voluntary_experiences, :language_experiences, :project_experiences, :notable_experiences, :publication_experiences, :course_experiences].each do |att|
  %h2=t att, scope: "resumes.form"
  - @resume.method(att).().each do |e|
    %hr
    %dl.dl-horizontal
      - e.attributes.each do |a, v|
        - unless a == "_id"
          %dt=t a, scope: "activemodel.attributes.#{att}"
          - unless v.nil? || v == ""
            %dd= v
          - else
            %dd
  %hr.dark


= article_for wiki_page do |c|
  - c.title = "#{link_to "Wiki", "/wiki"} #{link_to wiki_page.title, wiki_page}".html_safe
  - c.body  = sanitize(wiki_page.body)

Add a link to edit wiki page

= article_for wiki_page do |c|
  - c.title = "#{link_to "Wiki", "/wiki"} #{link_to wiki_page.title, wiki_page}".html_safe
  - c.body  = sanitize(wiki_page.body)
  - if current_account && current_account.can_update?(wiki_page)
    - c.actions = link_to("Modifier", "/wiki/#{wiki_page.to_param}/modifier", :class => 'action')


%ul
  - issues.each do |issue|
    %li
      - if deck_format.present? and issue =~ /^(.+) is not yet implemented in XMage$/
        = link_to_card_name($1) do
          = $1
        is not yet implemented in XMage
        %span.cardinfo
          - votes = deck_format.legality(card).split("-")[1].to_i
          = link_to({controller: "exh", action: "vote", name: $1}, class: "legality-banned") do
            %i{class: (signed_in? && exh_card($1).voters.include?(current_user)) ? "voted" : ""}
              = "#{votes} vote#{votes == 1 ? "" : "s"}"
      - else
        = issue

Remove previous feature (needs more work)

%ul
  - issues.each do |issue|
    %li
      = issue


%h3 Using Rails

%p
  = link_to "Ruby on Rails", "http://rubyonrails.org"
  is an open-source web framework that's optimized for programmer
  happiness and sustainable productivity.
%p
  Depending on whether you want to send emails via Cuttlefish in your development or production environment either edit config/environments/development.rb or config/environments/production.rb and add the following:

%p
  :coderay
    #!ruby

    # Send #{app.name} mails to Cuttlefish (see http://cuttlefish.io)
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = {
      :address => "#{Rails.configuration.cuttlefish_domain}",
      :port => #{Rails.configuration.cuttlefish_smtp_port},
      :user_name => "#{app.smtp_username}",
      :password => "#{app.smtp_password}",
      :authentication => :plain
     }

Make HTML valid -
 tags are not permitted in
 tags

%h3 Using Rails

%p
  = link_to "Ruby on Rails", "http://rubyonrails.org"
  is an open-source web framework that's optimized for programmer
  happiness and sustainable productivity.
%p
  Depending on whether you want to send emails via Cuttlefish in your development or production environment either edit config/environments/development.rb or config/environments/production.rb and add the following:

:coderay
  #!ruby

  # Send #{app.name} mails to Cuttlefish (see http://cuttlefish.io)
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    :address => "#{Rails.configuration.cuttlefish_domain}",
    :port => #{Rails.configuration.cuttlefish_smtp_port},
    :user_name => "#{app.smtp_username}",
    :password => "#{app.smtp_password}",
    :authentication => :plain
   }


%h1.ui.header
  Merge requests for #{@project.name}
%p
  #{pluralize(@total_mrs, 'pending merge request')}.

- if @project.locked_branches.any?
  .ui.icon.warning.message
    %i.lock.icon
    .content
      .header #{"Branche".pluralize(locked_branches.size)} locked
      %ul.list
        - locked_branches.each do |lock|
          %li #{lock.branch} - “#{lock.reason}” (#{lock.who.name} at #{lock.created_at.to_formatted_s(:short)})

- if @waiting_you.empty? && @waiting_others.empty?
  %p Nothing here, go drink some wine :-)
- else
  = render partial: 'list', locals: { mrs: @waiting_you, on_empty: 'Nothing here, uhu!!' }

  %h4.ui.horizontal.divider.header
    %i.hourglass.half.icon
    Waiting for others

  = render partial: 'list', locals: { mrs: @waiting_others, on_empty: 'Nothing here, go review some MR!' }
%p
  See #{link_to 'finished code reviews', old_ones_project_merge_requests_path(@project)}.

Fix stupid typo when there are locked branches.

%h1.ui.header
  Merge requests for #{@project.name}
%p
  #{pluralize(@total_mrs, 'pending merge request')}.

- if @project.locked_branches.any?
  .ui.icon.warning.message
    %i.lock.icon
    .content
      .header #{'Branch'.pluralize(locked_branches.size)} locked
      %ul.list
        - locked_branches.each do |lock|
          %li #{lock.branch} - “#{lock.reason}” (#{lock.who.name} at #{lock.created_at.to_formatted_s(:short)})

- if @waiting_you.empty? && @waiting_others.empty?
  %p Nothing here, go drink some wine :-)
- else
  = render partial: 'list', locals: { mrs: @waiting_you, on_empty: 'Nothing here, uhu!!' }

  %h4.ui.horizontal.divider.header
    %i.hourglass.half.icon
    Waiting for others

  = render partial: 'list', locals: { mrs: @waiting_others, on_empty: 'Nothing here, go review some MR!' }
%p
  See #{link_to 'finished code reviews', old_ones_project_merge_requests_path(@project)}.


---
---

- if site.google_analytics

  :javascript
    dataLayer = [{'channel' : 'liveoak', 'additional_tracking_code' : '#{site.google_analytics}'}];

  :plain


.form-container
  = simple_form_for @message, url: url_for(action: @message.new_record? ? "create" : "update", controller: "messages") do |f|
    = f.error_notification

    .form-inputs
      = f.input :name
      = f.input :subject, hint: "All emails are from <pre>#{html_escape(Rails.configuration.hackathon['email_from'])}</pre>".html_safe
      = f.input :template, as: :select, collection: Message::POSSIBLE_TEMPLATES.map { |x| [x.titleize, x] }, include_blank: false
      = f.input :recipients, as: :select, collection: Message::POSSIBLE_RECIPIENTS.invert, input_html: { class: "selectize", multiple: true }
      = f.input :body, input_html: { rows: 10 }
      %p
        %small
          %em Markdown and HTML supported.

    .form-actions
      = f.button :submit

Improve style of message form help text

.form-container
  = simple_form_for @message, url: url_for(action: @message.new_record? ? "create" : "update", controller: "messages") do |f|
    = f.error_notification

    .form-inputs
      = f.input :name
      = f.input :subject, hint: "All emails are from <pre>#{html_escape(Rails.configuration.hackathon['email_from'])}</pre>".html_safe
      = f.input :template, as: :select, collection: Message::POSSIBLE_TEMPLATES.map { |x| [x.titleize, x] }, include_blank: false
      = f.input :recipients, as: :select, collection: Message::POSSIBLE_RECIPIENTS.invert, input_html: { class: "selectize", multiple: true }
      = f.input :body, input_html: { rows: 10 }, hint: "Supports markdown and HTML"

    .form-actions
      = f.button :submit


= render :partial => 'layouts/doctype'
%html
  %head
    %title
      = _('VNC Console')
    = stylesheet_link_tag 'application'
    = javascript_include_tag 'application', 'novnc/base64', 'novnc/des', 'novnc/util', 'novnc/input', 'novnc/jsunzip',
    'novnc/display', 'novnc/keyboard', 'novnc/keysym', 'novnc/keysymdef', 'novnc/logo',
    'novnc/playback', 'novnc/rfb', 'novnc/websock', 'novnc/webutil', 'novnc/web-socket-js/swfobject',
    'novnc/web-socket-js/web_socket', 'novnc-rails', 'miq_novnc'
    - if Rails.env.development?
      = javascript_include_tag 'miq_debug'

  %body{:style => 'margin: 0px; padding-top: 0px !important;'}
    = link_to('Ctrl-Alt-Del', '#', :id => 'sendCtrlAltDelButton', :class => 'btn btn-default')
    #vnc{'data-port' => proxy_port, 'data-password' => password, 'data-encrypt' => encrypt}
      #noVNC_status_bar.console-status
        #noVNC_status.label
          = _('Loading ...')

    %canvas#noVNC_canvas.console-screen
      = _('Canvas not supported.')

Fix asset loading for HTML5 VNC console.

= render :partial => 'layouts/doctype'
%html
  %head
    %title
      = _('VNC Console')
    = stylesheet_link_tag 'application'
    = javascript_include_tag 'application', 'novnc-rails', 'miq_novnc'
    - if Rails.env.development?
      = javascript_include_tag 'miq_debug'

  %body{:style => 'margin: 0px; padding-top: 0px !important;'}
    = link_to('Ctrl-Alt-Del', '#', :id => 'sendCtrlAltDelButton', :class => 'btn btn-default')
    #vnc{'data-port' => proxy_port, 'data-password' => password, 'data-encrypt' => encrypt}
      #noVNC_status_bar.console-status
        #noVNC_status.label
          = _('Loading ...')

    %canvas#noVNC_canvas.console-screen
      = _('Canvas not supported.')


:ruby
  options = local_assigns[:options] || {microdata: true}
  if options[:microdata]
    microdata_fragment = {itemscope: true, itemtype: 'http://data-vocabulary.org/Breadcrumb'}
    microdata_link = {itemprop: 'url'}
    microdata_title = {itemprop: 'title'}
  else
    microdata_fragment = {}
    microdata_link = {}
    microdata_title = {}
  end

- breadcrumbs(options).tap do |links|
  - if links.any?
    %nav.breadcrumbs
      %ol.breadcrumbs__list
        - links[0..-2].each do |link|
          %li.breadcrumbs__fragment{microdata_fragment}
            %a.breadcrumbs__link{**microdata_link, href: link.url}
              %span{microdata_title}= link.text
        %li.breadcrumbs__fragment{microdata_fragment}
          - if links.options[:link_current]
            %a.breadcrumbs__link{**microdata_link, href: links.last.url}
              %span{microdata_title}= links.last.text
          - else
            %span{microdata_title}= links.last.text

Remove dup of DOM structure

:ruby
  options = local_assigns[:options] || {microdata: true}
  if options[:microdata]
    microdata_fragment = {itemscope: true, itemtype: 'http://data-vocabulary.org/Breadcrumb'}
    microdata_link = {itemprop: 'url'}
    microdata_title = {itemprop: 'title'}
  else
    microdata_fragment = {}
    microdata_link = {}
    microdata_title = {}
  end

- breadcrumbs(options).tap do |links|
  - if links.any?
    %nav.breadcrumbs
      %ol.breadcrumbs__list
        - links.each do |link|
          %li.breadcrumbs__fragment{microdata_fragment}
            - if links.options[:link_current] || link != links.last
              %a.breadcrumbs__link{**microdata_link, href: link.url}
                %span{microdata_title}= link.text
            - else
              %span{microdata_title}= link.text


- content_for(:project_info) do
  %h1
    About the STEM Resource Finder
  %p
    = I18n.t('HomePage.Teacher.Intro')
  %p
    = link_to "Preview the activities.", root_url
  %p
    %strong
      Why sign up?
    When you register as a teacher, you can browse activities, create classes,
    assign activities to your students, follow their progress,
    and view reports of their work.
  %p
    Looking for more? Our
    = link_to "NGSS Pathfinder", "https://concord.org/ngss"
    includes hundreds of other models and activities.

Remove line that says, "Looking for more? Our NGSS Path Finder includes hundreds of other models and activities."


%header.with-proposition.c-hmlr-header#global-header{ role: 'banner' }
  .header-wrapper
    .header-global
      .header-logo
        %a.content{ href: '/app/ukhpi', title: 'Go to the UK HPI homepage' }
          = image_tag('ukhpi-icon.png', srcset: image_path('ukhpi-icon.svg'), alt: '')

    .header-proposition
      .content
        %a.js-header-toggle.menu{ href: '#proposition-links' } Menu
        %nav#proposition-menu
          %a#proposition-name{ href: '/app/ukhpi' }
            UK House Price Index

          %ul#proposition-links
            %li
              %a{ href: browse_path } view
            %li
              %a{ href: compare_path } compare locations
            %li
              %a{ href: '/app/qonsole' } SPARQL query
            %li
              %a{ href: '/app/doc/ukhpi' } help

.o-lr-top-bar

.container.o-container
  .o-beta-banner
    %p
      %strong.o-beta-tag BETA
      %span.text-muted
        This is a new service – your
        feedback
        will help us to improve it.

Change header verb from 'view' to 'browse'

%header.with-proposition.c-hmlr-header#global-header{ role: 'banner' }
  .header-wrapper
    .header-global
      .header-logo
        %a.content{ href: '/app/ukhpi', title: 'Go to the UK HPI homepage' }
          = image_tag('ukhpi-icon.png', srcset: image_path('ukhpi-icon.svg'), alt: '')

    .header-proposition
      .content
        %a.js-header-toggle.menu{ href: '#proposition-links' } Menu
        %nav#proposition-menu
          %a#proposition-name{ href: '/app/ukhpi' }
            UK House Price Index

          %ul#proposition-links
            %li
              %a{ href: browse_path } browse
            %li
              %a{ href: compare_path } compare locations
            %li
              %a{ href: '/app/qonsole' } SPARQL query
            %li
              %a{ href: '/app/doc/ukhpi' } help

.o-lr-top-bar

.container.o-container
  .o-beta-banner
    %p
      %strong.o-beta-tag BETA
      %span.text-muted
        This is a new service – your
        feedback
        will help us to improve it.


%h1 Audit Trail

.font-xsmall= will_paginate(@versions)
%table
  %th Date
  %th Action
  %th Changed by
  %th

  - @versions.each do |version|
    %tr
      %td= version.created_at.to_formatted_s(:long)
      %td
        %h4= version.event_description
        %p= link_to_edited_item(version)
        %p= render partial: view_template(version), locals: { version: version }

      %td= version.whodunnit
      %td
        - unless version.membership?
          = button_to 'undo', "/audit_trail/undo/#{version.id}"

.font-xsmall= will_paginate(@versions)

Add confirm prompt to the undo version button

%h1 Audit Trail

.font-xsmall= will_paginate(@versions)
%table
  %th Date
  %th Action
  %th Changed by
  %th

  - @versions.each do |version|
    %tr
      %td= version.created_at.to_formatted_s(:long)
      %td
        %h4= version.event_description
        %p= link_to_edited_item(version)
        %p= render partial: view_template(version), locals: { version: version }

      %td= version.whodunnit
      %td
        - unless version.membership?
          = button_to 'undo', "/audit_trail/undo/#{version.id}", data: { confirm: 'Are you sure you want to undo this change?' }

.font-xsmall= will_paginate(@versions)


= LeafletMap({:mapid => 'lmap',
  :markers => @markers,
  :tile_provider => Rails.application.config.map_tile_provider,
  :map_key => Rails.application.config.map_tile_key,
  :access_token => Rails.application.config.map_access_token,
  :min_zoom => Rails.application.config.map_min_zoom_level,
  :max_zoom => Rails.application.config.map_max_zoom_level,
  :class => "map",
  :style => "height:400px;"})

= yield :scripts

Fix issue where an asset was not being rendered on the map

= LeafletMap({:mapid => 'lmap',
  :markers => @asset.map_markers.to_json,
  :tile_provider => Rails.application.config.map_tile_provider,
  :map_key => Rails.application.config.map_tile_key,
  :access_token => Rails.application.config.map_access_token,
  :min_zoom => Rails.application.config.map_min_zoom_level,
  :max_zoom => Rails.application.config.map_max_zoom_level,
  :class => "map",
  :style => "height:400px;"})

= yield :scripts


.thread-item.lmo-flex.lmo-relative.lmo-action-dock-wrapper{layout: "row", id: "sequence-{{event.sequenceId}}"}
  .thread-item__avatar.lmo-margin-right
    %user_avatar{user: "event.actor()", size: "small", ng-if: "event.actor()"}
  .thread-item__body.lmo-flex.lmo-flex__horizontal-center{layout: "column"}
    .thread-item__headline.lmo-flex.lmo-flex__center.lmo-flex__grow{layout: "row"}
      %h3.thread-item__title{id: "event-{{event.id}}"}
        %span{ng-bind-html: "headline()"}
        %span{aria-hidden: "true"}>·
        %a.thread-item__link.lmo-pointer{lmo-href: "{{link()}}"}
          %timeago.timeago--inline{timestamp: "event.createdAt"}
    %thread_item_directive.thread-item__directive{event: "event"}

Use regular ol' href for thread item timestamps

.thread-item.lmo-flex.lmo-relative.lmo-action-dock-wrapper{layout: "row", id: "sequence-{{event.sequenceId}}"}
  .thread-item__avatar.lmo-margin-right
    %user_avatar{user: "event.actor()", size: "small", ng-if: "event.actor()"}
  .thread-item__body.lmo-flex.lmo-flex__horizontal-center{layout: "column"}
    .thread-item__headline.lmo-flex.lmo-flex__center.lmo-flex__grow{layout: "row"}
      %h3.thread-item__title{id: "event-{{event.id}}"}
        %span{ng-bind-html: "headline()"}
        %span{aria-hidden: "true"}>·
        %a.thread-item__link.lmo-pointer{href: "{{link()}}"}
          %timeago.timeago--inline{timestamp: "event.createdAt"}
    %thread_item_directive.thread-item__directive{event: "event"}


- if flash[:error]
  .highlight--box.highlight--caution__soft
    %p= flash[:error]

= form_tag(path, method: :post) do
  .form-group
    = hidden_field_tag('previous_controller', params[:controller])
    = hidden_field_tag('previous_action', params[:action])
    = hidden_field_tag('constituency_id', @constituency.graph_id) if @constituency
    = hidden_field_tag('person_id', @person.graph_id) if @person
    = label_tag 'postcode', t('.search_by_postcode')
    = text_field_tag('postcode', @postcode, value: flash[:postcode], maxlength: 8, pattern:'[0-9a-zA-Z ]{5,}')
    - submit_text = @person.nil? && @constituency.nil? ? "Find" : "Check"
    = submit_tag(submit_text, class: 'btn--secondary')

%p= t('.do_not_know_postcode', link: link_to(t('.do_not_know_postcode_link'), 'http://www.royalmail.com/find-a-postcode', target: '_blank', title: t('open_new_window'))).html_safe

Apply enhancements to postcode search

- if flash[:error]
  .highlight--box.highlight--caution__soft
    %p= flash[:error]

= form_tag(path, method: :post) do
  .form-group
    = hidden_field_tag('previous_controller', params[:controller])
    = hidden_field_tag('previous_action', params[:action])
    = hidden_field_tag('constituency_id', @constituency.graph_id) if @constituency
    = hidden_field_tag('person_id', @person.graph_id) if @person
    = label_tag 'input', t('.search_by_postcode')
    = text_field_tag(:postcode, @postcode, value: flash[:postcode], maxlength: 8, pattern:'[0-9a-zA-Z ]{5,}', id:'input')
    - button_text = @person.nil? && @constituency.nil? ? "Find" : "Check"
    %button{:id => 'btn_loading', :class => 'btn--secondary', :value => button_text, :type => 'submit'}
      %span{:class => 'btn--loading__text'}= button_text
      %span{:class => 'btn--loading__icon'}
        %object{:data => 'https://s3-eu-west-1.amazonaws.com/web1devci.pugin-website/1.4.4/icons/loading.svg', :type => 'image/svg+xml'}

%p= t('.do_not_know_postcode', link: link_to(t('.do_not_know_postcode_link'), 'http://www.royalmail.com/find-a-postcode', target: '_blank', title: t('open_new_window'))).html_safe


= render partial: 'breadcrumbs'

%h1= @page_title = 'Edit profile'

= render 'form'

.form-group.delete-actions
  .deletable
    = link_to info_text('delete_this_profile'), @person, method: :delete,
      data: { confirm: "Are you sure you want to delete #{ @person }?" }
  %p.form-hint= info_text('profile_deletable')

Improve warning text on delete profile dialog box

= render partial: 'breadcrumbs'

%h1= @page_title = 'Edit profile'

= render 'form'

.form-group.delete-actions
  .deletable
    = link_to info_text('delete_this_profile'), @person, method: :delete,
      data: { confirm: "Are you sure you want to delete #{ @person }? #{ info_text('profile_deletable') }." }
  %p.form-hint= info_text('profile_deletable')


%table.table.table-hover.table-condensed.parameter
  %col{style: 'width:20%'}
  %col{style: 'width:80%'}
  %thead
    %tr
      %th Argument
      %th Description
  %tbody
    != @rows

Change the balance between parameter table columns

%table.table.table-hover.table-condensed.parameter
  %col{style: 'width:25%'}
  %col{style: 'width:75%'}
  %thead
    %tr
      %th Argument
      %th Description
  %tbody
    != @rows


- breadcrumb 'Attendance'
%div.category_block.block_wrap
  = render :partial => 'shared/maintitle'
  %table#index.ipb_table.tablesorter
    %thead
      %tr
        %th.image{ :width => "48px" }
        %th.center Status
        %th.date Started At
        %th.date Stopped At
        %th.number Attendees
        %th.number Loots
    %tbody
      - @raids.each do |raid|
        %tr{ :class => cycle('row1', 'row2') }
          %td.image{ :width => "48px" }
            = link_to(image_tag('edit.png'), live_raid_path(raid))
            = link_to_delete(:text => '', :path => live_raid_path(raid))
          %td.center= h(raid.status)
          %td.date= h(raid.started_at)
          %td.date= h(raid.stopped_at)
          %td.number= h(raid.attendees.size)
          %td.number= h(raid.loots.size)

%fieldset.submit= link_to('Create a New Raid', new_live_raid_path, :class => 'input_submit')

Hide Delete for active raids in the UI.

- breadcrumb 'Attendance'
%div.category_block.block_wrap
  = render :partial => 'shared/maintitle'
  %table#index.ipb_table.tablesorter
    %thead
      %tr
        %th.image{ :width => "48px" }
        %th.center Status
        %th.date Started At
        %th.date Stopped At
        %th.number Attendees
        %th.number Loots
    %tbody
      - @raids.each do |raid|
        %tr{ :class => cycle('row1', 'row2') }
          %td.image{ :width => "48px" }
            = link_to(image_tag('edit.png'), live_raid_path(raid))
            - unless raid.status == 'Active'
              = link_to_delete(:text => '', :path => live_raid_path(raid))
          %td.center= h(raid.status)
          %td.date= h(raid.started_at)
          %td.date= h(raid.stopped_at)
          %td.number= h(raid.attendees.size)
          %td.number= h(raid.loots.size)

%fieldset.submit= link_to('Create a New Raid', new_live_raid_path, :class => 'input_submit')


.timetable-event{:style => "top:#{cloud_slot.timetable_margin + 37}px;height:#{cloud_slot.timetable_height}px",
  :class => "bg-#{cloud_slot.cl_status}"}
  %h5= cloud_slot.title
  %ul
    %li
      = cloud_slot.timetable_start.getutc.strftime('%H.%M')
      - if cloud_slot.timetable_end
        = "- #{cloud_slot.timetable_end.getutc.strftime('%H.%M')}"
    - if cloud_slot.kind_of? TimetableEvent
      %li= cloud_slot.rooms.join ", "
      %li
        %i= cloud_slot.teachers.join ", "
      .mark{:class => "text-#{cloud_slot.cl_status}", :style => "background:transparent"}= cloud_slot.mark
    - elsif cloud_slot.kind_of? Event
      .body= cloud_slot.body

Delete timetable events from the timetable itself

.timetable-event{:style => "top:#{cloud_slot.timetable_margin + 37}px;height:#{cloud_slot.timetable_height}px",
  :class => "bg-#{cloud_slot.cl_status}"}
  %h5= cloud_slot.title
  %ul
    %li
      = cloud_slot.timetable_start.getutc.strftime('%H.%M')
      - if cloud_slot.timetable_end
        = "- #{cloud_slot.timetable_end.getutc.strftime('%H.%M')}"
    - if cloud_slot.kind_of? TimetableEvent
      %li= cloud_slot.rooms.join ", "
      %li
        %i= cloud_slot.teachers.join ", "
      .mark{:class => "text-#{cloud_slot.cl_status}", :style => "background:transparent"}= cloud_slot.mark
    - elsif cloud_slot.kind_of? Event
      .body= cloud_slot.body
  - if cloud_slot.is_deletable?
    = link_to cloud_slot, :method => :delete, :class => "btn btn-danger btn-xs pull-right", :confirm => "Are you sure?" do
      %i.fa.fa-trash
      Delete


.decision-tools-card.lmo-card
  %h2.lmo-h2.decision-tools-card__title{translate: "decision_tools_card.title"}
  %p.decision-tools-card__purpose{translate: "decision_tools_card.purpose"}
  %md-list.decision-tools-card__poll-types
    %md-list-item.decision-tools-card__poll-type{class: "decision-tools-card__poll-type--{{pollType}}", ng-click: "startPoll(pollType)", ng-repeat: "pollType in pollTypes() track by $index"}
      %i.material-icons.decision-tools-card__icon {{fieldFromTemplate(pollType, 'material_icon')}}
      .decision-tools-card__content
        .decision-tools-card__poll-type-title.md-body-2{translate: "decision_tools_card.{{pollType}}_title"}
        .decision-tools-card__poll-type-subtitle.md-caption{translate: "decision_tools_card.{{pollType}}_subtitle"}

Fix weird class breaking decision tools card

.decision-tools-card.lmo-card
  %h2.lmo-h2.decision-tools-card__title{translate: "decision_tools_card.title"}
  %p.decision-tools-card__purpose{translate: "decision_tools_card.purpose"}
  %md-list.decision-tools-card__poll-types
    %md-list-item.decision-tools-card__poll-type{ng-click: "startPoll(pollType)", ng-repeat: "pollType in pollTypes() track by $index"}
      %i.material-icons.decision-tools-card__icon {{fieldFromTemplate(pollType, 'material_icon')}}
      .decision-tools-card__content{class: "decision-tools-card__poll-type--{{pollType}}"}
        .decision-tools-card__poll-type-title.md-body-2{translate: "decision_tools_card.{{pollType}}_title"}
        .decision-tools-card__poll-type-subtitle.md-caption{translate: "decision_tools_card.{{pollType}}_subtitle"}


%table{ class: table_css_classes }
  %thead
    %tr
      - columns.each do |name, options|
        %td= name
  %tbody
    - collection.each do |resource|
      %tr
        - columns.each do |name, options|
          - if options[:block].present?
            %td= options[:block].call(resource)
          - else
            %td= resource.send(name)

Add i18n support for attribute names.

%table{ class: table_css_classes }
  %thead
    %tr
      - columns.each do |name, options|
        - if resource_class.respond_to?(:human_attribute_name)
          %td= resource_class.human_attribute_name(name)
        - else
          %td= name
  %tbody
    - collection.each do |resource|
      %tr
        - columns.each do |name, options|
          - if options[:block].present?
            %td= options[:block].call(resource)
          - else
            %td= resource.send(name)


.container
  .row
    .col-sm-4.offset-sm-4
      = render 'layouts/messages'
      .card.mt-3
        .card-body
          %h1.mb-3.mt-0= t('views.auth.2fa.title')
          = bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name), method: :post) do |f|

            = f.text_field :otp_attempt, autofocus: true, label: 'Please enter the code from your authenticator app'

            = f.submit t('views.sessions.create'), class: 'btn btn-primary mt-3 mb-3'

= render 'shared/links'

Add translations for 2FA login view

.container
  .row
    .col-sm-4.offset-sm-4
      = render "layouts/messages"
      .card.mt-3
        .card-body
          %h1.mb-3.mt-0= t(".heading")
          = bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name), method: :post) do |f|
            = f.text_field :otp_attempt, autofocus: true, label: t(".otp_attempt")
            = f.submit t("voc.login"), class: "btn btn-primary mt-3 mb-3"

= render "shared/links"


%header.dashboard
  .content
    .content-inner
      = render 'content/search'

%section.dashboard
  .content
    %h2.casebooks= t 'content.dashboard.headers.casebooks'
    = render partial: 'content/dashboard/content_browser', locals: {header: t('content.dashboard.headers.owned-casebooks'), content: @user.casebooks.owned, section: 'owned'}
    = render partial: 'content/dashboard/content_browser', locals: {header: t('content.dashboard.headers.followed-casebooks'), content: @user.casebooks.followed, section: 'followed'}
  -# -# %script{type: 'text/template'}= render partial: 'content/dashboard/content_browser'

Delete 'casebooks you follow' dashboard section & change 'your casebooks' to whatever user is being viewed.

%header.dashboard
  .content
    .content-inner
      = render 'content/search'

%section.dashboard
  .content
    %h2.casebooks= t 'content.dashboard.headers.casebooks'
    - if @user == current_user
      = render partial: 'content/dashboard/content_browser', locals: {header: t('content.dashboard.headers.owned-casebooks'), content: @user.casebooks.owned, section: 'owned'}
    - else
      = render partial: 'content/dashboard/content_browser', locals: {header: "#{@user.attribution}'s Casebooks", content: @user.casebooks.owned, section: 'owned'}
  -# -# %script{type: 'text/template'}= render partial: 'content/dashboard/content_browser'


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

Replace sql with simple by_day method (refactor only)

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


.title-bar
  .title-bar-left
    %button.menu-icon{"data-open" => "offCanvasLeft", :type => "button"}
    %span.title-bar-title ExpenseTracker
  .title-bar-right
    %button.menu-icon{"data-open" => "offCanvasRight", :type => "button"}

Correct application name in titlebar

.title-bar
  .title-bar-left
    %button.menu-icon{"data-open" => "offCanvasLeft", :type => "button"}
    %span.title-bar-title Trek-O-Maniacs
  .title-bar-right
    %button.menu-icon{"data-open" => "offCanvasRight", :type => "button"}


.nav-tabs-container
  .nav-tabs-outer
    %ul.nav-tabs
      %li.nav-tab
        = link_to t('.watched'), user, class: "nav-tab-link type-followed #{'active' if current_page?(user)}"
      -#%li.nav-tab
        = link_to t('.checked_by_me'), [user, :edited_relics], class: "nav-tab-link type-edited #{'active' if current_page?(user_edited_relics_path(user))}"
      %li.nav-tab
        = link_to t('.my_routes'), [user, :my_routes], class: "nav-tab-link type-my-routes #{'active' if current_page?(user_my_routes_path(user))}"
      %li.nav-tab
        = link_to t('.settings'), edit_user_path(user), class: "nav-tab-link type-checked #{'active' if current_page?(edit_user_path(user))}"

Fix the order of icons used in the user profile

.nav-tabs-container
  .nav-tabs-outer
    %ul.nav-tabs
      %li.nav-tab
        = link_to t('.watched'), user, class: "nav-tab-link type-followed #{'active' if current_page?(user)}"
      -#%li.nav-tab
        = link_to t('.checked_by_me'), [user, :edited_relics], class: "nav-tab-link type-checked #{'active' if current_page?(user_edited_relics_path(user))}"
      %li.nav-tab
        = link_to t('.my_routes'), [user, :my_routes], class: "nav-tab-link type-checked #{'active' if current_page?(user_my_routes_path(user))}"
      %li.nav-tab
        = link_to t('.settings'), edit_user_path(user), class: "nav-tab-link type-settings #{'active' if current_page?(edit_user_path(user))}"


= link_to development, class: 'development item' do
  .ui.tiny.image
    %img{ src: development.street_view }
  .middle.aligned.content
    .header= development.name
    .meta
      %span.address= development.display_address(short: true)
    .description
      = development.tagline

Fix street view in related thumbnails

= link_to development, class: 'development item' do
  - unless development.street_view.null?
    .ui.tiny.image
      %img{ src: development.street_view.data }
  .middle.aligned.content
    .header= development.name
    .meta
      %span.address= development.display_address(short: true)
    .description
      = development.tagline


!!! Strict
%html{ :lang => "en", :"xml:lang" => "en", :xmlns => "http://www.w3.org/1999/xhtml" }
  %head
    %meta{ :content => "text/html; charset=utf-8", :"http-equiv" => "Content-Type" }
    %meta{ :content => "en", :"http-equiv" => "Content-Language" }
    %title= "#{@title.last} | integrity"
    - stylesheets(:reset, :buttons, :integrity, :application)
  %body
    #header
      %h1= @title.last
    #content= yield

Put Brighter Planet in the <title />

!!! Strict
%html{ :lang => "en", :"xml:lang" => "en", :xmlns => "http://www.w3.org/1999/xhtml" }
  %head
    %meta{ :content => "text/html; charset=utf-8", :"http-equiv" => "Content-Type" }
    %meta{ :content => "en", :"http-equiv" => "Content-Language" }
    %title= "#{@title.last} [Brighter Planet]"
    - stylesheets(:reset, :buttons, :integrity, :application)
  %body
    #header
      %h1= @title.last
    #content= yield


!!!
%html{:lang => 'en'}
  %head
    %title TreeStats
    %link{:rel => "stylesheet", :type => "text/css", :href => "/styles.css" }
    %link{:href => "https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700", :rel => "stylesheet", :type => 'text/css'}
  %body
    %table
      %tbody
        %tr
          %td{:colspan => 2}
            %table
              %tbody
                %tr#header
                  %td#title
                    %h1
                      %a{:href => "/"} TreeStats
                  %td#misc= haml :misc
                %tr
                  %td#search
                    = haml :_search
                  %td#download
                    Download:
                    %a{:href => "/download"} Latest Release

        %tr.line
          %td#nav
            = haml :nav
          %td#content
            = yield
        %tr
          %td#footer.center{:colspan => 2} This website created with love by Kolth.
          %td#footer.center{:colspan => 2} This website created with love by Kolth.

Add URL to my GH account in the footer


- report = nil if local_assigns[:report].nil?
.row.info-header{style: 'margin-top: 10px;'}
  .col-sm-12
    .btns.pull-right
      = button_tag type: :submit, id: 'runReporting', class: 'btn action-button controls' do
        = translate_helper(:run)
    - if report
      %h1= @is_generic_report ? report.name : report.display_name

  :javascript
    $('#runReporting').on('click', function() {
      $('.filter-form form').submit();
    });

Remove duplicated Run button from report page

- report = nil if local_assigns[:report].nil?
.row.info-header{style: 'margin-top: 10px;'}
  .col-sm-12
    - if @is_generic_report
      .btns.pull-right
        = button_tag type: :submit, id: 'runReporting', class: 'btn action-button controls' do
          = translate_helper(:run)
    - if report
      %h1= @is_generic_report ? report.name : report.display_name

  :javascript
    $('#runReporting').on('click', function() {
      $('.filter-form form').submit();
    });


/[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');

: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()})}
  };

Add shim for HTML5 time element.

/[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()})}
  };


%h2 Welcome to October!
Thanks for becoming a part of Project October. You have been registered with the email address
%b #{@user.email}.

%h2 First things first...
October recommends articles based on keywords. We will automatically track your
top keywords as you interact with your news, but first, we need to get to know
you a little better! Go to
=link_to "the October homepage", root_url
and enter some keywords and we'll get you some news!

Copy tweaks to the email

%h2 Welcome to October!
Thanks for becoming a part of Project October. You have been registered with the username
%b #{@user.name}
and the email address
%b #{@user.email}.

%h2 First things first...
October recommends articles based on keywords. We will automatically track your
top keywords as you interact with your news, but first, we need to get to know
you a little better! Go to
=link_to "the October homepage", root_url
and enter some keywords and we'll get you some news!

%h2 Upvote and Downvote
As you read articles on October, please make sure to click the upvote (+) and
downvote (-) buttons. This is the only way we can customize your news to your
liking, so vote early and vote often.


.progress
  - if progress.nil?
    #{status}
  - else
    %div{ class: "progress-bar progress-bar-#{status}", role: "progressbar", style: "width: #{progress}%" }
      - if progress >= 30
        #{progress}%
    - if progress < 30
      #{progress}%

Allow inline style on the progress bar width

.progress
  - if progress.nil?
    = status
  - else
    -# haml-lint:disable InlineStyles
    %div{ class: "progress-bar progress-bar-#{status}", role: "progressbar", style: "width: #{progress}%" }
      - if progress >= 30
        #{progress}%
    - if progress < 30
      #{progress}%
    -# haml-lint:enable InlineStyles


- main_toolbar do |t|
  = t.export(:outgoing_delivery_docket, key: :number)
  = t.edit resource
  = t.destroy

= main_state_bar(resource)

= main_informations attachment: true do
  = attributes_list do |l|
    - l.attribute :number
    - l.attribute :mode
    - l.attribute :driver, url: true
    - l.attribute :transporter, url: true
    - l.attribute :reference_number
    - l.attribute :started_at
    - l.attribute :stopped_at
    -# l.attribute :net_mass
    - l.attribute :responsible, url: true
    - l.attribute :annotation

= cobbles do |c|
  - c.cobble :receptions do
    = cobble_list :receptions

  - c.cobble :shipments do
    = cobble_list :shipments

Remove receptions cobble from deliveries show

- main_toolbar do |t|
  = t.export(:outgoing_delivery_docket, key: :number)
  = t.edit resource
  = t.destroy

= main_state_bar(resource)

= main_informations attachment: true do
  = attributes_list do |l|
    - l.attribute :number
    - l.attribute :mode
    - l.attribute :driver, url: true
    - l.attribute :transporter, url: true
    - l.attribute :reference_number
    - l.attribute :started_at
    - l.attribute :stopped_at
    -# l.attribute :net_mass
    - l.attribute :responsible, url: true
    - l.attribute :annotation

= cobbles do |c|
  - c.cobble :shipments do
    = cobble_list :shipments


- if signed_in?
  .global-actions
    .btn-group
      = link_to gardens_by_owner_path(owner: current_member.slug), class: 'btn btn-default' do
        = t('links.my_gardens')

    .btn-group
      = link_to new_planting_path, class: 'btn btn-default' do
        = t('buttons.plant')
      = link_to new_harvest_path, class: 'btn btn-default' do
        = t('buttons.harvest')
      = link_to new_seed_path, class: 'btn btn-default' do
        = t('buttons.save_seeds')

    .btn-group
      = link_to t('posts.write_blog_post'), new_post_path, class: 'btn btn-default'

- content_for(:attributions) do
  seed by Template from the Noun Project

Add "something" to global action labels

- if signed_in?
  .global-actions
    .btn-group
      = link_to gardens_by_owner_path(owner: current_member.slug), class: 'btn btn-default' do
        = t('links.my_gardens')

    .btn-group
      = link_to new_planting_path, class: 'btn btn-default' do
        = t('plantings.plant_something')
      = link_to new_harvest_path, class: 'btn btn-default' do
        = t('harvests.harvest_something')
      = link_to new_seed_path, class: 'btn btn-default' do
        = t('buttons.save_seeds')

    .btn-group
      = link_to t('posts.write_blog_post'), new_post_path, class: 'btn btn-default'

- content_for(:attributions) do
  seed by Template from the Noun Project