- mask=@journal.facility.journal_mask
%JRNL_HDR_IMP
  %BUSINESS_UNIT== NWUNV
  %JOURNAL_ID== NEXT
  %JOURNAL_DATE= @journal.journal_date.strftime("%Y%m%d")
  %DESCR254=h "#{mask}: Journal ##{ @journal.id}, Created By: #{User.find(@journal.created_by).username}"
  %LEDGER_GROUP== ACTUALS
  %SOURCE== RSC
  %OPRID== GLBATCH
  - @journal_rows.each_with_index do |row, i|
    %JRNL_LN_IMP
      %JOURNAL_LINE= i+1
      %BUSINESS_UNIT== NWUNV
      %LEDGER== ACTUALS
      %ACCOUNT= row.account
      %FOREIGN_AMOUNT= number_to_currency row.amount, :delimiter => '', :unit => ''
      - line_desc="#{mask}:#{row.description}"
      - line_desc="#{mask}:#{row.order_detail.to_s}:#{row.order_detail.product.name}" if row.order_detail
      - line_desc=line_desc[0..29] if line_desc.size > 30
      %LINE_DESCR=h line_desc
      %FUND_CODE= row.fund
      %DEPTID= row.dept
      - if row.project
        %PROJECT_ID= row.project # optional
      - if row.program
        %PROGRAM_CODE= row.program # optional
      - if row.activity
        %ACTIVITY_ID= row.activity # optional
      - if row.reference
        %JRNL_LN_REF= row.reference #optional
  %NU_JRNL_TRL_IMP
    %RECORD_COUNT= @journal_rows.length
    %TOTAL_CREDITS= number_to_currency @journal_rows.inject(0) { |sum,row| sum += (row.amount < 0 ? row.amount : 0) }, :delimiter => '', :unit => '' # negative number
    %TOTAL_DEBITS= number_to_currency @journal_rows.inject(0) { |sum,row| sum += (row.amount > 0 ? row.amount : 0) }, :delimiter => '', :unit => '' # positive number

Create generic journal XML output.

%journal{id: @journal.id}
  %date= @journal.journal_date.strftime("%Y%m%d")
  %description= "Journal ##{@journal.id}, Created By: #{@journal.created_by_user.username}"
  - @journal_rows.each_with_index do |row, i|
    %journal_row
      %journal_line= i + 1
      %account= row.account
      %amount= number_to_currency row.amount, :delimiter => '', :unit => ''

  %totals
    %record_count= @journal_rows.length
    %total_credits= number_to_currency @journal_rows.inject(0) { |sum,row| sum += (row.amount < 0 ? row.amount : 0) }, :delimiter => '', :unit => '' # negative number
    %TOTAL_DEBITS= number_to_currency @journal_rows.inject(0) { |sum,row| sum += (row.amount > 0 ? row.amount : 0) }, :delimiter => '', :unit => '' # positive number


%p#notice
%h1 SchemaVersion
%table
  %thead
    %tr
      %th Schema ID
      %th Version
      %th Spec
      %th{:colspan => "3"}
  %tbody
    - @schema_versions.each do |schema_version|
      %tr
        %td= schema_version.schema_id
        %td= schema_version.version_number
        %td= schema_version.spec
        %td= link_to 'Ver', [@schema,schema_version]
%br
  = link_to 'New Version', new_schema_schema_version_path

Add Info of Schema Versions to the index view

%p#notice
%h1= @schema.name
%h2= @schema.schema_category.name
%table
  %thead
    %tr
      %th Fecha
      %th Version
      %th{:colspan => "3"}
  %tbody
    - @schema_versions.each do |schema_version|
      %tr
        %td= schema_version.created_at
        %td= schema_version.version_number
        %td= link_to 'Ver', [@schema,schema_version]


.alert-cta
  %h6
    %a{href: "/register", target: "_blank"}
      = t '.selling_on_ofn'

      %strong
        = t '.register'
        %i.ofn-i_054-point-right

Add comment to explain hard-coded link

.alert-cta
  %h6
    -# Please forgive the hard-coded link:
       The more elegant 'registration_path' resolves to /signup due to spree_auth_device > config > routes.rb
       This is one of several possible fixes. Long-term, we'd like to bring the accounts page into OFN.
       View the discussion here: https://github.com/openfoodfoundation/openfoodnetwork/pull/3174
    %a{href: "/register", target: "_blank"}
      = t '.selling_on_ofn'

      %strong
        = t '.register'
        %i.ofn-i_054-point-right


%div
  = markdown(@note.note, pipeline: :email)

Make sure notify email always has author info.

%div
  "#{link_to @note.author_name, user_url(@note.author)} wrote:"
%div
  = markdown(@note.note, pipeline: :email)


- publicish_project_count = ProjectsFinder.new(current_user: current_user).execute.count
.blank-state.blank-state-welcome
  %h2.blank-state-welcome-title
    Welcome to GitLab
  %p.blank-state-text
    Code, test, and deploy together

- if current_user.can_create_group?
  .blank-state
    .blank-state-icon
      = custom_icon("group", size: 50)
    %h3.blank-state-title
      You can create a group for several dependent projects.
    %p.blank-state-text
      Groups are the best way to manage projects and members.
    = link_to new_group_path, class: "btn btn-new" do
      New group

.blank-state
  .blank-state-icon
    = custom_icon("project", size: 50)
  %h3.blank-state-title
    You don't have access to any projects right now
  %p.blank-state-text
    - if current_user.can_create_project?
      You can create up to
      %strong= number_with_delimiter(current_user.projects_limit)
      = succeed "." do
        = "project".pluralize(current_user.projects_limit)
    - else
      If you are added to a project, it will be displayed here.
  - if current_user.can_create_project?
    = link_to new_project_path, class: "btn btn-new" do
      New project

- if publicish_project_count > 0
  .blank-state
    .blank-state-icon
      = icon("globe")
    %h3.blank-state-title
      There are
      = number_with_delimiter(publicish_project_count)
      public projects on this server.
    %p.blank-state-text
      Public projects are an easy way to allow everyone to have read-only access.
    = link_to trending_explore_projects_path, class: "btn btn-new" do
      Browse projects

Move welcome pages to individual partials

.row.blank-state-parent-container
  .col-md-6.section-container
    .section-body.section-welcome
      .blank-state.blank-state-welcome
        %h2.blank-state-welcome-title
          Welcome to GitLab
        %p.blank-state-text
          Code, test, and deploy together
      - if current_user.admin?
        = render "blank_state_admin_welcome"
      - else
        = render "blank_state_welcome"


#dashboard_popup{class: @constraint.key}
  %h2
    - if @constraint.output_element
      = t("output_elements.#{@constraint.output_element.key}").html_safe
    - else
      = t("constraints.#{@constraint.key}.title").html_safe

    - if @constraint.output_element_id
      %span.popup-actions
        %a.chart_format.tooltip.button{href: "#", title: t('output_elements.tooltips.chart')}
          Chart view
        %a.table_format.tooltip.button{href: "#", title: t('output_elements.tooltips.table')}
          Table view

  - if @constraint.description
    .description= @constraint.description.try :short_content

  - if @constraint.output_element_id
    #charts
      .chart{:'data-chart_id' => @constraint.output_element_id }

  = render partial: @constraint.key rescue nil

  = render 'output_elements/chart_template'
  :javascript
    #{render 'js_init.js'}

Update table and chart view button

#dashboard_popup{class: @constraint.key}
  %h2
    - if @constraint.output_element
      = t("output_elements.#{@constraint.output_element.key}").html_safe
    - else
      = t("constraints.#{@constraint.key}.title").html_safe

    - if @constraint.output_element_id
      %span.popup-actions
        %a.chart_format.tooltip.button{href: "#", title: t('output_elements.tooltips.chart')}
          %span.fa.fa-bar-chart-o
          Chart View
        %a.table_format.tooltip.button{href: "#", title: t('output_elements.tooltips.table')}
          %span.fa.fa-table
          Table View

  - if @constraint.description
    .description= @constraint.description.try :short_content

  - if @constraint.output_element_id
    #charts
      .chart{:'data-chart_id' => @constraint.output_element_id }

  = render partial: @constraint.key rescue nil

  = render 'output_elements/chart_template'
  :javascript
    #{render 'js_init.js'}


%tr
  %th= t_attr :date, Booking
  %th= t_attr :text, Booking
  %th= t_attr :reference, Booking
  %th.currency= t_attr :credit_account, Booking
  %th.currency= t_attr :debit_account, Booking
  %th.currency= t_attr :balance, Booking
  %th.action-links

Mark booking list as having 3 action icons.

%tr
  %th= t_attr :date, Booking
  %th= t_attr :text, Booking
  %th= t_attr :reference, Booking
  %th.currency= t_attr :credit_account, Booking
  %th.currency= t_attr :debit_account, Booking
  %th.currency= t_attr :balance, Booking
  %th.action-links.count-3


= semantic_form_for @tenant do |f|
  = f.semantic_errors
  = f.inputs do
    = f.input :users

    - f.object.build_company unless f.object.company
    = f.inputs t('form.company.address') do
      = f.semantic_fields_for :company do |p|
        = render 'vcards/form', :f => p

  = f.inputs t('form.company.book_keeping') do
    = f.input :incorporated_on, :as => :date_field
    = f.input :fiscal_year_ends_on, :as => :date_field
    = f.input :vat_number

  = f.buttons do
    = f.commit_button

Fix Label overlap in Tenant view.


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

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

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

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

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

Fix bug in indexes UI: revert to working version

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

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

    .col-md-4
      %h4 Expand the Network
      %p Here you can add new Machines to the list.
      - if current_or_null_user.can_create?(Machine)
        = link_to new_machine_path, class: "btn btn-success" do
          = fa_icon "plus", text: t("views.labs.index.add_a_machine", default: "New Machine")

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

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


- page.page_elements.each do |element|
  %div{ :id => dom_id_for(element.embeddable, :item), :class => style_for_item(element) }
    = render_show_partial_for(element.embeddable)

Comment on pre-existing bug w/copied Investigations

- page.page_elements.each do |element|
  = # FIXME if you copy an investigation and then visit Sections#show (i.e., click on one of its sections), several
  = # page_elements will have element.embeddable.nil? == true and therefore render_show_partial will attempt to render
  = # the (nonexistent) 'nil_show' partial
  %div{ :id => dom_id_for(element.embeddable, :item), :class => style_for_item(element) }
    = render_show_partial_for(element.embeddable)


%ul.nav.nav-tabs
  %li= render partial: 'shared/ref_switcher', locals: {destination: 'commits'}

  = nav_link(controller: [:commit, :commits]) do
    = link_to 'Commits', project_commits_path(@project, @repository.root_ref)
  = nav_link(controller: :compare) do
    = link_to 'Compare', project_compare_index_path(@project)

  = nav_link(html_options: {class: branches_tab_class}) do
    = link_to recent_project_branches_path(@project) do
      Branches
      %span.badge= @repository.branches.length

  = nav_link(controller: :tags) do
    = link_to project_tags_path(@project) do
      Tags
      %span.badge= @repository.tags.length

  = nav_link(controller: :repositories, action: :stats) do
    = link_to stats_project_repository_path(@project) do
      Stats

  - if current_controller?(:commits) && current_user.private_token
    %li.pull-right
      = link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed" do
        %i.icon-rss

Add default values to compare page link

%ul.nav.nav-tabs
  %li= render partial: 'shared/ref_switcher', locals: {destination: 'commits'}

  = nav_link(controller: [:commit, :commits]) do
    = link_to 'Commits', project_commits_path(@project, @repository.root_ref)
  = nav_link(controller: :compare) do
    = link_to 'Compare', project_compare_index_path(@project, from: @repository.root_ref, to: @ref || @repository.root_ref)

  = nav_link(html_options: {class: branches_tab_class}) do
    = link_to recent_project_branches_path(@project) do
      Branches
      %span.badge= @repository.branches.length

  = nav_link(controller: :tags) do
    = link_to project_tags_path(@project) do
      Tags
      %span.badge= @repository.tags.length

  = nav_link(controller: :repositories, action: :stats) do
    = link_to stats_project_repository_path(@project) do
      Stats

  - if current_controller?(:commits) && current_user.private_token
    %li.pull-right
      = link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed" do
        %i.icon-rss


- content_for :before_footer do
  .content.past-years
    %p
      - if @year.year == @years.last
        Previous
      - else
        Other
      Years:
      = link_to 2006, "http://www.trianglegoclub.org/gocongress06"
      // 2007 - Was on old.usgo.org, no longer exists
      // 2008 - Not sure, we never had a link to it?
      // 2009-10 - Was on old.usgo.org, no longer exists
      - @years.each do |y|
        = link_to y, "/#{y}"

Remove current year from list of other years

- content_for :before_footer do
  .content.past-years
    %p
      - if @year.year == @years.last
        Previous
      - else
        Other
      Years:
      = link_to 2006, "http://www.trianglegoclub.org/gocongress06"
      // 2007 - Was on old.usgo.org, no longer exists
      // 2008 - Not sure, we never had a link to it?
      // 2009-10 - Was on old.usgo.org, no longer exists
      - @years.each do |y|
        - if y != @year.year
          = link_to y, "/#{y}"


:ruby
  purchases = purchase_affair.purchases

%tr{data: { outgoing_payment_purchase_affair: purchase_affair.id} }
  = hidden_field_tag 'purchase_affairs[]', nil, data: { outgoing_payment_purchase_affair_selection: true }
  %td= check_box_tag :check, '1', false, data: { outgoing_payment_purchase_affair_selector: true, outgoing_payment_selected_amount: 0 }
  - if purchases.count == 1
    - purchase = purchases.first
    %td= purchase.payment_at.nil? ? purchase.invoiced_at.l : purchase.payment_at.l
    %td=link_to :purchase.tl + ' ' + purchase_affair.deal_work_name, backend_purchase_path(purchase)
    %td=link_to purchase.reference_number, backend_purchase_path(purchase)
  - else
    %td= purchase_affair.created_at.l
    %td=link_to purchase_affair.class.model_name.human + ' ' + purchase_affair.number, backend_purchase_affair_path(purchase_affair)
  %td{data: { outgoing_payment_purchase_affair_amount: purchase_affair.balance }}= purchase_affair.balance.l(currency: f.object.mode.currency)

Fix new action on outgoing_payment_list (really this time)

:ruby
  purchases = purchase_affair.purchase_invoices

%tr{data: { outgoing_payment_purchase_affair: purchase_affair.id} }
  = hidden_field_tag 'purchase_affairs[]', nil, data: { outgoing_payment_purchase_affair_selection: true }
  %td= check_box_tag :check, '1', false, data: { outgoing_payment_purchase_affair_selector: true, outgoing_payment_selected_amount: 0 }
  - if purchases.count == 1
    - purchase = purchases.first
    %td= purchase.payment_at.nil? ? purchase.invoiced_at.l : purchase.payment_at.l
    %td=link_to :purchase.tl + ' ' + purchase_affair.deal_work_name, backend_purchase_path(purchase)
    %td=link_to purchase.reference_number, backend_purchase_path(purchase)
  - else
    %td= purchase_affair.created_at.l
    %td=link_to purchase_affair.class.model_name.human + ' ' + purchase_affair.number, backend_purchase_affair_path(purchase_affair)
  %td{data: { outgoing_payment_purchase_affair_amount: purchase_affair.balance }}= purchase_affair.balance.l(currency: f.object.mode.currency)


- if current_user
  .main
    %h1 Articles
    .search-bar
      = form_tag articles_path, method: :get, remote: true do
        = text_field_tag :search, params[:search], placeholder: "Search articles by keyword"
        = submit_tag "Search", class: "btn-a"

    %ul.article-list
      = render @articles

  %aside.categories
    = render "tags/tag_categories", tags: @tags

  = link_to "New Article", new_article_path, class: "btn-a"
- else
  .main
    %h1
      = link_to "Please Log in to Continue", login_path, data: { no_turbolink: true }

Use the proper Devise helper method

- if user_signed_in?
  .main
    %h1 Articles
    .search-bar
      = form_tag articles_path, method: :get, remote: true do
        = text_field_tag :search, params[:search], placeholder: "Search articles by keyword"
        = submit_tag "Search", class: "btn-a"

    %ul.article-list
      = render @articles

  %aside.categories
    = render "tags/tag_categories", tags: @tags

  = link_to "New Article", new_article_path, class: "btn-a"
- else
  .main
    %h1
      = link_to "Please Log in to Continue", login_path, data: { no_turbolink: true }


= simple_form_for @booking do |f|
  .row-fluid
    .span6
      = f.input :title, :input_html => {"data-autofocus" => true}
    .span6
      = f.input :value_date, :as => :date_field
  .row-fluid
    .span6
      = f.input :amount, :as => :string, :input_html => {:size => 12}
    .span6
      = f.input :code

  .row-fluid
    .span6
      = f.association :credit_account, :collection => accounts_as_collection(Account.all), :as => :combobox
    .span6
      = f.association :debit_account, :collection => accounts_as_collection(Account.all), :as => :combobox

  .row-fluid
    .span12
      = f.input :comments, :input_html => {:rows => 4, :class => 'span12'}

  .row-fluid
    .span12
      = f.input :reference_type, :as => :hidden, :input_html => {:value => 'Invoice'}
      //= f.association :reference, :collection => suggested_invoices_for_booking(@booking, :include_all => true), :as => :combobox, :include_blank => true

  .form-actions
    = f.button :submit

Drop size attribute from bookings.amount form field.

= simple_form_for @booking do |f|
  .row-fluid
    .span6
      = f.input :title, :input_html => {"data-autofocus" => true}
    .span6
      = f.input :value_date, :as => :date_field
  .row-fluid
    .span6
      = f.input :amount, :as => :string
    .span6
      = f.input :code

  .row-fluid
    .span6
      = f.association :credit_account, :collection => accounts_as_collection(Account.all), :as => :combobox
    .span6
      = f.association :debit_account, :collection => accounts_as_collection(Account.all), :as => :combobox

  .row-fluid
    .span12
      = f.input :comments, :input_html => {:rows => 4, :class => 'span12'}

  .row-fluid
    .span12
      = f.input :reference_type, :as => :hidden, :input_html => {:value => 'Invoice'}
      //= f.association :reference, :collection => suggested_invoices_for_booking(@booking, :include_all => true), :as => :combobox, :include_blank => true

  .form-actions
    = f.button :submit


%html
  %head
    %title= yield(:title) + t(:app_name)
    %meta{"content" => "text/html;charset=UTF-8", "http-equiv" => "content-type"}
    %link{:rel => "shortcut icon", :href => "/favicon.ico"}
    = stylesheet_link_tag 'screen.css', :media => 'screen, projection'
    = csrf_meta_tag
    = yield :head
  %body
    .navbar.navbar-fixed-top
      .fill.navbar-inner
        .container-fluid
          = link_to image_tag(@site_settings.site_logo.url), '/', :class => 'brand'
          = render "shared/menu"

    .container-fluid
      = render "shared/flashes"
      .row-fluid
        - if (content_column_right = yield :content_column_right).empty?
          .span12= yield
        - else
          .span12= yield
          .span4= yield :content_column_right
    .clear
    %footer.footer
      .container-fluid
        %p
          ©
          = t(:company_name)
          2012
    = render "shared/javascripts"

Add viewport meta for responsive bootstrap

%html
  %head
    %title= yield(:title) + t(:app_name)
    %meta{"content" => "text/html;charset=UTF-8", "http-equiv" => "content-type"}
    %meta{ name: "viewport" content: "width=device-width, initial-scale=1.0" }
    %link{:rel => "shortcut icon", :href => "/favicon.ico"}
    = stylesheet_link_tag 'screen.css', :media => 'screen, projection'
    = csrf_meta_tag
    = yield :head
  %body
    .navbar.navbar-fixed-top
      .fill.navbar-inner
        .container-fluid
          = link_to image_tag(@site_settings.site_logo.url), '/', :class => 'brand'
          = render "shared/menu"

    .container-fluid
      = render "shared/flashes"
      .row-fluid
        - if (content_column_right = yield :content_column_right).empty?
          .span12= yield
        - else
          .span12= yield
          .span4= yield :content_column_right
    .clear
    %footer.footer
      .container-fluid
        %p
          ©
          = t(:company_name)
          2012
    = render "shared/javascripts"


- event = last_push_event
- if event && show_last_push_widget?(event)
  .row-content-block.top-block.hidden-xs.white
    .event-last-push
      .event-last-push-text
        %span You pushed to
        = link_to namespace_project_commits_path(event.project.namespace, event.project, event.ref_name), class: 'ref-name' do
          %strong= event.ref_name

        = clipboard_button(text: event.ref_name, gfm: "`#{event.ref_name}`", class: 'btn-clipboard btn-transparent', title: 'Copy branch name to clipboard')

        - if event.project != @project
          %span at
          %strong= link_to_project event.project

        #{time_ago_with_tooltip(event.created_at)}

      .pull-right
        = link_to new_mr_path_from_push_event(event), title: "New merge request", class: "btn btn-info btn-sm" do
          Create merge request

Kill copy button with 🔥

- event = last_push_event
- if event && show_last_push_widget?(event)
  .row-content-block.top-block.hidden-xs.white
    .event-last-push
      .event-last-push-text
        %span You pushed to
        %strong
          = link_to event.ref_name, namespace_project_commits_path(event.project.namespace, event.project, event.ref_name), class: 'ref-name'

        - if event.project != @project
          %span at
          %strong= link_to_project event.project

        #{time_ago_with_tooltip(event.created_at)}

      .pull-right
        = link_to new_mr_path_from_push_event(event), title: "New merge request", class: "btn btn-info btn-sm" do
          Create merge request


= render "projects/settings_nav"

%p.slead
  Deploy keys allow read-only access to repository. They can be used for CI, staging or production servers

%p
  You can create a deploy key or add existing one
  = link_to new_project_deploy_key_path(@project), class: "btn btn-primary pull-right", title: "New Deploy Key" do
    %i.icon-plus
    New Deploy Key

%hr.clearfix

.row
  .span6.enabled-keys
    %h5.cgreen
      Enabled deploy keys
      %small for this project
    %ul.bordered-list
      = render @enabled_keys
      - if @enabled_keys.blank?
        .light-well
          %p.nothing_here_message Create #{link_to 'new deploy key', new_project_deploy_key_path(@project)} or add existing one
  .span6.available-keys
    %h5
      Available deploy keys
      %small from projects you are able to manage
    %ul.bordered-list
      = render @available_keys
      - if @available_keys.blank?
        .light-well
          %p.nothing_here_message All deploy keys from projects you can manage will be displayed here

Improve accuracy of deploy key message.

= render "projects/settings_nav"

%p.slead
  Deploy keys allow read-only access to repository. They can be used for CI, staging or production servers

%p
  You can create a deploy key or add existing one
  = link_to new_project_deploy_key_path(@project), class: "btn btn-primary pull-right", title: "New Deploy Key" do
    %i.icon-plus
    New Deploy Key

%hr.clearfix

.row
  .span6.enabled-keys
    %h5.cgreen
      Enabled deploy keys
      %small for this project
    %ul.bordered-list
      = render @enabled_keys
      - if @enabled_keys.blank?
        .light-well
          %p.nothing_here_message Create #{link_to 'new deploy key', new_project_deploy_key_path(@project)} or add existing one
  .span6.available-keys
    %h5
      Available deploy keys
      %small from projects you are able to manage
    %ul.bordered-list
      = render @available_keys
      - if @available_keys.blank?
        .light-well
          %p.nothing_here_message All deploy keys created in projects you own will be displayed here


- if @items.empty? || is_last_page?(@items)
  :javascript
    last_page = true;

- if @items.empty?
  %li.no_results No results found.
- elsif is_last_page?(@items)
  %li.book
    .last_page_message End of results.
- else
  = render partial: 'item', collection: @items

Fix search when there is only 1 page of results

- if @items.empty? || is_last_page?(@items)
  :javascript
    last_page = true;

- if @items.empty?
  %li.no_results No results found.
- else
  = render partial: 'item', collection: @items
  - if is_last_page?(@items)
    %li.book
      .last_page_message End of results.


%p
  In this file you can put any commands needed before your test suite is run.
  It is a bash script and it will run in an Ubuntu 15.10 system. If you find that
  a needed package is missing you can use "apt-get" to install it.

%p
  You can also run commands to create your database (like 'rake db:create' in
  Run on Rails).

Add documentation for conditions on build commands

%p
  In this file you can put any commands needed before your test suite is run.
  It is a bash script and it will run in an Ubuntu 15.10 system. If you find that
  a needed package is missing you can use
  %code
    apt-get
  to install it.

%p
  You can also run commands to create your database (like
  %code
    rake db:create
  in Ruby on Rails).

%p
  To give you more flexibility on what commands run and when,
  the following environment variables are available in your script:

  %ul
    %li
      %strong WORKER_INITIALIZING
      %br

      This variable is set only when the worker is initializing. It will only run
      once. It is useful when you want to run one off commands.

      %p
        E.g. You want to install bundler gem and phantomjs. This can be achieved as this:
        %br

        :ruby
          code=<<-CODE
          if [[ -n $WORKER_INITIALIZING ]]
          then
            gem install bundler
            apt-get update
            apt-get install -y phantomjs
          fi
          CODE
        %pre= code

    %li
      %strong changed_file_paths_match
      %br

      This is a bash function which checks if any of the changed files between
      the current commit and the previous matches the given string. It might
      be useful when you want to run database migrations of install new gems.

      %p
        E.g. You want to run "bundle install" only when there are changes in the
        Gemfile.lock. This can be achieved as this:
        %br

        :ruby
          code = <<-CODE
          if changed_file_paths_match "Gemfile.lock"
          then
            bundle install --deployment --path /vendor/bundle --jobs 2 --retry 2
          fi
          CODE
        %pre= code
        or to setup the database
        :ruby
          code= <<-CODE
          if changed_file_paths_match "db/migrations"
          then
            rake db:setup
          fi
          CODE
        %pre=code

    %li
      %strong commit_changed
      %br

      This is a bash function that exists with 1 when the current commit is
      different than the last job's. It is useful when you want to run commands
      whenever the commit changes.

      %p
        E.g. You want to call a cleanup script before running a new commit.
        This can be achieved as this:

        :ruby
          code = <<-CODE
          if commit_changed
          then
            rake my_cleanup_task
          fi
          CODE
        %pre= code


- if !@all_scrapers.total_count.zero?
  %aside.col-xs-12.col-md-3
    = render partial: "scraper_search_filter_controls"

.col-xs-12.col-md-9
  - if @scrapers.total_count.zero?
    .alert.alert-info
      - if !@all_scrapers.total_count.zero?
        = no_search_results_message("scrapers with data, that are".html_safe, @q)
      - else
        = no_search_results_message("scrapers", @q)
  - else
    - @scrapers.with_details.each do |scraper, details|
      = render scraper, highlight: details[:highlight]
    = paginate @scrapers

Make the special handling of no results for scrapers at all clearer

- if @all_scrapers.total_count.zero?
  .col-xs-12.col-md-9
    .alert.alert-info
      = no_search_results_message("scrapers", @q)
- else
  %aside.col-xs-12.col-md-3
    = render partial: "scraper_search_filter_controls"

  .col-xs-12.col-md-9
    - if @scrapers.total_count.zero?
      .alert.alert-info
        = no_search_results_message("scrapers with data, that are".html_safe, @q)
    - else
      - @scrapers.with_details.each do |scraper, details|
        = render scraper, highlight: details[:highlight]
      = paginate @scrapers


%table.social.white-bg{:width => "100%"}
  %tr
    %td
      %table.column{:align => "left"}
        %tr
          %td
            %h3
              = t(".customer_greeting", name: @order.bill_address.firstname)
            %h4
              = t(".instructions_html", distributor: @order.distributor.name )
            %img.float-left{:src => "#{@order.distributor.logo.url(:medium)}"}/
      %span.clear

%p.callout
  = t(".dont_cancel", email: @order.distributor.contact.email)

%p
%h4
  = t(".order_summary_canceled_html", number: @order.number)
%p
  = t(".details")

= render 'order_summary'

%p
  - if @order.paid?
    = t(".paid_order", distributor: @order.distributor.name)
  - else
    = t(".unpaid_order")

= render 'signoff'
= render 'shared/mailers/social_and_contact'

Remove second table of cancel email instructions style

%table.social.white-bg{width: "100%"}
  %table.column{align: "left"}
    %tr
      %td
        %h3
          = t(".customer_greeting", name: @order.bill_address.firstname)
        %h4
          = t(".instructions_html", distributor: @order.distributor.name )
        %img.float-left{src: "#{@order.distributor.logo.url(:medium)}"}

%p.callout
  = t(".dont_cancel", email: @order.distributor.contact.email)

%p
%h4
  = t(".order_summary_canceled_html", number: @order.number)
%p
  = t(".details")

= render 'order_summary'

%p
  - if @order.paid?
    = t(".paid_order", distributor: @order.distributor.name)
  - else
    = t(".unpaid_order")

= render 'signoff'
= render 'shared/mailers/social_and_contact'


= simple_form_for(@import_result.new_record? ? [@user, @competition, @import_result] : [@import_result], |
  {:remote => true, :html => {:class => "data_entry"}}) do |f|                                    |
  = render partial: "/shared/error_messages", object: @import_result
  = f.hidden_field :is_start_time

  %table.import_results
    - cache ['header', @competition] do
      = render "imported_time_result_thead"
    %tbody
      = render partial: 'imported_time_result', collection: @import_results, as: :import_result

    %tfoot
      %tr
        %td
        %td{ colspan: 2}= registrant_bib_number_select_box(f, @competition, class: "js--autoFocus")
        %td

        - displayer = @competition.results_displayer
        - displayer.form_inputs.each do |field_name, field_options|
          %td= f.number_field field_name, field_options

        %td= f.select :status, TimeResult.status_values, include_blank: true
        %td{ colspan: "2"}= f.button :submit, "Submit", data: { disable_with: false }

#notice

Fix order of form for import_results

= simple_form_for(@import_result.new_record? ? [@user, @competition, @import_result] : [@import_result], |
  {:remote => true, :html => {:class => "data_entry"}}) do |f|                                    |
  = render partial: "/shared/error_messages", object: @import_result
  = f.hidden_field :is_start_time

  %table.import_results
    - cache ['header', @competition] do
      = render "imported_time_result_thead"
    %tbody
      = render partial: 'imported_time_result', collection: @import_results, as: :import_result

    %tfoot
      %tr
        %td
        %td{ colspan: 2}= registrant_bib_number_select_box(f, @competition, class: "js--autoFocus")
        %td
        %td= f.select :status, TimeResult.status_values, include_blank: true

        - displayer = @competition.results_displayer
        - displayer.form_inputs.each do |field_name, field_options|
          %td= f.number_field field_name, field_options

        %td{ colspan: "2"}= f.button :submit, "Submit", data: { disable_with: false }

#notice


%miq-quadicon.center-block
:javascript
  var data = camelizeQuadicon(#{quadicon_hash(record).to_json});
  document.querySelector('miq-quadicon').setAttribute('data', JSON.stringify(data));
  miq_bootstrap('miq-quadicon');

Add a unique random DOM ID for each quadicon and use it in miq_bootstrap

- uid = "quad-#{rand(36**8).to_s(36)}"
%miq-quadicon.center-block{:id => uid}
:javascript
  var data = camelizeQuadicon(#{quadicon_hash(record).to_json});
  document.querySelector("miq-quadicon##{uid}").setAttribute('data', JSON.stringify(data));
  miq_bootstrap("miq-quadicon##{uid}");


.clip_container.clipboard-btn{:id => "#{copy_button_id}_container", :data => { :"clipboard-text" => copy_text } }
  .clip_button{:id => copy_button_id, :title => "Copy to clipboard"}
    %i.fa.fa-copy{:id => "#{copy_button_id}_icon"}>
:javascript
  new Clipboard("##{copy_button_id}_container");

Make the copy button more obviously a button

.clip_container.clipboard-btn{:id => "#{copy_button_id}_container", :data => { :"clipboard-text" => copy_text } }
  .clip_button{:id => copy_button_id, :title => "Copy to clipboard"}
    %btn.btn-sm.btn-secondary{id: "#{copy_button_id}_icon"}
      %i.fa.fa-copy
:javascript
  new Clipboard("##{copy_button_id}_container");


.snapshot-card
  = link_to cl_image_tag(snapshot.image_name,
    width: 100, height: 100, crop: :fill, gravity: :north_east),
    snapshot

Add created_at string to snapshot-card

.snapshot-card
  = link_to cl_image_tag(snapshot.image_name,
    width: 100, height: 100, crop: :fill, gravity: :north_east),
    snapshot
  %p= time_ago_in_words(snapshot.created_at) + ' ago'


by
%a{ href: user_path(@build.user) }
  = image_tag avatar_icon(@build.user, 24), class: "avatar s24"
  %strong{ data: { toggle: 'tooltip', placement: 'top', title: @build.user.to_reference } }
    = @build.user.name

Change username full name back to only username on xs viewports

by
%a{ href: user_path(@build.user) }
  %span.hidden-xs
    = image_tag avatar_icon(@build.user, 24), class: "avatar s24"
    %strong{ data: { toggle: 'tooltip', placement: 'top', title: @build.user.to_reference } }
      = @build.user.name
  %strong.visible-xs-inline= @build.user.to_reference


= simple_form_for([campaign, hero], url: url, method: method, multipart: true) do |f|
  = f.error_notification

  .form-inputs
    = f.input :name, placeholder: 'Name'
    = f.input :archetype, placeholder: 'Archetype'
    = f.input :race, placeholder: 'Race'
    = f.input :alignment, placeholder: 'Alignment'
    = f.input :deity, placeholder: 'Deity'
    = f.input :titles, placeholder: 'Titles'
    = f.input :appearance, placeholder: 'Appearance'
    = f.input :background, placeholder: 'Background'
    = f.input :mechanics, placeholder: 'Mechanics'
    = f.input :image, as: :file

  .form-actions
    = f.button :submit

Expand some text areas in hero form.

= simple_form_for([campaign, hero], url: url, method: method, multipart: true) do |f|
  = f.error_notification

  .form-inputs
    = f.input :name, placeholder: 'Name'
    = f.input :titles, placeholder: 'Titles', input_html: { rows: 5 }
    = f.input :archetype, placeholder: 'Archetype'
    = f.input :race, placeholder: 'Race'
    = f.input :alignment, placeholder: 'Alignment'
    = f.input :deity, placeholder: 'Deity'
    = f.input :appearance, placeholder: 'Appearance', input_html: { rows: 5 }
    = f.input :mechanics, placeholder: 'Mechanics', input_html: { rows: 5 }
    = f.input :background, placeholder: 'Background', input_html: { rows: 10 }
    = f.input :image, as: :file

  .form-actions
    = f.button :submit


- middle = 'icn--middle' if middle
- klass ||= nil
- title ||= nil

- unless title.nil?
  %i.icn{ class: "icn--#{icon} #{middle} #{klass}" }
    %span.srt= title
- else
  %i.icn{ class: "icn--#{icon} #{middle} #{klass}" }

Add `aria-hidden` attribute to Icon partial

- middle = 'icn--middle' if middle
- klass ||= nil
- title ||= nil

- unless title.nil?
  %i.icn{ class: "icn--#{icon} #{middle} #{klass}", 'aria-hidden' => true }
  %span.srt= title
- else
  %i.icn{ class: "icn--#{icon} #{middle} #{klass}" }


= f.semantic_fields_for :vcard do |vcard|
  = vcard.input :full_name, :input_html => {"data-autofocus" => true}
  = vcard.semantic_fields_for :address do |address|
    = address.input :extended_address
    = address.input :street_address
    = address.input :post_office_box
    = address.input :postal_code
    = address.input :locality

Use two column layout for postal code and locality.

= f.semantic_fields_for :vcard do |vcard|
  = vcard.input :full_name, :input_html => {"data-autofocus" => true}
  = vcard.semantic_fields_for :address do |address|
    = address.input :extended_address
    = address.input :street_address
    = address.input :post_office_box
    = address.input :postal_code, :wrapper_html => {:class => 'col1'}
    = address.input :locality, :wrapper_html => {:class => 'col2'}


!!!
%html{ :xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => :en,  :lang => :en }
  %head
    %meta{ "http-equiv" => "Content-Type", :content => "text/html; charset=utf-8" }
    %title= t(:crm_admin_page)
    == <!-- #{controller.controller_name} : #{controller.action_name} -->
    = stylesheet_link_tag :application
    = stylesheet_link_tag :print, :media => 'print'
    %style= yield :styles

    = javascript_include_tag :application
    -# include timeago locales
    = javascript_include_tag "jquery_timeago/jquery.timeago.#{I18n.locale}"
    = hook(:javascript_includes, self)

    %script{:type => "text/javascript"}= yield :javascript
    = csrf_meta_tag

  %body.admin
    = render "layouts/admin/header"
    = render "layouts/tabbed"
    = render "layouts/footer"
    %script{:type => "text/javascript"}
      = "crm.base_url = '#{Setting.base_url}';" unless Setting.base_url.blank?
      = get_browser_timezone_offset
      = yield :javascript_epilogue

Revert need to include separate js.

!!!
%html{ :xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => :en,  :lang => :en }
  %head
    %meta{ "http-equiv" => "Content-Type", :content => "text/html; charset=utf-8" }
    %title= t(:crm_admin_page)
    == <!-- #{controller.controller_name} : #{controller.action_name} -->
    = stylesheet_link_tag :application
    = stylesheet_link_tag :print, :media => 'print'
    %style= yield :styles

    = javascript_include_tag :application
    = hook(:javascript_includes, self)

    %script{:type => "text/javascript"}= yield :javascript
    = csrf_meta_tag

  %body.admin
    = render "layouts/admin/header"
    = render "layouts/tabbed"
    = render "layouts/footer"
    %script{:type => "text/javascript"}
      = "crm.base_url = '#{Setting.base_url}';" unless Setting.base_url.blank?
      = get_browser_timezone_offset
      = yield :javascript_epilogue


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

Move edit link closer to update

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


- content_for :title, "Using PhantomJS"
:markdown
  ## PhantomJS

  In most circumstances web scraping is done by downloading a web page using your programming language and a library.
  However in some cases you need to simulate a web browser.
  This could be because the web site is poorly programmed or because it makes extensive use of JavaScript.

  You can do this with [PhantomJS](http://phantomjs.org/) on morph.io. It is essentially a headless browser that you can control from your scraper using JavaScript or a wrapper library.

Add placeholder sections to PhantomJS documentation

- content_for :title, "Using PhantomJS"
:markdown
  ## PhantomJS

  In most circumstances web scraping is done by downloading a web page using your programming language and a library.
  However in some cases you need to simulate a web browser.
  This could be because the web site is poorly programmed or because it makes extensive use of JavaScript.

  You can do this with [PhantomJS](http://phantomjs.org/) on morph.io. It is essentially a headless browser that you can control from your scraper using JavaScript or a wrapper library.

  ### Using
  #{render "missing_documentation"}

  ### Examples
  #{render "missing_documentation"}


:markdown
  - Titles – `#` (biggest), `##` (smaller), `###` (even smaller), ...
  - `*italic*` – *italic*
  - `**bold**` – **bold**
  - `[link](http://example.com)` – [link](http://example.com)
  - `<email@example.com>` – <email@example.com>

  In order to get paragraphs in texts, an additional empty new line is required between
  them.

  **Bad**:

  This is one paragraph.<br>
  This is another paragraph.

  **Good**:

  This is one paragraph.

  This is another paragraph.

Add reference to embedding images

:markdown
  - Titles – `#` (biggest), `##` (smaller), `###` (even smaller), ...
  - `*italic*` – *italic*
  - `**bold**` – **bold**
  - `[link](http://example.com)` – [link](http://example.com)
  - `![image](http://image.jpg)` – displays the image
  - `<email@example.com>` – <email@example.com>

  In order to get paragraphs in texts, an additional empty new line is required between
  them.

  **Bad**:

  This is one paragraph.<br>
  This is another paragraph.

  **Good**:

  This is one paragraph.

  This is another paragraph.


= link_to "« #{t('shared.back')}".html_safe, admin_places_path, class: 'light-button left'

= link_to "+ #{t('shared.create') }".html_safe, new_admin_place_candidate_path(place), class: 'light-button'

= link_to "#{t 'shared.skip'} »".html_safe, next_admin_places_path(q: { dist_greater_than: place.distance_to(current_admin_user)}, order: :distance_asc), class: 'light-button right'

Make back and skip links instead of buttons.

= link_to "« #{t('shared.back')}".html_safe, admin_places_path, class: :left

= link_to "+ #{t('shared.create') }".html_safe, new_admin_place_candidate_path(place), class: 'light-button'

= link_to "#{t 'shared.skip'} »".html_safe, next_admin_places_path(q: { dist_greater_than: place.distance_to(current_admin_user)}, order: :distance_asc), class: :right


#modal-remove-blob.modal.hide
  .modal-dialog
    .modal-content
      .modal-header
        %a.close{href: "#", "data-dismiss" => "modal"} ×
        %h3.page-title Remove #{@blob.name}
        %p.light
          From branch
          %strong= @ref

      .modal-body
        = form_tag project_blob_path(@project, @id), method: :delete do
          .form-group.commit_message-group
            = label_tag 'commit_message', class: "control-label" do
              Commit message
            .col-sm-10
              = text_area_tag 'commit_message', params[:commit_message], placeholder: "Removed this file because...", required: true, rows: 3
          .form-group
            .col-sm-10
              = submit_tag 'Remove file', class: 'btn btn-remove'
              = link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal"

Fix blob remove modal style

#modal-remove-blob.modal.hide
  .modal-dialog
    .modal-content
      .modal-header
        %a.close{href: "#", "data-dismiss" => "modal"} ×
        %h3.page-title Remove #{@blob.name}
        %p.light
          From branch
          %strong= @ref

      .modal-body
        = form_tag project_blob_path(@project, @id), method: :delete, class: 'form-horizontal' do
          .form-group.commit_message-group
            = label_tag 'commit_message', class: "control-label" do
              Commit message
            .col-sm-10
              = text_area_tag 'commit_message', params[:commit_message], placeholder: "Removed this file because...", required: true, rows: 3, class: 'form-control'
          .form-group
            .col-sm-2
            .col-sm-10
              = submit_tag 'Remove file', class: 'btn btn-remove'
              = link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal"


%section.new.alert{ :"data-fancybox" => true, :"data-replace" => "section.new.alert" }
  %h2= t('views.alerts.new.header')
  - if request.xhr?
    = render 'shared/flash', :flash => flash
  .row
    = semantic_form_for [relic, alert], :remote => true do |f|
      %p.description= t('views.alerts.new.description')
      = f.input :file, :as => :file
      %p.description= t('views.relics.edit.photos.statement_html')
      = f.input :description, :as => :text, :input_html => { :value => params[:description] }
      = f.input :author
      = f.input :date_taken
      .actions
        = f.submit t('views.alerts.new.submit')
        lub
        = link_to t('views.alerts.new.cancel'), relic_path(relic.id), :remote => true

Move description on top in Alert form

%section.new.alert{ :"data-fancybox" => true, :"data-replace" => "section.new.alert" }
  %h2= t('views.alerts.new.header')
  - if request.xhr?
    = render 'shared/flash', :flash => flash
  .row
    = semantic_form_for [relic, alert], :remote => true do |f|
      %p.description= t('views.alerts.new.description')
      = f.input :description, :as => :text, :input_html => { :value => params[:description] }
      = f.input :file, :as => :file
      %p.description= t('views.relics.edit.photos.statement_html')
      = f.input :author
      = f.input :date_taken
      .actions
        = f.submit t('views.alerts.new.submit')
        lub
        = link_to t('views.alerts.new.cancel'), relic_path(relic.id), :remote => true


%table.char
  %tbody
    %tr
      %td.specialized{:colspan => 2} General
    %tr
      %td Birth:
      %td= @character['birth'].strftime("%b %d, %Y at %H:%M %Z")
    %tr
      %td Deaths
      %td= add_commas(@character['deaths'].to_s)
    - if @character.properties
      %tr
        %td.specialized{:colspan => 2} Masteries
      - @character.properties.each do |k,v|
      - next unless PropertiesHelper::is_type(k, :mastery)
        %tr
          %td= PropertiesHelper::get_property_name(k)
          %td= PropertiesHelper::get_mastery_name(k,v)
      %tr
        %td.specialized{:colspan => 2} Resistances
      - @character.properties.each do |k,v|
      - next unless PropertiesHelper::is_type(k, :resist)
        %tr
          %td= PropertiesHelper::get_property_name(k)
          %td= v
      %tr
        %td.specialized{:colspan => 2} Society
      - @character.properties.each do |k,v|
      - next unless PropertiesHelper::is_type(k, :society)
        %tr
          %td= PropertiesHelper::get_property_name(k)
          %td= v

Add fishing and chess to Other pane

%table.char
  %tbody
    %tr
      %td.specialized{:colspan => 2} General
    %tr
      %td Birth:
      %td= @character['birth'].strftime("%b %d, %Y at %H:%M %Z")
    %tr
      %td Deaths
      %td= add_commas(@character['deaths'].to_s)
    %tr
      %td Fishing Skill
      %td
        - if @character.properties.has_key?("192")
          = @character.properties["192"]
    %tr
      %td Chess Rank
      %td
        - if @character.properties.has_key?("181")
          = @character.properties["181"]
    - if @character.properties
      %tr
        %td.specialized{:colspan => 2} Masteries
      - @character.properties.each do |k,v|
      - next unless PropertiesHelper::is_type(k, :mastery)
        %tr
          %td= PropertiesHelper::get_property_name(k)
          %td= PropertiesHelper::get_mastery_name(k,v)
      %tr
        %td.specialized{:colspan => 2} Resistances
      - @character.properties.each do |k,v|
      - next unless PropertiesHelper::is_type(k, :resist)
        %tr
          %td= PropertiesHelper::get_property_name(k)
          %td= v
      %tr
        %td.specialized{:colspan => 2} Society
      - @character.properties.each do |k,v|
      - next unless PropertiesHelper::is_type(k, :society)
        %tr
          %td= PropertiesHelper::get_property_name(k)
          %td= v


%h1 Voting

%h2 Voting at your polling station

%p Most people vote at their local polling station. This is usually in a school, hall or community centre near you.

%p
  The council will send you a
  %strong poll card
  showing you where to vote.

%p If you lose your poll card, don't worry. You can still vote as long as you are registered.

%p
  You can vote at your polling station
  %strong between 7am and 10pm on 6 May.

%p If you don't want to vote at a polling station or are unable to get there you can:

%ul
  %li vote by post
  %li ask someone to vote for you

%h2 Voting by post

%p Anyone can apply to vote by post.

%p If you are registered to vote by post you won't be allowed to vote at a polling station.

%h2 Asking someone to vote for you

%p
  You can choose to have someone vote for you at the polling station. This is called a
  %strong proxy vote.

%p If you want to vote by post or have someone vote for you and haven't already told Sutton Council about this, do it straight away.

Make generic for all elections

%h1 Voting

%h2 Voting at your polling station

%p Most people vote at their local polling station. This is usually in a school, hall or community centre near you.

%p
  The council will send you a
  %strong poll card
  showing you where to vote.

%p If you lose your poll card, don't worry. You can still vote as long as you are registered.

%p
  You can vote at your polling station
  %strong between 7am and 10pm on election day.

%p If you don't want to vote at a polling station or are unable to get there you can:

%ul
  %li vote by post
  %li ask someone to vote for you

%h2 Voting by post

%p Anyone can apply to vote by post.

%p If you are registered to vote by post you won't be allowed to vote at a polling station.

%h2 Asking someone to vote for you

%p
  You can choose to have someone vote for you at the polling station. This is called a
  %strong proxy vote.

%p If you want to vote by post or have someone vote for you and haven't already told Sutton Council about this, do it straight away.


%ul.tabs
  %li.active= link_to t_model, '#tab-contact'
  %li= link_to t_model(Salary), '#tab-salaries'
  %li= link_to t_title(:list, Invoice), '#tab-invoices'
  %li= link_to t_title(:list, Activity), '#tab-activities' if Bookyt::Engine.engines.include?('bookyt_projects')
  %li= link_to t_title(:timesheet, Activity), '#tab-timesheet' if Bookyt::Engine.engines.include?('bookyt_projects')
  %li= link_to t_title(:list, Attachment), '#tab-attachments'

.tab-content
  #tab-contact.active= render "form"
  #tab-salaries= render 'show_salaries'
  #tab-invoices= render 'show_invoices'
  #tab-activities= render 'show_activities' if Bookyt::Engine.engines.include?('bookyt_projects')
  #tab-timesheet= render 'show_timesheet' if Bookyt::Engine.engines.include?('bookyt_projects')
  #tab-attachments= render 'show_attachments'

Include salary tab in employee view only if bookyt_salary is enabled.

%ul.tabs
  %li.active= link_to t_model, '#tab-contact'
  %li= link_to t_model(Salary), '#tab-salaries' if Bookyt::Engine.engines.include?('bookyt_salary')
  %li= link_to t_title(:list, Invoice), '#tab-invoices'
  %li= link_to t_title(:list, Activity), '#tab-activities' if Bookyt::Engine.engines.include?('bookyt_projects')
  %li= link_to t_title(:timesheet, Activity), '#tab-timesheet' if Bookyt::Engine.engines.include?('bookyt_projects')
  %li= link_to t_title(:list, Attachment), '#tab-attachments'

.tab-content
  #tab-contact.active= render "form"
  #tab-salaries= render 'show_salaries' if Bookyt::Engine.engines.include?('bookyt_salary')
  #tab-invoices= render 'show_invoices'
  #tab-activities= render 'show_activities' if Bookyt::Engine.engines.include?('bookyt_projects')
  #tab-timesheet= render 'show_timesheet' if Bookyt::Engine.engines.include?('bookyt_projects')
  #tab-attachments= render 'show_attachments'


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

= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
  .omniauth
    .block-button.omniauth-pixiv
      = t('simple_form.labels.omniauth_pixiv.signin')

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

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

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

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

Split pixiv auth button for iOS App

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

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

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

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

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

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


.label-row
  = link_to_label(label)
  = markdown(label.description, pipeline: :single_line)

  .pull-right
    %strong.append-right-20
      = link_to_label(label) do
        = pluralize label.open_issues_count, 'open issue'

    - if defined?(editable) && editable && can?(current_user, :admin_label, @project)
      = link_to 'Edit', edit_namespace_project_label_path(@project.namespace, @project, label), class: 'btn btn-sm'
      = link_to 'Delete', namespace_project_label_path(@project.namespace, @project, label), class: 'btn btn-sm btn-remove remove-row', method: :delete, remote: true, data: {confirm: "Remove this label? Are you sure?"}

Fix label - description spacing

.label-row
  = link_to_label(label)
  %span.prepend-left-10
    = markdown(label.description, pipeline: :single_line)

  .pull-right
    %strong.append-right-20
      = link_to_label(label) do
        = pluralize label.open_issues_count, 'open issue'

    - if defined?(editable) && editable && can?(current_user, :admin_label, @project)
      = link_to 'Edit', edit_namespace_project_label_path(@project.namespace, @project, label), class: 'btn btn-sm'
      = link_to 'Delete', namespace_project_label_path(@project.namespace, @project, label), class: 'btn btn-sm btn-remove remove-row', method: :delete, remote: true, data: {confirm: "Remove this label? Are you sure?"}


%h5 Load Profiles

%p= link_to 'Create a new load profile', new_load_profile_path, class: 'button button-primary'

%ul
  - LoadProfile.all.sort_by(&:display_name).each do |profile|
    %li= link_to(profile.display_name, profile)

%hr
= link_to('Testing Grounds', testing_grounds_path, class: 'button')

Move "testing grounds" button to top of load_profiles/index

%h5 Load Profiles

%p
  = link_to('◄ Testing Grounds', testing_grounds_path, class: 'button')
  = link_to 'Create a new load profile', new_load_profile_path, class: 'button button-primary'

%ul
  - LoadProfile.all.sort_by(&:display_name).each do |profile|
    %li= link_to(profile.display_name, profile)


%nav.navbar.navbar-expand-lg.navbar-dark.bg-dark.justify-content-between
  .nav
    %a.navbar-brand{ href: root_path }
      = image_tag("pear.png", class: 'logo', alt: 'Growstuff brand logo (drawing of a pear)')
      %span.site-name Growstuff
  .nav
    %button.navbar-toggler{ "aria-controls" => "navbarSupportedContent", "aria-expanded" => "false", "aria-label" => "Toggle navigation", "data-target" => "#navbarSupportedContent", "data-toggle" => "collapse", type: "button" }
      %i.fas.fa-ellipsis-v.navbar-toggler-icon
    = render 'layouts/menu'
  = render 'crops/search_bar'

Move search bar to middle, hide sitename on small screens

%nav.navbar.navbar-expand-lg.navbar-dark.bg-dark.justify-content-between
  .nav
    %a.navbar-brand{ href: root_path }
      = image_tag("pear.png", class: 'logo', alt: 'Growstuff brand logo (drawing of a pear)')
      .d-none.d-md-block
        %span.site-name Growstuff
  .nav= render 'crops/search_bar'
  .nav
    %button.navbar-toggler{ "aria-controls" => "navbarSupportedContent", "aria-expanded" => "false", "aria-label" => "Toggle navigation", "data-target" => "#navbarSupportedContent", "data-toggle" => "collapse", type: "button" }
      %i.fas.fa-ellipsis-v.navbar-toggler-icon
    = render 'layouts/menu'


.card
  .card-body.gl-responsive-table-row
    .table-section.section-60
      .table-mobile-header{ role: "rowheader" }= s_("ClusterIntegration|Kubernetes cluster")
      .table-mobile-content
        = link_to cluster.name, cluster.show_path
    .table-section.section-25
      .table-mobile-header{ role: "rowheader" }= s_("ClusterIntegration|Environment scope")
      .table-mobile-content= cluster.environment_scope
    .table-section.section-15.text-right
      .table-mobile-header{ role: "rowheader" }
      .table-mobile-content
        %span.badge.badge-light
          = cluster.project_type? ? s_("ClusterIntegration|Project cluster") : s_("ClusterIntegration|Group cluster")

Add active and connection disabled badges to clusters

.card
  .card-body.gl-responsive-table-row
    .table-section.section-60
      .table-mobile-header{ role: "rowheader" }= s_("ClusterIntegration|Kubernetes cluster")
      .table-mobile-content
        = link_to cluster.name, cluster.show_path
        - if cluster.enabled?
          %span.badge.badge-info Active
        - else
          %span.badge.badge-danger Connection disabled
    .table-section.section-25
      .table-mobile-header{ role: "rowheader" }= s_("ClusterIntegration|Environment scope")
      .table-mobile-content= cluster.environment_scope
    .table-section.section-15.text-right
      .table-mobile-header{ role: "rowheader" }
      .table-mobile-content
        %span.badge.badge-light
          = cluster.project_type? ? s_("ClusterIntegration|Project cluster") : s_("ClusterIntegration|Group cluster")


- if current_user
  %span.dropdown
    %a.dropdown-new.btn.btn-new{href: '#', "data-toggle" => "dropdown"}
      = icon('plus')
    %ul.dropdown-menu.dropdown-menu-right.project-home-dropdown
      - if can?(current_user, :create_issue, @project)
        %li
          = link_to url_for_new_issue do
            = icon('exclamation-circle fw')
            New issue
      - if can?(current_user, :create_merge_request, @project)
        %li
          = link_to new_namespace_project_merge_request_path(@project.namespace, @project) do
            = icon('tasks fw')
            New merge request
      - if can?(current_user, :create_snippet, @project)
        %li
          = link_to new_namespace_project_snippet_path(@project.namespace, @project) do
            = icon('file-text-o fw')
            New snippet
      - if can?(current_user, :push_code, @project)
        %li.divider
        %li
          = link_to new_namespace_project_branch_path(@project.namespace, @project) do
            = icon('code-fork fw')
            New branch
        %li
          = link_to new_namespace_project_tag_path(@project.namespace, @project) do
            = icon('tags fw')
            New tag

Use a relative link instead of full URL with New Issue button to be consistent

- if current_user
  %span.dropdown
    %a.dropdown-new.btn.btn-new{href: '#', "data-toggle" => "dropdown"}
      = icon('plus')
    %ul.dropdown-menu.dropdown-menu-right.project-home-dropdown
      - if can?(current_user, :create_issue, @project)
        %li
          = link_to url_for_new_issue(@project, only_path: true) do
            = icon('exclamation-circle fw')
            New issue
      - if can?(current_user, :create_merge_request, @project)
        %li
          = link_to new_namespace_project_merge_request_path(@project.namespace, @project) do
            = icon('tasks fw')
            New merge request
      - if can?(current_user, :create_snippet, @project)
        %li
          = link_to new_namespace_project_snippet_path(@project.namespace, @project) do
            = icon('file-text-o fw')
            New snippet
      - if can?(current_user, :push_code, @project)
        %li.divider
        %li
          = link_to new_namespace_project_branch_path(@project.namespace, @project) do
            = icon('code-fork fw')
            New branch
        %li
          = link_to new_namespace_project_tag_path(@project.namespace, @project) do
            = icon('tags fw')
            New tag


.workflow.tasks
  %h3= workflow.to_s

  - unless workflow.documentation[:title].empty?
    :markdown
      #{workflow.documentation[:title]}
  - unless workflow.documentation[:description].empty?
    :markdown
      #{workflow.documentation[:description]}

  %h5 Tasks

  - unless workflow.documentation[:task_description].empty?
    :markdown
      #{workflow.documentation[:task_description]}

  %ul.tasks.clean_list
    - tasks = workflow.exec_exports + workflow.synchronous_exports + workflow.asynchronous_exports

    - tasks.sort.each do |task|
      %li
        //%a(href="#{to(File.join("/", workflow.to_s, task.to_s))}")= task
        %a(href="#{File.join("/", workflow.to_s, task.to_s)}")= task
        - info = workflow.task_info(task)
        - if info[:description]
          %span= info[:description].split(/\n\s*\n/).first

Make sure we list all task exports, including streming

.workflow.tasks
  %h3= workflow.to_s

  - unless workflow.documentation[:title].empty?
    :markdown
      #{workflow.documentation[:title]}
  - unless workflow.documentation[:description].empty?
    :markdown
      #{workflow.documentation[:description]}

  %h5 Tasks

  - unless workflow.documentation[:task_description].empty?
    :markdown
      #{workflow.documentation[:task_description]}

  %ul.tasks.clean_list
    - tasks = workflow.all_exports

    - tasks.sort.each do |task|
      %li
        //%a(href="#{to(File.join("/", workflow.to_s, task.to_s))}")= task
        %a(href="#{File.join("/", workflow.to_s, task.to_s)}")= task
        - info = workflow.task_info(task)
        - if info[:description]
          %span= info[:description].split(/\n\s*\n/).first


- @docs.each do |doc|
  %h2= link_to doc.title, doc
  %p= time_ago_in_words(doc.created_at)
  %p= truncate(doc.content, length: 50)

Add 'Create Doc' link on index view

- @docs.each do |doc|
  %h2= link_to doc.title, doc
  %p= time_ago_in_words(doc.created_at)
  %p= truncate(doc.content, length: 50)

= link_to "Create Doc", new_doc_path


- js = escape_javascript(
- render(partial: 'teams/list', locals: { teams: @teams })
- )
$("#filterrific_results").html("#{js}");

Fix line that was previously working and now causing a syntax error

- js = escape_javascript(render(partial: 'teams/list', locals: { teams: @teams }))
$("#filterrific_results").html("#{js}");


.poll-common-stance-choice{ng-class: "poll-common-stance-choice--{{stanceChoice.poll().pollType}}"}
  %poll_common_stance_icon{stance_choice: "stanceChoice"}
  %span{ng-if: "hasVariableScore()"}> {{stanceChoice.score}} -
  %span.poll-common-stance-choice__option-name{ng-if: "translateOptionName()", translate: "poll_{{stanceChoice.poll().pollType}}_options.{{stanceChoice.pollOption().name}}"}
  %poll_meeting_time{ng-if: "!translateOptionName() && datesAsOptions()", name: "stanceChoice.pollOption().name"}
  %span{ng-if: "!translateOptionName && !datesAsOptions()"} {{stanceChoice.pollOption().name}}

Fix poll option names not appearing

.poll-common-stance-choice{ng-class: "poll-common-stance-choice--{{stanceChoice.poll().pollType}}"}
  %poll_common_stance_icon{stance_choice: "stanceChoice"}
  %span{ng-if: "hasVariableScore()"}> {{stanceChoice.score}} -
  %span.poll-common-stance-choice__option-name{ng-if: "translateOptionName()", translate: "poll_{{stanceChoice.poll().pollType}}_options.{{stanceChoice.pollOption().name}}"}
  %poll_meeting_time{ng-if: "!translateOptionName() && datesAsOptions()", name: "stanceChoice.pollOption().name"}
  %span{ng-if: "!translateOptionName() && !datesAsOptions()"} {{stanceChoice.pollOption().name}}


= simple_format squat.address, {}, wrapper_tag: "address"

= simple_format squat.body, class: :body

- if squat.link
  = link_to squat.link, squat.link, class: :link

.periods
  %h5= t(:squat_period)
  - squat.periods.each do |p|
    .period
      = simple_format p.to_s

-unless squat.tags.blank?
  .tags
    %h5= t(:tags)
    %ul
      - squat.tags.try(:each) do |tag|
        %li= t(tag.to_sym)

Make squat links target _blank browser tab

= simple_format squat.address, {}, wrapper_tag: "address"

= simple_format squat.body, class: :body

- if squat.link
  = link_to squat.link, squat.link, class: :link, target: '_blank'

.periods
  %h5= t(:squat_period)
  - squat.periods.each do |p|
    .period
      = simple_format p.to_s

-unless squat.tags.blank?
  .tags
    %h5= t(:tags)
    %ul
      - squat.tags.try(:each) do |tag|
        %li= t(tag.to_sym)


= form_for current_user.work_entries.new do |f|
  %p.pull-left
    %strong New timer:
    = f.text_field :invoice_notes, class: "form-control medium inline", placeholder: "Whatcha workin on?"

  %p.pull-left
    = f.select :project_id, project_options_for_select(exclude_inactive: true, selected_id: current_user.last_project.try(:id)), {}, class: "form-control", style: "display: inline-block; max-width: 280px;"

    = f.submit "Start", class: "btn btn-primary btn-sm"

    = f.submit "Edit", class: "btn btn-info btn-sm"

Fix wrapping of new timer form

= form_for current_user.work_entries.new do |f|
  .nowrap{style: "padding-bottom: 10px;"}
    %strong New timer:
    = f.text_field :invoice_notes, class: "form-control inline", placeholder: "Whatcha workin on?", style: "width: 250px;"

    = f.select :project_id, project_options_for_select(exclude_inactive: true, selected_id: current_user.last_project.try(:id)), {}, class: "form-control", style: "display: inline-block; width: 250px;"

    = f.submit "Start", class: "btn btn-primary btn-sm"

    = f.submit "Edit", class: "btn btn-info btn-sm"


.what-is-this
  = markdown t("projects.page.about1", :project_language => @project.language, :project_nwo => escape_markdown(@project.name), :badge_image_url => badge_markup.image_path, :new_issue_url => github_issue_url(:project => @project))

  = markdown t("projects.page.about2")
  - if @project.build_on_inch_ci?
    - path = @project.language?(:javascript) ? help_configuration_json_path : help_configuration_yaml_path
    = markdown t("projects.page.about_help", :config_path => path)
  = markdown t("projects.page.about4")

Fix issue URL in about text (thx @Art4)

.what-is-this
  = markdown t("projects.page.about1", :project_language => @project.language, :project_nwo => escape_markdown(@project.name), :badge_image_url => badge_markup.image_path)

  = markdown t("projects.page.about2")
  - if @project.build_on_inch_ci?
    - path = @project.language?(:javascript) ? help_configuration_json_path : help_configuration_yaml_path
    = markdown t("projects.page.about_help", :config_path => path)
  = markdown t("projects.page.about4", :new_issue_url => github_issue_url(:project => @project))


.inst-box
  %header
    %strong
      Kind
    %p.desc
      Choose the type of location that best describes the services offered.
  %p
    - if f.object.new_record?
      = f.select :kind, Location.kind.options, prompt: 'Choose an option'
    - else
      = f.select :kind, Location.kind.options

Apply Bootstrap 3 styling to Kind dropdown.

.inst-box
  %header
    %strong
      Kind
    %p.desc
      Choose the type of location that best describes the services offered.
  %p
    - if f.object.new_record?
      = f.select :kind, Location.kind.options, { prompt: 'Choose an option' }, class: 'form-control'
    - else
      = f.select :kind, Location.kind.options, {}, class: 'form-control'


%tr
  %td
    = clinic_visit.date
  %td
    = clinic_visit.bmi
  %td
    = clinic_visit.bp
  %td
    = link_to 'Add Letter', new_clinic_visit_letter_path(clinic_visit), class: 'button tiny'
    = link_to 'Edit', edit_patient_clinic_visit_path(patient_id: clinic_visit.patient.to_param, id: clinic_visit.to_param), class: 'button tiny'
    = link_to 'Delete', patient_clinic_visit_path(patient_id: clinic_visit.patient.to_param, id: clinic_visit.to_param), method: :delete, class: 'button tiny cancel'

Streamline clinic visit index links (remove buttons)

%tr
  %td
    = clinic_visit.date
  %td
    = clinic_visit.bmi
  %td
    = clinic_visit.bp
  %td
    = link_to 'Create Clinic Letter', new_clinic_visit_letter_path(clinic_visit)
     |
    = link_to 'Edit', edit_patient_clinic_visit_path(patient_id: clinic_visit.patient.to_param, id: clinic_visit.to_param)
     |
    = link_to 'Delete', patient_clinic_visit_path(patient_id: clinic_visit.patient.to_param, id: clinic_visit.to_param), method: :delete


- content_for :note_actions do
  - if can?(current_user, :update_issue, @issue)
    = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue'
    = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue'

#js-notes
  - content_for :page_specific_javascripts do
    = webpack_bundle_tag 'common_vue'
    = webpack_bundle_tag 'notes'

#notes
  = render 'shared/notes/notes_with_form', :autocomplete => true

Add data-discussions-path to issues notes div

- content_for :note_actions do
  - if can?(current_user, :update_issue, @issue)
    = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue'
    = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue'

#js-notes
  - content_for :page_specific_javascripts do
    = webpack_bundle_tag 'common_vue'
    = webpack_bundle_tag 'notes'

#notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json) } }
  = render 'shared/notes/notes_with_form', :autocomplete => true


.panel.panel-default
  .panel-heading.clearfix
    = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'dash-filter form-control'
    - if current_user.can_create_project?
      %span.pull-right
        = link_to new_project_path, class: "btn btn-new" do
          %i.icon-plus
          New project

  %ul.well-list.dash-list
    - projects.each do |project|
      %li.project-row
        = render "project", project: project

    - if projects.blank?
      %li
        .nothing-here-block There are no projects here.
    - if @projects_count > @projects_limit
      %li.bottom
        %span.light
          #{@projects_limit} of #{pluralize(@projects_count, 'project')} displayed.
        .pull-right.append-right-10
          = link_to projects_dashboard_path do
            Show all
            %i.icon-angle-right

Fix dashboard "show more project" link padding

.panel.panel-default
  .panel-heading.clearfix
    = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'dash-filter form-control'
    - if current_user.can_create_project?
      %span.pull-right
        = link_to new_project_path, class: "btn btn-new" do
          %i.icon-plus
          New project

  %ul.well-list.dash-list
    - projects.each do |project|
      %li.project-row
        = render "project", project: project

    - if projects.blank?
      %li
        .nothing-here-block There are no projects here.
    - if @projects_count > @projects_limit
      %li.bottom
        %span.light
          #{@projects_limit} of #{pluralize(@projects_count, 'project')} displayed.
        .pull-right
          = link_to projects_dashboard_path do
            Show all
            %i.icon-angle-right


= link_to person_event_url(@topic, event, :format => "pdf"), {"class" => "btn", "#{review.published ? "data-hacky" : "disabled"}" => "disabled"} do
  %i.icon-print
  print
= link_to person_event_url(@topic, review.events.creation.first), :class => "btn" do
  %i.icon-th-list
  Show entire review

- if review.attendance
  %h4
    Attendance:
    = "#{review.attendance}%"

Fix bad links to reviews from everyone view

= link_to person_event_url(review.person, event, :format => "pdf"), {"class" => "btn", "#{review.published ? "data-hacky" : "disabled"}" => "disabled"} do
  %i.icon-print
  print
= link_to person_event_url(review.person, review.events.creation.first), :class => "btn" do
  %i.icon-th-list
  Show entire review

- if review.attendance
  %h4
    Attendance:
    = "#{review.attendance}%"


.top-bar.show-for-large
  .row
    .top-bar-left
      %ul.menu
        %li.topbar__logo= link_to image_tag('/logo.svg'), (signed_in? ? dashboard_path : root_path)
        - if company_signed_in?
          %li= link_to t('nav.jobs'), offers_path
          %li= link_to t('nav.candidates'), candidates_path
        -else
          %li= link_to t('nav.jobs_pl'), offers_poland_path
          %li= link_to t('nav.jobs_abroad'), offers_path
          %li= link_to t('nav.companies'), companies_path
    .top-bar-right
      %ul.menu
        %li= locale_link((current_locale == :en ? :pl : :en))

        - if signed_in?
          -if admin_signed_in?
            %li= link_to "Dashboard", "#"
          - else
            %li= link_to t('nav.profile'), profile_path
          %li= link_to t('nav.sign_out'), destroy_user_session_path, method: :delete
        - else
          %li= link_to t('nav.sign_in'), new_user_session_path
          %li= link_to t('nav.sign_up'), sign_up_path

Change links in topbar for company view

.top-bar.show-for-large
  .row
    .top-bar-left
      %ul.menu
        %li.topbar__logo= link_to image_tag('/logo.svg'), (signed_in? ? dashboard_path : root_path)
        - if company_signed_in?
          %li= link_to t('nav.jobs_pl'), offers_poland_path
          %li= link_to t('nav.jobs_abroad'), offers_path
          %li= link_to t('nav.candidates'), candidates_path
        -else
          %li= link_to t('nav.jobs_pl'), offers_poland_path
          %li= link_to t('nav.jobs_abroad'), offers_path
          %li= link_to t('nav.companies'), companies_path
    .top-bar-right
      %ul.menu
        %li= locale_link((current_locale == :en ? :pl : :en))

        - if signed_in?
          -if admin_signed_in?
            %li= link_to "Dashboard", "#"
          - else
            %li= link_to t('nav.profile'), profile_path
          %li= link_to t('nav.sign_out'), destroy_user_session_path, method: :delete
        - else
          %li= link_to t('nav.sign_in'), new_user_session_path
          %li= link_to t('nav.sign_up'), sign_up_path


-# Copyright (C) 2016 Google Inc.
-# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>

-extends "layouts/dashboard.haml"

-block title
  Admin Dashboard

-block extra_javascript
  =super()

-block header
  -include 'base_objects/_page_header.haml'

-block widget_area

Set GGRC.page_object for admin dashboard

-# Copyright (C) 2016 Google Inc.
-# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>

-extends "layouts/dashboard.haml"

-block title
  Admin Dashboard

-block extra_javascript
  =super()
  GGRC.page_object = { "person": ={ full_user_json()|safe } };

-block header
  -include 'base_objects/_page_header.haml'

-block widget_area


- if ENV['BUGSNAG_JAVASCRIPT_API_KEY']
  %script{ src:"//d2wy8f7a9ursnm.cloudfront.net/bugsnag-2.min.js",
    "data-apikey" => "#{ENV["BUGSNAG_JAVASCRIPT_API_KEY"]}" }

Add release stages to suppress dev and test errors

- if ENV['BUGSNAG_JAVASCRIPT_API_KEY']
  %script{ src:"//d2wy8f7a9ursnm.cloudfront.net/bugsnag-2.min.js",
    "data-apikey" => "#{ENV["BUGSNAG_JAVASCRIPT_API_KEY"]}" }
  :javascript
    Bugsnag.releaseStage = "#{Rails.env}";
    Bugsnag.notifyReleaseStages = ["staging", "production"];


.highlight__box.highlight--primary
  %p Parliament has been dissolved before the general election on 8 June. There are currently no MPs.

Update to dissolution banner highlight

.highlight__box.highlight--primary__soft
  %p Parliament has been dissolved before the general election on 8 June. There are currently no MPs.


.page{:id => page_name, "data-server-generated" => "true"}
	%h1
		%a{:href => '/', :style => "text-decoration: none"}
			%img{:src => '/favicon.png', :height => '32px'}
		= page['title']
	.story
		- page['story'].each do |item|
			%div{:class => ['item', type=item['type']], :id => item['id'], "data-static-item" => item.to_json}
				- case type
				- when 'paragraph'
					%p= resolve_links(item['text'])
				- when 'image'
					%img{:src => item['url']}
					%p= resolve_links(item['caption'])
				- when 'chart'
					%p.readout= item['data'].last.last || "0.0"
					%p= resolve_links(item['caption'])
				- else
					%p.error= type
	.footer
		%a{:id => "license", :href => "http://creativecommons.org/licenses/by-sa/3.0/"} CC BY-SA 3.0
		='.'
		%a{:class => "show-page-source", :href => "/#{page_name}.json"} JSON

Remove charts from ruby rendering

.page{:id => page_name, "data-server-generated" => "true"}
	%h1
		%a{:href => '/', :style => "text-decoration: none"}
			%img{:src => '/favicon.png', :height => '32px'}
		= page['title']
	.story
		- page['story'].each do |item|
			%div{:class => ['item', type=item['type']], :id => item['id'], "data-static-item" => item.to_json}
				- case type
				- when 'paragraph'
					%p= resolve_links(item['text'])
				- when 'image'
					%img{:src => item['url']}
					%p= resolve_links(item['caption'])
				- else
					%p.error= type
	.footer
		%a{:id => "license", :href => "http://creativecommons.org/licenses/by-sa/3.0/"} CC BY-SA 3.0
		='.'
		%a{:class => "show-page-source", :href => "/#{page_name}.json"} JSON


.row
  .columns.panel.radius.callout
    %h5 Reset Your Password
    %p Enter a new password and a confirmation below to change your current password
    = simple_form_for @user, :url => passwords_path(@user) do |f|
      = f.hidden_field :token, @token
      = f.label :password
      = f.password_field :password
      = f.label :password_confirmation
      = f.password_field :password_confirmation
      = f.submit "Reset Password", :class => "button tiny radius"

Correct the form path and token

.row
  .columns.panel.radius.callout
    %h5 Reset Your Password
    %p Enter a new password and a confirmation below to change your current password
    = simple_form_for @user, :url => password_path(@token) do |f|
      = hidden_field_tag :token, @token
      = f.label :password
      = f.password_field :password
      = f.label :password_confirmation
      = f.password_field :password_confirmation
      = f.submit "Reset Password", :class => "button tiny radius"


Add `show` template to display nested lists

#main_div
  - if %w(generic_objects).include?(@display)
    = render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"}
  - else
    = render :partial => 'layouts/textual_groups_generic'


.item
  .content
    - if report.errors.any?
      %ul.menu_v.error-explanation
        %li Client can't be saved, there are errors in form:
        - report.errors.full_messages.each do |msg|
          %li= msg
    %p
      %ul.menu_v
        /:app_id, :app_secret, :name, :site_url, :domain_matchers
        %li
          Name:
          = f.text_field :name
        %li
          URL:
          = f.text_field :url
        %li
          Launch Text:
          = f.text_field :launch_text
        %li
          Client:
          = f.select :client_id, report.options_for_client, {}, prompt: 'client:'
        %li
          Report Type:
          = f.select :report_type, report.options_for_report_type, {}, prompt: 'report type:'
        %li
          Allowed for Students:
          = f.check_box :allowed_for_students
      = submit_tag

Add extra description for "allow_for_students" property

.item
  .content
    - if report.errors.any?
      %ul.menu_v.error-explanation
        %li Client can't be saved, there are errors in form:
        - report.errors.full_messages.each do |msg|
          %li= msg
    %p
      %ul.menu_v
        /:app_id, :app_secret, :name, :site_url, :domain_matchers
        %li
          Name:
          = f.text_field :name
        %li
          URL:
          = f.text_field :url
        %li
          Launch Text:
          = f.text_field :launch_text
        %li
          Client:
          = f.select :client_id, report.options_for_client, {}, prompt: 'client:'
        %li
          Report Type:
          = f.select :report_type, report.options_for_report_type, {}, prompt: 'report type:'
        %li
          Allowed for Students:
          = f.check_box :allowed_for_students
          %p If the report type is 'offering', then students will see a button to open the report.
      = submit_tag


- if entry
  - attribute.klass.find_by(id: entry).send(attribute.name).each do |resource|
    = link_to "##{ resource.id }", edit_polymorphic_path(resource)

Add condition if resource was deleted for has_many partial

- if entry && attribute.klass.exists?(entry)
  - attribute.klass.find_by(id: entry).send(attribute.name).each do |resource|
    = link_to "##{ resource.id }", edit_polymorphic_path(resource)


=h1 "Les derniers comptes utilisateurs créés"

%table
  %tr
    %th Login
    %th Email
    %th Karma
    %th IP
    %th Status
    %th Date de création
    %th Actions
  - @accounts.each do |account|
    %tr
      %td= link_to account.login, account.user
      %td= account.email
      %td= account.karma
      %td= account.current_sign_in_ip
      %td= account.inactive? ? "Inactif" : "Actif"
      %td= account.created_at.to_s(:posted)
      %td
        = button_to("Activer",   [:admin, account], :method => :put) if account.inactive? && account.user_id != 1
        = button_to("Suspendre", [:admin, account], :method => :put) if !account.inactive?

Add pagination links for accounts listing in admin

=h1 "Les derniers comptes utilisateurs créés"

%table
  %tr
    %th Login
    %th Email
    %th Karma
    %th IP
    %th Status
    %th Date de création
    %th Actions
  - @accounts.each do |account|
    %tr
      %td= link_to account.login, account.user
      %td= account.email
      %td= account.karma
      %td= account.current_sign_in_ip
      %td= account.inactive? ? "Inactif" : "Actif"
      %td= account.created_at.to_s(:posted)
      %td
        = button_to("Activer",   [:admin, account], :method => :put) if account.inactive? && account.user_id != 1
        = button_to("Suspendre", [:admin, account], :method => :put) if !account.inactive?

= paginate @accounts


%ul.category-summary
  - categories.select {|category| category.post_count > 0 }.each do |category|
    %li.category-summary__item
      = link_to "#{category.name} (#{category.post_count})", category_url(category.slug), class: "category-summary__title"

      %ul.category-summary__list
        - if category.has_children?
          - category.children.each do |sub_category|
            %li.category-summary__list-item
              = link_to category.name, category_url(category.slug)

        - else
          - category.posts.published.order_by_recent.limit(7).each do |post|
            %li.category-summary__list-item
              = link_to post.title, post_url(post.public_id)

Fix sub category's text :<

%ul.category-summary
  - categories.select {|category| category.post_count > 0 }.each do |category|
    %li.category-summary__item
      = link_to "#{category.name} (#{category.post_count})", category_url(category.slug), class: "category-summary__title"

      %ul.category-summary__list
        - if category.has_children?
          - category.children.each do |sub_category|
            %li.category-summary__list-item
              = link_to "#{sub_category.name} (#{sub_category.post_count})", category_url(category.slug)

        - else
          - category.posts.published.order_by_recent.limit(7).each do |post|
            %li.category-summary__list-item
              = link_to post.title, post_url(post.public_id)


#rates_tabs_div
  - if x_node == "root"
    = render :partial => "rates_list"
  - elsif @edit && @edit[:new] && params[:pressed] && params[:pressed] != "chargeback_rates_delete"
    = render :partial => "cb_rate_edit"
  - elsif %w(Compute Storage).include?(x_node.split('-').last)
    = render :partial => 'layouts/x_gtl', :locals => {:action_url => "cb_rates_list"}
  - else
    = render :partial => "cb_rate_show"

Enable to edit Chargeback rate after resetting changes

#rates_tabs_div
  - if x_node == "root"
    = render :partial => "rates_list"
  - elsif @edit && @edit[:new] && ((params[:pressed] && params[:pressed] != "chargeback_rates_delete") || params[:button] == "reset")
    = render :partial => "cb_rate_edit"
  - elsif %w(Compute Storage).include?(x_node.split('-').last)
    = render :partial => 'layouts/x_gtl', :locals => {:action_url => "cb_rates_list"}
  - else
    = render :partial => "cb_rate_show"


!!!
%html
  %head
    %meta{:name =>  'viewport', :content => 'width=device-width, initial-scale=1.0'}
    %title= @page_title
    %link{:href => '/bootstrap/css/bootstrap.min.css', :rel => 'stylesheet', :media => 'screen'}
    %link{:href => '/css/common.css', :rel => 'stylesheet', :media => 'screen'}

  %body
    .navbar.navbar-inverse.navbar-fixed-top
      .container#header
        .navbar-header
          %button.navbar-toggle{'data-target' => '.navbar-collapse', 'data-toggle' => 'collapse', :type => 'button'}
            %span.icon-bar
            %span.icon-bar
            %span.icon-bar
          %a.navbar-brand{:href => '/'} Ginger
        .collapse.navbar-collapse
          %ul.nav.navbar-nav
            %li
              %a{:href => '/'} Home

    %form{:action => "/data_source/#{@data_source_name}", :method => 'POST'}
      %p
        %h3 Data Source name
        %input.form-control{:name => 'name', :type => 'text', :value => "#{@data_source_name}", :style => 'width: 100%;', :disabled => 'disabled'}
      %p
        %h3 Attributes
        %textarea.form-control{:name => 'attributes', :style => 'width: 100%; height: 250px;'}= @data_source[param_to_sym(@data_source_name)]
      %input{:type => 'submit', :value => 'Submit', :class=>'btn btn-success'}

Make the datasource name field readonly

!!!
%html
  %head
    %meta{:name =>  'viewport', :content => 'width=device-width, initial-scale=1.0'}
    %title= @page_title
    %link{:href => '/bootstrap/css/bootstrap.min.css', :rel => 'stylesheet', :media => 'screen'}
    %link{:href => '/css/common.css', :rel => 'stylesheet', :media => 'screen'}

  %body
    .navbar.navbar-inverse.navbar-fixed-top
      .container#header
        .navbar-header
          %button.navbar-toggle{'data-target' => '.navbar-collapse', 'data-toggle' => 'collapse', :type => 'button'}
            %span.icon-bar
            %span.icon-bar
            %span.icon-bar
          %a.navbar-brand{:href => '/'} Ginger
        .collapse.navbar-collapse
          %ul.nav.navbar-nav
            %li
              %a{:href => '/'} Home

    %form{:action => "/data_source/#{@data_source_name}", :method => 'POST'}
      %p
        %h3 Data Source name
        %input.form-control{:name => 'name', :type => 'text', :value => "#{@data_source_name}", :style => 'width: 100%;', :readonly => 'readonly'}
      %p
        %h3 Attributes
        %textarea.form-control{:name => 'attributes', :style => 'width: 100%; height: 250px;'}= @data_source[param_to_sym(@data_source_name)]
      %input{:type => 'submit', :value => 'Submit', :class=>'btn btn-success'}


=render partial: 'index_heading'

%section.resource_list
  %h1 Submitted
  %table#submitted_policies
    %thead
      %tr
        %th Title
        %th Author
        %th.actions Actions
    %tbody
    - @editions.each do |edition|
      %tr.policy
        %td.title= link_to edition.title, admin_edition_path(edition), title: "Show #{edition.title}"
        %td.author= edition.author.name
        %td.actions
          = link_to 'edit', edit_admin_edition_path(edition), title: "Edit #{edition.title}"

Make edit link consistent with the drafts view

=render partial: 'index_heading'

%section.resource_list
  %h1 Submitted
  %table#submitted_policies
    %thead
      %tr
        %th Title
        %th Author
        %th.actions Actions
    %tbody
    - @editions.each do |edition|
      %tr.policy
        %td.title= link_to edition.title, admin_edition_path(edition), title: "Show #{edition.title}"
        %td.author= edition.author.name
        %td.actions
          = link_to 'Edit', edit_admin_edition_path(edition), title: "Edit #{edition.title}"


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

  .row-fluid
    .span12= f.input :remarks, :input_html => {:rows => 4}

  = f.button :submit

Drop remarks field from esr file upload.

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

  = f.button :submit


%body
  %header.navbar.navbar-fixed-top.navbar-inverse
    .container
      = link_to "Ecotone", root_path, id: "logo"
      %nav
        %ul.nav.navbar-nav.navbar-right
          - if logged_in?
            - if admin?(current_user)
              %li= link_to "Users", users_path
            %li.dropdown
              %a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"}
                = current_user.name
                %b.caret
              %ul.dropdown-menu
                %li= link_to "Profile", current_user
                %li= link_to "Update Account", edit_user_path(current_user)
                %li.divider
                %li= link_to "Log out", logout_path, method: "delete"
          - else
            %li= link_to "Log in", login_path

Remove duplicate body tag from header partial.


%ul.nav.nav-sidebar
  = nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
    = link_to explore_root_path, title: 'Projects' do
      = icon('bookmark fw')
      %span
        Projects
  = nav_link(controller: :groups) do
    = link_to explore_groups_path, title: 'Groups' do
      = icon('group fw')
      %span
        Groups
  = nav_link(controller: :snippets) do
    = link_to explore_snippets_path, title: 'Snippets' do
      = icon('clipboard fw')
      %span
        Snippets
  = nav_link(controller: :help) do
    = link_to help_path, title: 'Help' do
      = icon('question-circle fw')
      %span
        Help

Fix active state for group pages if user not logged in

%ul.nav.nav-sidebar
  = nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
    = link_to explore_root_path, title: 'Projects' do
      = icon('bookmark fw')
      %span
        Projects
  = nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do
    = link_to explore_groups_path, title: 'Groups' do
      = icon('group fw')
      %span
        Groups
  = nav_link(controller: :snippets) do
    = link_to explore_snippets_path, title: 'Snippets' do
      = icon('clipboard fw')
      %span
        Snippets
  = nav_link(controller: :help) do
    = link_to help_path, title: 'Help' do
      = icon('question-circle fw')
      %span
        Help


.nobreak
  %h3= "Wave #{wave}"
  - if wave_times.count > 0
    %h4= wave_times.where(wave: wave).first.try(:scheduled_time)

  %table.full.grid
    %thead
      %tr
        %th ID
        %th Name
        - if @competition.age_group_type
          %th Age Group
        %th= RepresentationType.description

    %tbody
      - competitors.each do |comp|
        -# Why is this cached with i18n?
        - cache_i18n [@competition, comp, @config] do
          %tr
            %td= comp.bib_number
            %td
              = name_with_team(comp)
            - if @competition.age_group_type
              %td= comp.age_group_entry_description
            %td= comp.representation

Add pagebreak after each wave

.nobreak
  %h3= "Wave #{wave}"
  - if wave_times.count > 0
    %h4= wave_times.where(wave: wave).first.try(:scheduled_time)

  %table.full.grid
    %thead
      %tr
        %th ID
        %th Name
        - if @competition.age_group_type
          %th Age Group
        %th= RepresentationType.description

    %tbody
      - competitors.each do |comp|
        -# Why is this cached with i18n?
        - cache_i18n [@competition, comp, @config] do
          %tr
            %td= comp.bib_number
            %td
              = name_with_team(comp)
            - if @competition.age_group_type
              %td= comp.age_group_entry_description
            %td= comp.representation
.page-break


!!!
%html
  %head
    %title Translatable
    /[if lt IE 8]
    = stylesheet_link_tag    "application"
    = javascript_include_tag "application"
    = csrf_meta_tags

    %link{:rel => "Shortcut Icon", :type => "image/ico", :href => asset_path("favicon.png")}

  %body
    .topbar
      .topbar-inner
        .container
          %h3
            = link_to "translatable", root_url
          %ul.nav
            %li
              = link_to "New", "#"
          = form_tag translations_url, :method => :get do
            = text_field_tag :filter_by, params[:filter_by], :placeholder => "filter"
          %ul.nav.secondary-nav
            %li.dropdown
              = link_to "Locales", "#", :class => "dropdown-toggle"
              %ul.dropdown-menu
                - Translation.locales.each do |locale|
                  = content_tag :li, link_to(locale, translations_url(:filter_by => params[:filter_by], :locale=> locale)), :class => (params[:locale] == locale ? 'active' : nil)

    .container
      = yield(:header_right)
      %section#content= yield

    %footer

Remove new link. Make the name lowercase

!!!
%html
  %head
    %title translatable
    /[if lt IE 8]
    = stylesheet_link_tag    "application"
    = javascript_include_tag "application"
    = csrf_meta_tags

    %link{:rel => "Shortcut Icon", :type => "image/ico", :href => asset_path("favicon.png")}

  %body
    .topbar
      .topbar-inner
        .container
          %h3
            = link_to "translatable", root_url
          %ul.nav
          = form_tag translations_url, :method => :get do
            = text_field_tag :filter_by, params[:filter_by], :placeholder => "filter"
          %ul.nav.secondary-nav
            %li.dropdown
              = link_to "Locales", "#", :class => "dropdown-toggle"
              %ul.dropdown-menu
                - Translation.locales.each do |locale|
                  = content_tag :li, link_to(locale, translations_url(:filter_by => params[:filter_by], :locale=> locale)), :class => (params[:locale] == locale ? 'active' : nil)

    .container
      = yield(:header_right)
      %section#content= yield

    %footer