/ data offset top: 74 (viz-graph-header) + 500 (viz-graph)
.visualization-table.container-fluid

  .visualization-table-scrollbar.row
    %p
      %a{ href: "#" }
        Scroll to Edit
    %i.icon-arrow-down

  .visualization-table-header
    %ul#visualization-table-selector.nav.nav-tabs.pull-left{ role: "tablist" }
      %li.active{ role: "presentation" }
        %a{ href: "#nodes", role: "tab", "data-toogle": "tab" } Nodes
      %li{ role: "presentation" }
        %a{ href: "#relations", role: "tab", "data-toogle": "tab" } Relationships

  .tab-content
    #nodes.tab-pane.active{ role: "tabpanel" }
      .btn-toolbar{ role: "group" }
        %a#visualization-add-node-btn.btn.btn-primary{ href: "#" }
          Add Node
        %a#visualization-add-node-column-btn.btn.btn-primary{ href: "#" }
          Add Column
        %button.btn.btn-primary.btn-invert{ type: "button" }
          Network Analysis
      .visualization-table-nodes
    #relations.tab-pane{ role: "tabpanel" }
      .btn-toolbar{ role: "group" }
        %a#visualization-add-relation-btn.btn.btn-primary{ href: "#" }
          Add Relationship
        %a#visualization-add-relation-column-btn.btn.btn-primary{ href: "#" }
          Add Column
      .visualization-table-relations

/  = react_component 'Nodes', { data: @nodes }

Remove not needed 'Add Column' buttons in nodes & relations edit tables

/ data offset top: 74 (viz-graph-header) + 500 (viz-graph)
.visualization-table.container-fluid

  .visualization-table-scrollbar.row
    %p
      %a{ href: "#" }
        Scroll to Edit
    %i.icon-arrow-down

  .visualization-table-header
    %ul#visualization-table-selector.nav.nav-tabs.pull-left{ role: "tablist" }
      %li.active{ role: "presentation" }
        %a{ href: "#nodes", role: "tab", "data-toogle": "tab" } Nodes
      %li{ role: "presentation" }
        %a{ href: "#relations", role: "tab", "data-toogle": "tab" } Relationships

  .tab-content
    #nodes.tab-pane.active{ role: "tabpanel" }
      .btn-toolbar{ role: "group" }
        %a#visualization-add-node-btn.btn.btn-primary{ href: "#" }
          Add Node
        %button.btn.btn-primary.btn-invert{ type: "button" }
          Network Analysis
      .visualization-table-nodes
    #relations.tab-pane{ role: "tabpanel" }
      .btn-toolbar{ role: "group" }
        %a#visualization-add-relation-btn.btn.btn-primary{ href: "#" }
          Add Relationship
      .visualization-table-relations

/  = react_component 'Nodes', { data: @nodes }


- content_for :title, "Data Feeds and API"

%h1 Data Feeds and API

%h2 MP attendance and rebelliousness rates
%p
  You can open XML files in any text editor, XML viewer or some
  spreadsheets. In the files there are comments with more
  information.
%p
  = link_to "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".
%p
  = link_to "mp-info.xml?house=lords", mp_info_feed_path(format: :xml, house: :lords)
  \- likewise for the House of Lords.

Add a section about the policy agreement XML

- content_for :title, "Data Feeds and API"

%h1 Data Feeds and API

%h2 MP attendance and rebelliousness rates
%p
  You can open XML files in any text editor, XML viewer or some
  spreadsheets. In the files there are comments with more
  information.
%p
  = link_to "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".
%p
  = link_to "mp-info.xml?house=lords", mp_info_feed_path(format: :xml, house: :lords)
  \- likewise for the House of Lords.

%h2 MP Policy Agreement
%p
  Each #{link_to 'policy', policies_path} has an XML representation of how much
  each MP agrees with it, e.g.
  = succeed '.' do
    =link_to "mpdream-info.xml?id=1", mpdream_info_feed_path(id: 1, format: :xml)
%p
  Hey, you should
  = succeed '!' do
    = link_to 'help document this better', 'https://github.com/openaustralia/publicwhip/blob/test/app/views/static/data.html.haml'


%h1
  You're about submit paper
  = @paper.short_title

%h2#paper-title= @paper.title

#paper-abstract= @paper.abstract

%table#paper-authors.table.table-hover
  %tr
    %thead Name
    %thead Affiliation
    %thead Email
  - @paper.authors.each do |author|
    %tr
      %td= "#{author[:first_name]} #{author[:last_name]}"
      %td= author[:affiliation]
      %td= author[:email]

%table#paper-declarations.table.table-hover
  %tr
    %thead Question
    %thead Answer
  - @paper.declarations.each do |declaration|
    %tr
      %td= declaration.question
      %td= declaration.answer

= button_to 'Submit', paper_submissions_path(@paper), class: 'btn-primary btn-lg btn'

Add cancel button to submission preview

%h1
  You're about submit paper
  = @paper.short_title

%h2#paper-title= @paper.title

#paper-abstract= @paper.abstract

%table#paper-authors.table.table-hover
  %tr
    %thead Name
    %thead Affiliation
    %thead Email
  - @paper.authors.each do |author|
    %tr
      %td= "#{author[:first_name]} #{author[:last_name]}"
      %td= author[:affiliation]
      %td= author[:email]

%table#paper-declarations.table.table-hover
  %tr
    %thead Question
    %thead Answer
  - @paper.declarations.each do |declaration|
    %tr
      %td= declaration.question
      %td= declaration.answer

= link_to 'Cancel', edit_paper_path(@paper), class: 'btn-primary btn-lg btn'
= button_to 'Submit', paper_submissions_path(@paper), class: 'btn-primary btn-lg btn'


%h3.page_title= "Edit Team #{@team.name}"
%hr
= form_for @team, url: teams_path do |f|
  - if @team.errors.any?
    .alert.alert-error
      %span= @team.errors.full_messages.first
  .clearfix
    = f.label :name do
      Team name is
    .input
      = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"

  .clearfix
    = f.label :path do
      Team path is
    .input
      = f.text_field :path, placeholder: "opensource", class: "xxlarge left"
  .form-actions
    = f.submit 'Save team changes', class: "btn btn-primary"
    = link_to 'Delete team', team_path(@team), method: :delete, confirm: "You are shure?", class: "btn btn-remove pull-right"

Fix crash on team update

%h3.page_title= "Edit Team #{@team.name}"
%hr
= form_for @team, url: team_path(@team) do |f|
  - if @team.errors.any?
    .alert.alert-error
      %span= @team.errors.full_messages.first
  .clearfix
    = f.label :name do
      Team name is
    .input
      = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"

  .clearfix
    = f.label :path do
      Team path is
    .input
      = f.text_field :path, placeholder: "opensource", class: "xxlarge left"
  .form-actions
    = f.submit 'Save team changes', class: "btn btn-primary"
    = link_to 'Delete team', team_path(@team), method: :delete, confirm: "You are shure?", class: "btn btn-remove pull-right"


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

%tr[booking_template]
  %td
    = link_to "%s (%s)" % [booking_template.title, booking_template.code], item_action.call(booking_template)
    - if booking_template.comments.present?
      %hr{:style => "height: 1px; margin: 0"}/
      %i= booking_template.comments
  %td= link_to booking_template.credit_account.code, account_path(booking_template.credit_account), :title => booking_template.credit_account.title unless booking_template.credit_account.nil?
  %td= link_to booking_template.debit_account.code, account_path(booking_template.debit_account), :title => booking_template.debit_account.title unless booking_template.debit_account.nil?
  %td.currency= amount_to_s(booking_template)
  %td= t(booking_template.amount_relates_to, :scope => 'booking_template.relation') if booking_template.amount_relates_to.present?
  %td.action-links
    = list_link_for(:edit, booking_template)
    = list_link_for(:delete, booking_template)
    =# link_to image_tag('16x16/copy.png', :title => 'Copy'), copy_booking_template_path(booking_template), :remote => true

Use full row selection for booking_templates.

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

%tr[booking_template]
  %td
    = link_to "%s (%s)" % [booking_template.title, booking_template.code], item_action.call(booking_template), 'data-href-container' => 'tr'
    - if booking_template.comments.present?
      %hr{:style => "height: 1px; margin: 0"}/
      %i= booking_template.comments
  %td= link_to booking_template.credit_account.code, account_path(booking_template.credit_account), :title => booking_template.credit_account.title unless booking_template.credit_account.nil?
  %td= link_to booking_template.debit_account.code, account_path(booking_template.debit_account), :title => booking_template.debit_account.title unless booking_template.debit_account.nil?
  %td.currency= amount_to_s(booking_template)
  %td= t(booking_template.amount_relates_to, :scope => 'booking_template.relation') if booking_template.amount_relates_to.present?
  %td.action-links
    = list_link_for(:edit, booking_template)
    = list_link_for(:delete, booking_template)
    =# link_to image_tag('16x16/copy.png', :title => 'Copy'), copy_booking_template_path(booking_template), :remote => true


%table.poll-mailer-common__discussion-info
  %tr
    %td
      %img.poll-mailer-common-avatar__image{src: asset_url(discussion.group.logo.url(:small))}
    %td
      = link_to discussion.group.full_name, group_url(discussion.group)
      %span -
      = link_to discussion.title, discussion_url(discussion)

Fix group logo in poll emails

%table.poll-mailer-common__discussion-info
  %tr
    %td
      %img.poll-mailer-common-avatar__image{src: asset_url(discussion.group.logo.url(:card))}
    %td
      = link_to discussion.group.full_name, group_url(discussion.group)
      %span -
      = link_to discussion.title, discussion_url(discussion)


= contextual_links

.page-header
  %h1= t_title

  %table.list
    %tr
      %th= t_attr :code
      %th= t_attr :title
      %th.right= t_attr :amount

    - for template in @salary_booking_templates
      - amount = template.line_items.where(:date => @duration).sum(&:total_amount)
      - next if amount == 0
      %tr
        %td= template.code
        %td= template.title
        %td.currency= currency_fmt(amount)

- content_for :sidebar do
  .sub-tabs
    %ul
      - for month in 1..12
        - date = Date.new(Date.today.year, month, 1)
        %li= link_to t('date.month_names')[date.month], url_for(:date => date.to_s(:db))

Use accounted_amount in salary booking template statistics.

= contextual_links

.page-header
  %h1= t_title

  %table.list
    %tr
      %th= t_attr :code
      %th= t_attr :title
      %th.right= t_attr :amount

    - for template in @salary_booking_templates
      - amount = template.line_items.where(:date => @duration).sum(&:accounted_amount)
      - next if amount == 0
      %tr
        %td= template.code
        %td= template.title
        %td.currency= currency_fmt(amount)

- content_for :sidebar do
  .sub-tabs
    %ul
      - for month in 1..12
        - date = Date.new(Date.today.year, month, 1)
        %li= link_to t('date.month_names')[date.month], url_for(:date => date.to_s(:db))


- title = local_assigns.fetch(:title, 'Assign labels')
- show_create = local_assigns.fetch(:show_create, true)
- show_footer = local_assigns.fetch(:show_footer, true)
- filter_placeholder = local_assigns.fetch(:filter_placeholder, 'Search labels')
- show_boards_content = local_assigns.fetch(:show_boards_content, false)
.dropdown-page-one
  = dropdown_title(title)
  - if show_boards_content
    .issue-board-dropdown-content
      %p
        Each label that exists in your issue tracker can have its own dedicated
        list. Select a label below to add a list to your Board and it will
        automatically be populated with issues that have that label. To create
        a list for a label that doesn't exist yet, simply create the label below.
        Learn more in the
        = succeed "." do
          = link_to "Issue Boards documentation", help_page_path("user/project/issue_board"), class: "underlined-link"
  = dropdown_filter(filter_placeholder)
  = dropdown_content
  - if @project && show_footer
    = dropdown_footer do
      %ul.dropdown-footer-list
        - if can?(current_user, :admin_label, @project)
          %li
            %a.dropdown-toggle-page{href: "#"}
              Create new label
        %li
          = link_to namespace_project_labels_path(@project.namespace, @project), :"data-is-link" => true do
            - if show_create && @project && can?(current_user, :admin_label, @project)
              Manage labels
            - else
              View labels
  = dropdown_loading

Remove link to docs from new list text

- title = local_assigns.fetch(:title, 'Assign labels')
- show_create = local_assigns.fetch(:show_create, true)
- show_footer = local_assigns.fetch(:show_footer, true)
- filter_placeholder = local_assigns.fetch(:filter_placeholder, 'Search labels')
- show_boards_content = local_assigns.fetch(:show_boards_content, false)
.dropdown-page-one
  = dropdown_title(title)
  - if show_boards_content
    .issue-board-dropdown-content
      %p
        Each label that exists in your issue tracker can have its own dedicated
        list. Select a label below to add a list to your Board and it will
        automatically be populated with issues that have that label. To create
        a list for a label that doesn't exist yet, simply create the label below.
  = dropdown_filter(filter_placeholder)
  = dropdown_content
  - if @project && show_footer
    = dropdown_footer do
      %ul.dropdown-footer-list
        - if can?(current_user, :admin_label, @project)
          %li
            %a.dropdown-toggle-page{href: "#"}
              Create new label
        %li
          = link_to namespace_project_labels_path(@project.namespace, @project), :"data-is-link" => true do
            - if show_create && @project && can?(current_user, :admin_label, @project)
              Manage labels
            - else
              View labels
  = dropdown_loading


= table.association :gallery, sortable: :gallery_name
= table.column(:preview_picture) do |picture|
  %img.img-responsive.bottom-margin-2{ src: picture.image.url(:default_thumb) }
= table.column :name, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column :description, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column(:image_file_size, sortable: true) { |picture| number_to_human_size(picture.image_file_size) }
= table.timestamps

Remove gallery sorting for now as it does not work on pg.

= table.association :gallery # , sortable: :gallery_name
= table.column(:preview_picture) do |picture|
  %img.img-responsive.bottom-margin-2{ src: picture.image.url(:default_thumb) }
= table.column :name, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column :description, sortable: true, class: 'truncate-chars truncate-chars-30'
= table.column(:image_file_size, sortable: true) { |picture| number_to_human_size(picture.image_file_size) }
= table.timestamps


%h2 Sign up
= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
  = devise_error_messages!
  %p
    = f.label :firstname
    %br/
    = f.text_field :firstname
  %div
    = f.label :lastname
    %br/
    = f.text_field :lastname
  %div
    = f.label :email
    %br/
    = f.email_field :email
  %div
    = f.label :password
    %br/
    = f.password_field :password
  %div
    = f.label :password_confirmation
    %br/
    = f.password_field :password_confirmation
  %div= f.submit "Sign up"
= render "devise/shared/links"

Add firstname and lastname to user sign_up

.authform
  %h2 Sign up
  = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
    = devise_error_messages!
    .form-group
      %div
        = f.label :firstname
        %br/
        = f.text_field :firstname, class: 'form-control'
    .form-group
      %div
        = f.label :lastname
        %br/
        = f.text_field :lastname, class: 'form-control'
    .form-group
      %div
        = f.label :email
        %br/
        = f.email_field :email, class: 'form-control'
    .form-group
      %div
        = f.label :password
        %br/
        = f.password_field :password, class: 'form-control'
    .form-group
      %div
        = f.label :password_confirmation
        %br/
        = f.password_field :password_confirmation, class: 'form-control'
    %div= f.submit "Sign up", :class => 'button right'
  = render "devise/shared/links"


%ul.slugtree{:data => { :href => mapping_sections_path(@program, :format => :html)}}
  -if sections.empty?
    Nothing found.
  =walk_slug_tree(Program.slugtree(sections)) do |section, step|
    .row-fluid
      .span12
        .regulationslot.toggle.span9
          =link_to mapping_selected_section_path(section), :remote => true, :method => :post, :class => [:selector, :collapsed] do
            %span.prefix=section.compact_slug
            =section.title
        -controls = section.linked_controls
        -status_class = (controls.empty? && !section.na?) ? 'statusred' : 'statusyellow'
        .attached.controllistRM.span3(class = status_class)
          -if !controls.empty?
            %ul.spannomargin{ :title => controls.map(&:slug).join(", ") }
              %li
                %a.controls{:data => { :href => mapping_section_dialog_path(section)} }
                  %strong=controls.count
                  \:
              -controls.each do |control|
                %li
                  %a.controls{:data => { :href => mapping_section_dialog_path(section)} }
                    =control.slug
          -if section.na?
            %a.controls{:data => { :href => mapping_section_dialog_path(section)} }
              N/A
          -elsif controls.empty?
            %a.controls{:data => { :href => mapping_section_dialog_path(section)} }
              %strong 0

Add 'collapsed' class to trigger ellipses

%ul.slugtree{:data => { :href => mapping_sections_path(@program, :format => :html)}}
  -if sections.empty?
    Nothing found.
  =walk_slug_tree(Program.slugtree(sections)) do |section, step|
    .row-fluid
      .span12
        .regulationslot.toggle.span9.collapsed
          =link_to mapping_selected_section_path(section), :remote => true, :method => :post, :class => [:selector, :collapsed] do
            %span.prefix=section.compact_slug
            =section.title
        -controls = section.linked_controls
        -status_class = (controls.empty? && !section.na?) ? 'statusred' : 'statusyellow'
        .attached.controllistRM.span3(class = status_class)
          -if !controls.empty?
            %ul.spannomargin{ :title => controls.map(&:slug).join(", ") }
              %li
                %a.controls{:data => { :href => mapping_section_dialog_path(section)} }
                  %strong=controls.count
                  \:
              -controls.each do |control|
                %li
                  %a.controls{:data => { :href => mapping_section_dialog_path(section)} }
                    =control.slug
          -if section.na?
            %a.controls{:data => { :href => mapping_section_dialog_path(section)} }
              N/A
          -elsif controls.empty?
            %a.controls{:data => { :href => mapping_section_dialog_path(section)} }
              %strong 0


= form_for @goal ||= Goal.new, class: "form", id: "goal-form" do |f|
  -if @goal.errors.any?
    #errors
      %ul
        - @goal.errors.full_messages.each do |msg|
          %li= msg

  = f.label "Write a goal here:"
  = f.text_field :description

  %div{class: "input-field col s12"}
  = f.label "Pick if this goal is a day, week, or phase goal:"
  = f.select(:duration, [['Day', 'daily'], ['Week', 'weekly'], ['Phase', 'phase']], {}, {:class => 'browser-default'})

  %div{class: "input-field col s12"}
  = f.label "Enter in a due date:"
  = f.date_field :due_date, class: "datepicker"

  = f.submit "Dream Forward", class: "btn waves-effect waves-light"

Add today's date to the new goal form by default

= form_for @goal ||= Goal.new, class: "form", id: "goal-form" do |f|
  -if @goal.errors.any?
    #errors
      %ul
        - @goal.errors.full_messages.each do |msg|
          %li= msg

  = f.label "Write a goal here:"
  = f.text_field :description

  %div{class: "input-field col s12"}
  = f.label "Pick if this goal is a day, week, or phase goal:"
  = f.select(:duration, [['Day', 'daily'], ['Week', 'weekly'], ['Phase', 'phase']], {}, {:class => 'browser-default'})

  %div{class: "input-field col s12"}
  = f.label "Enter in a due date:"
  = f.date_field :due_date, value: Date.today, class: "datepicker"

  = f.submit "Dream Forward", class: "btn waves-effect waves-light"


%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}

= csrf_meta_tags

%title
  - if content_for? :html_title
    = yield :html_title
  - else
    = t(controller.controller_name, :default => controller.controller_name.titleize)
  = " - OFN #{t(:administration)}"

%link{:href => "//fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600&subset=latin,cyrillic,greek,vietnamese", :rel => "stylesheet", :type => "text/css"}

= stylesheet_pack_tag 'admin-styles'
= render "layouts/bugsnag_js"
= javascript_include_tag 'admin/all'

= render "spree/admin/shared/translations"
= render "spree/admin/shared/routes"

= javascript_pack_tag "admin", "data-turbo-track": "reload"

%script
  = raw "var AUTH_TOKEN = \"#{form_authenticity_token}\";"

%link{'data-require' => "font-awesome@*", 'data-semver'=>"4.2.0", 'rel' => "stylesheet", 'href' => "//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css"}

= render "layouts/auth_token_script"

= yield :head

Use https when loading fonts in admin

%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}

= csrf_meta_tags

%title
  - if content_for? :html_title
    = yield :html_title
  - else
    = t(controller.controller_name, :default => controller.controller_name.titleize)
  = " - OFN #{t(:administration)}"

%link{:href => "https://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600&subset=latin,cyrillic,greek,vietnamese", :rel => "stylesheet", :type => "text/css"}

= stylesheet_pack_tag 'admin-styles'
= render "layouts/bugsnag_js"
= javascript_include_tag 'admin/all'

= render "spree/admin/shared/translations"
= render "spree/admin/shared/routes"

= javascript_pack_tag "admin", "data-turbo-track": "reload"

%script
  = raw "var AUTH_TOKEN = \"#{form_authenticity_token}\";"

%link{'data-require' => "font-awesome@*", 'data-semver'=>"4.2.0", 'rel' => "stylesheet", 'href' => "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css"}

= render "layouts/auth_token_script"

= yield :head


.nav.center
  %ul
    %li
      %span="© Meine kleine Farm #{Date.today.year}".html_safe
    - Spree::Page.limit(6).each do |page|
      - if page.has_context?('footer')
        %li= link_to page.nav_title, page.path, :title => page.meta_description

Prepare footer to work with spree_essentials_menu.

.nav.center
  %div{:style => 'float:left;'}="© Meine kleine Farm #{Date.today.year}".html_safe
  - @menu_bar = Spree::MenuBar.find_by_name("Footer")
  = render :partial => "spree/shared/render_menu", :locals => {:menu_bar => @menu_bar}


- content_for :page_title, "Hound"

= image_tag('landing/HoundLogo.svg', class: 'logo')
%ol.getting-started
  %li.step.pitch
    .tagline
      %h2
        Review your JavaScript, CoffeeScript, and Ruby code
        for style guide violations
        with a trusty hound.
    = render "shared/auth_button"

  %li.step.step-activate
    %h3 Activate Repos
    %p
      Tell Hound which GitHub repos to watch.
      Private repos are $12 each per month.
      Public repos are free.
    %figure
      = image_tag('landing/step-activate.png')

  %li.step.step-code
    %h3 Commit & Create Pull Request
    %p
      Write and commit code as you normally would then
      open a pull request to get reviewed by Hound.
    %figure
      = image_tag('landing/step-code.png')

  %li.step.step-comment
    %h3 View Hound Comments
    %p
      Hound will review your pull request and make inline comments on
      any style guide violations.
    %figure
      = image_tag('landing/step-comment.png')

  %li.step.cta
    = link_to '/auth/github', class: 'auth button' do
      %i.fa.fa-github
      %span= t('authenticate')

= render 'shared/footer'

Add SCSS to supported languages list on homepage

- content_for :page_title, "Hound"

= image_tag('landing/HoundLogo.svg', class: 'logo')
%ol.getting-started
  %li.step.pitch
    .tagline
      %h2
        Review your JavaScript, CoffeeScript, SCSS, and Ruby code
        for style guide violations
        with a trusty hound.
    = render "shared/auth_button"

  %li.step.step-activate
    %h3 Activate Repos
    %p
      Tell Hound which GitHub repos to watch.
      Private repos are $12 each per month.
      Public repos are free.
    %figure
      = image_tag('landing/step-activate.png')

  %li.step.step-code
    %h3 Commit & Create Pull Request
    %p
      Write and commit code as you normally would then
      open a pull request to get reviewed by Hound.
    %figure
      = image_tag('landing/step-code.png')

  %li.step.step-comment
    %h3 View Hound Comments
    %p
      Hound will review your pull request and make inline comments on
      any style guide violations.
    %figure
      = image_tag('landing/step-comment.png')

  %li.step.cta
    = link_to '/auth/github', class: 'auth button' do
      %i.fa.fa-github
      %span= t('authenticate')

= render 'shared/footer'


%h1 Sign-In

=form_tag public_auth_local_sign_in_path, method: 'POST', id: 'password-sign-in', class: "password-sign-in", role: "form" do
  = hidden_field_tag :authenticity_token, form_authenticity_token
  = hidden_field_tag :current_fullpath, params[:fullpath]
  .form-group
    %label{for: "login"}
      Login / email address
    =text_field :sign_in, :login, placeholder: "Login or email", autofocus: 'autofocus', class: "form-control"
  .form-group
    %label{for: :password}
      Password
    =password_field :sign_in, :password, placeholder: "Password", class: "form-control"
  =button_tag type: 'submit' , class: "btn btn-primary" do
    %i.icon-sign-in
    Sign me in

Remove superfluous CSRF token (fixes invalid token problem)

%h1 Sign-In

=form_tag public_auth_local_sign_in_path, method: 'POST', id: 'password-sign-in', class: "password-sign-in", role: "form" do
  = hidden_field_tag :current_fullpath, params[:fullpath]
  .form-group
    %label{for: "login"}
      Login / email address
    =text_field :sign_in, :login, placeholder: "Login or email", autofocus: 'autofocus', class: "form-control"
  .form-group
    %label{for: :password}
      Password
    =password_field :sign_in, :password, placeholder: "Password", class: "form-control"
  =button_tag type: 'submit' , class: "btn btn-primary" do
    %i.icon-sign-in
    Sign me in


.poll-common-bar-chart
  .poll-common-bar-chart__bar{ng-repeat: "option in poll.pollOptions() track by option.id", ng-style: "styleData(option)"}
    {{barTextFor(option)}}

Order bar chart options by priority

.poll-common-bar-chart
  .poll-common-bar-chart__bar{ng-repeat: "option in poll.pollOptions() | orderBy: 'priority' track by option.id", ng-style: "styleData(option)"}
    {{barTextFor(option)}}


.nav
  %a{ :href => "/candidates" }
    « All candidates

%h1= @page_title = @candidate.name

%h2 Elections contested

%table
  %tr
    %th
    %th date
    %th party
    %th body
    %th district
    %th votes
    %th position
    %th

  - @candidate.candidacies.each do |ccy|
    %tr
      %td{ :style => "background-color: #{ccy.party.colour}" }
      %td
        %a{ :href => "/bodies/#{ccy.election.body.slug}/elections/#{ccy.election.d}" }
          = long_date(ccy.election.d)
      %td= ccy.party.name
      %td
        %a{ :href => "/bodies/#{ccy.election.body.slug}" }
          = ccy.election.body.name
      %td
        %a{ :href => "/bodies/#{ccy.election.body.slug}/elections/#{ccy.election.d}/#{ccy.district.body.districts_name}/#{ccy.district.slug}" }
          = ccy.district.name
          = ccy.district.body.district_name
      %td.right= commify(ccy.votes)
      %td.right= to_ordinal(ccy.position)
      %td= ccy.seats == 1 ? "Elected" : "Not elected"

.warning
  This might not be the complete electoral history for this candidate. They might have stood in elections outside Sutton and / or in Sutton elections for which we don't have data.

Remove "ward"/"constituency" to make table easier to read; make table easier to copy/paste

.nav
  %a{ :href => "/candidates" }
    « All candidates

%h1= @page_title = @candidate.name

%h2 Elections contested

%table
  %tr
    %th
    %th date
    %th party
    %th body
    %th district
    %th votes
    %th position
    %th

  - @candidate.candidacies.each do |ccy|
    %tr
      %td{ :style => "background-color: #{ccy.party.colour}" }
      %td
        %a{ :href => "/bodies/#{ccy.election.body.slug}/elections/#{ccy.election.d}" }
          = long_date(ccy.election.d)
      %td= ccy.party.name
      %td
        %a{ :href => "/bodies/#{ccy.election.body.slug}" }
          = ccy.election.body.name
      %td
        %a{ :href => "/bodies/#{ccy.election.body.slug}/elections/#{ccy.election.d}/#{ccy.district.body.districts_name}/#{ccy.district.slug}" }
          = ccy.district.name
      %td.right= commify(ccy.votes)
      %td.right= to_ordinal(ccy.position)
      %td= ccy.seats == 1 ? "Elected" : "Not elected"

.warning
  This might not be the complete electoral history for this candidate. They might have stood in elections outside Sutton and / or in Sutton elections for which we don't have data.


- model_class = User
- content_for :actions do
  %li.nav-item
    = link_to 'new user', [:new, :user], class: "nav-link"

.user-filter
  .btn-group
    %a.btn.btn-primary{href: "#0"} #
    - ('a'..'z').each do |a|
      %a.btn.btn-primary{href: "##{a}"}= a
.row
.row
  = render @users

- content_for :footer do
  = javascript_include_tag "users"
  %noscript
    %style .user { display: initial; }

Hide the user filter if JavaScript is disabled

- model_class = User
- content_for :actions do
  %li.nav-item
    = link_to 'new user', [:new, :user], class: "nav-link"

.user-filter
  .btn-group
    %a.btn.btn-primary{href: "#0"} #
    - ('a'..'z').each do |a|
      %a.btn.btn-primary{href: "##{a}"}= a
.row
.row
  = render @users

- content_for :footer do
  = javascript_include_tag "users"
  %noscript
    %style .user { display: initial; }
    %style .user-filter { display: none; }


= link_to user, class: "list-group-item" do
  .row
    .col-md-2
      = owner_image(user, 80, false)
    .col-md-7
      %div= user.nickname
      - if user.name
        %div
          - if details && details[:highlight] && details[:highlight][:name]
            -# Hmmm... not sure I should just blindly mark it as safe
            = details[:highlight][:name].html_safe
          - else
            = user.name
      - if !user.company.blank?
        %div= user.company
      - elsif !user.blog.blank?
        %div= user.blog
    .col-md-3
      - if user.scrapers.count > 0
        %div
          Has
          = pluralize(user.scrapers.count, "scraper")
      - if user.other_scrapers_contributed_to.count > 0
        %div
          Contributed to
          = pluralize(user.other_scrapers_contributed_to.count, "scraper")

Make partial still work if details is not defined

= link_to user, class: "list-group-item" do
  .row
    .col-md-2
      = owner_image(user, 80, false)
    .col-md-7
      %div= user.nickname
      - if user.name
        %div
          - if defined?(details) && details[:highlight][:name]
            -# Hmmm... not sure I should just blindly mark it as safe
            = details[:highlight][:name].html_safe
          - else
            = user.name
      - if !user.company.blank?
        %div= user.company
      - elsif !user.blog.blank?
        %div= user.blog
    .col-md-3
      - if user.scrapers.count > 0
        %div
          Has
          = pluralize(user.scrapers.count, "scraper")
      - if user.other_scrapers_contributed_to.count > 0
        %div
          Contributed to
          = pluralize(user.other_scrapers_contributed_to.count, "scraper")


.row.animate-slide{ "ng-show" => "query || appliedPropertiesList() || appliedTaxonsList()" }
  .small-12.columns
    .alert-box.search-alert.ng-scope
      %div{"ng-show" => "Products.products.length > 0"}
        %span.filter-label
          = t :products_results_for
          %span{ ng: { hide: "!query"} }
            %span.applied-search
              {{ query }}

          %span{ "ng-show" => "query && ( appliedPropertiesList() || appliedTaxonsList() )" }
            = t :products_filters_in

          %span.applied-properties{'ng-bind-html' => 'appliedPropertiesList()'}
          %span.applied-taxons{'ng-bind-html' => 'appliedTaxonsList()'}

        %a.clear-all.right{"ng-click" => "clearAll()"}
          = t :products_clear
          %i.ofn-i_009-close

      %div{"ng-show" => "Products.products.length == 0 && !Products.loading"}
        .row.summary
          .small-12.columns
            %p.no-results
              = t :products_no_results_html, query: "<strong>{{query}}</strong>".html_safe
            %button.clear-search{type: 'button', ng: {click: 'clearAll()'}}
              = t :products_clear_search

Add join word "or" when both categories and properties are present

.row.animate-slide{ "ng-show" => "query || appliedPropertiesList() || appliedTaxonsList()" }
  .small-12.columns
    .alert-box.search-alert.ng-scope
      %div{"ng-show" => "Products.products.length > 0"}
        %span.filter-label
          = t :products_results_for
          %span{ ng: { hide: "!query"} }
            %span.applied-search
              {{ query }}

          %span{ "ng-show" => "query && ( appliedPropertiesList() || appliedTaxonsList() )" }
            = t :products_filters_in

          %span.applied-properties{'ng-bind-html' => 'appliedPropertiesList()'}

          %span{ "ng-show" => "appliedPropertiesList() && appliedTaxonsList()" }
            = t :products_or

          %span.applied-taxons{'ng-bind-html' => 'appliedTaxonsList()'}

        %a.clear-all.right{"ng-click" => "clearAll()"}
          = t :products_clear
          %i.ofn-i_009-close

      %div{"ng-show" => "Products.products.length == 0 && !Products.loading"}
        .row.summary
          .small-12.columns
            %p.no-results
              = t :products_no_results_html, query: "<strong>{{query}}</strong>".html_safe
            %button.clear-search{type: 'button', ng: {click: 'clearAll()'}}
              = t :products_clear_search


:ruby

  src = "https://maps.googleapis.com/maps/api/staticmap"
  src+= "?size=#{properties[:width]}x#{properties[:height]}"
  src+= "&zoom=#{properties[:zoom]}&scale=#{properties[:scale]}"

  if properties[:marker]
    src+= "&markers=icon:#{CGI.escape(properties[:icon])}|#{properties[:latitude]},#{properties[:longitude]}"
  else
    src+= "&center=#{properties[:latitude]},#{properties[:longitude]}"
  end

%img.poi-map__img{ src: src, width: properties[:width], height: properties[:height], alt: properties[:alt] }

Add custom stylers to static maps

:ruby

  src = "https://maps.googleapis.com/maps/api/staticmap"
  src+= "?size=#{properties[:width]}x#{properties[:height]}"
  src+= "&zoom=#{properties[:zoom]}&scale=#{properties[:scale]}"

  if properties[:marker]
    src+= "&markers=icon:#{CGI.escape(properties[:icon])}|#{properties[:latitude]},#{properties[:longitude]}"
  else
    src+= "&center=#{properties[:latitude]},#{properties[:longitude]}"
  end

  stylers = [
    "feature:water|element:geometry|color:0xcbdae7",
    "feature:landscape.man_made|element:geometry.fill|color:0xeff1f3",
    "feature:road|element:labels.text.stroke|color:0xffffff",
    "feature:road.arterial|element:geometry.fill|color:0xffffff",
    "feature:road.arterial|element:geometry.stroke|visibility:off",
    "feature:road.highway|element:geometry.fill|color:0x16c98d",
    "feature:road.highway|element:geometry.stroke|visibility:off",
    "feature:road.local|element:geometry.stroke|visibility:off",
    "feature:road.local|element:labels|visibility:off",
    "feature:poi.park|element:geometry.fill|color:0xc8e6aa",
    "feature:poi.school|element:geometry|color:0xdfdad3",
    "feature:poi.medical|element:geometry|color:0xfa5e5b"
  ]

  src+= "&style=#{stylers.join('&style=')}"

%img.poi-map__img{ src: src, width: properties[:width], height: properties[:height], alt: properties[:alt] }


= render 'styleguide/partials/shared'

- require "ostruct"
- maps = YAML.load(File.read(File.expand_path('../../../../data/styleguide/maps_stubs.yml', __FILE__)))

.card.styleguide-intro.copy--body.context--content
  %h1.copy--h1 POI Maps
  %p
    Simple Google Maps integration for static and dynamic maps. The maps are responsive by default.

  %p
    The width, height and scale properties are optional but the defaults for each are shown below.

- maps.each_with_index do |map, i|
  = styleguide_component("poi-maps/#{map[:styleguide_title].downcase.split(' ').first}", properties: map, count: i, card_style: true)

Fix maps page in the styleguide

= render 'styleguide/partials/shared'

- require "ostruct"
- maps = YAML.load(File.read(File.expand_path('../../../../data/styleguide/maps_stubs.yml', __FILE__)))

.card.styleguide-intro.copy--body.context--content
  %h1.copy--h1 POI Maps
  %p
    Simple Google Maps integration for static and dynamic maps. The maps are responsive by default.

  %p
    The width, height and scale properties are optional but the defaults for each are shown below.

- maps.each_with_index do |map, i|
  = styleguide_component("poi_maps/#{map[:styleguide_title].downcase.split(' ').first}", properties: map, count: i, card_style: true)


- content_for(:title) { "Reports" }

%table
  %thead
    %tr
      %th Source
      %th Status
      %th Weather
      %th Date
  %tbody
    - @reports.each do |report|
      %tr
        %td=h report.source.name
        %td= report.status
        %td= report.weather
        %td= report.created_at.to_s(:short)

Rename report date table heading.

- content_for(:title) { "Reports" }

%table
  %thead
    %tr
      %th Source
      %th Status
      %th Weather
      %th Reported
  %tbody
    - @reports.each do |report|
      %tr
        %td=h report.source.name
        %td= report.status
        %td= report.weather
        %td= report.created_at.to_s(:short)


.control-group{"data-bind" => "with: $data.textField($data,'#{@field_name}')"}
  %label.control-label= @field_name
  .controls
    %input{type: "text", id: "#{@field_name}", "data-bind" => "value: v" }

Add back errors for text field.

.control-group{"data-bind" => "with: $data.textField($data,'#{@field_name}')"}
  %label.control-label= @field_name
  .controls
    %input{type: "text", id: "#{@field_name}", "data-bind" => "value: v" }
    .errors{"data-bind" => "foreach: $data.errors"}
      %p.text-error(data-bind="text: $data")


- @page_title = 'GovUK Elements Rails Guide'
- @app_title = 'GovUK Elements Rails Guide'

%h1.heading-large GOV.UK elements rails snippets

%p GOV.UK elements Rails view helpers can be used to help with prototyping.

%h2.heading-medium Forms

= render partial: 'helper_example',
      locals: { label: 'Text inputs', code: 'f.text_field :name' }

= render partial: 'helper_example',
      locals: { label: 'Textarea inputs', code: 'f.text_area :name' }

= render partial: 'helper_example',
      locals: { label: 'Radio buttons',
        code: "f.radio_buttons(:status, %i[ accepted declined ], inline: true, labeler: ->(v){ t(v, scope: 'invitations.statuses') })" }

Comment out non-implemented form helper examples

- @page_title = 'GovUK Elements Rails Guide'
- @app_title = 'GovUK Elements Rails Guide'

%h1.heading-large GOV.UK elements rails snippets

%p GOV.UK elements Rails view helpers can be used to help with prototyping.

%h2.heading-medium Forms

= render partial: 'helper_example',
      locals: { label: 'Text inputs', code: 'f.text_field :name' }

= # render partial: 'helper_example',
      locals: { label: 'Textarea inputs', code: 'f.text_area :name' }

= # render partial: 'helper_example',
      locals: { label: 'Radio buttons',
        code: "f.radio_buttons(:status, %i[ accepted declined ], inline: true, labeler: ->(v){ t(v, scope: 'invitations.statuses') })" }


= simple_form_for @user, html: { class: 'form-horizontal', id: 'user_form' } do |f|
  = f.input :name
  = f.input :email
  = f.input :profile, input_html: { rows: 5, class: 'span6' }
  %hr
  = f.simple_fields_for :preference do |preference_form|
    = preference_form.input :languages, as: :select, collection: %w(english japanese chinese), prompt: 'Select language'
  .form-actions
    = f.button :submit, disable_with: 'Updating...', id: 'user_submit', class: 'btn btn-primary'

Update to data: { disable_with: 'Text' } style

= simple_form_for @user, html: { class: 'form-horizontal', id: 'user_form' } do |f|
  = f.input :name
  = f.input :email
  = f.input :profile, input_html: { rows: 5, class: 'span6' }
  %hr
  = f.simple_fields_for :preference do |preference_form|
    = preference_form.input :languages, as: :select, collection: %w(english japanese chinese), prompt: 'Select language'
  .form-actions
    = f.button :submit, data: { disable_with: 'Updating...' }, id: 'user_submit', class: 'btn btn-primary'


.media.smiles
  .pull-left
    %i.fa.fa-smile-o
  .media-body
    - if a.smiles.all.count.zero?
      = t 'views.answerbox.no_smile'
    - else
      - a.smiles.all.each do |smile|
        %a{ href: show_user_profile_path(smile.user.screen_name),
          title: smile.user.display_name,
          data: { toggle: :tooltip, placement: :top, smile_id: smile.id } }
          %img.avatar-xs{ src: smile.user.profile_picture.url(:medium) }

Use user_screen_name() in smile tooltip

.media.smiles
  .pull-left
    %i.fa.fa-smile-o
  .media-body
    - if a.smiles.all.count.zero?
      = t 'views.answerbox.no_smile'
    - else
      - a.smiles.all.each do |smile|
        %a{ href: show_user_profile_path(smile.user.screen_name),
          title: user_screen_name(smile.user, anonymous: false, url: false),
          data: { toggle: :tooltip, placement: :top, smile_id: smile.id } }
          %img.avatar-xs{ src: smile.user.profile_picture.url(:medium) }


- @title = "Paint Composer"

%tunes.show
  = render :partial => tune
  - if tune.parent
    = render tune.parent

%tags
  - tune.tag_list.each do |tag|
    = tag_link(tag)
  = form_tag add_tag_tune_path do
    = text_field_tag :tag, nil, :placeholder => "Tag name"
    %button(type='submit') Add Tag

%actions
  - if current_user
    - if current_user.favorite?(tune)
      = button_to remove_favorite_tune_path(tune) do
        💔 Remove Favorite
    - else
      = button_to add_favorite_tune_path(tune) do
        💝 Add Favorite

  - if owner_or_admin?
    %a.button(href="#{editor_tune_path(tune)}")
      ⬆ Load in Editor
    %a.button(href="#{edit_tune_path(tune)}")
      📝 Edit Details
    %a.button(href="#{tune_path(tune)}" data-method="delete")
      🗑 Delete

- if tune.children.any?
  %h2
    Remixes

  %tunes
    = render :partial => tune.children.limit(20)

= display_comments tune

Load in editor should appear for all users

- @title = "Paint Composer"

%tunes.show
  = render :partial => tune
  - if tune.parent
    = render tune.parent

%tags
  - tune.tag_list.each do |tag|
    = tag_link(tag)
  = form_tag add_tag_tune_path do
    = text_field_tag :tag, nil, :placeholder => "Tag name"
    %button(type='submit') Add Tag

%actions
  %a.button(href="#{editor_tune_path(tune)}")
    ⬆ Load in Editor

  - if current_user
    - if current_user.favorite?(tune)
      = button_to remove_favorite_tune_path(tune) do
        💔 Remove Favorite
    - else
      = button_to add_favorite_tune_path(tune) do
        💝 Add Favorite

  - if owner_or_admin?
    %a.button(href="#{edit_tune_path(tune)}")
      📝 Edit Details
    %a.button(href="#{tune_path(tune)}" data-method="delete")
      🗑 Delete

- if tune.children.any?
  %h2
    Remixes

  %tunes
    = render :partial => tune.children.limit(20)

= display_comments tune


%li.dojo
  %header
    %a{:href => "#{dojo.url}"}
      %span.dojo-picture{style: "background-image: url(#{dojo.logo});"}
    %a{:href => "#{dojo.url}"}
      %span.dojo-name
        = "#{dojo.name} (#{dojo.prefecture.name}) "
        - if not dojo.counter == 1
          %span.dojo-counter{'data-toggle' => 'tooltip', 'data-placement' => 'bottom', 'data-original-title' => '道場数'}= "#{dojo.counter}"
  %ul.tags
    - dojo.tags.each do |tag|
      %li= tag
  %p.dojo-desciption
    = dojo.description
    - if dojo.is_private
      %a.dojo-private{href: '/docs/private-dojo'} Private

Add 'rel=noopener' attr to links in top page

%li.dojo
  %header
    %a{href: "#{dojo.url}", target: "_blank", rel: "external noopener"}
      %span.dojo-picture{style: "background-image: url(#{dojo.logo});"}
    %a{href: "#{dojo.url}", target: "_blank", rel: "external noopener"}
      %span.dojo-name
        = "#{dojo.name} (#{dojo.prefecture.name}) "
        - if not dojo.counter == 1
          %span.dojo-counter{'data-toggle' => 'tooltip', 'data-placement' => 'bottom', 'data-original-title' => '道場数'}= "#{dojo.counter}"
  %ul.tags
    - dojo.tags.each do |tag|
      %li= tag
  %p.dojo-desciption
    = dojo.description
    - if dojo.is_private
      %a.dojo-private{href: '/docs/private-dojo'} Private


- @title = 'Tools'
%h1
  = @title
  - if current_user && current_user.system_admin?
    = link_to 'Create Tool', new_tool_path, class: 'btn btn-xs btn-primary'
%p
  Tools to help jumpstart your research.

%p.lead Popular Tools
%p.lead Search for Tool
%p.lead Submit a Tool
%p.lead Bookmark a Tool
%p.lead Popular Requests
%p.lead Researcher Helped Solve a Request
%p.lead Researcher Submitted a Tool Requested that's Highly Rated
%p.lead "Tool URL no longer available"
%p.lead Tool Description
%p.lead Tool Discussion

.content-container
  = render 'tools/tools'

- content_for :call_to_action do
  .call-to-action
    .call-to-action-body
      %strong Are you a tool developer?
    .call-to-action-body
      Submit a link to your tool code repository and help other researchers.
    .call-to-action-body
      = link_to 'Contribute a Tool', '#', data: { object: 'suppress-click' }, class: 'btn btn-call-to-action'

    .call-to-action-body
      %strong Unsure how to work with a data type?
    .call-to-action-body
      Put in a request for a tool.
    .call-to-action-body
      = link_to 'Request a Tool', '#', data: { object: 'suppress-click' }, class: 'btn btn-call-to-action'

Remove temporary text on tools index

- @title = 'Tools'
%h1
  = @title
  - if current_user && current_user.system_admin?
    = link_to 'Create Tool', new_tool_path, class: 'btn btn-xs btn-primary'
%p
  Tools to help jumpstart your research.

- if false
  %p.lead Popular Tools
  %p.lead Search for Tool
  %p.lead Submit a Tool
  %p.lead Bookmark a Tool
  %p.lead Popular Requests
  %p.lead Researcher Helped Solve a Request
  %p.lead Researcher Submitted a Tool Requested that's Highly Rated
  %p.lead "Tool URL no longer available"
  %p.lead Tool Description
  %p.lead Tool Discussion

.content-container
  = render 'tools/tools'

- content_for :call_to_action do
  .call-to-action
    .call-to-action-body
      %strong Are you a tool developer?
    .call-to-action-body
      Submit a link to your tool code repository and help other researchers.
    .call-to-action-body
      = link_to 'Contribute a Tool', '#', data: { object: 'suppress-click' }, class: 'btn btn-call-to-action'

    .call-to-action-body
      %strong Unsure how to work with a data type?
    .call-to-action-body
      Put in a request for a tool.
    .call-to-action-body
      = link_to 'Request a Tool', '#', data: { object: 'suppress-click' }, class: 'btn btn-call-to-action'


.container
  %h2
    404
    %small Not Found
  %p
    Those splits either never existed or were deleted.
  %p
    If you have reason to believe this is a mistake, please
    %a{href: "mailto:qhiiyr@gmail.com"} email me
    this URL and why you think so.

Fix header styling of the run 404 page

- content_for(:header) do
  %h2
    404
    %small Not Found
%article
  %p
    Those splits either never existed or were deleted.
  %p
    If you have reason to believe this is a mistake, please
    %a{href: "mailto:qhiiyr@gmail.com"} email me
    this URL and why you think so.


- render :partial => 'filters'

= content do
  %table(cellpadding=0 cellspacing=0)
    %thead
      %tr
        %th Name
        %th Total
        %th Updated At
        %th Bill

    %tbody
      - @orders.each do |order|
        %tr
          %td
            = link_to(order.name, path(order), :class => 'title')
            %span.reference= order.reference
            %span.summary= order.items_summary
          %td
            = order.formatted_total
          %td
            %span.time= order.updated_at
            by #{order.updater_name}
          %td
            = link_to('Bill', path(:review_billing, :order_process, :id => order), :class => 'button')

= paginate(@orders, :theme => 'admin')

Fix busted link on billing listing.

- render :partial => 'filters'

= content do
  %table(cellpadding=0 cellspacing=0)
    %thead
      %tr
        %th Name
        %th Total
        %th Updated At
        %th Bill

    %tbody
      - @orders.each do |order|
        %tr
          %td
            = link_to(order.name, path(order), :class => 'title')
            %span.reference= order.reference
            %span.summary= order.items_summary
          %td
            = order.formatted_total
          %td
            %span.time= order.updated_at
            by #{order.updater_name}
          %td
            = link_to('Bill', path(:bill, :order_process, :id => order), :class => 'button')

= paginate(@orders, :theme => 'admin')


.top-bar
  .row
    .top-bar-left
      %ul.menu
        %li.menu-text= t 'site_name'
        %li= link_to t('topbar.jobs_de'), '#'
        %li= link_to t('topbar.jobs_pl'), '#'
    .top-bar-right
      %ul.menu
        %li= link_to t('topbar.sign_in'), new_user_session_path
        %li= link_to t('topbar.sign_up'), new_user_registration_path

Make site name in topbar clickable

.top-bar
  .row
    .top-bar-left
      %ul.menu
        %li= link_to t('site_name'), root_path
        %li= link_to t('topbar.jobs_de'), '#'
        %li= link_to t('topbar.jobs_pl'), '#'
    .top-bar-right
      %ul.menu
        %li= link_to t('topbar.sign_in'), new_user_session_path
        %li= link_to t('topbar.sign_up'), new_user_registration_path


.page.common-page
  .row
    .columns.small-12.large-5.small-centered
      %h2.text-center{ng: {if: 'entries.length === 0'}}
        No entries

      %ul.small-block-grid-1.entries
        %li{ng: {repeat: 'entry in entries'}}
          .list-entry.row
            .column.small-4.large-2
              %a{href: 'javascript:void(0)', ng: {click: 'listen(entry)'}}
                .play-button.fa
                  
            .column.small-8.large-10
              .entry-word {{ entry.entry_word }}
              .translation {{ entry.translation }}

Fix common phrases partial play button style bug

.page.common-page
  .row
    .columns.small-12.large-5.small-centered
      %h2.text-center{ng: {if: 'entries.length === 0'}}
        No entries

      %ul.small-block-grid-1.entries
        %li{ng: {repeat: 'entry in entries'}}
          .list-entry.row
            .column.small-4.large-2.audio-player-container

              .audio-player{ng: {if: 'entry.audio'}}
                %a.play-button{href: 'javascript:void(0)', ng: {click: 'listen(entry)', if: ' ! isWebView || isWebView && entry.audio.indexOf("http") !== 0'}}
                .loading-container{ng: {if: 'isWebView && entry.audio.indexOf("http") === 0'}}
                  .loading.spin

              / %a{href: 'javascript:void(0)', ng: {click: 'listen(entry)'}}
              /   .play-button.fa
              /     

            .column.small-8.large-10
              .entry-word {{ entry.entry_word }}
              .translation {{ entry.translation }}


- if can? :destroy, @scraper
  .row
    .col-md-8
      .panel.panel-danger
        .panel-heading
          %h3.panel-title Here be dragons!
        .panel-body
          %p
            %strong Be careful here, these actions can't be undone.
        %ul.danger-settings-options-list.list-group
          %li.list-group-item
            %h4 Clear this scraper’s database
            %p All your data will be gone!
            = button_to "Clear database", clear_scraper_path(@scraper),
              {class: "btn btn-danger",
                data: {confirm: "All the data you’ve scraped will be deleted. Are you sure you want to clear this scraper’s database?"}}
          %li.list-group-item
            %h4 Delete this scraper
            %p Delete the entire scraper from morph.io, data and all.
            = button_to "Delete scraper", @scraper,
              {class: "btn btn-danger", method: :delete,
                data: {confirm: "Scraper #{@scraper.full_name} and its database will be deleted from morph.io. Are you sure you want to delete your scraper?"}}

Make copy more human to re-enforce that this is their scraper to take care of

- if can? :destroy, @scraper
  .row
    .col-md-8
      .panel.panel-danger
        .panel-heading
          %h3.panel-title Here be dragons!
        .panel-body
          %p
            %strong Be careful here, these actions can't be undone.
        %ul.danger-settings-options-list.list-group
          %li.list-group-item
            %h4 Clear your scraper’s database
            %p All your data will be gone!
            = button_to "Clear database", clear_scraper_path(@scraper),
              {class: "btn btn-danger",
                data: {confirm: "All the data you’ve scraped will be deleted. Are you sure you want to clear your scraper’s database?"}}
          %li.list-group-item
            %h4 Delete your scraper
            %p Delete the entire scraper from morph.io, data and all.
            = button_to "Delete your scraper", @scraper,
              {class: "btn btn-danger", method: :delete,
                data: {confirm: "Scraper #{@scraper.full_name} and its database will be deleted from morph.io. Are you sure you want to delete your scraper?"}}


%span Players
%form{:action => '/search', :method => 'get'}
  %select{:name => 'server', :value => params[:server]}
    - ["All Servers", "Darktide", "Frostfell", "Harvestgain", "Leafcull", "Morningthaw", "Thistledown", "Solclaim", "Verdantine", "WintersEbb"].each do |s|
      - if params[:server] && params[:server] == s
        %option{:value => s, :selected => true}= s
      - else
        %option{:value => s}= s

  %input{:name => 'character', :type => 'text', :value => params[:player]}
  %input{:type => 'submit'}

%span Allegiances
%form{:action => '/search', :method => 'get'}
  %select{:name => 'server', :value => params[:server]}
    - ["All Servers", "Darktide", "Frostfell", "Harvestgain", "Leafcull", "Morningthaw", "Thistledown", "Solclaim", "Verdantine", "WintersEbb"].each do |s|
      - if params[:server] && params[:server] == s
        %option{:value => s, :selected => true}= s
      - else
        %option{:value => s}= s

  %input{:name => 'allegiance', :type => 'text', :value => params[:allegiance]}
  %input{:type => 'submit'}

Add new servers to search

%span Players
%form{:action => '/search', :method => 'get'}
  %select{:name => 'server', :value => params[:server]}
    - ["All Servers", "Megaduck", "Ducktide", "YewTide", "Darktide", "Frostfell", "Harvestgain", "Leafcull", "Morningthaw", "Thistledown", "Solclaim", "Verdantine", "WintersEbb"].each do |s|
      - if params[:server] && params[:server] == s
        %option{:value => s, :selected => true}= s
      - else
        %option{:value => s}= s

  %input{:name => 'character', :type => 'text', :value => params[:player]}
  %input{:type => 'submit'}

%span Allegiances
%form{:action => '/search', :method => 'get'}
  %select{:name => 'server', :value => params[:server]}
    - ["All Servers", "Megaduck", "Ducktide", "YewTide", "Darktide", "Frostfell", "Harvestgain", "Leafcull", "Morningthaw", "Thistledown", "Solclaim", "Verdantine", "WintersEbb"].each do |s|
      - if params[:server] && params[:server] == s
        %option{:value => s, :selected => true}= s
      - else
        %option{:value => s}= s

  %input{:name => 'allegiance', :type => 'text', :value => params[:allegiance]}
  %input{:type => 'submit'}


---
title: "Home"
---

%section.intro
  %h1 Jeff Cole

  %h3 I build things with computers for people.

  %p Here are some other places you can find me.

  %p
    %i.fa.fa-github
    %i.fa.fa-linkedin-square
    %i.fa.fa-envelope

  %hr

%h2 Posts

%ul
  - index_items.each do |article|
    %li= title_and_date_link article

Add talks to index page

---
title: "Home"
---

%section.intro
  %h1 Jeff Cole

  %h3 I build things with computers for people.

  %p Here are some other places you can find me.

  %p
    %i.fa.fa-github
    %i.fa.fa-linkedin-square
    %i.fa.fa-envelope

  %hr

%h2 Posts

%ul
  - index_items.each do |article|
    %li= title_and_date_link article

%h2 Talks

%ul
  - talks.each do |talk|
    = partial :talk, locals: {talk: talk}


.u-mb-2
  .container.u-py-2
    .Grid
      .Grid-cell
        %h2.u-mb-2
          Popular tags
          = link_to tag_filter_path, title: 'Filter by tag' do
            =inline_svg('filter.svg', {class: 'Icon u-ml-05'})

        -if @tags
          =render partial: "tags/tag", collection: @tags
        -else
          %p No tags found.

.container
  -unless @lists.empty?
    %h2
      Newest lists
    .Grid
      -@lists.each do |list|
        .Grid-cell.1-of-3--desk
          =render list

    .Grid
      .Grid-cell.1-of-3--desk
        = paginate @lists

  -else
    %p No lists created yet.

Change grid on newest page.

.u-mb-2
  .container.u-py-2
    .Grid
      .Grid-cell
        %h2.u-mb-2
          Popular tags
          = link_to tag_filter_path, title: 'Filter by tag' do
            =inline_svg('filter.svg', {class: 'Icon u-ml-05'})

        -if @tags
          =render partial: "tags/tag", collection: @tags
        -else
          %p No tags found.

.container
  -unless @lists.empty?
    %h2
      Newest lists
    .Grid.Grid--flush
      -@lists.each do |list|
        .Grid-cell.1-of-4--desk
          =render list

    .Grid
      .Grid-cell
        = paginate @lists

  -else
    %p No lists created yet.


-# admin/admin.js.erb in spree requires id to start with "spree_" for sortable tables
%tr.product_property.fields{"data-hook" => "producer_property", id: "spree_#{dom_id(f.object)}"}
  %td.no-border
    %span.handle
    = f.hidden_field :id
  %td.property_name
    = f.text_field :property_name, :class => 'autocomplete'
  %td.value
    = f.text_field :value, :class => 'autocomplete'
  %td.actions
    - unless @enterprise.producer_properties.empty?
      = link_to_remove_fields t(:remove), f, no_text: true, url: (f.object.persisted? && main_app.admin_enterprise_producer_property_path(@enterprise, f.object))

Replace free text with with select dropdown for property names when not super admin

-# admin/admin.js.erb in spree requires id to start with "spree_" for sortable tables
%tr.product_property.fields{"data-hook" => "producer_property", id: "spree_#{dom_id(f.object)}"}
  %td.no-border
    %span.handle
    = f.hidden_field :id
  %td.property_name
    - if spree_current_user.admin?
      = f.text_field :property_name, :class => 'autocomplete'
    - else
      = f.select :property_name, @properties, { :include_blank => true }, { class: 'select2 fullwidth' }
  %td.value
    = f.text_field :value, :class => 'autocomplete'
  %td.actions
    - unless @enterprise.producer_properties.empty?
      = link_to_remove_fields t(:remove), f, no_text: true, url: (f.object.persisted? && main_app.admin_enterprise_producer_property_path(@enterprise, f.object))


- remote ||= false
.search-result-item.image-result{data: {'title' => presenter.title, 'status-label' => presenter.status_label}}
  .badge= presenter.status_label
  .authority
    %div{:class => presenter.recommended_class}
  .basic-info
    %h3
      - if remote
        = link_to presenter.title, presenter.docker_index_url, target: '_blank', title: 'View details on the Docker Index'
      - else
        = presenter.title
    %p= presenter.short_description
  .actions
    = form_tag applications_path do
      = hidden_field_tag 'application[image]', presenter.title
      = label 'application[tag]', 'Tag:'
      = select_tag 'application[tag]',
        options_for_select(['latest']),
        data: {'load-tags-endpoint' => load_tags_search_path, 'loaded' => false}
      = button_tag 'Run Image', class: 'button-positive', data: {disable_with: 'Starting App...'}
  - if remote
    .community-data
      = link_to presenter.docker_index_url + "/stars/", target: '_blank' do
        .star-count=presenter.star_count

Add Google Analytics event for running an image

- remote ||= false
.search-result-item.image-result{data: {'title' => presenter.title, 'status-label' => presenter.status_label}}
  .badge= presenter.status_label
  .authority
    %div{:class => presenter.recommended_class}
  .basic-info
    %h3
      - if remote
        = link_to presenter.title, presenter.docker_index_url, target: '_blank', title: 'View details on the Docker Index'
      - else
        = presenter.title
    %p= presenter.short_description
  .actions
    = form_tag applications_path do
      = hidden_field_tag 'application[image]', presenter.title
      = label 'application[tag]', 'Tag:'
      = select_tag 'application[tag]',
        options_for_select(['latest']),
        data: {'load-tags-endpoint' => load_tags_search_path, 'loaded' => false}
      %button.button-positive{ data: { disable_with: 'Starting App...', tracking: { method: 'click', action: 'Create Application', category: 'Run Image', label: presenter.title }}} Run Image
  - if remote
    .community-data
      = link_to presenter.docker_index_url + "/stars/", target: '_blank' do
        .star-count=presenter.star_count


$('#plan-summary').html("<%= escape_javascript(render :partial => 'capital_projects/capital_plan_summary', :locals => {:highlight_years => [@fiscal_year], :action_path => '/planning'}) %>");
$('#swimlane').html("<%= escape_javascript(render 'swimlane') %>");

Make the index ajax call update the charts


-nature = @document_template.nature.to_sym
-if [:balance_sheet, :income_statement].include?(nature)
  =formalize do |f|
    -f.title Financialyear.human_name
    -f.field Financialyear.human_name, select_tag("financialyear", options_for_select(@current_company.financialyears.collect{|x| [x.code, x.id.to_s]}, params[:financialyear]))
-elsif nature == :journal
  =formalize do |f|
    -f.title Journal.human_name
    -f.field Journal.human_name, select_tag("journal", options_for_select(@current_company.journals.collect{|x| [x.name, x.id.to_s]}, params[:journal]))
-if [:journal, :general_journal, :general_ledger].include?(nature)
  =formalize do |f|
    -f.title :period
    -f.field tg("from"), calendar_field_tag(:started_on, params[:started_on]||(Date.today-1.month))
    -f.field tg("to"),   calendar_field_tag(:stopped_on, params[:stopped_on]||Date.today)

Fix a bug on document printing in accountancy

-nature = (@document_template ? @document_template.nature.to_sym : :unknown)
-if [:balance_sheet, :income_statement].include?(nature)
  =formalize do |f|
    -f.title Financialyear.human_name
    -f.field Financialyear.human_name, select_tag("financialyear", options_for_select(@current_company.financialyears.collect{|x| [x.code, x.id.to_s]}, params[:financialyear]))
-elsif nature == :journal
  =formalize do |f|
    -f.title Journal.human_name
    -f.field Journal.human_name, select_tag("journal", options_for_select(@current_company.journals.collect{|x| [x.name, x.id.to_s]}, params[:journal]))
-if [:journal, :general_journal, :general_ledger].include?(nature)
  =formalize do |f|
    -f.title :period
    -f.field tg("from"), calendar_field_tag(:started_on, params[:started_on]||(Date.today-1.month))
    -f.field tg("to"),   calendar_field_tag(:stopped_on, params[:stopped_on]||Date.today)


- set_meta_tags description: "Search morph.io scrapers and users#{" for ‘" + @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"

Add basic content for <title> on search page

- content_for :title, "Search"
- set_meta_tags description: "Search morph.io scrapers and users#{" for ‘" + @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"


= simple_form_for(@vendor,
  :html => {:class => 'form-vertical' },
  :wrapper => :vertical_form,
  :wrapper_mappings => {:check_boxes => :vertical_radio_and_checkboxes, :radio_buttons => :vertical_radio_and_checkboxes, :file => :vertical_file_input, :boolean => :vertical_boolean}) do |f|

  = f.input :name
  = f.input :address1, :label => "Address 1"
  = f.input :address2, :label => "Address 2"
  .row
    .col-sm-4
      = f.input :city
    .col-sm-4
      = f.input :state, :as => :select, :collection => Country['US'].states
    .col-sm-4
      = f.input :zip

  = f.input :phone, :as => :tel
  = f.input :fax, :as => :tel
  = f.input :url, :as => :url

  = f.button :submit, :class => "btn btn-primary"

:javascript
  $(document).ready(function(){
    transam.make_same_height('.header-part');
  });

Tweak the address layout of the vendor form

= simple_form_for(@vendor,
  :html => {:class => 'form-vertical' },
  :wrapper => :vertical_form,
  :wrapper_mappings => {:check_boxes => :vertical_radio_and_checkboxes, :radio_buttons => :vertical_radio_and_checkboxes, :file => :vertical_file_input, :boolean => :vertical_boolean}) do |f|

  = f.input :name
  = f.input :address1, :label => "Address 1"
  = f.input :address2, :label => "Address 2"
  .row
    .col-sm-7
      = f.input :city
    .col-sm-2
      = f.input :state, :as => :select, :collection => Country['US'].states
    .col-sm-3
      = f.input :zip

  = f.input :phone, :as => :tel
  = f.input :fax, :as => :tel
  = f.input :url, :as => :url

  = f.button :submit, :class => "btn btn-primary"

:javascript
  $(document).ready(function(){
    transam.make_same_height('.header-part');
  });


- if @project
  = back_button project_page_path(@project)

%h2.sub-header
  - if @project
    = t("builds.index.title_with_project", :project_name => @project.name)
  - else
    = t("builds.index.title")

.table-responsive
  %table.table.table-striped.builds
    %thead
      %tr
        %th #
        %th Project
        %th.revision_uid Revision
        %th Branch
        %th.duration Duration
        %th.status{:colspan => 2} Status
    %tbody
      - @builds.each do |build|
        %tr
          %td= @project ? build.number : build.id
          %td= link_to_project build.branch.project
          %td.revision_uid
            = link_to_branch build.branch
            %small
              - if revision = build.revision
                - if revision.tag_uid
                  %span.badge{:title => revision.uid}
                    = "#{revision.tag_uid}"
                -else
                  = "(#{revision.uid})"

          %td
          %td.duration
            - if build.finished_at
              = build.finished_at - build.started_at
              seconds
            - elsif build.started_at
              %span{"data-increment-every-second" => true}
                = (Time.now - build.started_at).to_i
              seconds ago
          %td.status{:class => build_css_class(build)}
            = build_status_icon(build)
          %td.trigger
            = build_trigger_icon(build)

Remove revision column from builds partial

- if @project
  = back_button project_page_path(@project)

%h2.sub-header
  - if @project
    = t("builds.index.title_with_project", :project_name => @project.name)
  - else
    = t("builds.index.title")

.table-responsive
  %table.table.table-striped.builds
    %thead
      %tr
        %th #
        %th Project
        %th Branch
        %th.duration Duration
        %th.status{:colspan => 2} Status
    %tbody
      - @builds.each do |build|
        %tr
          %td= @project ? build.number : build.id
          %td= link_to_project build.branch.project
          %td.revision_uid
            = link_to_branch build.branch
            %small
              - if revision = build.revision
                - if revision.tag_uid
                  %span.badge{:title => revision.uid}
                    = "#{revision.tag_uid}"
                -else
                  = "(#{revision.uid})"
          %td.duration
            - if build.finished_at
              = (build.finished_at - build.started_at).to_i
              seconds
            - elsif build.started_at
              %span{"data-increment-every-second" => true}
                = (Time.now - build.started_at).to_i
              seconds ago
          %td.status{:class => build_css_class(build)}
            = build_status_icon(build)
          %td.trigger
            = build_trigger_icon(build)


.instance-panel
  .container
    .col-md-12{:class => "text-center"}
      %h1= t(:schema_directory)
      .form-group.col-md-8.container-form
        = form_tag(search_schemas_path, method: "get") do
          .inner-addon.left-addon
            %i.glyphicon.glyphicon-search
            %input#search-schema.form-control{:placeholder => t(:enter_schema_name), :type => "text", :name => "text_search"}/
.container
  .row
    .col-md-2.sidebar
      %h3.col-title=SchemaCategory.model_name.human(count: 2)
      %ul#categories-list.list-categories
        - @categories.with_schemas.each do |category|
          %li
            %a{data: {category: category.id}}
              = category.name

    .col-md-10.schema-wrapper
      .schema-box-container
        - @schemas.each do |schema|
          .box-schema.active{data: {categories:schema.schema_category_ids.join(' ')}}
            .title
              = link_to [schema, schema.last_version] do
                = truncate(schema.name, :length => 50)
            .body
              %span
                -#{t(:description)}:
              = truncate(schema.description, :length => 183)

Add no description message to schema index

.instance-panel
  .container
    .col-md-12{:class => "text-center"}
      %h1= t(:schema_directory)
      .form-group.col-md-8.container-form
        = form_tag(search_schemas_path, method: "get") do
          .inner-addon.left-addon
            %i.glyphicon.glyphicon-search
            %input#search-schema.form-control{:placeholder => t(:enter_schema_name), :type => "text", :name => "text_search"}/
.container
  .row
    .col-md-2.sidebar
      %h3.col-title=SchemaCategory.model_name.human(count: 2)
      %ul#categories-list.list-categories
        - @categories.with_schemas.each do |category|
          %li
            %a{data: {category: category.id}}
              = category.name

    .col-md-10.schema-wrapper
      .schema-box-container
        - @schemas.each do |schema|
          .box-schema.active{data: {categories:schema.schema_category_ids.join(' ')}}
            .title
              = link_to [schema, schema.last_version] do
                = truncate(schema.name, :length => 50)
            .body
              %span
                -#{t(:description)}:
              = schema.description.present? ? truncate(schema.description, :length => 183) : t(:no_description)


%p
  %strong
    SmartGraphs
%p
  The SmartGraphs project, funded by the National Science Foundation, studies the educational
  value of “SmartGraphs,” digital objects that “know” about themselves and that provide scaffolding
  to students to help them learn about graphs and the concepts conveyed in graphs. The project plans
  to create digital SmartGraphs that can be authored or customized by teachers and accept inputs
  from students’ responses, sketches, functions, models, and probes. The software analyzes the graphs
  for the kinds of features that experts recognize and then engages students in conversations that
  instruct and assess. The project goal is to develop SmartGraphs, document their effectiveness through
  rigorous research, and scale up so this technology becomes widely available.
%p
  This project is funded by the National Science Foundation (Grant No. DRL-0918522).
  Any opinions, findings, and conclusions or recommendations expressed in this
  material are those of the author(s) and do not necessarily reflect
  the views of the National Science Foundation.

Add a link to Juan's Morning Jog to the project info partial.

%p
  %strong
    SmartGraphs
%p
  The SmartGraphs project, funded by the National Science Foundation, studies the educational
  value of “SmartGraphs,” digital objects that “know” about themselves and that provide scaffolding
  to students to help them learn about graphs and the concepts conveyed in graphs. The project plans
  to create digital SmartGraphs that can be authored or customized by teachers and accept inputs
  from students’ responses, sketches, functions, models, and probes. The software analyzes the graphs
  for the kinds of features that experts recognize and then engages students in conversations that
  instruct and assess. The project goal is to develop SmartGraphs, document their effectiveness through
  rigorous research, and scale up so this technology becomes widely available.
%p
  This project is funded by the National Science Foundation (Grant No. DRL-0918522).
  Any opinions, findings, and conclusions or recommendations expressed in this
  material are those of the author(s) and do not necessarily reflect
  the views of the National Science Foundation.
%h5
  Example Activity
%p
  If you'd like to try an example activity, check out
  %a{:href => "http://saildataservice.concord.org/2/offering/9462/jnlp/540/view?sailotrunk.otmlurl=http://otrunk.concord.org/examples/SmartGraph/juans-morning-jog.otml&sailotrunk.hidetree=false"}
    Juan's Morning Jog
  %span{:style => "font-size:0.85em;"}
    (size: 28 MB)
%p
  The example requires Java 5 (also referred to as 1.5) or later in order to run.
  %b
    Note:
  If you're using Mac OS X 10.4 or 10.5, you'll need to run our
  %a{:href => "http://jnlp.concord.org/dev/org/concord/maven-jnlp/web-start-fix/web-start-fix.jnlp"}
    Java WebStart Fix
  as well.


= title _('Your response to: %s' % @assignment.title)
= head_embed javascript_include_tag('jquery_ujs')

.row#response
  .seven.columns

    = @response.content.html_safe

    - unless @response.answers.blank?
      - @response.answers.each_with_index do |question, question_id|
        = render(:partial => "quiz_#{question['type']}", :locals => {:question => question, :question_id => question_id, :show_results => true})

    - if can?(:destroy, @response)
      %p
        = link_to(_('Delete'), lecture_assignment_response_path, :method => :delete, :class => 'button radius small response-delete')

  = render(:partial => 'sidebar_show')

Update response delete button css ids.

= title _('Your response to: %s' % @assignment.title)
= head_embed javascript_include_tag('jquery_ujs')

.row#response
  .seven.columns

    = @response.content.html_safe

    - unless @response.answers.blank?
      - @response.answers.each_with_index do |question, question_id|
        = render(:partial => "quiz_#{question['type']}", :locals => {:question => question, :question_id => question_id, :show_results => true})

    - if can?(:destroy, @response)
      %p
        = link_to(_('Delete'), lecture_assignment_response_path, :method => :delete, :class => 'button radius small', :id =>'response-delete')

  = render(:partial => 'sidebar_show')


.thread-event.thread-comment{ng_controller: 'NewCommentItemController'}
  .thread-event-header.media
    .pull-left{ng-include: "'generated/templates/user/avatar.html'", ng-init: 'user = comment.author()'}
    .media-body
      %strong {{comment.authorName()}}
  .thread-event-body{btf-markdown: 'comment.body' }
    -#{{ comment.body }}

  .thread-event-footer
    .thread-actions-and-meta
      %a{translate: 'common.action.like', ng-show: '!currentUserLikesIt()', href: '#', ng_click: 'like()'}>
      %a{translate: 'common.action.unlike', href: '#', ng_click: 'unlike()', ng-show: 'currentUserLikesIt()'}>
      ·
      %a{translate: 'common.action.reply', href: '#', ng_click: 'reply()'}>
      ·
      %timeago{timestamp: 'comment.createdAt' }>

    .thread-attachments
      .thread-attachment{ng-repeat: 'attachment in comment.attachments()'}
        %a{ng-href: '{{attachment.location}}', target: '_blank'}
          {{ attachment.filename }}

    .thread-liked-by-sentence{ng_show: 'anybodyLikesIt()'}
      {{ likedBySentence }}

Move attachments above like/reply line

.thread-event.thread-comment{ng_controller: 'NewCommentItemController'}
  .thread-event-header.media
    .pull-left{ng-include: "'generated/templates/user/avatar.html'", ng-init: 'user = comment.author()'}
    .media-body
      %strong {{comment.authorName()}}
  .thread-event-body{btf-markdown: 'comment.body' }

  .thread-attachments
    .thread-attachment{ng-repeat: 'attachment in comment.attachments()'}
      %a{ng-href: '{{attachment.location}}', target: '_blank'}
        {{ attachment.filename }}

  .thread-event-footer
    .thread-actions-and-meta
      %a{translate: 'common.action.like', ng-show: '!currentUserLikesIt()', href: '#', ng_click: 'like()'}>
      %a{translate: 'common.action.unlike', href: '#', ng_click: 'unlike()', ng-show: 'currentUserLikesIt()'}>
      ·
      %a{translate: 'common.action.reply', href: '#', ng_click: 'reply()'}>
      ·
      %timeago{timestamp: 'comment.createdAt' }>

    .thread-liked-by-sentence{ng_show: 'anybodyLikesIt()'}
      {{ likedBySentence }}


.row.bar
  .large-12.columns
    %a.root{ href: "#{root_url}"}
      Jobs
      %small that
      MakeSense

  .large-12.columns
    = link_to "Post a Job", new_job_path, class: "button radius right", "data-no-turbolink" => "true"
  %hr

Disable 'Post a Job' for maintenance

.row.bar
  .large-12.columns
    %a.root{ href: "#{root_url}"}
      Jobs
      %small that
      MakeSense

  .large-12.columns
    = link_to "Post a Job", '#', class: "button radius right disabled", "data-no-turbolink" => "true"
  %hr


#body_content.clearfix
  #body_content_left.clearfix
    = @page[:body].html_safe
    - if @page[:spotlight_top]
      .spotlight.top
        = @page[:spotlight_top]
    - if @page[:spotlight_left]
      .spotlight.left
        = @page[:spotlight_left]
    - if @page[:spotlight_right]
      .spotlight.right
        = @page[:spotlight_right]
  #body_content_right.clearfix
    %h3 Upcoming Shows
    %ul.sidebar_events
      - Shovelpunks::Events.upcoming.each do |event|
        %li
          %a{:href=>"##{event.id}", :rel=>'facebox'}
            %b= event.title
            »
            = short_date event
          %span.description{:id=>event.id, :style=>'display:none'}
            = event.description
            %a{:href=>event.url, :title=>"Tickets for #{event.title}"} Buy Tix →
    %hr{:style=>'margin-top:30px'}
    - if @page[:side_body]
      .side_body= @page[:side_body]

Add mag theatre to home page

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


- content_for :javascript do
  != map_javascript_include_tags
- cache do
  #map-col
    #map
    :javascript
      var areaStops = #{location_stops_js([@route])}
      jQuery(document).ready(function(){
         area_init();
      });
    .extra-info
      %ul.stops
        Stops:
        - @route.stops.sort_by(&:name).each do |stop|
          %li= link_to stop.full_name, stop_url(stop.locality, stop)
  .route
    %h3.name= @route.name
    .details
      %span.locality= "#{@route.area}."
      .operators
        - if !@route.operators.empty?
          Operated by
          %ul
            - @route.operators.each do |operator|
              %li= operator.name
    .terminuses
      != terminus_text(@route)
= render :partial => 'shared/location_stories', :locals => {:location => @route}

Reduce size of terminus text


- if @space && @space.id != nil
  - member_or_superuser = (current_user && (@space.users.include?(current_user) || current_user.superuser?))
  - if @space.public? || member_or_superuser
    = content_for :page_menu do
      %ul
        %li= link_to t('home.one').capitalize, space_path(@space), spaces_menu_select_if(:home)
        %li= link_to t('webconference.one').capitalize, space_webconference_path(@space), spaces_menu_select_if(:webconference)
        %li= link_to t('post.wall').capitalize, space_posts_path(@space), spaces_menu_select_if(:posts)
        %li= link_to t('event.other').capitalize, space_events_path(@space), spaces_menu_select_if(:events)
        %li= link_to t('people').capitalize, space_users_path(@space), spaces_menu_select_if(:users)
        - if @space.repository?
          %li= link_to t('repository.one').capitalize, space_attachments_path(@space), spaces_menu_select_if(:repository)
        - if user_signed_in?
          - if @space.role_for?(current_user, :name => 'Admin') || current_user.superuser?
            %li= link_to t('admin.one').capitalize, edit_space_path(@space), spaces_menu_select_if(:admin, :class => "admin danger-text")

Fix selection of items in a space's menu

- if @space && @space.id != nil
  - member_or_superuser = (current_user && (@space.users.include?(current_user) || current_user.superuser?))
  - if @space.public? || member_or_superuser
    = content_for :page_menu do
      %ul
        %li{ spaces_menu_select_if(:home) }
          = link_to t('home.one').capitalize, space_path(@space)
        %li{ spaces_menu_select_if(:webconference) }
          = link_to t('webconference.one').capitalize, space_webconference_path(@space)
        %li{ spaces_menu_select_if(:posts) }
          = link_to t('post.wall').capitalize, space_posts_path(@space)
        %li{ spaces_menu_select_if(:events) }
          = link_to t('event.other').capitalize, space_events_path(@space)
        %li{ spaces_menu_select_if(:users) }
          = link_to t('people').capitalize, space_users_path(@space)
        - if @space.repository?
          %li{ spaces_menu_select_if(:repository) }
            = link_to t('repository.one').capitalize, space_attachments_path(@space)
        - if user_signed_in?
          - if @space.role_for?(current_user, :name => 'Admin') || current_user.superuser?
            %li{ spaces_menu_select_if(:admin, :class => "admin danger-text") }
              = link_to t('admin.one').capitalize, edit_space_path(@space)


- if entry.present? && attribute.class.exists?(entry)
  = link_to "##{ entry }",
    edit_polymorphic_path(attribute.class.find_by(id: entry))
- else
  = "##{ entry }"

Fix belongs_to partial for list

- if entry.present?
  - if attribute.class.exists?(entry)
    = link_to "##{ entry }", edit_polymorphic_path(attribute.class.find_by(id: entry))
  - else
    = "##{ entry }"


- if @committee_member.new_record?
  - url = editor_committee_committee_members_path(@committee)
  - method = :post
- else
  - url = editor_committee_committee_member_path(@committee, @committee_member)
  - method = :patch

= form_for @committee_member, url: url, method: method, html: { class: 'form-horizontal' } do |f|
  - if @committee_member.errors.any?
    .bs-callout.bs-callout-danger
      %h4
        = pluralize @committee_member.errors.count, 'error'
        prohibited this committee member from being saved

      %ul
        - @committee_member.errors.full_messages.each do |msg|
          %li= msg

  .form-group
    = f.label :member_id, nil, class: 'col-md-2 control-label'
    .col-md-10
      = f.select :member_id, Member.current.collect { |m| [m.name, m.id] }, { include_blank: true }, class: 'form-control'

  .form-group
    .col-md-10.col-md-offset-2
      = f.submit nil, class: 'btn btn-primary'
      = link_to 'cancel', url, class: ''

Use reverse name when adding committee members

- if @committee_member.new_record?
  - url = editor_committee_committee_members_path(@committee)
  - method = :post
- else
  - url = editor_committee_committee_member_path(@committee, @committee_member)
  - method = :patch

= form_for @committee_member, url: url, method: method, html: { class: 'form-horizontal' } do |f|
  - if @committee_member.errors.any?
    .bs-callout.bs-callout-danger
      %h4
        = pluralize @committee_member.errors.count, 'error'
        prohibited this committee member from being saved

      %ul
        - @committee_member.errors.full_messages.each do |msg|
          %li= msg

  .form-group
    = f.label :member_id, nil, class: 'col-md-2 control-label'
    .col-md-10
      = f.select :member_id, Member.current.order(:last_name, :first_name).collect { |m| [m.name_reverse, m.id] }, { include_blank: true }, class: 'form-control'

  .form-group
    .col-md-10.col-md-offset-2
      = f.submit nil, class: 'btn btn-primary'
      = link_to 'cancel', url, class: ''


%ul.breadcrumb
  %li
    %i.icon-angle-right
    = link_to project_tree_path(@project, @ref) do
      = @project.path
  - tree_breadcrumbs(@tree, 6) do |title, path|
    \/
    %li
      - if path
        = link_to truncate(title, length: 40), project_tree_path(@project, path)
      - else
        = link_to title, '#'

%div#tree-content-holder.tree-content-holder
  .file_holder
    .file_title
      %i.icon-file
      %span.file_name
        = blob.name
        %small= number_to_human_size blob.size
      %span.options= render "actions"
    - if blob.text?
      = render "text", blob: blob
    - elsif blob.image?
      = render "image", blob: blob
    - else
      = render "download", blob: blob

Fix last tree breadcrumbs for blob

%ul.breadcrumb
  %li
    %i.icon-angle-right
    = link_to project_tree_path(@project, @ref) do
      = @project.path
  - tree_breadcrumbs(@tree, 6) do |title, path|
    \/
    %li
      - if path
        - if path.end_with?(@path)
          = link_to project_blob_path(@project, path) do
            %span.cblue
              = truncate(title, length: 40)
        - else
          = link_to truncate(title, length: 40), project_tree_path(@project, path)
      - else
        = link_to title, '#'

%div#tree-content-holder.tree-content-holder
  .file_holder
    .file_title
      %i.icon-file
      %span.file_name
        = blob.name
        %small= number_to_human_size blob.size
      %span.options= render "actions"
    - if blob.text?
      = render "text", blob: blob
    - elsif blob.image?
      = render "image", blob: blob
    - else
      = render "download", blob: blob


= semantic_form_for @activity do |f| #when:date from:datetime to:datetime person_id:integer project_id:integer comment:string
  = f.inputs do
    = f.input :person
    = f.input :project
  = f.inputs do
    = f.input :when, :as => :date_field
    = f.input :from, :as => :hour_field
    = f.input :to, :as => :hour_field
    = f.input :hours
    = f.input :minutes
  = f.inputs do
    = f.input :comment
  = f.buttons do
    = f.commit_button

Set when field as required.

= semantic_form_for @activity do |f| #when:date from:datetime to:datetime person_id:integer project_id:integer comment:string
  = f.inputs do
    = f.input :person
    = f.input :project
  = f.inputs do
    = f.input :when, :as => :date_field, :required => true
    = f.input :from, :as => :hour_field
    = f.input :to, :as => :hour_field
    = f.input :hours
    = f.input :minutes
  = f.inputs do
    = f.input :comment
  = f.buttons do
    = f.commit_button


%p#notice= notice

%p
  %b Name:
  = @newsletter.name
%p
  %b Url:
  = @newsletter.url
%p
  %b Description:
  = @newsletter.description
%p
  %b Source:
  = image_tag attachment_url(@newsletter, :featured_image, :fill, 300, 300, format: "jpg")
%p
  %b Tags:
  = raw @newsletter.tag_list.map { |t| link_to t, tag_path(t) }.join(', ')

%p
  = image_tag @newsletter.image_url

= link_to 'Edit', edit_newsletter_path(@newsletter)
\|
= link_to 'Back', newsletters_path

Save it in more places

%p#notice= notice

%p
  %b Name:
  = @newsletter.name
%p
  %b Url:
  = @newsletter.url
%p
  %b Description:
  = @newsletter.description
%p
  %b Source:
  = image_tag attachment_url(@newsletter, :featured_image, :fill, 300, 300, format: "jpg")
%p
  %b Tags:
  = raw @newsletter.tag_list.map { |t| link_to t, tag_path(t), class: 'tag label label-info' }.join(' ')

%p
  = image_tag @newsletter.image_url

= link_to 'Edit', edit_newsletter_path(@newsletter)
\|
= link_to 'Back', newsletters_path


%section#about
  .container
    .row
      .col-lg-12.text-center
        %h2.section-heading Ruby Belgium
        %h3.section-subheading.text-muted The Association.
        %p.text-left
          The Association aims at promoting the programming language
          Ruby and supporting the Belgian Ruby community.
          In that way, the Association organizes and supports events
          gathering Ruby developers and promoting Ruby. It works in
          Belgium for education, jobs, and spread of Ruby.
        %p.text-left
          The association is more about the people than the technology.

Increase font size in about section

%section#about
  .container
    .row
      .col-lg-12.text-center
        %h2.section-heading Ruby Belgium
        %h3.section-subheading.text-muted The Association.
        %p.lead.text-left
          The Association aims at promoting the programming language
          Ruby and supporting the Belgian Ruby community.
          In that way, the Association organizes and supports events
          gathering Ruby developers and promoting Ruby. It works in
          Belgium for education, jobs, and spread of Ruby.
        %p.lead.text-left
          The association is more about the people than the technology.


- if current_user
  %h4
    Servers available
    (#{I18n.l(Time.current, :format => :time_without_seconds)} - #{I18n.l(1.hour.from_now, :format => :time_without_seconds)})
  - available_server_count = ServerForUserFinder.new(current_user, Time.current, 1.hour.from_now).servers.size
  .row
    .col-md-6
      %h5 For you
      = "#{available_server_count} / #{Server.active.count}"
    - if !current_user.donator?
      .col-md-6
        %h5 Premium
        = "#{Server.for_donators.active.count - used_donator_server_count} / #{Server.for_donators.active.count}"

- else
  %h4 Servers in use
  .row
    .col-md-6
      %h5 Everyone
      = "#{used_free_server_count} / #{Server.active.without_group.count}"
      servers
    .col-md-6
      %h5 Premium
      = "#{used_donator_server_count} / #{Server.for_donators.active.count}"
      servers

Clean up this view a little

- without_group_count = Server.active.without_group.count
- for_donators_count = Server.for_donators.active.count
- if current_user
  %h4
    Servers available
    (#{I18n.l(Time.current, :format => :time_without_seconds)} - #{I18n.l(1.hour.from_now, :format => :time_without_seconds)})
  - available_server_count = ServerForUserFinder.new(current_user, Time.current, 1.hour.from_now).servers.size
  .row
    - if current_user.donator?
      .col-md-6
        %h5 For you
        = "#{available_server_count} / #{Server.active.count}"
    - else
      .col-md-6
        %h5 For you
        = "#{available_server_count} / #{without_group_count}"
      .col-md-6
        %h5 Premium
        = "#{for_donators_count - used_donator_server_count} / #{for_donators_count}"

- else
  %h4 Servers in use
  .row
    .col-md-6
      %h5 Everyone
      = "#{used_free_server_count} / #{without_group_count}"
      servers
    .col-md-6
      %h5 Premium
      = "#{used_donator_server_count} / #{for_donators_count}"
      servers


- content_for :title do
  Tag use in Gerrit over past #{pluralize @days, 'day'}
  %small
    %span{day_links}

%section{ data: { view: 'Tags', authors: h(@authors.to_json) } }
  %h2 Global tag use
  #global-used= haml :'shared/progress'

  %h2 Per-author tag use
  - @authors.each do |author|
    %h3&= author
    %ul.nav.nav-tabs{ data: { tabs: 'tabs' } }
      %li.active
        %a{ href: "##{name_to_id author}-used", data: { toggle: 'tab' } } Used
      %li
        %a{ href: "##{name_to_id author}-received", data: { toggle: 'tab' } } Received

    .tab-content
      .tab-pane.active{ id: "#{name_to_id author}-used" }
      .tab-pane{ id: "#{name_to_id author}-received" }

Hide word cloud panes if they wouldn't have any content in them

- content_for :title do
  Tag use in Gerrit over past #{pluralize @days, 'day'}
  %small
    %span{day_links}

%section{ data: { view: 'Tags', authors: h(@authors.to_json) } }
  %h2 Global tag use
  #global-used= haml :'shared/progress'

  %h2 Per-author tag use
  - @authors.each do |author|
    %h3&= author
    %ul.nav.nav-tabs{ data: { tabs: 'tabs' } }
      - if @stats[:from][author].any?
        %li.active
          %a{ href: "##{name_to_id author}-used", data: { toggle: 'tab' } } Used
      - if @stats[:to][author].any?
        %li{ class: ('active' unless @stats[:from][author].any?) }
          %a{ href: "##{name_to_id author}-received", data: { toggle: 'tab' } } Received

    .tab-content
      - if @stats[:from][author].any?
        .tab-pane.active{ id: "#{name_to_id author}-used" }
      - if @stats[:to][author].any?
        .tab-pane{ class: ('active' unless @stats[:from][author].any?), id: "#{name_to_id author}-received" }


= render partial: 'headline'

- if session[:ab_section_count] == 1
	= render partial: 'drafts',
		locals: {title: "Toimenpide- ja Lakiehdotukset sekä Luonnokset", section: "proposal_and_draft",
				 items: @proposals_and_drafts, items_counts: @proposal_and_drafts_counts, item_counter: 0 }
- else # session[:ab_section_count] == 2
	= render partial: 'drafts',
		locals: {title: "Toimenpide- ja Lakiehdotukset", items: @proposals, items_counts: @proposals_counts, item_counter: 0, section: "proposal" }
	= render partial: 'drafts',
		locals: {title: "Luonnokset", items: @drafts, items_counts: @drafts_counts, item_counter: 3,  section: "draft" }

= render partial: 'ideas'
= render partial: 'news'
= render partial: 'newsletter'

Fix wrong variable passed to drafts partial

= render partial: 'headline'

- if session[:ab_section_count] == 1
	= render partial: 'drafts',
		locals: {title: "Toimenpide- ja Lakiehdotukset sekä Luonnokset", section: "proposal_and_draft",
				 items: @proposals_and_drafts, items_counts: @proposal_and_drafts_counts, item_counter: 0 }
- else # session[:ab_section_count] == 2
	= render partial: 'drafts',
		locals: {title: "Toimenpide- ja Lakiehdotukset", items: @proposals, items_counts: @proposals_counts, item_counter: 0, section: "proposal" }
	= render partial: 'drafts',
		locals: {title: "Luonnokset", items: @drafts, items_counts: @draft_counts, item_counter: 3,  section: "draft" }

= render partial: 'ideas'
= render partial: 'news'
= render partial: 'newsletter'


= simple_form_for @booking, :url => select_bookings_path do |f|
  = hidden_field_tag :stage, 'select'
  = f.input :title, :input_html => {'data-autofocus' => true}
  = f.input :value_date, :as => :date_field, :input_html => {:size => 10, :style => 'text-align: right'}
  = f.button :submit

Use proper bootstrap markup for bookings/new_form.

= simple_form_for @booking, :url => select_bookings_path do |f|
  = hidden_field_tag :stage, 'select'
  .row-fluid
    .span8= f.input :title, :input_html => {'data-autofocus' => true}
    .span4= f.input :value_date, :as => :date_field, :input_html => {:size => 10, :style => 'text-align: right'}

  .form-actions
    = f.button :submit


= semantic_form_for @booking do |f|
  = f.semantic_errors
  = f.inputs do
    = f.input :value_date
    = f.input :amount, :input_html => {:size => 12, :style => 'text-align: right'}
    = f.input :title
    = f.input :credit_account
    = f.input :debit_account
    = f.input :comments, :input_html => {:rows => 5}
  = f.buttons do
    = f.commit_button

Use date_field in bookings form.

= semantic_form_for @booking do |f|
  = f.semantic_errors
  = f.inputs do
    = f.input :value_date, :as => :date_field, :input_html => {:size => 10, :style => 'text-align: right'}
    = f.input :amount, :input_html => {:size => 12, :style => 'text-align: right'}
    = f.input :title
    = f.input :credit_account
    = f.input :debit_account
    = f.input :comments, :input_html => {:rows => 5}
  = f.buttons do
    = f.commit_button