.panel.panel-default
  - tasks_sprint = @sprint.project.tasks.unscoped.done.where('updated_at >= ?', @sprint.created_at).where('updated_at <= ?', @sprint.updated_at)
  .panel-body.hidden-xs
    %strong
      Highest tasks

  .list-group.hidden-xs
    - if tasks_sprint.empty?
      .list-group-item
        Nothing to rate
    - else
      - tasks_sprint.order('workload DESC').each do |task|
        .list-group-item
          = badge(task.workload)
          = link_to task_path(task) do
            = task.title

  .panel-body.hidden-xs
    %strong
      Workload

  .list-group.hidden-xs
    .list-group-item
      Burn up
      - total_workload = 0
      - burn_up_data   = tasks_sprint.group_by_period(:day, :updated_at).order('max(updated_at)').sum(:workload)
      - if burn_up_data.empty?
        - burn_up_data = { @sprint.created_at => 0 }
      - burn_up_data = burn_up_data.transform_keys { |key| key.strftime('%B %d') }
      = area_chart burn_up_data.each { |key, value| burn_up_data[key] = total_workload += value }, discrete: true, library: { chartArea: { width: '80%', height: '90%' }, hAxis: { textPosition: 'none' }, pointSize: 8 }

Fix highest task in sprint panel

.panel.panel-default
  - tasks_sprint = Task.unscoped.done.where('updated_at >= ?', @sprint.created_at).where('updated_at <= ?', @sprint.updated_at).where(project: @sprint.project)
  .panel-body.hidden-xs
    %strong
      Highest tasks

  .list-group.hidden-xs
    - if tasks_sprint.empty?
      .list-group-item
        Nothing to rate
    - else
      - tasks_sprint.order('workload DESC').each do |task|
        .list-group-item
          = badge(task.workload)
          = link_to task_path(task) do
            = task.title

  .panel-body.hidden-xs
    %strong
      Workload

  .list-group.hidden-xs
    .list-group-item
      Burn up
      - total_workload = 0
      - burn_up_data   = tasks_sprint.group_by_period(:day, :updated_at).order('max(updated_at)').sum(:workload)
      - if burn_up_data.empty?
        - burn_up_data = { @sprint.created_at => 0 }
      - burn_up_data = burn_up_data.transform_keys { |key| key.strftime('%B %d') }
      = area_chart burn_up_data.each { |key, value| burn_up_data[key] = total_workload += value }, discrete: true, library: { chartArea: { width: '80%', height: '90%' }, hAxis: { textPosition: 'none' }, pointSize: 8 }


.col-md-3.sidebar
  %ul#sidebar.nav.sidenav
    %li
      %h4
        Actions
        .menu-icon-container
          %span.glyphicon.glyphicon-tasks.menu-icon
    %hr/
    %li.sidebar-item
      %a{:href => "/submissions/#{@assignment.id}/new"}
        %span.glyphicon.glyphicon-plus
        New submission
    - if !@submission.finalised
      %li.sidebar-item
        %a{:href => "/submissions/#{@submission.id}/finalise"}
          %span.glyphicon.glyphicon-check
          Finalise submission
    %li.sidebar-item
      = link_to submission_path(@submission) + "/download" do
        %span.glyphicon.glyphicon-floppy-save
        Download submission
    %li.sidebar-item
      = link_to submission_path(@submission) + "/pdf" do
        %span.glyphicon.glyphicon-floppy-save
        Download PDF
    %li.sidebar-item
      = link_to assignment_path(@submission.assignment) do
        %span.glyphicon.glyphicon-file
        View assignment
    %li.sidebar-item
      = link_to submission_path(@submission), method: :delete, |
        data: { confirm: "are you sure you wish to delete this submission?"} do |
        %span.glyphicon.glyphicon-trash
        Delete submission

Fix capitalisation on submission deletion alert

.col-md-3.sidebar
  %ul#sidebar.nav.sidenav
    %li
      %h4
        Actions
        .menu-icon-container
          %span.glyphicon.glyphicon-tasks.menu-icon
    %hr/
    %li.sidebar-item
      %a{:href => "/submissions/#{@assignment.id}/new"}
        %span.glyphicon.glyphicon-plus
        New submission
    - if !@submission.finalised
      %li.sidebar-item
        %a{:href => "/submissions/#{@submission.id}/finalise"}
          %span.glyphicon.glyphicon-check
          Finalise submission
    %li.sidebar-item
      = link_to submission_path(@submission) + "/download" do
        %span.glyphicon.glyphicon-floppy-save
        Download submission
    %li.sidebar-item
      = link_to submission_path(@submission) + "/pdf" do
        %span.glyphicon.glyphicon-floppy-save
        Download PDF
    %li.sidebar-item
      = link_to assignment_path(@submission.assignment) do
        %span.glyphicon.glyphicon-file
        View assignment
    %li.sidebar-item
      = link_to submission_path(@submission), method: :delete, |
        data: { confirm: "Are you sure you wish to delete this submission?"} do |
        %span.glyphicon.glyphicon-trash
        Delete submission


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

Add the value and link to each contract

%h1 Who profits from WestConnex?
%ul.contractors
  - @contractors.each do |contractor|
    %li.contractor
      %h2.contractor-name= contractor.name
      %span.contractor-value= number_to_currency(contractor.total_est_contract_value, precision: 0)
      %h3.contract-counter= pluralize(contractor.contracts.count, "contract")
      %ul.contracts
        - contractor.contracts.each do |contract|
          %li.contract
            %p
              #{number_to_currency(contract.value, precision: 0)}
              for
              “#{link_to(contract.description, contract.url, title: "View the contract listing at tenders.gov.nsw")}”.


.ui.text.container
  %h1 Awww yeahhh!
  %p You've got the app setup!

Add content to the home page

.ui.center.aligned.container
  .ui.welcome.segment
    %h1 Awww yeahhh!
    %p
      You've got the app setup!
      %br
      That was the easy part
    %p
      If this starter app helped you get up and running in any way, I accept:
      %br
      Thanks:
      %a{href: 'https://twitter.com/amingilani'} @amingilani
      %br
      Gratitude:
      %a{href: 'bitcoin:13kcVthUJti7KEb4cQp1mH2X3aBu6DSTBz'} 13kcVthUJti7KEb4cQp1mH2X3aBu6DSTBz

    %p Go forth and build something awesome


-#     Chicago Ideas Week
-#     speakers/edison.html.haml
-#     05/21/2012

-# Begin Main Speaker content
%section.container#main_content

  %img{ :src => "/assets/application/edison_logo.jpg", :rel => "bookmark", :title => "", :width => "1000", :height => "350" }
  %div#edison_info
    %div
      %p Edison Talks is an invitation-only, daylong gathering of provocative presentations, performances and interactive installations led by globally recognized visionaries created to connect and inspire leaders from across the globe.
    %div
      %h2
        %p Friday, October 12th, 2012
        %p 9:00am - 6:00pm
      %p Chicago Tribune Freedom Center,
      %p Riverfront Theater
      %p
        For questions, please contact:
        %a{:href => "mailto:edisontalks@chicagoideas.com"}
          edisontalks@chicagoideas.com

  - if @speakers.length > 0
    %div#edison_speakers
      %ul.preview_list.speaker_list.double_rows
        = render "partials/edison_speakers_loop", :speakers => @speakers
      %div{:class => "clearfix" }
  - else
    %div#edison_speakers_none
      %p List of Speakers Coming Soon

Tweak to Edison Talks Landing page text

-#     Chicago Ideas Week
-#     speakers/edison.html.haml
-#     05/21/2012

-# Begin Main Speaker content
%section.container#main_content

  %img{ :src => "/assets/application/edison_logo.jpg", :rel => "bookmark", :title => "", :width => "1000", :height => "350" }
  %div#edison_info
    %div
      %p Edison Talks is an invitation-only, daylong gathering of provocative presentations, performances and interactive installations led by globally recognized visionaries created to connect and inspire leaders from across the globe.
    %div
      %h2
        %p Friday, October 12th, 2012
        %p 9:00am - 6:00pm
      %p Chicago Tribune Freedom Center,
      %p Riverfront Theater
      %p
        For questions, please contact:
        %a{:href => "mailto:edisontalks@chicagoideas.com"}
          edisontalks@chicagoideas.com

  - if @speakers.length > 0
    %div#edison_speakers
      %ul.preview_list.speaker_list.double_rows
        = render "partials/edison_speakers_loop", :speakers => @speakers
      %div{:class => "clearfix" }
  - else
    %div#edison_speakers_none
      %p Speakers Coming Soon


- page_title 'Badges'

.prepend-top-10
  .panel.panel-default
    .panel-heading
      %b Builds badge ·
      = @badge.to_html
    .panel-body
      %table.table
        %tr
          %td Markdown
          %td= markdown("```markdown\n#{@badge.to_markdown}\n```")
        %tr
          %td HTML
          %td= markdown("```html\n#{@badge.to_html}\n```")

Improve view with list of badges

- page_title 'Badges'

.prepend-top-10
  .panel.panel-default
    .panel-heading
      %b Builds badge ·
      = @badge.to_html
    .panel-body
      .row
        .col-md-2.text-center
          Markdown
        .col-md-10
          = markdown("```markdown\n#{@badge.to_markdown}\n```")
      .row
        %hr
      .row
        .col-md-2.text-center
          HTML
        .col-md-10
          = markdown("```html\n#{@badge.to_html}\n```")


.container-fluid
  = form_for @assignment, url: path do |f|
    .row
      .col-2.offset-3
        .form-group
          = f.label :user_id
          = f.collection_select :user_id, @users, :id, :last_name,
                                {}, class: 'form-control custom-select'
      .col-4
        .form-group
          = f.label :start_date
          = f.text_field :start_date, class: 'datepicker form-control'
        .form-group
          = f.label :end_date
          = f.text_field :end_date, class: 'datepicker form-control'
    .row
      .offset-3.col-3= f.submit 'Save', class: 'btn btn-secondary'
      - if @assignment.persisted?
        .col-3.text-right= button_to 'Delete assignment',
          roster_assignment_path(@roster, @assignment),
          method: :delete, class: 'btn btn-danger'

Fix up form: roster_id, default dates

.container-fluid
  = form_for @assignment, url: path do |f|
    = f.hidden_field :roster_id, value: @roster.id
    .row
      .col-2.offset-3
        .form-group
          = f.label :user_id
          = f.collection_select :user_id, @users, :id, :last_name,
                                {}, class: 'form-control custom-select'
      .col-4
        .form-group
          = f.label :start_date
          = f.text_field :start_date, value: f.object.start_date || @start_date,
            class: 'datepicker form-control'
        .form-group
          = f.label :end_date
          = f.text_field :end_date, value: f.object.end_date || @end_date,
            class: 'datepicker form-control'
    .row
      .offset-3.col-3= f.submit 'Save', class: 'btn btn-secondary'
      - if @assignment.persisted?
        .col-3.text-right= button_to 'Delete assignment',
          roster_assignment_path(@roster, @assignment),
          method: :delete, class: 'btn btn-danger'


%nav.navbar.navbar-fixed-top.navbar-inverse
  .navbar-inner
    .container
      %a.btn.btn-navbar(data-target=".nav-collapse" data-toggle="collapse")
        %span.icon-bar
        %span.icon-bar
        %span.icon-bar
      %a.logo.hidden-phone{href: 'http://higgins.org'}
        %img{src: '/assets/higgins-logo.gif'}
      %a.brand{href: "/"} Search the Higgins Collection
      .container.nav-collapse
        %ul.nav
          %li= link_to "Higgins Museum", 'http://higgins.org'
          %li= link_to "Virtual Armory", 'http://users.wpi.edu/~virtualarmory/'
          %li= link_to "About", page_path(:about)
          -if user_signed_in?
            %li= link_to 'Admin', admin_path

Change nav link from higgins armory to WAM

%nav.navbar.navbar-fixed-top.navbar-inverse
  .navbar-inner
    .container
      %a.btn.btn-navbar(data-target=".nav-collapse" data-toggle="collapse")
        %span.icon-bar
        %span.icon-bar
        %span.icon-bar
      %a.logo.hidden-phone{href: 'http://higgins.org'}
        %img{src: '/assets/higgins-logo.gif'}
      %a.brand{href: "/"} Search the Higgins Collection
      .container.nav-collapse
        %ul.nav
          %li= link_to "Higgins Collection (WAM)", 'http://www.worcesterart.org/Director/higgins-collection/index.html'
          %li= link_to "Virtual Armory", 'http://users.wpi.edu/~virtualarmory/'
          %li= link_to "About", page_path(:about)
          -if user_signed_in?
            %li= link_to 'Admin', admin_path


.new-site-comment-form
  %h1= t ".title"
  = semantic_form_for @site_comment, remote: true do |f|
    = f.inputs do
      = f.input :body
      = f.input :name
      = f.input :email
      = f.input :context_url, as: :hidden, value: request.referer
    = f.buttons do
      = f.commit_button
      = cancel_link root_path

Reduce the number of duplicate feedbacks by disabling the submit button.

.new-site-comment-form
  %h1= t ".title"
  = semantic_form_for @site_comment, remote: true do |f|
    = f.inputs do
      = f.input :body
      = f.input :name
      = f.input :email
      = f.input :context_url, as: :hidden, value: request.referer
    = f.buttons do
      = f.commit_button button_html: { data: { disable_with: t("formtastic.actions.saving") } }
      = cancel_link root_path


%div{ class: "card card--#{status} mbm" }
  %h2= link_to page, link, target: '_blank'
  %p{ class: ('mbf' unless note) }
    %strong Status:
    - if status == 'success'
      %span.tsi= data.status.success_status
    - elsif status == 'warning'
      %span.tsi= data.status.warning_status
    - else
      %span.tsi= data.status.error_status
  - if note
    %p.mbf= note

Remove the target '_blank' attribute from links

%div{ class: "card card--#{status} mbm" }
  %h2= link_to page, link
  %p{ class: ('mbf' unless note) }
    %strong Status:
    - if status == 'success'
      %span.tsi= data.status.success_status
    - elsif status == 'warning'
      %span.tsi= data.status.warning_status
    - else
      %span.tsi= data.status.error_status
  - if note
    %p.mbf= note


- page_title("Editando Post")

.ribbon Administración de Posts

= render 'pills'

%h2.title
  Editando Post ##{@article.id}
  %small= link_to "Ver original", @article, :target => '_blank'

= render 'form', :post => @post

Fix copy/paste bug in admin/posts/edit

- page_title("Editando Post")

.ribbon Administración de Posts

= render 'pills'

%h2.title
  Editando Post ##{@post.id}
  %small= link_to "Ver original", @post, :target => '_blank'

= render 'form', :post => @post


%tr.line_item.nested-form-item
  %td= line_item.text_field :date, :style => 'width: 85px', 'date-picker' => 'true'
  %td= line_item.text_field :title, :required => true, :style => 'width: 30em'
  %td= line_item.text_field :times, :required => true, :style => 'width: 3em', :autocomplete => "off"
  %td= line_item.select :quantity, ['x', 'hours', 'overall'].map{|quantity| [t(quantity, :scope => 'line_items.quantity'), quantity]}, {}, :style => 'width: 6em'
  %td= line_item.text_field :price, :required => true, :style => 'width: 5em', :autocomplete => "off"
  %td.currency.total_amount= currency_fmt(line_item.object.total_amount)
  %td= line_item.select :vat_rate_code, vat_rates_as_collection
  %td= line_item.select :booking_template_id, BookingTemplate.by_type(resource_class.name + '_position').collect{|booking_template| [booking_template.title, booking_template.id]}
  %td.action_links
    = line_item.hidden_field :_destroy
    = link_to t_action(:delete), '#', :class => 'icon-delete-text delete-nested-form-item'

Fix code generation for booking_template selection in line_item form.

%tr.line_item.nested-form-item
  %td= line_item.text_field :date, :style => 'width: 85px', 'date-picker' => 'true'
  %td= line_item.text_field :title, :required => true, :style => 'width: 30em'
  %td= line_item.text_field :times, :required => true, :style => 'width: 3em', :autocomplete => "off"
  %td= line_item.select :quantity, ['x', 'hours', 'overall'].map{|quantity| [t(quantity, :scope => 'line_items.quantity'), quantity]}, {}, :style => 'width: 6em'
  %td= line_item.text_field :price, :required => true, :style => 'width: 5em', :autocomplete => "off"
  %td.currency.total_amount= currency_fmt(line_item.object.total_amount)
  %td= line_item.select :vat_rate_code, vat_rates_as_collection
  %td= line_item.select :booking_template_id, BookingTemplate.by_type(resource_class.name.underscore + '_position').collect{|booking_template| [booking_template.title, booking_template.id]}
  %td.action_links
    = line_item.hidden_field :_destroy
    = link_to t_action(:delete), '#', :class => 'icon-delete-text delete-nested-form-item'


%h2
  Rules of
  = co.name

.section
  TODO: Rules text here.

Add an edit button to the co-op rules page.

%h2
  Rules of
  = co.name

.section
  = link_button("Propose an amendment to the rules", :url => edit_constitution_path)
  %br.clear

.section
  TODO: Rules text here.


- if pitch.editable_by?(current_user) || pitch.featureable_by?(current_user) || pitch.postable_by?(current_user) || (pitch.story && pitch.fact_checker == current_user) || (pitch.fully_funded? && current_user == pitch.user)
  .block-spacer-negative
- if pitch.editable_by?(current_user)
  .centered= link_to image_tag("edit_this_pitch_b.png"), edit_pitch_path(pitch)
- if pitch.featureable_by?(current_user)
  - if pitch.featured?
    .centered= link_to image_tag('un-feature.gif'), unfeature_pitch_path(pitch), :method => :put
  - else
    .centered= link_to image_tag('feature_this_pitch.png'), feature_pitch_path(pitch), :method => :put
- if pitch.postable_by?(current_user)
  = link_to image_tag('make_blog_post.gif'), new_pitch_post_path(pitch)
- if pitch.story && pitch.fact_checker == current_user
  = link_to image_tag('go_to_story.gif'), story_path(pitch.story)
- if pitch.fully_funded? && current_user == pitch.user
  = link_to image_tag('report.gif'), edit_story_path(pitch.story)

Remove excessive logic in action buttons partial

- if pitch.editable_by?(current_user) || pitch.featureable_by?(current_user) || pitch.postable_by?(current_user)
  .block-spacer-negative
- if pitch.editable_by?(current_user)
  .centered= link_to image_tag("edit_this_pitch_b.png"), edit_pitch_path(pitch)
- if pitch.featureable_by?(current_user)
  - if pitch.featured?
    .centered= link_to image_tag('un-feature.gif'), unfeature_pitch_path(pitch), :method => :put
  - else
    .centered= link_to image_tag('feature_this_pitch.png'), feature_pitch_path(pitch), :method => :put
- if pitch.postable_by?(current_user)
  = link_to image_tag('make_blog_post.gif'), new_pitch_post_path(pitch)
- if pitch.story && pitch.fact_checker == current_user
  = link_to image_tag('go_to_story.gif'), story_path(pitch.story)
- if pitch.fully_funded? && current_user == pitch.user
  = link_to image_tag('report.gif'), edit_story_path(pitch.story)


%tr
  %td
    = author_view?(letter) ? letter.patient.full_name : letter.author.full_name
  %td
    = letter.letter_description.text
  %td
    = letter.state
  %td
    = letter.updated_at
  %td
    = link_to 'Edit', edit_patient_letter_path(patient_id: letter.patient.to_param, id: letter.to_param), class: 'button tiny'
    = link_to 'Delete', patient_letter_path(patient_id: letter.patient.to_param, id: letter.to_param), method: :delete, class: 'button tiny cancel'

Streamline patient letters action links

%tr
  %td
    = author_view?(letter) ? letter.patient.full_name : letter.author.full_name
  %td
    = letter.letter_description.text
  %td
    = letter.state
  %td
    = letter.updated_at
  %td
    = link_to 'Edit', edit_patient_letter_path(patient_id: letter.patient.to_param, id: letter.to_param)
     |
    = link_to 'Delete', patient_letter_path(patient_id: letter.patient.to_param, id: letter.to_param), method: :delete


.card{ data: { id: u.id } }
  .card-body
    .media
      .pull-left
        %a{ href: user_path(u) }
          %img.avatar-md.mr-2{ src: u.profile_picture.url(:medium) }
      .media-body
        %h6.media-heading.answerbox__question-user
          - if u.profile.display_name.blank?
            %a{ href: user_path(u) }
              = u.screen_name
          - else
            %a{ href: user_path(u) }
              = u.profile.display_name
            %span.text-muted= u.screen_name
        %p.answerbox__question-text
          - case type
          - when 'new'
            = t('views.discover.userbox.new', time: time_ago_in_words(u.created_at))
          - when 'most'
            = t('views.discover.userbox.answers', questions: pluralize(a, t('views.general.question')))
          - else
            = t('views.discover.userbox.questions', questions: pluralize(q, t('views.general.question')))

Add new translations for Discover userbox

.card{ data: { id: u.id } }
  .card-body
    .media
      .pull-left
        %a{ href: user_path(u) }
          %img.avatar-md.mr-2{ src: u.profile_picture.url(:medium) }
      .media-body
        %h6.media-heading.answerbox__question-user
          - if u.profile.display_name.blank?
            %a{ href: user_path(u) }
              = u.screen_name
          - else
            %a{ href: user_path(u) }
              = u.profile.display_name
            %span.text-muted= u.screen_name
        %p.answerbox__question-text= t(".#{type}", value: value, count: value)


- @page_title = "Create New District"
- content_for :javascript do
  = javascript_include_tag 'new_sketch.js'
#new_sketch_page
  #picture_frame
    #stage
    = form_for @sketch do |f|
      = hidden_field_tag :sketch_token, @sketch.token
      = hidden_field_tag :combined_code, @sketch.district.combined_code
      = f.text_field :title, :placeholder => fun_title(@sketch.district)
      = f.text_field :byline, :placeholder => fun_name
      %button#save_drawing(type:submit) Save
    #population_estimate
      %p#population_label Population
      %p#population_value 0
    %button#undo_last_path(type:button) Undo
    %button#clear_all_paths(type:button) Clear
    .clear
  %section#about_the_app
    %h1 About
    %p
      :markdown
        Congressional districts sometimes have weird, even non-sensical
        shapes! Here you can have some fun with them.

        We've given you a random district. Tag it, name it, save it, and share
        it.
  = render :partial => 'gallery'

Tweak new page about text

- @page_title = "Create New District"
- content_for :javascript do
  = javascript_include_tag 'new_sketch.js'
#new_sketch_page
  #picture_frame
    #stage
    = form_for @sketch do |f|
      = hidden_field_tag :sketch_token, @sketch.token
      = hidden_field_tag :combined_code, @sketch.district.combined_code
      = f.text_field :title, :placeholder => fun_title(@sketch.district)
      = f.text_field :byline, :placeholder => fun_name
      %button#save_drawing(type:submit) Save
    #population_estimate
      %p#population_label Population
      %p#population_value 0
    %button#undo_last_path(type:button) Undo
    %button#clear_all_paths(type:button) Clear
    .clear
  %section#about_the_app
    %h1 About
    %p
      :markdown
        Congressional districts sometimes have weird, even non-sensical
        shapes! Here you can have some fun with them.

        We've given you a random district. Tag it and name it. After you save
        it, we'll give you a link to share with your friends. If you are
        lucky, it might also show up in the gallery, too!
  = render :partial => 'gallery'


- if signed_in?
  .priority-panel
    %h3= t ".thread_priority"
    = semantic_form_for (@thread.priority_for(current_user) || UserThreadPriority.new), url: thread_user_priorities_path(@thread) do |f|
      = f.inputs do
        = f.input :priority, :as => :select, :collection => f.object.class.priorities_map
      = f.buttons do
        = f.commit_button

Tweak priority panel to match other panels

- if signed_in?
  %section.priority-panel
    %h2= t ".thread_priority"
    = semantic_form_for (@thread.priority_for(current_user) || UserThreadPriority.new), url: thread_user_priorities_path(@thread) do |f|
      = f.inputs do
        = f.input :priority, :as => :select, :collection => f.object.class.priorities_map
      = f.buttons do
        = f.commit_button


!!! 5
%html
  %head
    %title densitypop.com - Cleveland-based Web Consulting, iPad R&D, Online Store Design
    %link(rel="stylesheet" href="http://webfonts.justanotherfoundry.com/Facit/")
    %link(rel="stylesheet" href="http://webfonts.justanotherfoundry.com/Lapture/")
    %link(rel="stylesheet" href="/css/screen.css")
  %body
    = yield

Set viewport size & disable scaling for iPhone

!!! 5
%html
  %head
    %title densitypop.com - Cleveland-based Web Consulting, iPad R&D, Online Store Design
    %meta(name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0")
    %link(rel="stylesheet" href="http://webfonts.justanotherfoundry.com/Facit/")
    %link(rel="stylesheet" href="http://webfonts.justanotherfoundry.com/Lapture/")
    %link(rel="stylesheet" href="/css/screen.css")
  %body
    = yield


.tabbable
  %ul.nav.nav-tabs
    %li.active= link_to 'Details', '#tab-details', {:data => {:toggle => 'tab'}}
    %li= link_to 'Stundenrapport', '#tab-activities', {:data => {:toggle => 'tab'}}

.tab-content
  #tab-details.tab-pane.active
    = render "form"
  #tab-activities.tab-pane
    = render 'show_activities'

Use translations for activities tab in projects.

.tabbable
  %ul.nav.nav-tabs
    %li.active= link_to 'Details', '#tab-details', {:data => {:toggle => 'tab'}}
    %li= link_to t_title(:list, Activity), '#tab-activities', {:data => {:toggle => 'tab'}}

.tab-content
  #tab-details.tab-pane.active
    = render "form"
  #tab-activities.tab-pane
    = render 'show_activities'


= wrap_layout :base_layout do
  .conference_layout{ class: "#{'sub_page' if current_page.data.sub_page}" }
    %section.hero
      .hero-inner
        .hero-copy
          %h1
            2015 International Conference for
            %br.header-break/
            Women Software Developers
            %a.small{ href: '#developer-definition' }*

          %h2
            March 19, 20, & 21, 2015
            %i.fa.fa-star-o
            Pace University, New York City

          %p
            %a.button.primary{ href: 'https://guestlistapp.com/events/306111' }
              Register NOW!
            %a.button.notice{ href: '/sponsors' }
              Sponsor

          %h4.childcare
            %a{ href: '/conference/childcare' }
              Childcare Available!

    #content
      = yield

      .developer-definition
        %a{ name: 'developer-definition' }
        %small
          We define "software developer" as anyone who has written a line of code
          (HTML, CSS, JavaScript, Ruby, Python, Java, whatever) and can explain
          what it does.  Designers, E-book publishers, and beginners as well as
          engineers with 20 years experience have enjoyed our workshops and been
          inspired by each other.

Add scholarship link to conf layout

= wrap_layout :base_layout do
  .conference_layout{ class: "#{'sub_page' if current_page.data.sub_page}" }
    %section.hero
      .hero-inner
        .hero-copy
          %h1
            2015 International Conference for
            %br.header-break/
            Women Software Developers
            %a.small{ href: '#developer-definition' }*

          %h2
            March 19, 20, & 21, 2015
            %i.fa.fa-star-o
            Pace University, New York City

          %p
            %a.button.success{ href: '/scholarships' } Scholarships
            %a.button.primary{ href: 'https://guestlistapp.com/events/306111' }
              Register NOW!
            %a.button.notice{ href: '/sponsors' } Sponsor

          %h4.childcare
            %a{ href: '/conference/childcare' }
              Childcare Available!

    #content
      = yield

      .developer-definition
        %a{ name: 'developer-definition' }
        %small
          We define "software developer" as anyone who has written a line of code
          (HTML, CSS, JavaScript, Ruby, Python, Java, whatever) and can explain
          what it does.  Designers, E-book publishers, and beginners as well as
          engineers with 20 years experience have enjoyed our workshops and been
          inspired by each other.


= search_form_for @ransack_search, :url => url_for(:action => :index), :html => {:method => :get, :class => "ransack_search"}, :remote => !!options[:remote] do |f|

  :javascript
    if (window.Ransack == null) { window.Ransack = {}; }
    Ransack.alt_predicates_i18n = #{I18n.translate(:"ransack.predicates.alt", :default => {}).to_json}

  .row
    .span12.well
      = f.grouping_fields do |g|
        = render 'ransack_ui/grouping_fields', :f => g

      %p
        = link_to_add_fields t(:add_group), f, :grouping

  .row
    .span12.well
      .pull-left
        = f.sort_fields do |s|
          = render 'ransack_ui/sort_fields', :f => s
      .pull-right
        = hidden_field_tag :distinct, '1'
        = hidden_field_tag :page, '1'
        = f.submit t(:submit), :class => 'btn btn-primary btn-large'

Use a single container for search form, split with hr

= search_form_for @ransack_search, :url => url_for(:action => :index), :html => {:method => :get, :class => "ransack_search"}, :remote => !!options[:remote] do |f|

  :javascript
    if (window.Ransack == null) { window.Ransack = {}; }
    Ransack.alt_predicates_i18n = #{I18n.translate(:"ransack.predicates.alt", :default => {}).to_json}

  .row
    .span12.well
      = f.grouping_fields do |g|
        = render 'ransack_ui/grouping_fields', :f => g

      %p
        = link_to_add_fields t(:add_group), f, :grouping

      %hr

      .pull-left
        = f.sort_fields do |s|
          = render 'ransack_ui/sort_fields', :f => s

      .pull-right
        = hidden_field_tag :distinct, '1'
        = hidden_field_tag :page, '1'
        = f.submit t(:submit), :class => 'btn btn-primary btn-large'


%p
  = label_tag(:'location-type', 'Location type')
  = select_tag(:'location-type', options_for_select(view_state.location_type_options))

%p
  = label_tag(:'location-term', 'Search for a location')
  = text_field_tag(:'location-term')

%button{ type: 'submit', value: 'search', name: 'form-action' }
  Search

Add dates to user preferences form

%p
  = label_tag(:'location-type', 'Location type')
  = select_tag(:'location-type', options_for_select(view_state.location_type_options))

%p
  = label_tag(:'location-term', 'Search for a location')
  = text_field_tag(:'location-term')

  %button{ type: 'submit', value: 'search', name: 'form-action' }
    Search

%h3.o-heading--3 Dates

%p
  = label_tag(:from, 'From:')
  = date_field_tag(:from, view_state.user_selections.from_date)

%p
  = label_tag(:to, 'To:')
  = date_field_tag(:to, view_state.user_selections.to_date)


.edit
  %h2= @phrasing_phrase.key
  = button_to "Delete this item", phrasing_phrase_path(@phrasing_phrase), :method => :delete, :onclick => "return confirm('Are you sure?');"
  = form_for @phrasing_phrase, :url => { :action => "update" } do |f|
    = f.text_area :value, :rows => 12
    = f.submit "Update"
  = link_to "Cancel", phrasing_phrases_path

Edit page improved w/ version listing

.edit
  %h2= @phrasing_phrase.key
  = link_to "Delete Phrase", phrasing_phrase_path(@phrasing_phrase), class: "btn btn-danger delete-phrase", :method => :delete, :onclick => "return confirm('Are you sure?');"
  = form_for @phrasing_phrase, :url => { :action => "update" } do |f|
    = f.text_area :value, :rows => 12
    = f.submit "Update", class: "btn btn-success submit-edit-phrase"
  %br
  - unless @phrasing_phrase.versions.empty?
    %table.phrase-versions
      %tr
        %th Value
        %th Created_at
        %th
        %th
      - @phrasing_phrase.versions.reverse.each do |version|
        %tr
          %td.phrasing-version-value= version.value.html_safe
          %td.phrasing-version-created_at= version.created_at.strftime("%d-%m-%Y %H:%M:%S")
          %td= link_to "Revert", "#", class: "btn btn-success"
          %td= link_to "Delete", "#", class: "btn btn-danger"


- if @organization_list.count > 1
  = form_tag inventory_index_path, :id => 'filter_form', :method => "get", :class => 'navbar-form navbar-right panel-action' do
    = hidden_field_tag :asset_type, @asset_type
    = hidden_field_tag :asset_subtype, @asset_subtype
    = hidden_field_tag :start_row, 0
    .form-group
      = select_tag(:org_id, options_for_select(Organization.where('id IN (?)', @organization_list).collect{|a| [a.coded_name, a.id]}, :selected => @org_filter), :class => "form-control", :style => "width: 200px;", :prompt => "Any Organization...")

.btn-group.pull-right.panel-action
  %button.btn.btn-primary.btn-sm.dropdown-toggle{:data => {:toggle => 'dropdown'}}
    I want to
    %span.caret
  %ul.dropdown-menu{:role => 'menu'}
    %li
      = link_to inventory_index_path(:asset_type => @asset_type, :asset_subtype => @asset_subtype, :start_row => 0, :format => 'xls') do
        %i.fa.fa-fw.fa-file-excel-o
        = " Export list to Excel"

:javascript
  $(document).ready(function() {

    $('#org_id').change(function() {
      $('#filter_form').submit();
    });

  });

Allow engines to drop UI components on the asset index actions panel header

- if @organization_list.count > 1
  = form_tag inventory_index_path, :id => 'filter_form', :method => "get", :class => 'navbar-form navbar-right panel-action' do
    = hidden_field_tag :asset_type, @asset_type
    = hidden_field_tag :asset_subtype, @asset_subtype
    = hidden_field_tag :start_row, 0
    .form-group
      = select_tag(:org_id, options_for_select(Organization.where('id IN (?)', @organization_list).collect{|a| [a.coded_name, a.id]}, :selected => @org_filter), :class => "form-control", :style => "width: 200px;", :prompt => "Any Organization...")

.btn-group.pull-right.panel-action
  %button.btn.btn-primary.btn-sm.dropdown-toggle{:data => {:toggle => 'dropdown'}}
    I want to
    %span.caret
  %ul.dropdown-menu{:role => 'menu'}
    %li
      = link_to inventory_index_path(:asset_type => @asset_type, :asset_subtype => @asset_subtype, :start_row => 0, :format => 'xls') do
        %i.fa.fa-fw.fa-file-excel-o
        = " Export list to Excel"

- SystemConfig.transam_module_names.each do |mod|
  = render :partial => "assets/#{mod}_index_actions" rescue nil

:javascript
  $(document).ready(function() {

    $('#org_id').change(function() {
      $('#filter_form').submit();
    });

  });


%li= link_to 'Home', root_path
%li= link_to 'Team', team_path
%li= link_to 'Camp', 'https://camp.hackclub.com'
%li= link_to 'Projects', 'https://shipped.hackclub.com'
%li= link_to 'Apply', apply_path
%li= link_to 'Donate', donate_path

Add workshops link to nav bar

%li= link_to 'Home', root_path
%li= link_to 'Team', team_path
%li= link_to 'Camp', 'https://camp.hackclub.com'
%li= link_to 'Workshops', 'https://workshops.hackclub.com'
%li= link_to 'Projects', 'https://shipped.hackclub.com'
%li= link_to 'Apply', apply_path
%li= link_to 'Donate', donate_path


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

-unless @lists.empty?
  %h2 Popular lists right now
  =render @lists
-else
  %p No lists created yet.

Add grey background, add container classes.

.u-bg-grey-light.u-mb-5
  .container.u-py-5
    %h2 Popular tags right now
    -if @tags
      =render partial: "tags/tag", collection: @tags
    -else
      %p No tags found.

.container
  -unless @lists.empty?
    %h2 Popular lists right now
    =render @lists
  -else
    %p No lists created yet.


.jumbotron
  .container
    %center
      %h1
        Welcome to the Atlas Documentation
      %h5
        The official, curated documentation for Atlas map configuration files. Please choose a language below:

%center
  = link_to '/en', :class => 'btn btn-link btn-lg' do
    %p
      = image_tag('http://lipis.github.io/flag-icon-css/flags/4x3/us.svg', :style => 'width: 32px', :class => 'img-rounded')
    %p
      English

  = link_to '/es', :class => 'btn btn-link btn-lg' do
    %p
      = image_tag('http://lipis.github.io/flag-icon-css/flags/4x3/es.svg', :style => 'width: 32px', :class => 'img-rounded')
    %p
      Español

  = link_to '/de', :class => 'btn btn-link btn-lg' do
    %p
      = image_tag('http://lipis.github.io/flag-icon-css/flags/4x3/de.svg', :style => 'width: 32px', :class => 'img-rounded')
    %p
      Deutsch

Fix mixed content SSL error

.jumbotron
  .container
    %center
      %h1
        Welcome to the Atlas Documentation
      %h5
        The official, curated documentation for Atlas map configuration files. Please choose a language below:

%center
  = link_to '/en', :class => 'btn btn-link btn-lg' do
    %p
      = image_tag('https://lipis.github.io/flag-icon-css/flags/4x3/us.svg', :style => 'width: 32px', :class => 'img-rounded')
    %p
      English

  = link_to '/es', :class => 'btn btn-link btn-lg' do
    %p
      = image_tag('https://lipis.github.io/flag-icon-css/flags/4x3/es.svg', :style => 'width: 32px', :class => 'img-rounded')
    %p
      Español

  = link_to '/de', :class => 'btn btn-link btn-lg' do
    %p
      = image_tag('https://lipis.github.io/flag-icon-css/flags/4x3/de.svg', :style => 'width: 32px', :class => 'img-rounded')
    %p
      Deutsch


.contextual
  = link_to t_action('edit'), edit_employee_path(@employee)
  = link_to t_action('index'), employees_path
%h1= t_title

= @employee.vcard.try(:full_name)

%h2= t_title :index, Employment

- @employments = @employee.employments.paginate(:page => params[:page])
= render 'employments/list'

Implement AJAX adding of employment to employees.

.contextual
  = link_to t_action('edit'), edit_employee_path(@employee)
  = link_to t_action('index'), employees_path
%h1= t_title

= @employee.vcard.try(:full_name)

.contextual
  = link_to t_action('new', Employment), new_employment_path, :remote => true, :class => "icon icon-add"
%h2= t_title :index, Employment

#new_employment
- @employments = @employee.employments.paginate(:page => params[:page])
= render 'employments/list'


%table{:id => "matrices", :class => "table table-striped"}
  %thead
    %tr
      %th Group/Name
      %th Num Rows
      %th Num Cols
      %th Nonzeros
      %th Kind
      %th Symmetric
      %th Date
      %th Author
      %th Editor
      %th Notes
      %th Download File
  %tbody
    - @matrices.each do |matrix|
      %tr
        %td= link_to "#{matrix.group}/#{matrix.name}", matrix_path(matrix)
        %td= number_with_delimiter(matrix.num_rows, :delimiter => ',')
        %td= number_with_delimiter(matrix.num_cols, :delimiter => ',')
        %td= number_with_delimiter(matrix.nonzeros, :delimiter => ',')
        %td= matrix.kind
        %td= matrix.symmetric
        %td= matrix.date
        %td= matrix.author
        %td= matrix.editor
        %td= matrix.notes
        %td
          = link_to "MATLAB", matrix.get_url(:matlab), class: "btn btn-default"
          = link_to "Rutherford Boeing", matrix.get_url(:rutherford_boeing), class: "btn btn-default"
          = link_to "Matrix Market", matrix.get_url(:matrix_market), class: "btn btn-default"
    %tr
      %td{:colspan => 0, :align => "center"}
        = will_paginate @matrices, renderer: BootstrapPagination::Rails

Fix colspan bug in Safari

%table{:id => "matrices", :class => "table table-striped"}
  %thead
    %tr
      %th Group/Name
      %th Num Rows
      %th Num Cols
      %th Nonzeros
      %th Kind
      %th Symmetric
      %th Date
      %th Author
      %th Editor
      %th Notes
      %th Download File
  %tbody
    - @matrices.each do |matrix|
      %tr
        %td= link_to "#{matrix.group}/#{matrix.name}", matrix_path(matrix)
        %td= number_with_delimiter(matrix.num_rows, :delimiter => ',')
        %td= number_with_delimiter(matrix.num_cols, :delimiter => ',')
        %td= number_with_delimiter(matrix.nonzeros, :delimiter => ',')
        %td= matrix.kind
        %td= matrix.symmetric
        %td= matrix.date
        %td= matrix.author
        %td= matrix.editor
        %td= matrix.notes
        %td
          = link_to "MATLAB", matrix.get_url(:matlab), class: "btn btn-default"
          = link_to "Rutherford Boeing", matrix.get_url(:rutherford_boeing), class: "btn btn-default"
          = link_to "Matrix Market", matrix.get_url(:matrix_market), class: "btn btn-default"
    %tr
      %td{:colspan => 42, :align => "center"}
        = will_paginate @matrices, renderer: BootstrapPagination::Rails


.container
  %h1 Receipts

  = paginate @receipts

  - @receipts.each do |receipt|
    %div.panel.panel-default
      %div.panel-heading
        = time_ago_in_words(receipt.date)
        ago
        (#{receipt.date.to_s(:long)})

      %div.panel-body
        %table.table
          %thead
            %tr
              %th Stock Code
              %th Description
              %th Quantity
              %th Total
          %tbody
            - receipt.line_items.each do |line_item|
              %tr
                %td= line_item.product.stock_code
                %td= line_item.product.description
                %td= line_item.quantity
                %td
                  = "$" + "%.2f" % line_item.total_inc_gst
            %tr
              %td
              %td
              %td
              %td= "$" + "%.2f" % receipt.total_inc_gst

Use rails helper to do the formatting of currency

.container
  %h1 Receipts

  = paginate @receipts

  - @receipts.each do |receipt|
    %div.panel.panel-default
      %div.panel-heading
        = time_ago_in_words(receipt.date)
        ago
        (#{receipt.date.to_s(:long)})

      %div.panel-body
        %table.table
          %thead
            %tr
              %th Stock Code
              %th Description
              %th Quantity
              %th Total
          %tbody
            - receipt.line_items.each do |line_item|
              %tr
                %td= line_item.product.stock_code
                %td= line_item.product.description
                %td= line_item.quantity
                %td= number_to_currency(line_item.total_inc_gst)
            %tr
              %td
              %td
              %td
              %td= number_to_currency(receipt.total_inc_gst)


- has_errors = !flash.first.nil?
- if has_errors
  %aside.messages
    - num_msgs = has_errors ? flash.first.second.count : 0
    - num_msgs.times do |idx|
      - flash.each do |name, msgs|
        - msg = msgs[idx]
        - if msg.is_a?(String)
          %p{ :class => name }= msg

-# Licensed under the ISC licence, see LICENCE.ISC for details

Create the message box only if there are errors to be shown

- has_errors = !flash[:error].empty?
- if has_errors
  %aside.messages
    - num_msgs = has_errors ? flash.first.second.count : 0
    - num_msgs.times do |idx|
      - flash.each do |name, msgs|
        - msg = msgs[idx]
        - if msg.is_a?(String)
          %p{ :class => name }= msg

-# Licensed under the ISC licence, see LICENCE.ISC for details


/ %button.btn-refresh
/   %i.icon-repeat
%h1 {{ pageTitle() }}
%small.search-infos{'ng-show' => 'results'}
  %span{'ng-show' => 'settings.page > 0'} Page {{ settings.page + 1 }} of
  %ng-pluralize{count: 'results.nbHits', when: '{"0": "No results", "one": "1 result", "other": "{{ results.nbHits | number }} results"}'}
  ({{ results.processingTimeMS / 1000.0 | number }} seconds)
.date-range-filter
  %ul.list-inline
    %li
      %input#range-1.radio{"ng-model"=>"settings.dateRange", name:"date-range", type:"radio", value:"last24h"}
      %label{for:"range-1"} Last 24h
    %li
      %input#range-2.radio{"ng-model"=>"settings.dateRange", name:"date-range", type:"radio", value:"pastWeek"}
      %label{for:"range-2"} Past week
    %li
      %input#range-3.radio{"ng-model"=>"settings.dateRange", name:"date-range", type:"radio", value:"pastMonth"}
      %label{for:"range-3"} Past month
    %li
      %input#range-4.radio{"ng-model"=>"settings.dateRange", name:"date-range", type:"radio", value:"all"}
      %label{for:"range-4"} Forever

Hide some date range if hot

/ %button.btn-refresh
/   %i.icon-repeat
%h1 {{ pageTitle() }}
%small.search-infos{'ng-show' => 'results'}
  %span{'ng-show' => 'settings.page > 0'} Page {{ settings.page + 1 }} of
  %ng-pluralize{count: 'results.nbHits', when: '{"0": "No results", "one": "1 result", "other": "{{ results.nbHits | number }} results"}'}
  ({{ results.processingTimeMS / 1000.0 | number }} seconds)
.date-range-filter
  %ul.list-inline
    %li
      %input#range-1.radio{"ng-model"=>"settings.dateRange", name:"date-range", type:"radio", value:"last24h"}
      %label{for:"range-1"} Last 24h
    %li
      %input#range-2.radio{"ng-model"=>"settings.dateRange", name:"date-range", type:"radio", value:"pastWeek"}
      %label{for:"range-2"} Past week
    %li{'ng-show' => 'state !== "hot"'}
      %input#range-3.radio{"ng-model"=>"settings.dateRange", name:"date-range", type:"radio", value:"pastMonth"}
      %label{for:"range-3"} Past month
    %li{'ng-show' => 'state !== "hot"'}
      %input#range-4.radio{"ng-model"=>"settings.dateRange", name:"date-range", type:"radio", value:"all"}
      %label{for:"range-4"} Forever


%h3= t(:routes_with_code)
=link_to t(:check_all), '', :id => 'assign-all-routes'
=link_to t(:uncheck_all), '', :id => 'unassign-all-routes'
%table.new-operator-routes
  %tr
    %th= t(:name)
    %th= t(:region)
    %th= t(:terminuses)
    %th= t(:search)
    %th= t(:assign_to_operator)
  - @routes.each do |route|
    - f.fields_for :route_operators, RouteOperator.new(:route => route) do |route_operator_fields|
      %tr
        %td= link_to route.name, main_url(location_path(route)), :target => '_blank'
        %td= route.region.name
        %td.route-terminuses= route.area
        %td= link_to t(:external_search), external_search_link("#{route.name} #{route.area}"), :target => '_blank'
        %td
          != route_operator_fields.hidden_field :route_id
          != route_operator_fields.check_box :_add, :class => 'assign-route'

Add admin links to routes listed for operator

%h3= t(:routes_with_code)
=link_to t(:check_all), '', :id => 'assign-all-routes'
=link_to t(:uncheck_all), '', :id => 'unassign-all-routes'
%table.new-operator-routes
  %tr
    %th= t(:name)
    %th= t(:region)
    %th= t(:terminuses)
    %th= t(:search)
    %th= t(:assign_to_operator)
  - @routes.each do |route|
    - f.fields_for :route_operators, RouteOperator.new(:route => route) do |route_operator_fields|
      %tr
        %td!= "#{link_to route.name, main_url(location_path(route)), :target => '_blank'} #{link_to("(#{t(:admin)})", admin_url(admin_route_path(route)))}"
        %td= route.region.name
        %td.route-terminuses= route.area
        %td= link_to t(:external_search), external_search_link("#{route.name} #{route.area}"), :target => '_blank'
        %td
          != route_operator_fields.hidden_field :route_id
          != route_operator_fields.check_box :_add, :class => 'assign-route'


%h2 Sign up

= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
  = devise_error_messages!

  %div
    = f.label :email
    %br
    = f.email_field :email, autofocus: true

  %div
    = f.label :password
    %br
    = f.password_field :password, autocomplete: "off"

  %div
    = f.label :password_confirmation
    %br
    = f.password_field :password_confirmation, autocomplete: "off"

  %div= f.submit "Sign up"

= render "devise/shared/links"

Make sign up page similar to the PHP one

- content_for :title, 'Sign up'

%h1= yield :title

%p
  Quickly fill in the information below, and we'll send you
  a confirmation email.  You will then be able to edit division descriptions and policies.
  %br
  = link_to 'Log in to change settings if you already signed up', edit_user_registration_path
%p What are you waiting for? It's free!

= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
  = devise_error_messages!

  %div
    %b= f.label :email
    %br
    = f.email_field :email, autofocus: true

  %div
    %b= f.label 'Your name (first and last)'
    %br
    = f.text_field :real_name

  %div
    %b= f.label :password
    %br
    = f.password_field :password, autocomplete: "off"

  %div
    %b= f.label :password_confirmation
    %br
    = f.password_field :password_confirmation, autocomplete: "off"

  %p
    Privacy policy: Your email address and info will never be given to or sold
    to third parties. Your login will let you edit policies and division
    descriptions and will display your name on division editing histories.
    Any changes to this policy will require your explicit agreement.

  %div= f.submit "Sign up"


%ul.poll.archived
  = list_of poll.answers do |answer|
    #{answer.answer} :
    %meter(style="width: #{answer.percent}%;" min="0" max="100" value="#{answer.percent}")
      = answer.votes
    (#{answer.percent} %)

Remove min and max on poll meters for compatibility between browers

%ul.poll.archived
  = list_of poll.answers do |answer|
    #{answer.answer} :
    %meter(style="width: #{answer.percent}%;" value="#{answer.votes}")
      = answer.votes
    (#{answer.percent} %)


.embeddable_tools
  .drag_handle
  = render :partial => "shared/embedded_editor_links", :locals => { :embeddable => embeddable, :page => page, :type => 'mw_int', :allow_hide => allow_hide }
.embeddable_options
  Iframe interactive
  .model-edit
    .interactive-content
      %div{:id => "authorable-interactive-#{embeddable.id}"}

:javascript
  (function() {
    var props = {
      interactive: #{embeddable.to_json},
      updateUrl: "#{page_mw_interactive_path(page, embeddable)}"
    };
    if (props.interactive.url) {
      InteractiveAuthoring = React.createElement(modulejs.require('components/authoring/mw_interactive'), props);
      ReactDOM.render(InteractiveAuthoring, $("#authorable-interactive-#{embeddable.id}")[0]);
    }
  }());

Add embeddable plugins pulldown to MwInteractives

.embeddable_tools
  .drag_handle
  = render :partial => "shared/embedded_editor_links", :locals => { :embeddable => embeddable, :page => page, :type => 'mw_int', :allow_hide => allow_hide }
.embeddable_options
  Iframe interactive
  .model-edit
    .interactive-content
      %div{:id => "authorable-interactive-#{embeddable.id}"}
= render :partial => "shared/embedded_editor_wrapper_plugins", :locals => { :embeddable => embeddable }

:javascript
  (function() {
    var props = {
      interactive: #{embeddable.to_json},
      updateUrl: "#{page_mw_interactive_path(page, embeddable)}"
    };
    if (props.interactive.url) {
      InteractiveAuthoring = React.createElement(modulejs.require('components/authoring/mw_interactive'), props);
      ReactDOM.render(InteractiveAuthoring, $("#authorable-interactive-#{embeddable.id}")[0]);
    }
  }());


= semantic_form_for @group, url: [:admin, @group] do |f|
  = f.inputs :name, :short_name, :website, :email
  = f.buttons do
    = f.commit_button
    = cancel_link

Allow admins to set the default thread privacy on groups

= semantic_form_for @group, url: [:admin, @group] do |f|
  = f.inputs do
    = f.input :name
    = f.input :short_name
    = f.input :website
    = f.input :email
    = f.input :default_thread_privacy, as: :select, collection: MessageThread::ALLOWED_PRIVACY
  = f.buttons do
    = f.commit_button
    = cancel_link


%ul.anime-list
  - @results.each do |post|
    - page_number = 1 + post.topic.posts.where('created_at <= ?', post.created_at).count / Forem.per_page
    %li.search-result.cf
      .large-1.columns.hide-for-small.avatar.no-padding-right
        = link_to image_tag(post.user.avatar.url(:thumb)), post.user
      .small-12.large-11.columns
        .large-12.columns.forum-title.no-padding
          = link_to post.topic.subject, forem.topic_path(post.topic, page: page_number, anchor: "post#{post.id}")
        .large-12.columns.forum-info.no-padding
          %p
            = distance_of_time_in_words_to_now post.created_at
            ago by
            = link_to post.user.name, post.user
            to
            = link_to post.topic.forum.title, forem.forum_path(post.topic.forum)
        .large-12.columns.synopsis
          %p
            = truncate strip_tags(post.text), length: 280, separator: ' '
            - if strip_tags(post.text).length > 280
              %span
                = link_to "[read more]", forem.topic_path(post.topic, page: page_number, anchor: "post#{post.id}")

= paginate @results

Fix forum topic link in search.

%ul.anime-list
  - @results.each do |post|
    - page_number = 1 + post.topic.posts.where('created_at <= ?', post.created_at).count / Forem.per_page
    %li.search-result.cf
      .large-1.columns.hide-for-small.avatar.no-padding-right
        = link_to image_tag(post.user.avatar.url(:thumb)), post.user
      .small-12.large-11.columns
        .large-12.columns.forum-title.no-padding
          = link_to post.topic.subject, forem.forum_topic_path(post.topic.forum, post.topic, page: page_number, anchor: "post#{post.id}")
        .large-12.columns.forum-info.no-padding
          %p
            = distance_of_time_in_words_to_now post.created_at
            ago by
            = link_to post.user.name, post.user
            to
            = link_to post.topic.forum.title, forem.forum_path(post.topic.forum)
        .large-12.columns.synopsis
          %p
            = truncate strip_tags(post.text), length: 280, separator: ' '
            - if strip_tags(post.text).length > 280
              %span
                = link_to "[read more]", forem.forum_topic_path(post.topic.forum, post.topic, page: page_number, anchor: "post#{post.id}")

= paginate @results


%h2 Hidden projects

%table
  %thead
    %tr
      %th Name
      %th url
      %th users
      %th visible
      %th trigger
  %tbody
    = render :collection => @projects, :partial => 'project'

Remove the header from admin, this isn't just invisible project.


%h2
  %a{:name => "dreammotions"} Policy Comparisons
%p
  This chart shows the percentage agreement between this
  = member_type(@member.australian_house)
  and each of the policies in the database, according to their voting record.
%table.mps
  - if @member.policy_member_distances.empty?
    %tr.odd
      %td{:colspan => "4"}
        No policies match this person's votes. You can
        = link_to "edit or make a policy", "/policies.php"
        that will appear here.
  %tr.headings
    %td Agreement
    %td Policy
  - @member.policy_member_distances.each do |policy_member_distance|
    %tr{:class => cycle("odd", "even")}
      %td
        %b= link_to number_to_percentage((1 - policy_member_distance.distance_a) * 100, precision: 0), member_path(@member, dmp: policy_member_distance.policy.id)
      %td= link_to policy_member_distance.policy.name, policy_path(policy_member_distance.policy)

Add hack to reset cycle so we don't start on "even"

%h2
  %a{:name => "dreammotions"} Policy Comparisons
%p
  This chart shows the percentage agreement between this
  = member_type(@member.australian_house)
  and each of the policies in the database, according to their voting record.
%table.mps
  - if @member.policy_member_distances.empty?
    %tr.odd
      %td{:colspan => "4"}
        No policies match this person's votes. You can
        = link_to "edit or make a policy", "/policies.php"
        that will appear here.
  %tr.headings
    %td Agreement
    %td Policy
  - @member.policy_member_distances.each do |policy_member_distance|
    -# HACK: For some reason the below cycle wasn't starting reset so resetting it manually
    - reset_cycle
    %tr{:class => cycle("odd", "even")}
      %td
        %b= link_to number_to_percentage((1 - policy_member_distance.distance_a) * 100, precision: 0), member_path(@member, dmp: policy_member_distance.policy.id)
      %td= link_to policy_member_distance.policy.name, policy_path(policy_member_distance.policy)


%div{ class: 'col-md-6' }
  %hr

  %h4{ class: 'page-header' }= label_with_icon(t('label.env_var.plural'), 'fa-list-ul', fixed: true)

  - if application.env_vars.any?
    - application.sorted_env_vars.each do |step, env_vars|
      - if env_vars.any?
        %ul{ class: 'list-group' }
          %li{ class: 'list-group-item' }
            = t('label.env_var.step') + ' :'
            %span{ class: 'label label-info' }= step

          %ul{ class: 'list-group' }
            - env_vars.each do |env_var|
              %li{ class: 'list-group-item' }
                %span{ class: 'mount-point' }
                  = render_env_var(env_var)
  - else
    .alert{ class: 'alert-info dont-dismiss' }= t('label.env_var.none_defined')

Fix view rendering for env vars

%div{ class: 'col-md-6' }
  %hr

  %h4{ class: 'page-header' }= label_with_icon(t('label.env_var.plural'), 'fa-list-ul', fixed: true)

  - if application.env_vars.any?
    %ul{ class: 'list-group' }
      - application.env_vars.each do |env_var|
        %li{ class: 'list-group-item' }
          %span{ class: 'mount-point' }= render_env_var(env_var)

  - else
    .alert{ class: 'alert-info dont-dismiss' }= t('label.env_var.none_defined')


%header.jumbotron
  .row
    .col-lg-4.col-md-6
      = image_tag 'logo.png', alt: 'LiveLog logo', class: 'img-responsive'
    .col-lg-8.col-md-6.text-center
      %h1 LiveLog
      %p
        京都大学を中心に活動するアコースティック軽音サークル

        「京大アンプラグド」のセットリスト検索システムです。
      = render 'songs/search_form'

Add a badge of Google Play

%header.jumbotron
  .row
    .col-lg-4.col-md-6
      = image_tag 'logo.png', alt: 'LiveLog logo', class: 'img-responsive'
    .col-lg-8.col-md-6.text-center
      %h1 LiveLog
      %p
        京都大学を中心に活動するアコースティック軽音サークル

        「京大アンプラグド」のセットリスト検索システムです。
      = render 'songs/search_form'
      %p
        %a{href: 'https://play.google.com/store/apps/details?id=net.ku_unplugged.livelog&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1', target: '_blank'}
          %img{src: 'https://play.google.com/intl/en_us/badges/images/generic/ja_badge_web_generic.png', alt: 'Google Play で手に入れよう', width: 160}


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

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

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

Fix milestones list pagination style

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

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

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

      = paginate @milestones, theme: "gitlab"


= f.autocomplete_field :tag_names, autocomplete_tag_name_ideas_path,
   'data-delimiter' => ',', :multiple => true,
   :placeholder => EXAMPLE_TAGS, :class => "input-text big"

Add space to tag editor delimeter

= f.autocomplete_field :tag_names, autocomplete_tag_name_ideas_path,
   'data-delimiter' => ', ', :multiple => true,
   :placeholder => EXAMPLE_TAGS, :class => "input-text big"


#contents
  =h1 "Visualiser une révision"

  %h2
    = link_to @wiki_page.title, @wiki_page
  %h3
    #{@version.user.try :name} : #{@version.message}
  %pre
    = HTMLDiff.diff(h(@was), h(@version.body)).html_safe

  - if @version.higher_item || @version.lower_item
    %nav
      %ul
        - if @version.higher_item
          %li= link_to "Précédente révision", wiki_page_revision_path(@wiki_page.friendly_id, @version.higher_item.version)
        - if @version.lower_item
          %li= link_to "Révision suivante", wiki_page_revision_path(@wiki_page.friendly_id, @version.lower_item.version)

Fix error 500 on the revision page of the wiki

#contents
  =h1 "Visualiser une révision"

  %h2
    = link_to @wiki_page.title, @wiki_page
  %h3
    #{@version.user.try :name} : #{@version.message}
  %pre
    = HTMLDiff.diff(h(@was), h(@version.body)).html_safe

  - if @version.higher_item || @version.lower_item
    %nav
      %ul
        - if @version.higher_item
          %li= link_to "Précédente révision", revision_wiki_page_path(@wiki_page.friendly_id, @version.higher_item.version)
        - if @version.lower_item
          %li= link_to "Révision suivante", revision_wiki_page_path(@wiki_page.friendly_id, @version.lower_item.version)


- for column in Booking.content_columns
  %p
    %b
      = column.human_name
      \:
    = h @booking.send(column.name)
= link_to t('bookyt.edit'), :action => 'edit', :id => @booking
|
\#{link_to 'Back', :action => 'list'} |
\#{link_to 'Destroy', { :action => 'destroy', :id => @booking }, :confirm => 'Are you sure?', :method => :post}

Fix exception in booking view.

= contextual_links

%h1= @booking

- for column in Booking.content_columns
  %p
    %b
      = column.human_name
      \:
    = h @booking.send(column.name)


- if event.proper?
  .event-item{class: "#{event.body? ? "event-block" : "event-inline" }"}
    .event-item-timestamp
      #{time_ago_with_tooltip(event.created_at)}

    - if event.created_project?
      = cache [event, current_user] do
        = render "events/event/created_project", event: event
    - else
      = cache event do
        = image_tag avatar_icon(event.author_email, 24), class: "avatar s24", alt:''
        - if event.push?
          = render "events/event/push", event: event
        - elsif event.commented?
          = render "events/event/note", event: event
        - else
          = render "events/event/common", event: event

Fix missing avatar in event feed when created project

- if event.proper?
  .event-item{class: "#{event.body? ? "event-block" : "event-inline" }"}
    .event-item-timestamp
      #{time_ago_with_tooltip(event.created_at)}

    - if event.created_project?
      = cache [event, current_user] do
        = image_tag avatar_icon(event.author_email, 24), class: "avatar s24", alt:''
        = render "events/event/created_project", event: event
    - else
      = cache event do
        = image_tag avatar_icon(event.author_email, 24), class: "avatar s24", alt:''
        - if event.push?
          = render "events/event/push", event: event
        - elsif event.commented?
          = render "events/event/note", event: event
        - else
          = render "events/event/common", event: event


.text-center.text-muted.pb-3
  ©
  = Date.today.year
  = APP_CONFIG['site_name']
  ·
  = link_to t('views.general.about'), about_path
  ·
  = link_to 'GitHub', 'https://github.com/Retrospring/retrospring'
  ·
  = link_to t('views.general.terms'), terms_path
  ·
  = link_to t('views.general.privacy'), privacy_policy_path

Add current version as title to site name in footer

.text-center.text-muted.pb-3
  ©
  = Date.today.year
  %span{ title: Retrospring::Version.to_s }= APP_CONFIG['site_name']
  ·
  = link_to t('views.general.about'), about_path
  ·
  = link_to 'GitHub', 'https://github.com/Retrospring/retrospring'
  ·
  = link_to t('views.general.terms'), terms_path
  ·
  = link_to t('views.general.privacy'), privacy_policy_path


.navbar.navbar-static-top
  .navbar-inner
    .container
      %a.btn.btn-navbar(data-target=".nav-collapse" data-toggle="collapse")
        %span.icon-bar
        %span.icon-bar
        %span.icon-bar
      %a.brand(href=root_path) Growstuff (development site)
      .container.nav-collapse
        %ul.nav
          %li= link_to "Crops", crops_path
          %li= link_to "Members", members_path
          %li= link_to "Posts", posts_path
          - if can? :create, Post
            %li= link_to("Post something", new_post_path)
          - if can? :create, Planting
            %li= link_to("Plant something", new_planting_path)
          %li.divider-vertical
          - if member_signed_in?
            %li.dropdown<
              %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => member_path(current_member)}
                = current_member.login_name
                %b.caret
              %ul.dropdown-menu
                %li= link_to "Profile", member_path(current_member)
                %li= link_to "Settings", edit_member_registration_path
                %li= link_to "Sign out", destroy_member_session_path, :method => :delete
          - else
            %li.pull-right= link_to 'Sign up', new_member_registration_path
            %li.pull-right= link_to 'Sign in', new_member_session_path

Add forums to top nav

.navbar.navbar-static-top
  .navbar-inner
    .container
      %a.btn.btn-navbar(data-target=".nav-collapse" data-toggle="collapse")
        %span.icon-bar
        %span.icon-bar
        %span.icon-bar
      %a.brand(href=root_path) Growstuff (development site)
      .container.nav-collapse
        %ul.nav
          %li= link_to "Crops", crops_path
          %li= link_to "Members", members_path
          %li= link_to "Posts", posts_path
          %li= link_to "Forums", forums_path
          - if can? :create, Post
            %li= link_to("Post something", new_post_path)
          - if can? :create, Planting
            %li= link_to("Plant something", new_planting_path)
          %li.divider-vertical
          - if member_signed_in?
            %li.dropdown<
              %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => member_path(current_member)}
                = current_member.login_name
                %b.caret
              %ul.dropdown-menu
                %li= link_to "Profile", member_path(current_member)
                %li= link_to "Settings", edit_member_registration_path
                %li= link_to "Sign out", destroy_member_session_path, :method => :delete
          - else
            %li.pull-right= link_to 'Sign up', new_member_registration_path
            %li.pull-right= link_to 'Sign in', new_member_session_path


%h2
  Edit #{resource_name.to_s.humanize}
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
  = devise_error_messages!
  %div
    = f.label :email
    %br/
    = f.email_field :email, autofocus: true
  - if devise_mapping.confirmable? && resource.pending_reconfirmation?
    %div
      Currently waiting confirmation for: #{resource.unconfirmed_email}
  %div
    = f.label :password
    %i (leave blank if you don't want to change it)
    %br/
    = f.password_field :password, autocomplete: "off"
  %div
    = f.label :password_confirmation
    %br/
    = f.password_field :password_confirmation, autocomplete: "off"
  %div
    = f.label :current_password
    %i (we need your current password to confirm your changes)
    %br/
    = f.password_field :current_password, autocomplete: "off"
  %div= f.submit "Update"
%h3 Cancel my account
%p
  Unhappy? #{button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete}
= link_to "Back", :back

Apply BBYIDX skin to User registration edit form

%div
  .main.panel.section
    .header
      %h2 Edit Your Account
    .body
      .group
        = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
          = devise_error_messages!
          .form-group.inline
            = f.label :name
            = f.text_field :name, autofocus: true, :class => "input-text big"
          .form-group.inline
            = f.label :email
            = f.email_field :email, :class => "input-text big"
          - if devise_mapping.confirmable? && resource.pending_reconfirmation?
            %div
              Currently waiting confirmation for: #{resource.unconfirmed_email}
          .form-group.inline
            = f.label :password
            = f.password_field :password, autocomplete: "off", :class => "input-text big"
            %p.note (leave blank if you don't want to change it)
          .form-group.inline
            = f.label :password_confirmation
            = f.password_field :password_confirmation, autocomplete: "off", :class => "input-text big"
          .form-group.inline
            = f.label :current_password
            = f.password_field :current_password, autocomplete: "off", :class => "input-text big"
            %p.note (we need your current password to confirm your changes)
          .form-submit-inline
            = f.submit "Update", :id => "submit-signup", :class => "input-submit"
        %h3 Cancel my account
        %p
          Unhappy? #{button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete}
        = link_to "Back", :back


:ruby
  colors = [[:private, :grey], [:rdv, :red], [:mixed_use, :orange],
           [:asofright, :green], [:ovr55, :blue], [:clusteros, :purple],
           [:phased, :pink], [:stalled, :black]]

- tags = colors.select { |b| @development.send(b.first) }
- if tags.any?
  .row
    .ten.wide.column
      #tags
        - tags.each do |b|
          .ui.basic.label{ class: b.last }
            = Development.human_attribute_name(b.first)

Make the tag display logic a little easier to understand.

:ruby
  tag_colors = {
    private:   :grey,
    rdv:       :red,
    mixed_use: :orange,
    asofright: :green,
    ovr55:     :blue,
    clusteros: :purple,
    phased:    :pink,
    stalled:   :black
  }

- tags = tag_colors.select { |tag, _color| @development.send(tag) }
- if tags.any?
  .row
    .ten.wide.column
      #tags
        - tags.each do |b|
          .ui.basic.label{ class: b.last }
            = Development.human_attribute_name(b.first)


= simple_form_for [@group, @membership] do |f|
  %fieldset
    .form-group
      = f.input :role, as: :string
    .form-group
      = f.association :person, collection: @candidates
    .form-checkbox
      = f.input :leader, as: :boolean
    .form-group
      = f.button :submit

Reorder fields on 'add someone to group' page

= simple_form_for [@group, @membership] do |f|
  %fieldset
    .form-group
      = f.association :person, collection: @candidates
    .form-group
      = f.input :role, as: :string
    .form-checkbox
      = f.input :leader, as: :boolean
    .form-group
      = f.button :submit


.u-bg-alpha
  %nav.MainNav.container
    =link_to root_path, class: 'MainNav-logo' do
      =inline_svg "logo.svg"
    %ul.MainNav-links
      %li.MainNav-link
        =link_to 'Lists', root_path
      %li.MainNav-link
        =link_to 'Tags', tags_path
      %li.MainNav-link
        =link_to 'Newest', root_path

      -if logged_in?
        %li.MainNav-link
          =link_to current_user.name, user_path(current_user.name)
        %li.MainNav-link
          =link_to 'Log Out', user_log_out_path, method: :delete
      -else
        %li.MainNav-link
          =link_to 'Login', user_log_in_path
        %li.MainNav-link
          =link_to 'Register', user_register_path

Remove register from main menu.


.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open(), 'has_shopfront' : producer.has_shopfront}"}
  .columns.small-12.medium-4.large-4.skinny-head
    / This needs logic to show profile only icon when available %i.ofn-i_060-producer-reversed
    %i{ng: {class: "producer.producer_icon_font"}}
    %span.margin-top
      %strong
        %a{"bo-if" => "producer.has_shopfront" } {{ producer.path }}

  .columns.small-6.medium-3.large-3
    %span.margin-top {{ producer.address.city }}
  .columns.small-4.medium-3.large-4
    %span.margin-top {{ producer.address.state_name | uppercase }}
  .columns.small-2.medium-2.large-1.text-right
    %span.margin-top
      %i{"ng-class" => "{'ofn-i_005-caret-down' : !open(), 'ofn-i_006-caret-up' : open()}"}

Tweak markup to show producer name and write logic for link around producer if also own shopfront

.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open(), 'has_shopfront' : producer.has_shopfront}"}
  .columns.small-12.medium-4.large-4.skinny-head
    / This needs logic to show profile only icon when available %i.ofn-i_060-producer-reversed
    %span{"bo-if" => "producer.has_shopfront" }
      %a{"bo-href" => "producer.path" }
        %i{ng: {class: "producer.producer_icon_font"}}
        %span.margin-top
          %strong {{ producer.name }}
    %span{"bo-if" => "!producer.has_shopfront" }
      %i{ng: {class: "producer.producer_icon_font"}}
      %span.margin-top
        %strong {{ producer.name }}

  .columns.small-6.medium-3.large-3
    %span.margin-top {{ producer.address.city }}
  .columns.small-4.medium-3.large-4
    %span.margin-top {{ producer.address.state_name | uppercase }}
  .columns.small-2.medium-2.large-1.text-right
    %span.margin-top
      %i{"ng-class" => "{'ofn-i_005-caret-down' : !open(), 'ofn-i_006-caret-up' : open()}"}


- breadcrumb('Catalogue', :product_categories)
- breadcrumb('Add Product')

= render :partial => 'form'

= render :partial => 'form'

Fix accidental duplication of product form.


%h1 Preferences
= form_with method: :post, url: {controller: "session", action: "preferences"}, model: @user do |f|
  .form-group.row
    = label_tag(:sort, "Default sorting", class: "col-sm-2 col-form-label")
    .col-sm-10
      .input-group
        .input-group-prepend
          .input-group-text sort:
        = f.text_field(:sort, class: "form-control", placeholder: "default")
      %small.form-text
        See
        = link_to({controller: "help", action: "syntax"}) do
          Syntax Help
        for details.
  .form-group.row
    = label_tag(:sort, "Default view", class: "col-sm-2 col-form-label")
    .col-sm-10
      = f.select(:view, options_for_select(@views.map{|view| [view, view] }, @user.view), class: "form-control custom-select")
  .form-group.row
    .col-sm-2
    .col-sm-10
      = f.submit("Save", class: "btn btn-outline-primary")

Fix CSS class on default view preference

%h1 Preferences
= form_with method: :post, url: {controller: "session", action: "preferences"}, model: @user do |f|
  .form-group.row
    = label_tag(:sort, "Default sorting", class: "col-sm-2 col-form-label")
    .col-sm-10
      .input-group
        .input-group-prepend
          .input-group-text sort:
        = f.text_field(:sort, class: "form-control", placeholder: "default")
      %small.form-text
        See
        = link_to({controller: "help", action: "syntax"}) do
          Syntax Help
        for details.
  .form-group.row
    = label_tag(:sort, "Default view", class: "col-sm-2 col-form-label")
    .col-sm-10
      = f.select(:view, options_for_select(@views.map{|view| [view, view] }, @user.view), {}, {class: "form-control custom-select"})
  .form-group.row
    .col-sm-2
    .col-sm-10
      = f.submit("Save", class: "btn btn-outline-primary")


#masthead.header
  %div
    %h1#logo= link_to LONG_SITE_NAME, root_path
    #nav-primary
      / -cache('primary_nav') do
      %ul.nav.user
      - if user_signed_in?
        / %li.first= link_to "#{h current_user.name}" , profile_url(current_user)
        %li= link_to 'Settings', edit_user_registration_path
        %li= link_to "About", home_about_path
        %li= link_to 'Log Out', destroy_user_session_path, method: :delete
      - else
        -cache('no_user_nav') do
          %li.first= link_to "About", home_about_path
          %li= link_to "Sign Up", new_user_registration_path
          %li=link_to 'Log in', new_user_session_path

Switch order of navbar links for consistency.

#masthead.header
  %div
    %h1#logo= link_to LONG_SITE_NAME, root_path
    #nav-primary
      / -cache('primary_nav') do
      %ul.nav.user
      - if user_signed_in?
        / %li.first= link_to "#{h current_user.name}" , profile_url(current_user)
        %li= link_to "About", home_about_path
        %li= link_to 'Settings', edit_user_registration_path
        %li= link_to 'Log Out', destroy_user_session_path, method: :delete
      - else
        -cache('no_user_nav') do
          %li.first= link_to "About", home_about_path
          %li= link_to "Sign Up", new_user_registration_path
          %li=link_to 'Log in', new_user_session_path


.container
  %h1 Add scraper from your Github repository

  :markdown
    Scrapers can be written in Ruby, PHP, Python or Perl. For Ruby they need to have a file in the root
    directory called `scraper.rb`, for PHP `scraper.php`, for Python `scraper.py` and for Perl `scraper.pl`.
    They should create an sqlite database in the current working directory called `#{Morph::Database.sqlite_db_filename}`.
    The main data should be written into a table called `#{Morph::Database.sqlite_table_name}`.
    The code needs to live in the master branch of the repository.

  %ul.nav.nav-tabs
    %li.active= link_to @user.nickname, "#owner_#{@user.nickname}", data: {toggle: "tab"}
    - @organizations.each do |org|
      %li= link_to org.nickname, "#owner_#{org.nickname}", data: {toggle: "tab"}

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

Use the nicer table (that is also automatic) for showing naming conventions for languages

.container
  %h1 Add scraper from your Github repository

  = render "documentation/languages"

  :markdown
    They should create an sqlite database in the current working directory called `#{Morph::Database.sqlite_db_filename}`.
    The main data should be written into a table called `#{Morph::Database.sqlite_table_name}`.
    The code needs to live in the master branch of the repository.

  %ul.nav.nav-tabs
    %li.active= link_to @user.nickname, "#owner_#{@user.nickname}", data: {toggle: "tab"}
    - @organizations.each do |org|
      %li= link_to org.nickname, "#owner_#{org.nickname}", data: {toggle: "tab"}

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


%form{action: url("/search", false, true), method: :get}
  %input{type: "textarea", name: "word", size: 20, value: params[:word]}
  - params.each do |key, value|
    - next if /\A(?:word|page)\z/ =~ key
    %input{type: "hidden", name: key, value: value}
  %input{type: "submit", value: "検索"}
  - unless params_to_description.empty?
    %label
      %input{type: "checkbox", name: "reset_params", value: "1"}
      絞り込みを解除

Fix input type for search box

%form{action: url("/search", false, true), method: :get}
  %input{type: "search", name: "word", size: 20, value: params[:word]}
  - params.each do |key, value|
    - next if /\A(?:word|page)\z/ =~ key
    %input{type: "hidden", name: key, value: value}
  %input{type: "submit", value: "検索"}
  - unless params_to_description.empty?
    %label
      %input{type: "checkbox", name: "reset_params", value: "1"}
      絞り込みを解除


- provide(:title, @live.title)
%header.page-header
  %h1<
    = @live.name
    %small.text-muted
      = @live.place.present? ? " #{I18n.l(@live.date)} @#{@live.place} " : I18n.l(@live.date)

.row
  .col-md-6.ml-auto.mr-auto.mb-4
    = link_to icon('paper-plane') + ' エントリーする', new_live_entry_path(@live), class: 'btn btn-outline-info btn-lg btn-block'

- if current_user.admin_or_elder?
  = render 'lives/btn_toolbar', live: @live

- if @entries.present?
  = render 'songs/songs_table', songs: @entries

Improve the view of the entries page

- provide(:title, @live.title)
%header.page-header
  %h1<
    = @live.name
    %small.text-muted
      = @live.place.present? ? " #{I18n.l(@live.date)} @#{@live.place} " : I18n.l(@live.date)
    - if @entries.present?
      = link_to icon('paper-plane') + ' エントリーする', new_live_entry_path(@live), class: 'btn btn-info btn-lg float-md-right mt-2'

- if current_user.admin_or_elder?
  = render 'lives/btn_toolbar', live: @live

- if @entries.present?
  = render 'songs/songs_table', songs: @entries
- else
  .row.mb-3
    .col-md-6.ml-auto.mr-auto
      = link_to icon('paper-plane') + ' エントリーする', new_live_entry_path(@live), class: 'btn btn-info btn-lg btn-block'


- if @sb[:active_tab] == "diagnostics_timelines"
  = render :partial => "layouts/flash_msg"
  - if @tl_record
    :javascript
      // Create from/to date JS vars to limit calendar selection range
      ManageIQ.calendar.calDateFrom = new Date(#{@tl_options[:sdate]});
      var ManageIQ.calendar.calDateTo = new Date(#{@tl_options[:edate]});
    = render :partial => 'layouts/tl_options'
    = render :partial => 'layouts/tl_detail'
  - else
    = render :partial => 'layouts/info_msg', :locals => {:message => _("This Server's Virtual Machine has not been identified.")}
  %div{:style => "padding-bottom: 20px"}

Fix javascript error in diagnostics timelines tab

- if @sb[:active_tab] == "diagnostics_timelines"
  = render :partial => "layouts/flash_msg"
  - if @tl_record
    :javascript
      // Create from/to date JS vars to limit calendar selection range
      ManageIQ.calendar.calDateFrom = new Date(#{@tl_options[:sdate]});
      ManageIQ.calendar.calDateTo = new Date(#{@tl_options[:edate]});
    = render :partial => 'layouts/tl_options'
    = render :partial => 'layouts/tl_detail'
  - else
    = render :partial => 'layouts/info_msg', :locals => {:message => _("This Server's Virtual Machine has not been identified.")}
  %div{:style => "padding-bottom: 20px"}


- items = expand_textual_group(items, @record)
- if items.present?
  %table.table.table-bordered.table-hover.table-striped.table-summary-screen
    %thead
      %tr
        %th{:colspan => "2", :align => "left"}
          = title
    - items.each do |item|
      - if @explorer && item[:explorer]
        - if item[:spinner]
          - click = remote_function(:url => item[:link], :loading => "miqSparkle(true);")
        - else
          - click = remote_function(:url => item[:link])
      - else
        - click = "DoNav('#{item[:link]}');"

      %tr{:class   => no_hover_class(item),
          :title   => item[:title] ? item[:title] : "",
          :onclick => item[:link] ? click : ""}
        %td.label
          = item[:label]
        %td
          = render :partial => "shared/summary/icon_or_image", :locals => {:item => item}
          = !item[:value].kind_of?(Array) ? item[:value] : render(:partial => "shared/summary/textual_multivalue", :locals => {:items => item[:value]})

Fix Stack Template Details screen styling

- items = expand_textual_group(items, @record)
- if items.present?
  %table.table.table-bordered.table-hover.table-striped.table-summary-screen
    %thead
      %tr
        %th{:colspan => "2", :align => "left"}
          = title
    %tbody
      - items.each do |item|
        - if @explorer && item[:explorer]
          - if item[:spinner]
            - click = remote_function(:url => item[:link], :loading => "miqSparkle(true);")
          - else
            - click = remote_function(:url => item[:link])
        - else
          - click = "DoNav('#{item[:link]}');"

        %tr{:class   => no_hover_class(item),
            :title   => item[:title] ? item[:title] : "",
            :onclick => item[:link] ? click : ""}
          %td.label
            = item[:label]
          %td
            = render :partial => "shared/summary/icon_or_image", :locals => {:item => item}
            = !item[:value].kind_of?(Array) ? item[:value] : render(:partial => "shared/summary/textual_multivalue", :locals => {:items => item[:value]})


- sub_header('Album', @asset_group.name)
- control('Asset', path(:new, :asset, @asset_group), :new)
- control('Edit', path(:edit, @asset_group), :edit)
- control('Delete', path(:delete, @asset_group), :delete)

= content do
  = render :partial => 'islay/admin/assets/grid', :locals => {:assets => @asset_group.assets, :size => 4}

Fix the grid size when viewing an album.

- sub_header('Album', @asset_group.name)
- control('Asset', path(:new, :asset, @asset_group), :new)
- control('Edit', path(:edit, @asset_group), :edit)
- control('Delete', path(:delete, @asset_group), :delete)

= content do
  = render :partial => 'islay/admin/assets/grid', :locals => {:assets => @asset_group.assets, :size => 2}


#main-box
  #quote Fresh Meat?

#content
  - form_for(@player) do |f|
    = f.error_messages

    %p
      = f.label :name
      %br
      = f.text_field :name

    %p= f.submit 'Create Player'

Make the new-player form work again.

#main-box
  #quote Fresh Meat?

#content
  = form_for(@player) do |f|
    = f.error_messages

    %p
      = f.label :name
      %br
      = f.text_field :name

    %p= f.submit "Create Player", :class => "button big"


.container-fluid
  .row
    .content-readings
      - if current_member.readings.size > 0
        %table.table.table-condensed.table-striped
          %thead
            %tr
              %th Reading
              %th When
              %th Intake
          %tbody
            - current_member.readings.each do |reading|
              %tr
                %td= @reading.glucometer_value
                %td= @reading.meal.to_s.titlecase
                %td= @reading.intake
      - else
        .text-center
          No Readings Recorded

Make a method, use a method; easier to understand this way.

.container-fluid
  .row
    .content-readings
      - if current_member.has_no_readings?
        .text-center
          No Readings Recorded
      - else
        %table.table.table-condensed.table-striped
          %thead
            %tr
              %th Reading
              %th When
              %th Intake
          %tbody
            - current_member.readings.each do |reading|
              %tr
                %td= @reading.glucometer_value
                %td= @reading.meal.to_s.titlecase
                %td= @reading.intake


%h1= language_name_with_icon(:nodejs, size: "30x30")

.row
  .col-sm-9
    :markdown
      Support for Node.js was only very recently added to morph.io.
      That's why we don't have any decent documentation yet for Node.js.
      Do you want to help?

Add a warning about the lack of nodejs documentation

%h1= language_name_with_icon(:nodejs, size: "30x30")

.alert.alert-warning
  %i.fa.fa-bell-o.fa-lg.pull-left
  Missing documentation. Help out by writing some.

.row
  .col-sm-9
    :markdown
      Support for Node.js was only very recently added to morph.io.
      That's why we don't have any decent documentation yet for Node.js.
      Do you want to help?


-icon, text = *identity.icon_and_text
-imgpath = "/images/sprites/user_#{icon}.png"
-plain ||= false
-no_link, no_profile = (plain or not identity.url), (plain or not identity.profile_url)
%span.identity<
	=succeed link_to_unless no_link, text, identity.url, {:rel => 'nofollow'} do
		-if FileTest.exists?("#{RAILS_ROOT}/public#{imgpath}")
			=link_to_unless no_profile, image_tag(imgpath), identity.profile_url, {:rel => 'nofollow'}
-if has_role? :admin and identity.user != current_user
	=link_to "(edit)", identity.user

Remove redundant user edit link.

-icon, text = *identity.icon_and_text
-imgpath = "/images/sprites/user_#{icon}.png"
-plain ||= false
-no_link, no_profile = (plain or not identity.url), (plain or not identity.profile_url)
%span.identity<
	=succeed link_to_unless no_link, text, identity.url, {:rel => 'nofollow'} do
		-if FileTest.exists?("#{RAILS_ROOT}/public#{imgpath}")
			=link_to_unless no_profile, image_tag(imgpath), identity.profile_url, {:rel => 'nofollow'}
-if has_role? :admin and identity.user != current_user and not current_page? :controller => :users, :action => :index
	=link_to "(edit)", identity.user


#delivery-fees
  %h2 Delivery Fees

  %table#delivery
    %thead
      %tr
        %th Item
        %th Shipping Method
        %th Delivery Fee
    %tbody
      - @order.line_items.each do |line_item|
        - tr_class = cycle('', 'alt')
        %tr{:class => tr_class}
          %td
            %h4= link_to line_item.product.name, product_path(line_item.product)
          %td.item-shipping-method= line_item.shipping_method.name
          %td.item-shipping-cost= number_to_currency line_item.itemwise_shipping_cost

  .subtotal{'data-hook' => 'delivery_fees_subtotal'}
    %h5
      Shipping total
      \:
      %span.order-total= order_delivery_fee_subtotal(@order)

Add cms field to cart page to explain delivery fees, located at cms path: /cart-delivery-fees

#delivery-fees
  = cms_page_content(:content, Cms::Page.find_by_full_path('/cart-delivery-fees'))
  %h2 Delivery Fees

  %table#delivery
    %thead
      %tr
        %th Item
        %th Shipping Method
        %th Delivery Fee
    %tbody
      - @order.line_items.each do |line_item|
        - tr_class = cycle('', 'alt')
        %tr{:class => tr_class}
          %td
            %h4= link_to line_item.product.name, product_path(line_item.product)
          %td.item-shipping-method= line_item.shipping_method.name
          %td.item-shipping-cost= number_to_currency line_item.itemwise_shipping_cost

  .subtotal{'data-hook' => 'delivery_fees_subtotal'}
    %h5
      Shipping total
      \:
      %span.order-total= order_delivery_fee_subtotal(@order)


- content_for :header do
  Process a visit request

- if prison_data(booked_visit)['canned_responses']

  .people

    %dl.labels
      %dt Prisoner:
      %dd= booked_visit.prisoner.full_name

      %dt Number:
      %dd= booked_visit.prisoner.number

      %dt Date of birth:
      %dd= format_date_nomis booked_visit.prisoner.date_of_birth

    %hr

    - booked_visit.visitors.each_with_index do |visitor, index|
      %dl.labels
        %dt Visitor #{index + 1}:
        %dd= visitor.full_name

        %dt Age:
        %dd= visitor.age

        %dt Date of birth:
        %dd= format_date_nomis visitor.date_of_birth

        - if visitor.email
          %dt Email:
          %dd= visitor.email

        - if visitor.phone
          %dt Phone:
          %dd= visitor.phone

  .processing-form
    = render 'canned_responses'

- else
  = render 'open_responses'

Fix the failing confirmation_controller spec

- content_for :header do
  Process a visit request

- if Prison.find(booked_visit.prisoner.prison_name).canned_responses

  .people

    %dl.labels
      %dt Prisoner:
      %dd= booked_visit.prisoner.full_name

      %dt Number:
      %dd= booked_visit.prisoner.number

      %dt Date of birth:
      %dd= format_date_nomis booked_visit.prisoner.date_of_birth

    %hr

    - booked_visit.visitors.each_with_index do |visitor, index|
      %dl.labels
        %dt Visitor #{index + 1}:
        %dd= visitor.full_name

        %dt Age:
        %dd= visitor.age

        %dt Date of birth:
        %dd= format_date_nomis visitor.date_of_birth

        - if visitor.email
          %dt Email:
          %dd= visitor.email

        - if visitor.phone
          %dt Phone:
          %dd= visitor.phone

  .processing-form
    = render 'canned_responses'

- else
  = render 'open_responses'


#node-share.btn-group.dropdown
  %button.dropdown-toggle.btn{:'data-toggle' => 'dropdown'}
    %i.icon-share

  %ul.dropdown-menu{role: 'menu'}
    %li
      =link_to "http://twitter.com/share?" + { related: 'wheelmap,sozialhelden', hashtags: 'wheelmap', lang: I18n.locale, text: t('nodes.show.share.text', name: node_share.name), dnt: true }.to_query, :'data-toggle' => 'share', :'data-name' => 'twitter', target: '_blank' do
        %i.icon-twitter
        = t('nodes.show.share.twitter')
    %li
      =link_to "http://www.facebook.com/sharer/sharer.php?s=100&p[url]=#{request.url}", :'data-toggle' => 'share', :'data-name' => 'facebook', target: '_blank' do
        %i.icon-facebook
        = t('nodes.show.share.facebook')
    %li
      =mailme_to(nil, body: t('nodes.show.share.text', name: node_share.name) + " (#{request.url})") do
        %i.icon-envelope-alt
        E-Mail

Use absolute url to node detail page.

#node-share.btn-group.dropdown
  %button.dropdown-toggle.btn{:'data-toggle' => 'dropdown'}
    %i.icon-share

  %ul.dropdown-menu{role: 'menu'}
    %li
      =link_to "http://twitter.com/share?" + { related: 'wheelmap,sozialhelden', hashtags: 'wheelmap', lang: I18n.locale, text: t('nodes.show.share.text', name: node_share.name), dnt: true , url: node_url(node_share)}.to_query, :'data-toggle' => 'share', :'data-name' => 'twitter', target: '_blank' do
        %i.icon-twitter
        = t('nodes.show.share.twitter')
    %li
      =link_to "http://www.facebook.com/sharer/sharer.php?s=100&p[url]=#{node_url(node_share)}", :'data-toggle' => 'share', :'data-name' => 'facebook', target: '_blank' do
        %i.icon-facebook
        = t('nodes.show.share.facebook')
    %li
      =mailme_to(nil, body: t('nodes.show.share.text', name: node_share.name) + " (#{node_url(node_share)})") do
        %i.icon-envelope-alt
        E-Mail


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

Enable links in user profile

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


.modal.modal-wide.hide.fade#save-and-finish-modal
  .modal-header
    %button.close{:type => :button, 'data-dismiss' => :modal, 'aria-hidden' => true} ×
    %h3= t('surveyor.save_and_finish')
  .modal-body
    .row-fluid
      .span6.log-in
        %h1= t('homepage.log_in')
        = render 'devise/sessions/form', resource: User.new, resource_name: 'user', remote: true, form_id: 'save_and_finish_modal_form'
      .span6
        %p= t('surveyor.you_need_to_register_or_sign_in_to_save')
        = link_to t('homepage.create_an_account'), new_user_registration_path, :class => 'btn btn-large btn-info btn-info-modal'

Convert save and finish modal to helper

= modal_popup('save-and-finish-modal', '', t('surveyor.save_and_finish')) do
  .row-fluid
    .span6.log-in
      %h1= t('homepage.log_in')
      = render 'devise/sessions/form', resource: User.new, resource_name: 'user', remote: true, form_id: 'save_and_finish_modal_form'
    .span6
      %p= t('surveyor.you_need_to_register_or_sign_in_to_save')
      = link_to t('homepage.create_an_account'), new_user_registration_path, :class => 'btn btn-large btn-info btn-info-modal'