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

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

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

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

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

Fix bug in indexes UI, another test

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

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

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

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

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


- if @rows && !@rows.empty?
  %h3 Data
  %p
    .btn-group
      = link_to "Download table (as CSV)", scraper_data_path(@scraper, :format => :csv), class: "btn btn-default"
      = link_to "Download SQLite database", scraper_data_path(@scraper, :format => :sqlite), class: "btn btn-default"
      = link_to "Use the API", api_path, class: "btn btn-default"
  %p rows #{[10, @scraper.database.no_rows].min} / #{@scraper.database.no_rows} (#{number_to_human_size @scraper.database.sqlite_db_size})
  .table-responsive.scraper-data
    %table.table.table-striped.table-bordered.table-condensed
      %tr
        - @rows.first.each_key do |field|
          %th= field
      - @rows.each do |row|
        %tr
          - row.each_value do |v|
            %td
              %div.has-popover{data: {toggle: "popover", placement: "bottom", trigger: "hover", content: v, container: "body"}}
                = auto_link(v)

Convert to string before trying to auto_link

- if @rows && !@rows.empty?
  %h3 Data
  %p
    .btn-group
      = link_to "Download table (as CSV)", scraper_data_path(@scraper, :format => :csv), class: "btn btn-default"
      = link_to "Download SQLite database", scraper_data_path(@scraper, :format => :sqlite), class: "btn btn-default"
      = link_to "Use the API", api_path, class: "btn btn-default"
  %p rows #{[10, @scraper.database.no_rows].min} / #{@scraper.database.no_rows} (#{number_to_human_size @scraper.database.sqlite_db_size})
  .table-responsive.scraper-data
    %table.table.table-striped.table-bordered.table-condensed
      %tr
        - @rows.first.each_key do |field|
          %th= field
      - @rows.each do |row|
        %tr
          - row.each_value do |v|
            %td
              %div.has-popover{data: {toggle: "popover", placement: "bottom", trigger: "hover", content: v, container: "body"}}
                = auto_link(v.to_s)


.row
  .small-12.columns
    %nav.top-padded{"aria-label": "You are here:", role: "navigation"}
      %ul.breadcrumbs
        %li
          =link_to "Events", events_path
        %li
          =link_to @event.name, event_path(@event)
        %li
          %span.show-for-sr Current:
          Registrations
    %h1.text-center
      =@event.name
      Registrations
    %table.hover.stack.datatables
      %thead
        %tr
          %th Date/Time
          %th User
          %th Email
          %th Character
          %th Paid?
      %tbody
        -@event.bookings.each do |booking|
          %tr
            %td= booking.created_at.to_s(:db)
            %td= link_to booking.user.handle, staff_user_path(booking.user)
            %td= link_to booking.user.email, "mailto:#{booking.user.email}"
            %td
              -if booking.character.present?
                =link_to booking.character.name, staff_character_path(booking.character)
            -if booking.paid?
              %td.text-center{ data: { order: booking.paid?, search: "paid" } }
                =link_to staff_receipt_path(booking.receipt) do
                  %i.fa.fa-check-circle
            -else
              %td.text-center{ data: { order: booking.paid? } }
                %i.fa.fa-times-circle

Fix broken link on staff event bookings index.

.row
  .small-12.columns
    %nav.top-padded{"aria-label": "You are here:", role: "navigation"}
      %ul.breadcrumbs
        %li
          =link_to "Events", events_path
        %li
          =link_to @event.name, event_path(@event)
        %li
          %span.show-for-sr Current:
          Registrations
    %h1.text-center
      =@event.name
      Registrations
    %table.hover.stack.datatables
      %thead
        %tr
          %th Date/Time
          %th User
          %th Email
          %th Character
          %th Paid?
      %tbody
        -@event.bookings.each do |booking|
          %tr
            %td= booking.created_at.to_s(:db)
            %td= link_to booking.user.handle, staff_user_path(booking.user)
            %td= link_to booking.user.email, "mailto:#{booking.user.email}"
            %td
              -if booking.character.present?
                =link_to booking.character.name,  staff_user_character_path(booking.character.user, booking.character)
            -if booking.paid?
              %td.text-center{ data: { order: booking.paid?, search: "paid" } }
                =link_to staff_receipt_path(booking.receipt) do
                  %i.fa.fa-check-circle
            -else
              %td.text-center{ data: { order: booking.paid? } }
                %i.fa.fa-times-circle


!!!
%html
  %head
    %meta{:charset => "utf-8"}
    %meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
    %title= content_for?(:title) ? yield(:title) : 'DocumentStore'
    %meta{:name => "description", :content => "#{content_for?(:description) ? yield(:description) : 'Documentstore'}"}
    = stylesheet_link_tag 'application', media: 'all'
    = javascript_include_tag 'vendor/modernizr'
    = javascript_include_tag 'application'
    = csrf_meta_tags
  %body{style: 'background-color: #b6e2eb;'}
    .row
      .large-12.columns
        = render 'layouts/messages'

    .row
      .large-12.columns
        = yield

Add some extra space at the top of the page for the launch template

!!!
%html
  %head
    %meta{:charset => "utf-8"}
    %meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
    %title= content_for?(:title) ? yield(:title) : 'DocumentStore'
    %meta{:name => "description", :content => "#{content_for?(:description) ? yield(:description) : 'Documentstore'}"}
    = stylesheet_link_tag 'application', media: 'all'
    = javascript_include_tag 'vendor/modernizr'
    = javascript_include_tag 'application'
    = csrf_meta_tags
  %body{style: 'background-color: #b6e2eb;'}
    .row.more-space-above
      .large-12.columns
        = render 'layouts/messages'

    .row.more-space-above
      .large-12.columns
        = yield


- assigned_successful_clazzes = summary_data.select{|item| item[1].length > 0}
- already_assigned_clazzes = summary_data.select{|item| item[2].length > 0}
- if assigned_successful_clazzes.length > 0
  .assign_class_header
    Assigned successfully
    .assigned_classes_container.webkit_scrollbars
      %ul
        - assigned_successful_clazzes.each do|summary_item|
          %li
            .class_name
              = summary_item[0]
            .assign_material_list
              = summary_item[1].join(', ')
- if already_assigned_clazzes.length > 0
  .assign_class_header
    Already assigned
    .assigned_classes_container.webkit_scrollbars
      %ul
        - already_assigned_clazzes.each do|summary_item|
          %li
            .class_name
              = summary_item[0]
            .assign_material_list
              = summary_item[2].join(', ')
%br
%table.classdata
  %tr
    %td
      = link_to "Cancel", "#",:href=>"javascript: void(0);",:onclick=>"close_popup()"
%div{:style=>"clear:both"}

Fix material assign page for text change

- assigned_successful_clazzes = summary_data.select{|item| item[1].length > 0}
- already_assigned_clazzes = summary_data.select{|item| item[2].length > 0}
- if assigned_successful_clazzes.length > 0
  .assign_class_header
    Assigned successfully
    .assigned_classes_container.webkit_scrollbars
      %ul
        - assigned_successful_clazzes.each do|summary_item|
          %li
            .class_name
              = summary_item[0]
            .assign_material_list
              = summary_item[1].join(', ')
- if already_assigned_clazzes.length > 0
  .assign_class_header
    Already assigned
    .assigned_classes_container.webkit_scrollbars
      %ul
        - already_assigned_clazzes.each do|summary_item|
          %li
            .class_name
              = summary_item[0]
            .assign_material_list
              = summary_item[2].join(', ')
%br
%table
  %tr
    %td
      = link_to "OK", "#",:href=>"javascript: void(0);",:onclick=>"close_popup()",:class=>"button",:style=>"margin-left: 205px;"
%div{:style=>"clear:both"}


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

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

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

= render 'order_summary'

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

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

Remove unused css property from image in cancel email

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

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

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

= render 'order_summary'

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

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


- content_for :title do
  Gallery

.row
  .col-md-12
    .embed-responsive.embed-responsive-16by9
      %object{ width: "100%", height: "100%" }
        %param{ name: "flashvars", value: "offsite=true&lang=en-us&page_show_url=%2Fgroups%2Fhackweek%2Fpool%2Fshow%2F&page_show_back_url=%2Fgroups%2Fhackweek%2Fpool%2F&group_id=366038@N24&jump_to=&start_index=" }
        %param{ name: "movie", value: "https://www.flickr.com/apps/slideshow/show.swf?v=1811922554" }
        %param{ name: "allowFullScreen", value: "true" }
        %embed{ type: "application/x-shockwave-flash", src: "https://www.flickr.com/apps/slideshow/show.swf?v=1811922554",
                allowFullScreen: "true",
                flashvars: "offsite=true&lang=en-us&page_show_url=%2Fgroups%2Fhackweek%2Fpool%2Fshow%2F&page_show_back_url=%2Fgroups%2Fhackweek%2Fpool%2F&group_id=366038@N24&jump_to=&start_index=",
                width: "100%", height: "100%" }

Use new flick embed gallery

- content_for :title do
  Gallery

.row
  .col-md-12
    .embed-responsive.embed-responsive-16by9
      %a{"data-flickr-embed"=>"true", "data-context"=>"true", href: "https://www.flickr.com/photos/104068895@N07/28144578805/in/pool-hackweek/", title: "P1010240"}
        %img{src: "https://c1.staticflickr.com/8/7434/28144578805_03accc52c5_b.jpg", width: "100%", height: "768"}
      %script{async: true, src: "//embedr.flickr.com/assets/client-code.js", charset: "utf-8"}


- content_for :breadcrumbs do
  = breadcrumbs(Home.hierarchy << 'Search results')

- content_for :edit_this_page do
  = link_to 'Add new person', new_person_path

#search_results
  %h1.noborder Search results
  .search-hint Select a person's name to view more details, or you can view their organisation if desired
  .pagination= pluralize(@people.length, "result") + ' found'

  - @people.each do |person|
    .search-result
      .grid-wrapper
        .grid.grid-1-2
          .inner-block
            .image-background
              = image_tag person.image.medium
            .details
              %h3= link_to person.name, person
              - person.memberships.each do |membership|
                .meta
                  = "#{ membership.role }, " if membership.role.present?
                  = link_to membership.group, membership.group

              .meta= person.phone
              .meta
                = mail_to(person.email)
                = mail_to(person.email)
                = mail_to(person.email)
                = mail_to(person.email)

Fix search results layout when there are no groups

- content_for :breadcrumbs do
  = breadcrumbs(Home.hierarchy << 'Search results')

- content_for :edit_this_page do
  = link_to 'Add new person', new_person_path

#search_results
  %h1.noborder Search results
  .search-hint Select a person's name to view more details, or you can view their organisation if desired
  .pagination= pluralize(@people.length, "result") + ' found'

  - @people.each do |person|
    .search-result
      .grid-wrapper
        .grid.grid-1-2
          .inner-block
            .image-background
              = image_tag person.image.medium
            .details
              %h3= link_to person.name, person
              - if person.memberships.empty?
                .meta
              - else
                - person.memberships.each do |membership|
                  .meta
                    = "#{ membership.role }, " if membership.role.present?
                    = link_to membership.group, membership.group

              .meta= person.phone
              .meta
                = mail_to(person.email)
                = mail_to(person.email)
                = mail_to(person.email)
                = mail_to(person.email)


%a.twitter-share-button{"data-url" => report_url(@report), "data-lang" => "es", "data-size" => "large", "data-via" => "codeandomexico", :href => "https://twitter.com/share"} Twittear
:javascript
  !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");

Add report category in tweets

- message = "Reportamos '#{@report.category.name}'"
%a.twitter-share-button{"data-text" => message, "data-url" => report_url(@report), "data-lang" => "es", "data-size" => "large", "data-via" => "codeandomexico", :href => "https://twitter.com/share"} Twittear
:javascript
  !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");


- if @task_list.nil?
  - if project.editable?(current_user)
    = task_list_link(project)
  - else
    %p= t('.cant_create')

- case location_name
  - when 'show_tasks'
    = task_overview_box(@task)

    %h2= @task_list
    = sidebar_tasks(@task_list.tasks.unarchived)

  - when 'show_task_lists'
    = task_list_overview_box(@task_list)

    %h2= @task_list
    = sidebar_tasks(@task_list.tasks.unarchived)

  - when 'index_task_lists'
    = filter_task_lists(project)

= banner(@events,@chart)

%h2= t('.other_views')
= subscribe_to_calendar_link(project)
= print_task_lists_link(project)

Add link to the TaskList on the sidebar when showing a Task

- if @task_list.nil?
  - if project.editable?(current_user)
    = task_list_link(project)
  - else
    %p= t('.cant_create')

- case location_name
  - when 'show_tasks'
    = task_overview_box(@task)

    %h2= link_to @task_list, [@task_list.project, @task_list]
    = sidebar_tasks(@task_list.tasks.unarchived)

  - when 'show_task_lists'
    = task_list_overview_box(@task_list)

    %h2= @task_list
    = sidebar_tasks(@task_list.tasks.unarchived)

  - when 'index_task_lists'
    = filter_task_lists(project)

= banner(@events,@chart)

%h2= t('.other_views')
= subscribe_to_calendar_link(project)
= print_task_lists_link(project)


- unless params[:controller] == 'questions' && params[:action] == 'new'
  .quick_question
    %h2
      = raw(current_group.question_prompt) || t(".quick_question")
    -@question = Question.new
    =form_for(@question, :url => new_question_url, :html=>{:method => :get, :class => "form", :id => "ask_question"}) do |f|
      -# TODO: refactor this
      -lang = logged_in? ? current_user.main_language : nil
      -lang = current_group.language ? current_group.language : lang

      =f.text_field :title, :class => "text_area", :id => "question_title"
      =f.submit t(".ask_question", :default => :"layouts.application.ask_question"), :class => "ask_question"

      -if lang
        = f.hidden_field :language, :value => lang
      -else
        = language_select(f, @question)
      .clear
    .clear

Fix widgets for show question

- unless params[:controller] == 'questions' && params[:action] == 'new'
  .quick_question
    %h2
      = raw(current_group.question_prompt) || t(".quick_question")
    -quick_question = Question.new
    =form_for(quick_question, :url => new_question_url, :html=>{:method => :get, :class => "form", :id => "ask_question"}) do |f|
      -# TODO: refactor this
      -lang = logged_in? ? current_user.main_language : nil
      -lang = current_group.language ? current_group.language : lang

      =f.text_field :title, :class => "text_area", :id => "question_title"
      =f.submit t(".ask_question", :default => :"layouts.application.ask_question"), :class => "ask_question"

      -if lang
        = f.hidden_field :language, :value => lang
      -else
        = language_select(f, quick_question)
      .clear
    .clear


- if entry
  = Adminable::EntriesPresenter.new(entry.public_send(attribute.name)).to_s

Fix presenter name for has_many index partial

- if entry
  = Adminable::Presenters::Entries.new(entry.public_send(attribute.name)).to_s


.hero-unit
  %h1 Lab Groups

%table.table-striped
  %thead
    %th
      Group number
    %th
      Labs
  %tbody
    - @lab_groups.each do |group|
      %td= group.number
      %td
        %ul
          - group.labs.each do |lab|
            %li= link_to lab.number, course_lab_group_lab_path(current_role_name, params[:course_id], group, lab)

Add flexibility and info to labgroupsindex

.hero-unit
  %h1
    Lab Groups for
  %h2
    = @course.all_course_codes
- unless @lab_groups.empty?
  .well
    %table.table-striped
      %thead
        %th
          Group number
        %th
          Labs
      %tbody
        - @lab_groups.each do |group|
          %td= group.number
          %td
            %ul
              - group.labs.each do |lab|
                %li
                  = link_to "Lab #{lab.number}: #{lab.title}",
                      course_lab_group_lab_path(current_role_name, params[:course_id], group, lab)

.well
  %h2
    You have no lab groups for this course yet.


%OTOrganism{ :local_id => ot_local_id_for(biologica_organism), :name => biologica_organism.name, :sex => biologica_organism.sex, :allowFatalCharacteristic => biologica_organism.fatal_characteristics, :alleles => biologica_organism.alleles, :strain => biologica_organism.strain, :chromosomesColor => biologica_organism.chromosomes_color}
  %world
    = render_scoped_reference(biologica_organism.biologica_world)

Fix the "allow fatal characteristics" attribute in biologica organisms.

%OTOrganism{ :local_id => ot_local_id_for(biologica_organism), :name => biologica_organism.name, :sex => biologica_organism.sex, :allowFatalCharacteristic => biologica_organism.fatal_characteristics.to_s, :alleles => biologica_organism.alleles, :strain => biologica_organism.strain, :chromosomesColor => biologica_organism.chromosomes_color}
  %world
    = render_scoped_reference(biologica_organism.biologica_world)


.page-header
  %h1 Edit App

= render "form"

- if policy(@app).destroy?
  %hr
  %h3 Remove this App

  %p
    Here lies danger. Removing the app from Cuttlefish will permanently delete the app, the associated emails and can not be undone!
  %p
    = button_to "Remove App", @app, confirm: "Are you sure?", method: :delete, class: "btn btn-danger"

Make the dangerous bit more obviously dangerous

.page-header
  %h1 Edit App

= render "form"

- if policy(@app).destroy?
  .alert.alert-block
    %h2 Remove this App
    %p
      Here lies danger. Removing the app from Cuttlefish will permanently delete the app, the associated emails and can not be undone!
    %p
      = button_to "Remove App", @app, confirm: "Are you sure?", method: :delete, class: "btn btn-danger"


-if @lists.empty?
  .row
    .col.s12
      %p.flow-text="There are no lists with this tag."
-else
  .row
    .col.s12
      %p.flow-text="All lists tagged with '#{@tag_name}'"

  .row
    .col.s12
      -if @lists
        =render @lists
      -else
        %p No list found.

Add correct layout to tag overview page.

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

.container
  %h2="All lists tagged with '#{@tag_name}'"
  .Grid
    .Grid-cell.2-of-3--desk
      -unless @lists.empty?
        =render @lists
      -else
        %p No lists created yet.
    .Grid-cell.1-of-3--desk
      %h2 Sidebar
      %p More content herer.


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

Hide header items that are not implemented yet

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

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


- options = { :omit_delete => true }
%div.item_collection{ :id => dom_id_for(portal_clazz)}
  %div{:id => dom_id_for(portal_clazz, :item), :class => 'item'}
    .action_menu
      .action_menu_header_left
        = portal_clazz.name
      .action_menu_header_right
        = portal_clazz.teacher.name
    = render :partial => 'shared/offering_for_student', :collection => portal_clazz.offerings, :as => :offering

Fix for occasions when the clazz has no teacher.

- options = { :omit_delete => true }
%div.item_collection{ :id => dom_id_for(portal_clazz)}
  %div{:id => dom_id_for(portal_clazz, :item), :class => 'item'}
    .action_menu
      .action_menu_header_left
        = portal_clazz.name
      .action_menu_header_right
        = portal_clazz.teacher ? portal_clazz.teacher.name : "(no teacher)"
    = render :partial => 'shared/offering_for_student', :collection => portal_clazz.offerings, :as => :offering


%li.wll{ :class => mr_css_classes(merge_request) }
  .right
    .left
      - if merge_request.merged?
        %span.btn.small.disabled.grouped
          %strong
            %i.icon-ok
            = "MERGED"
      - if merge_request.notes.any?
        %span.btn.small.disabled.grouped
          %i.icon-comment
          = merge_request.notes.count
      %span.btn.small.disabled.grouped
        = merge_request.source_branch
        →
        = merge_request.target_branch
  = image_tag gravatar_icon(merge_request.author_email), :class => "avatar"

  = link_to project_merge_request_path(merge_request.project, merge_request) do
    %p.row_title= truncate(merge_request.title, :length => 80)

  %span.update-author
    %small.cdark= "##{merge_request.id}"
    authored by #{merge_request.author_name}
    = time_ago_in_words(merge_request.created_at)
    ago
    - if merge_request.upvotes > 0
      %span.badge.badge-success= "+#{merge_request.upvotes}"

Update links to merge requests

%li.wll{ :class => mr_css_classes(merge_request) }
  .right
    .left
      - if merge_request.merged?
        %span.btn.small.disabled.grouped
          %strong
            %i.icon-ok
            = "MERGED"
      - if merge_request.notes.any?
        %span.btn.small.disabled.grouped
          %i.icon-comment
          = merge_request.notes.count
      %span.btn.small.disabled.grouped
        = merge_request.source_branch
        →
        = merge_request.target_branch
  = image_tag gravatar_icon(merge_request.author_email), :class => "avatar"

  %p= link_to truncate(merge_request.title, :length => 80), project_merge_request_path(merge_request.project, merge_request), :class => "row_title"

  %span.update-author
    %small.cdark= "##{merge_request.id}"
    authored by #{merge_request.author_name}
    = time_ago_in_words(merge_request.created_at)
    ago
    - if merge_request.upvotes > 0
      %span.badge.badge-success= "+#{merge_request.upvotes}"


-macro chart(name, height, tabs)
  %div.tableauPlaceholder(style="height: #{height-20}px")
    %object.tableauViz(style="display:none; height:#{height+100}px; width: 100%")
      %param(name='host_url' value='https://public.tableau.com/')
      %param(name='site_root' value='')
      %param(name='name' value="#{name}")
      %param(name='tabs' value="#{tabs ? 'yes' : 'no'}")
      %param(name='toolbar' value='no')
      %param(name='static_image' value="https://public.tableau.com/static/images/#{name|slice(0,2)}/#{name}/1.png?#{random()}")
      %param(name='animate_transition' value='yes')
      %param(name='display_static_image' value='yes')
      %param(name='display_spinner' value='no')
      %param(name='display_overlay' value='no')
      %param(name='display_count' value='no')

Fix graph height for Tableau change

-macro chart(name, height, tabs)
  %div.tableauPlaceholder(style="height: #{height-20}px")
    %object.tableauViz(style="display:none; height:#{height}px; width: 100%")
      %param(name='host_url' value='https://public.tableau.com/')
      %param(name='site_root' value='')
      %param(name='name' value="#{name}")
      %param(name='tabs' value="#{tabs ? 'yes' : 'no'}")
      %param(name='toolbar' value='no')
      %param(name='static_image' value="https://public.tableau.com/static/images/#{name|slice(0,2)}/#{name}/1.png?#{random()}")
      %param(name='animate_transition' value='yes')
      %param(name='display_static_image' value='yes')
      %param(name='display_spinner' value='no')
      %param(name='display_overlay' value='no')
      %param(name='display_count' value='no')


= simple_form_for @employee do |f|

  .row-fluid
    .span6
      %h3= t('form.person.address')
      = render 'vcards/form', :f => f

    .span6
      %h3= t_model(PhoneNumber)
      = link_to t_action(:more), [:new_phone_number, resource.persisted? ? resource : controller_name], :remote => true, :class => 'icon-add-text', :style => 'float: right'
      .nested-form.list.contacts
        = f.fields_for :vcard do |vcard|
          - vcard.object.contacts.build_defaults
          - vcard.fields_for :contacts do |contact|
            = render 'phone_numbers/form', :item => contact

  %h3= t('form.person.civil')
  .row-fluid
    .span6
      = f.input :sex, :as => :select, :collection => { t('sex.male') => Person::MALE, t('sex.female') => Person::FEMALE }
      = f.input :nationality
      = f.input :date_of_birth, :as => :date_field
    .span6
      = f.input :civil_status
      = f.input :religion
      = f.input :social_security_nr

  = f.fields_for :employments, (@employments || f.object.employments.valid) do |employment|
    = employment.input :employer_id, :as => :hidden

    = render 'employments/fields', :f => employment

  = f.button :submit

Use .association for :civil_status and :religion fields in employees form.

= simple_form_for @employee do |f|

  .row-fluid
    .span6
      %h3= t('form.person.address')
      = render 'vcards/form', :f => f

    .span6
      %h3= t_model(PhoneNumber)
      = link_to t_action(:more), [:new_phone_number, resource.persisted? ? resource : controller_name], :remote => true, :class => 'icon-add-text', :style => 'float: right'
      .nested-form.list.contacts
        = f.fields_for :vcard do |vcard|
          - vcard.object.contacts.build_defaults
          - vcard.fields_for :contacts do |contact|
            = render 'phone_numbers/form', :item => contact

  %h3= t('form.person.civil')
  .row-fluid
    .span6
      = f.input :sex, :as => :select, :collection => { t('sex.male') => Person::MALE, t('sex.female') => Person::FEMALE }
      = f.input :nationality
      = f.input :date_of_birth, :as => :date_field
    .span6
      = f.association :civil_status
      = f.association :religion
      = f.input :social_security_nr

  = f.fields_for :employments, (@employments || f.object.employments.valid) do |employment|
    = employment.input :employer_id, :as => :hidden

    = render 'employments/fields', :f => employment

  = f.button :submit


- @map = basic_map do |map, page|
  - page << map.setCenter(OpenLayers::LonLat.new(@start_location.x, @start_location.y).transform(projection, map.getProjectionObject()),@start_location.z);

  - vectorlayer = MapLayers::JsVar.new("vectorlayer")
  - protocol = OpenLayers::Protocol::HTTP.new( url: all_geometries_issues_path(:json), format: :format_plain )
  - page.assign(vectorlayer, OpenLayers::Layer::Vector.new("Issues", protocol: protocol, projection: projection, strategies: [OpenLayers::Strategy::BBOX.new()]))
  - page << map.add_layer(vectorlayer)

%div#map
!= @map.to_html

Update issues map to use the new display_bbox_map helper

- @map = display_bbox_map(@start_location, all_geometries_issues_path(:json)) do |map, page|
  %div#map
!= @map.to_html


%span Players
%form{:action => '/search', :method => 'get'}
  %select{:name => 'server', :value => params[:server]}
    - ["All Servers", *ServerHelper.servers].each do |s|
      - if params[:server] && params[:server] == s
        %option{:value => s, :selected => true}= s
      - else
        %option{:value => s}= s

  %input{:name => 'character', :type => 'text', :value => params[:player]}
  %input{:type => 'submit'}
  %span{"data-tippy-content" => haml(:_search_help), :class => "tippy"} ?

%span Allegiances
%form{:action => '/search', :method => 'get'}
  %select{:name => 'server', :value => params[:server]}
    - ["All Servers", *ServerHelper.servers].each do |s|
      - if params[:server] && params[:server] == s
        %option{:value => s, :selected => true}= s
      - else
        %option{:value => s}= s

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

Add all servers to search

%span Players
%form{:action => '/search', :method => 'get'}
  %select{:name => 'server', :value => params[:server]}
    - ["All Servers", *ServerHelper.all_servers].each do |s|
      - if params[:server] && params[:server] == s
        %option{:value => s, :selected => true}= s
      - else
        %option{:value => s}= s

  %input{:name => 'character', :type => 'text', :value => params[:player]}
  %input{:type => 'submit'}
  %span{"data-tippy-content" => haml(:_search_help), :class => "tippy"} ?

%span Allegiances
%form{:action => '/search', :method => 'get'}
  %select{:name => 'server', :value => params[:server]}
    - ["All Servers", *ServerHelper.all_servers].each do |s|
      - if params[:server] && params[:server] == s
        %option{:value => s, :selected => true}= s
      - else
        %option{:value => s}= s

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


.breadcrumb.clearfix{:style => "padding:3.5px 15px;"}
  - if @next_record_path == "#"
    %i.fa.fa-chevron-circle-right.text-muted.fa-2x.navbar-right
  - else
    = link_to @next_record_path, :title => 'Next record' do
      %i.fa.fa-chevron-circle-right.fa-2x.navbar-right

  %span.navbar-right{:style => 'padding: 5px 10px;'} Page #{@row_number} of #{@total_rows}

  - if @prev_record_path == "#"
    %i.fa.fa-chevron-circle-left.text-muted.fa-2x.navbar-right
  - else
    = link_to @prev_record_path, :title => 'Previous record' do
      %i.fa.fa-chevron-circle-left.fa-2x.navbar-right

Allow the row pager to use remote (ajax) links if required

.breadcrumb.clearfix{:style => "padding:3.5px 15px;"}
  - if @next_record_path == "#"
    %i.fa.fa-chevron-circle-right.text-muted.fa-2x.navbar-right
  - else
    = link_to @next_record_path, :title => 'Next record', :remote => @row_pager_remote.nil? ? false : @row_pager_remote  do
      %i.fa.fa-chevron-circle-right.fa-2x.navbar-right

  %span.navbar-right{:style => 'padding: 5px 10px;'} Page #{@row_number} of #{@total_rows}

  - if @prev_record_path == "#"
    %i.fa.fa-chevron-circle-left.text-muted.fa-2x.navbar-right
  - else
    = link_to @prev_record_path, :title => 'Previous record', :remote => @row_pager_remote.nil? ? false : @row_pager_remote  do
      %i.fa.fa-chevron-circle-left.fa-2x.navbar-right


.row
  %table.effective-datatable.table-striped.table-bordered{:id => "#{datatable.to_param}-table", :data => {'effective-datatables-table' => true, 'source' => datatable_path(datatable, :format => 'json'), 'filter' => datatable_filter(datatable), 'non-sortable' => datatable_non_sortable(datatable), 'non-visible' => datatable_non_visible(datatable)}}
    %thead
      - max_depth = datatable.table_columns.map { |_, opts| opts[:th][:depth].to_i rescue 0 }.max
      - [*0..max_depth].each do |depth|
        %tr
          - table_columns = datatable.table_columns.select { |_, opts| (opts[:th][:depth] || 0 rescue 0) == depth }
          - table_columns.each do |name, opts|
            %th{(opts[:th] || {}).merge({:title => opts[:label] || name})}= opts[:label] || name
            - (opts[:append_th] || []).each do |faux_col|
              %th{(faux_col[:th] || {}).merge({:title => faux_col[:label]})}= faux_col[:label]
    %tbody

Remove .row wrapping div from render_datatable()

%table.effective-datatable.table-striped.table-bordered.table-condensed{:id => "#{datatable.to_param}-table", :data => {'effective-datatables-table' => true, 'source' => datatable_path(datatable, :format => 'json'), 'filter' => datatable_filter(datatable), 'non-sortable' => datatable_non_sortable(datatable), 'non-visible' => datatable_non_visible(datatable)}}
  %thead
    - max_depth = datatable.table_columns.map { |_, opts| opts[:th][:depth].to_i rescue 0 }.max
    - [*0..max_depth].each do |depth|
      %tr
        - table_columns = datatable.table_columns.select { |_, opts| (opts[:th][:depth] || 0 rescue 0) == depth }
        - table_columns.each do |name, opts|
          %th{(opts[:th] || {}).merge({:title => opts[:label] || name})}= opts[:label] || name
          - (opts[:append_th] || []).each do |faux_col|
            %th{(faux_col[:th] || {}).merge({:title => faux_col[:label]})}= faux_col[:label]
  %tbody


= render article
= render '/comments/comment_area', commentable: article

Add prev/next links to show view.

= render article

.row
  .col-sm-6
    %p.text-center
      = link_to article.previous, class: ['btn', 'btn-link', if not article.previous then 'disabled' end] do
        #{icon :caret_left, library: :font_awesome} Previous
    - if article.previous
      %p.text-center.text-muted
        %q= article.previous.title

  .col-sm-6
    %p.text-center
      = link_to article.next, class: ['btn', 'btn-link', if not article.next then 'disabled' end] do
        Next #{icon :caret_right, library: :font_awesome}
    - if article.next
      %p.text-center.text-muted
        %q= article.next.title

= render '/comments/comment_area', commentable: article


!!! 5
%HTML{lang: "en"}

  %link{rel: "stylesheet", href: "/stylesheets/stylesheet.css" }

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

  %meta{name: "viewport", content: "width=device-width, initial-scale=1"}

  %body
    .container
      .banner
        .content
          %img{src: "https://raw.githubusercontent.com/bioboxes/logo/0c6bfccd2440ccf06356243ba71b32588ad40617/logo_dark.png", class: 'img-responsive'}
      .main
        .content
          = yield

Add alt tag to logo

!!! 5
%HTML{lang: "en"}

  %link{rel: "stylesheet", href: "/stylesheets/stylesheet.css" }

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

  %meta{name: "viewport", content: "width=device-width, initial-scale=1"}

  %body
    .container
      .banner
        .content
          %img{src: "https://raw.githubusercontent.com/bioboxes/logo/0c6bfccd2440ccf06356243ba71b32588ad40617/logo_dark.png", class: 'img-responsive', alt: "Bioboxes Logo"}
      .main
        .content
          = yield


/.item-container{ "ng-class" => "{ 'row-container' : $ctrl.modalMode}" }
.item-container{ "ng-class" => "$ctrl.CL.itemContainer", "ng-if" => "$ctrl.many" }
  .form-control.item{ "ng-repeat" => "item in $ctrl.itemList track by $index",
        "ng-if" => "$ctrl.many && ($index < 2 || !$ctrl.condition.tableMode)",
        "ng-click" => "$ctrl.select(item)",
        "ng-class" => "$ctrl.CL.item"}
    {{ item.$display_name() }}
  .form-control.item{ "ng-if" => "$ctrl.itemList.length > 3 && $ctrl.condition.tableMode",
                  "ng-click" => "$ctrl.showItems()",
                  "ng-class" => "$ctrl.CL.item" }
    {{$ctrl.UI.clickText}}
  .no-item{ "ng-if" => "$ctrl.condition.noItem" }
    {{$ctrl.UI.noItem}}

/ single item
.form-control.item{ "ng-if" => "!$ctrl.many && !$ctrl.condition.noItem",
       "ng-click" => "$ctrl.selectSingle()"}
  {{ $ctrl.itemList.$display_name() }}

.no-item{ "ng-if" => "!$ctrl.many && $ctrl.condition.noItem" }
  {{$ctrl.UI.noItem}}

Fix for show/hide logic in associated 'many' resource

/.item-container{ "ng-class" => "{ 'row-container' : $ctrl.modalMode}" }
.item-container{ "ng-class" => "$ctrl.CL.itemContainer", "ng-if" => "$ctrl.many" }
  .form-control.item{ "ng-repeat" => "item in $ctrl.itemList track by $index",
        "ng-if" => "$ctrl.many && (( ($index < 2) || (($index < 3) && ($ctrl.itemList.length < 4)) ) || !$ctrl.condition.tableMode )",
        "ng-click" => "$ctrl.select(item)",
        "ng-class" => "$ctrl.CL.item"}
    {{ item.$display_name() }}
  .form-control.item{ "ng-if" => "$ctrl.itemList.length > 3 && $ctrl.condition.tableMode",
                  "ng-click" => "$ctrl.showItems()",
                  "ng-class" => "$ctrl.CL.item" }
    {{$ctrl.UI.clickText}}
  .no-item{ "ng-if" => "$ctrl.condition.noItem" }
    {{$ctrl.UI.noItem}}

/ single item
.form-control.item{ "ng-if" => "!$ctrl.many && !$ctrl.condition.noItem",
       "ng-click" => "$ctrl.selectSingle()"}
  {{ $ctrl.itemList.$display_name() }}

.no-item{ "ng-if" => "!$ctrl.many && $ctrl.condition.noItem" }
  {{$ctrl.UI.noItem}}


Builds for
= @tpl.platform
= @tpl.platform_version
, template "#{@tpl.name}"

- if @targets_not_built.count > 0 then
  - form_tag(image_factory_builds_path, { :action => 'create', :method => :post }) do
    = hidden_field_tag :template_id, @tpl.id
    New Build for
    = select( "targets", "", options_for_select(@targets_not_built))
    = submit_tag "Go", :name => "build"

- form_tag do
  = hidden_field_tag :template_id, @tpl.id
  /= restful_submit_tag "Upload", 'upload', upload_image_factory_builds_path, 'POST'
  /= restful_submit_tag "Delete", 'delete', delete_image_factory_builds_path, 'DELETE'

%ul
  - if @images.empty?
    %li No Builds
  - else
    - @images.each do |img|
      %li
        = "#{img.name}-#{img.template.architecture}: #{img.status}"
        - if img.status == Image::STATE_COMPLETED
          %ul
            - img.provider_images.each do |pimg|
              %li
                = "#{pimg.provider.name}: #{pimg.status}"
            - img.not_uploaded_providers.each do |provider|
              %li
                = "#{provider.name}: "
                not uploaded
                = link_to 'upload', upload_image_factory_builds_path(:template_id => @tpl.id, :image_id => img.id, :provider_id => provider.id), {:class => 'button'}

Correct template platform name displayed in image builds

Builds for
= @tpl.platform_name
= @tpl.platform_version
, template "#{@tpl.name}"

- if @targets_not_built.count > 0 then
  - form_tag(image_factory_builds_path, { :action => 'create', :method => :post }) do
    = hidden_field_tag :template_id, @tpl.id
    New Build for
    = select( "targets", "", options_for_select(@targets_not_built))
    = submit_tag "Go", :name => "build"

- form_tag do
  = hidden_field_tag :template_id, @tpl.id
  /= restful_submit_tag "Upload", 'upload', upload_image_factory_builds_path, 'POST'
  /= restful_submit_tag "Delete", 'delete', delete_image_factory_builds_path, 'DELETE'

%ul
  - if @images.empty?
    %li No Builds
  - else
    - @images.each do |img|
      %li
        = "#{img.name}-#{img.template.architecture}: #{img.status}"
        - if img.status == Image::STATE_COMPLETED
          %ul
            - img.provider_images.each do |pimg|
              %li
                = "#{pimg.provider.name}: #{pimg.status}"
            - img.not_uploaded_providers.each do |provider|
              %li
                = "#{provider.name}: "
                not uploaded
                = link_to 'upload', upload_image_factory_builds_path(:template_id => @tpl.id, :image_id => img.id, :provider_id => provider.id), {:class => 'button'}


%h1 Listing instances

%table
  %tr
    %th Name
    %th Status
    %th Ip address
    %th Driver
    %th IP_Address
    %th Public_IP_Address
    %th Os
    %th Internet accessible
    %th Subnet
    %th
    %th
    %th

  - @instances.each do |instance|
    %tr
      %td= instance.name
      %td= instance.status
      %td= instance.ip_address
      %td= instance.driver_id
      %td= instance.ip_address
      %td= instance.public_ip || "Not Set"
      %td= instance.os
      %td= instance.internet_accessible || "false"
      %td= link_to instance.subnet.name, subnet_path(instance.subnet)
      %td= link_to 'Show', instance
      %td= link_to 'Edit', edit_instance_path(instance)
      %td= link_to 'Destroy', instance, :method => :delete, :data => { :confirm => 'Are you sure?' }

%br

= link_to 'New Instance', new_instance_path

Fix mismatched columns in instance view

%h1 Listing instances

%table
  %tr
    %th Name
    %th Status
    %th Driver
    %th IP_Address
    %th Public_IP_Address
    %th Os
    %th Internet accessible
    %th Subnet
    %th
    %th
    %th

  - @instances.each do |instance|
    %tr
      %td= instance.name
      %td= instance.status
      %td= instance.driver_id
      %td= instance.ip_address
      %td= instance.public_ip || "Not Set"
      %td= instance.os
      %td= instance.internet_accessible || "false"
      %td= link_to instance.subnet.name, subnet_path(instance.subnet)
      %td= link_to 'Show', instance
      %td= link_to 'Edit', edit_instance_path(instance)
      %td= link_to 'Destroy', instance, :method => :delete, :data => { :confirm => 'Are you sure?' }

%br

= link_to 'New Instance', new_instance_path


%footer
  .container
    .row
      .col-sm-12.text-center
        %div.col-sm-12.text-center
        %ul.nav.nav-pills.nav-justified
          %li
            = link_to(announcements_path) do
              %i.fa.fa-bullhorn
              News
          %li
            = link_to(about_path) do
              %i.fa.fa-question
              About
          %li
            = link_to(gallery_path) do
              %i.fa.fa-picture-o
              Pics
          %li
            = link_to('https://github.com/SUSE/hackweek/blob/master/CREDITS.md') do
              %i.fa.fa-heartbeat
              Credit.
        %p.small{style: 'padding-top: 25px'}
          © 2016 SUSE.
          This tool is
          = link_to 'free software,', 'http://www.gnu.org/philosophy/free-sw.html'
          you can run, copy, distribute, study, change and improve it.
          The source code and the developers are on
          = link_to 'github.', 'https://github.com/SUSE/hackweek'

Fix copyright year in footer -> 2017

%footer
  .container
    .row
      .col-sm-12.text-center
        %div.col-sm-12.text-center
        %ul.nav.nav-pills.nav-justified
          %li
            = link_to(announcements_path) do
              %i.fa.fa-bullhorn
              News
          %li
            = link_to(about_path) do
              %i.fa.fa-question
              About
          %li
            = link_to(gallery_path) do
              %i.fa.fa-picture-o
              Pics
          %li
            = link_to('https://github.com/SUSE/hackweek/blob/master/CREDITS.md') do
              %i.fa.fa-heartbeat
              Credit.
        %p.small{style: 'padding-top: 25px'}
          © 2017 SUSE.
          This tool is
          = link_to 'free software,', 'http://www.gnu.org/philosophy/free-sw.html'
          you can run, copy, distribute, study, change and improve it.
          The source code and the developers are on
          = link_to 'github.', 'https://github.com/SUSE/hackweek'


.standalone
  - form_for(@user, :url => passwords_path, :html => one_submit_only(:user), :method => :put) do |f|
    .title #{t:reset_password}
    = f.error_messages
    .intro #{t:confirm_password_intro}
    .section
      .label #{t:newpassword}:
      = f.password_field :password
      .label #{t:password_confirmation}:
      = f.password_field :password_confirmation
    %br
    .buttonbar
      = f.submit t(:update_password_and_login)

Fix url for password resetting.

.standalone
  - form_for(@user, :url => password_path(params[:id]), :html => one_submit_only(:user), :method => :put) do |f|
    .title #{t:reset_password}
    = f.error_messages
    .intro #{t:confirm_password_intro}
    .section
      .label #{t:newpassword}:
      = f.password_field :password
      .label #{t:password_confirmation}:
      = f.password_field :password_confirmation
    %br
    .buttonbar
      = f.submit t(:update_password_and_login)


.main-content
  .row.g-center
    = render partial: "patients/patient_info_header", locals: { model: @patient }

  .row
    = render partial: "patients/mini_renal_profile", locals: { model: @patient }

.row
  %h5 Deceased Patients

.row
  %ul.no-bullet
    - @dead_patients.each do |patient|

      %li
        = patient.full_name

Fix failing 'manage patients' functionality

.main-content

.row
  %h5 Deceased Patients

.row
  %ul.no-bullet
    - @dead_patients.each do |patient|

      %li
        = patient.full_name


%ul.small-block-grid-1.info
  %li
  -#  This is to make a space above. It's a hack but it works for now.
  %li
    %a{href: '/sbmarathon/register/'}
      %img{src: '/assets/images/banner/sbm16_banner.jpg'}
  %li
    %a{href: '/programs/bssp/'}
      %img{src: '/assets/images/banner/bssp_sponsor.jpg'}
  %li
    %a{href: 'http://shop.becauseofhope.org/products'}
      %img{src: '/assets/images/banner/BOH_shop.jpg'}

%h2 Sustainably empowering widows and orphans in Uganda.

Change order of banners on front page

%ul.small-block-grid-1.info
  %li
  -#  This is to make a space above. It's a hack but it works for now.
  %li
    %a{href: '/sbmarathon/register/'}
      %img{src: '/assets/images/banner/sbm16_banner.jpg'}
  %li
    %a{href: 'http://shop.becauseofhope.org/products'}
      %img{src: '/assets/images/banner/BOH_shop.jpg'}
  %li
    %a{href: '/programs/bssp/'}
      %img{src: '/assets/images/banner/bssp_sponsor.jpg'}

%h2 Sustainably empowering widows and orphans in Uganda.


%h3 Internal Note

= simple_form_for [:admin, order], (EffectiveOrders.admin_simple_form_options || {}).merge(url: effective_orders.admin_order_path(order)) do |f|
  = f.input :note_internal, label: 'Internal note', hint: 'For internal admin use only.  This note will never be displayed to the buyer.'

  %p.text-right
    = f.button :submit, 'Save Internal Note', data: { disable_with: 'Saving...' }

Use admin order actions on the form note internal form

%h3 Internal Note

= simple_form_for [:admin, order], (EffectiveOrders.admin_simple_form_options || {}).merge(url: effective_orders.admin_order_path(order)) do |f|
  = f.input :note_internal, label: 'Internal note', hint: 'For internal admin use only.  This note will never be displayed to the buyer.'

  = render partial: '/admin/orders/order_actions', locals: { order: @order, form: f, f: f }


%table
  %tbody
    %tr
      %td.headerleft.center
        %span.name
          = RankHelper::get_rank_name(@character['race'], @character['gender'], @character['rank'])
          = @character['name']
        %span.block.title
          = GenderHelper::get_gender_name(@character['gender'])
          = RaceHelper::get_race_name(@character['race'])
          - if @character['current_title']
            = TitleHelper::get_title_name(@character['current_title'])
        %span.block.title
        %table.internal.xplum
          %tbody
            - if @character['luminance_earned'] && @character['luminance_earned'] > 0
              %tr
                %td.left
                  %span Luminance:
                %td.right
                  %span= "#{add_commas(@character['luminance_earned'].to_s)} / #{add_commas(@character['luminance_total'].to_s)}"
            %tr
              %td.left
                %span Total Experience (XP):
              %td.right
                %span= add_commas(@character['total_xp'].to_s)
      %td.headerright.center.level
        %span.block Character
        %span.block Level
        %span.block.level= @character['level']

Add <abbr> tags to gender/race/title

%table
  %tbody
    %tr
      %td.headerleft.center
        %span.name
          = RankHelper::get_rank_name(@character['race'], @character['gender'], @character['rank'])
          = @character['name']
        %span.block.title
          %abbr{:title => "Gender"}= GenderHelper::get_gender_name(@character['gender'])
          %abbr{:title => "Race"}= RaceHelper::get_race_name(@character['race'])
          - if @character['current_title']
            %abbr{:title => "Current Title"}= TitleHelper::get_title_name(@character['current_title'])
        %span.block.title
        %table.internal.xplum
          %tbody
            - if @character['luminance_earned'] && @character['luminance_earned'] > 0
              %tr
                %td.left
                  %span Luminance:
                %td.right
                  %span= "#{add_commas(@character['luminance_earned'].to_s)} / #{add_commas(@character['luminance_total'].to_s)}"
            %tr
              %td.left
                %span Total Experience (XP):
              %td.right
                %span= add_commas(@character['total_xp'].to_s)
      %td.headerright.center.level
        %span.block Character
        %span.block Level
        %span.block.level= @character['level']


%link{rel: 'stylesheet', href:'/mailer.css'}
%table.row
  %tbody
    %tr
      %th
        %table
          %tr
            %td.main-content
              %h1.headline
                = "#{@course.title}: submitted!"
              %p.paragraph
                = "Hi #{@instructor.real_name || @instructor.username}! Thank you for joining Wiki Education's Student Program. Your course page has been submitted successfully."
              %p.paragraph
                Helaine Blumenthal, Wikipedia Student Program Manager at Wiki Education, will
                be in touch with you soon and will work to support your assignment
                throughout the term. In the meantime, if you have any questions, check out
                = succeed ',' do
                  %a.link{href: 'https://ask.wikiedu.org'} ask.wikiedu.org
                where you can find answers to commonly asked questions about
                teaching with Wikipedia.
              %p.paragraph
                You can access — and continue to edit — your course page here:
            %td.expander
        %table
          %tr
            %td.main-content.link-cell
              %a.button_link{:href => @course_link}
                = @course.title
            %td.expander
        %table
          %tr
            %td.main-content
              %p.paragraph
                Best regards,
                %br
                %em
                  The Wiki Ed team

Update course submission confirmation email for Fall 2020

%link{rel: 'stylesheet', href:'/mailer.css'}
%table.row
  %tbody
    %tr
      %th
        %table
          %tr
            %td.main-content
              %h1.headline
                = "#{@course.title}: application submitted."
              %p.paragraph
                = "Dear #{@instructor.real_name || @instructor.username},"
              %p.paragraph
                Thank you for submitting your Wiki Education course page. Your application is now complete.
              %p.paragraph
                If you are applying for a spot in our Fall 2020 cohort, we will notify you of our decision by August 7.
              %p.paragraph
                If you've submitted your course page for Summer 2020 or another academic term, we will follow up accordingly.
              %p.paragraph
                If you have any questions, please reach out to Helaine Blumenthal (helaine@wikiedu.org)
              %p.paragraph
                You can access — and continue to edit — your course page here:
            %td.expander
        %table
          %tr
            %td.main-content.link-cell
              %a.button_link{:href => @course_link}
                = @course.title
            %td.expander
        %table
          %tr
            %td.main-content
              %p.paragraph
                Best regards,
                %br
                %em
                  The Wiki Ed team


#internal-user.tab-pane.active
  %form
    .form-body
      .ui-form-group.rowed
        %p.mbm Alle Funktionen nutzen und auf <br/> mehr Inhalte zugreifen.
        %a#internal-login-link.primary-button.block.large{href: login_path}
          = _("Log in")

Rename internal-user to zhdk-users in css

#zhdk-user.tab-pane.active
  %form
    .form-body
      .ui-form-group.rowed
        %p.mbm Alle Funktionen nutzen und auf <br/> mehr Inhalte zugreifen.
        %a#zhdk-login-link.primary-button.block.large{href: login_path}
          = _("Log in")


- active   ||= nil
- activity ||= nil

- content_for :title do
  - Activity.model_name.human(count: 2)

%ul.nav.nav-tabs
  %li{class: active_if(active == :show)}
    %a{href:activity_path(activity)}= t(:".show_action")
  - unless activity.closed?
    %li{class: active_if(active == :report)}
      %a{href:report_activity_path(activity)}= t(:".activity_report_action")
  %li.secondary-tab{class: active_if(active == :destroy)}
    %a{href:confirm_destroy_activity_path(activity)}= t(:".destroy_action")
  %li.secondary-tab{class: active_if(active == :edit)}
    %a{href:edit_activity_path(activity)}= t(:".edit_action")
  %li
    %a{href:suite_path(activity.suite)}= t(:".return_to_suite")

Fix for non-visible menu option when closing activities

- active   ||= nil
- activity ||= nil

- content_for :title do
  - Activity.model_name.human(count: 2)

%ul.nav.nav-tabs
  %li{class: active_if(active == :show)}
    %a{href:activity_path(activity)}= t(:".show_action")
  - if !activity.closed? || activity.status_changed?
    %li{class: active_if(active == :report)}
      %a{href:report_activity_path(activity)}= t(:".activity_report_action")
  %li.secondary-tab{class: active_if(active == :destroy)}
    %a{href:confirm_destroy_activity_path(activity)}= t(:".destroy_action")
  %li.secondary-tab{class: active_if(active == :edit)}
    %a{href:edit_activity_path(activity)}= t(:".edit_action")
  %li
    %a{href:suite_path(activity.suite)}= t(:".return_to_suite")


%hr
#footer{style: "padding-bottom: 15px"}
  %p.text-center
    = link_to fa_icon("question-circle") + " About", about_path

    = link_to fa_icon("compass") + " Principles", principles_path

    = link_to fa_icon("users") + " How to help", how_you_can_help_path

    = link_to fa_icon("envelope") + " Newsletter", "http://eepurl.com/cWwWWf", target: "_blank"

    = link_to fa_icon("commenting") + " Feedback", feedback_form_url, target: "_blank"

Add email contact link in footer

%hr
#footer{style: "padding-bottom: 15px"}
  %p.text-center
    = link_to fa_icon("question-circle") + " About", about_path

    = link_to fa_icon("compass") + " Principles", principles_path

    = link_to fa_icon("users") + " How to help", how_you_can_help_path

    = mail_to "contact@thriveabilitylab.com", fa_icon("envelope") + " Email us"

    = link_to fa_icon("newspaper-o") + " Newsletter", "http://eepurl.com/cWwWWf", target: "_blank"

    = link_to fa_icon("commenting") + " Feedback", feedback_form_url, target: "_blank"


%div.tree-ref-holder
  = render 'shared/ref_switcher', destination: 'tree', path: @path
- if can? current_user, :download_code, @project
  .tree-ref-holder.pull-right
    = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small', split_button: true
%div#tree-holder.tree-holder
  = render "tree", tree: @tree

Fix download archive menu for tree view.

%div.tree-ref-holder
  = render 'shared/ref_switcher', destination: 'tree', path: @path
- if can? current_user, :download_code, @project
  = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small tree-ref-holder pull-right', split_button: true
%div#tree-holder.tree-holder
  = render "tree", tree: @tree


= element.content_data.content

Use RedCloth to markup TextElements (if RedCloth is found)

- if element.content_data.content.blank?

- else
  - if Object.const_defined?('RedCloth')
    = RedCloth.new(element.content_data.content).to_html.html_safe
  - else
    = element.content_data.content


.survey-report-container.panel
  .survey-report-question.rounded-top
    %h3 Health Conditions Related to Sleep Apnea
  .survey-report-answer
    %p.lead
      If you currently do not have a diagnosis of sleep apnea, but have one or more of these health conditions and experience many symptoms related to sleep apnea, you should consult your medical provider.
  .survey-report-info
    %p.lead
      Use your mouse to
      %span.f500 click on
      each circle to learn more!
    #health-conditions-info
    #health-conditions{ style: 'position:relative', data: { object: 'd3-report', question: 'health-conditions' } }
      #tooltip.hidden.hidden-xs{ style: 'position: absolute;' }

Replace some survey feedback text about other health conditions

.survey-report-container.panel
  .survey-report-question.rounded-top
    %h3 Health Conditions Related to Sleep Apnea
  .survey-report-answer
    %p.lead
      Sleep apnea is related, and can lead, to many other health issues. People may develop other health conditions before and after they are diagnosed with sleep apnea. Researchers are interested in examining the relationship between sleep apnea and other health conditions in order to improve treatments and overall health.
      %br
      %br
      Many of these conditions are common in the general population, and some, such as diabetes, may be particularly common in people with sleep apnea. One goal of MyApnea.Org is to better understand the links among these diseases and sleep apnea . This information may help identify how treatment of sleep apnea impacts many aspects of health.
  .survey-report-info
    %p.lead
      Use your mouse to
      %span.f500 click on
      each circle to learn more!
    #health-conditions-info
    #health-conditions{ style: 'position:relative', data: { object: 'd3-report', question: 'health-conditions' } }
      #tooltip.hidden.hidden-xs{ style: 'position: absolute;' }


.page-header
  %h1 Recent emails

%ul.nav.nav-pills
  %li{class: ("active" if @status.nil?)}
    = link_to "All", emails_path
  %li{class: ("active" if @status == "delivered")}
    = link_to "Delivered", emails_path(status: "delivered")
  %li{class: ("active" if @status == "soft_bounce")}
    = link_to "Soft bounces", emails_path(status: "soft_bounce")
  %li{class: ("active" if @status == "hard_bounce")}
    = link_to "Hard bounces", emails_path(status: "hard_bounce")

= paginated_section @emails do
  %table.table.table-striped
    %thead
      %tr
        %th To
        %th Created
    %tbody(data-provides="rowlink")
      - @emails.each do |email|
        %tr{class: delivered_class(email.status)}
          %td= link_to truncate(email.to_as_string, length: 50), email_path(email), :class => "rowlink"
          %td
            = time_ago_in_words(email.created_at)
            ago

Replace pills with a btn-group

.page-header
  %h1 Recent emails

.btn-group
  = link_to "All", emails_path, :class => ["btn", "btn-small", ("active" if @status.nil?)]
  = link_to "Delivered", emails_path(status: "delivered"), :class => ["btn", "btn-small", ("active" if @status == "delivered")]
  = link_to "Soft bounces", emails_path(status: "soft_bounce"), :class => ["btn", "btn-small", ("active" if @status == "soft_bounce")]
  = link_to "Hard bounces", emails_path(status: "hard_bounce"), :class => ["btn", "btn-small", ("active" if @status == "hard_bounce")]

= paginated_section @emails do
  %table.table.table-striped
    %thead
      %tr
        %th To
        %th Created
    %tbody(data-provides="rowlink")
      - @emails.each do |email|
        %tr{class: delivered_class(email.status)}
          %td= link_to truncate(email.to_as_string, length: 50), email_path(email), :class => "rowlink"
          %td
            = time_ago_in_words(email.created_at)
            ago


!!! 5
<!--[if IE 7]><html class="no-js ie7" lang="en"><![endif]-->
<!--[if IE 8]><html class="no-js ie8" lang="en"><![endif]-->
<!--[if IE 9]><html class="no-js ie9" lang="en"><![endif]-->
<!--[if gt IE 9]><!--><html class='no-js' lang="en"><!--<![endif]-->
%head
  = render 'layouts/core/head'
%body
  .wrap--footer-push
    = render 'layouts/core/master_head', :user_nav => defined?(user_nav) ? user_nav : true
    .row.row--content#js-row--content
      .row__inner.row__inner--content
        = yield
      .row--footer-push
  .wrap--footer
    = render 'layouts/core/footer'
  .js-config.is-hidden
    = render 'layouts/core/snippets/fs_init'
    = js_configuration
    = yield :scripts

  = "build: #{Variant.full_namespace}"

Set window.appEnvironment to Rails.env if not production

!!! 5
<!--[if IE 7]><html class="no-js ie7" lang="en"><![endif]-->
<!--[if IE 8]><html class="no-js ie8" lang="en"><![endif]-->
<!--[if IE 9]><html class="no-js ie9" lang="en"><![endif]-->
<!--[if gt IE 9]><!--><html class='no-js' lang="en"><!--<![endif]-->
%head
  = render 'layouts/core/head'
%body
  .wrap--footer-push
    = render 'layouts/core/master_head', :user_nav => defined?(user_nav) ? user_nav : true
    .row.row--content#js-row--content
      .row__inner.row__inner--content
        = yield
      .row--footer-push
  .wrap--footer
    = render 'layouts/core/footer'
  .js-config.is-hidden
    = render 'layouts/core/snippets/fs_init'
    = js_configuration
    - unless Rails.env.production?
      :javascript
        window.appEnvironment = "#{Rails.env}";
    = yield :scripts

  = "build: #{Variant.full_namespace}"


.container
  %h1 New scraper

  = simple_form_for @scraper do |f|
    .row
      .col-sm-6
        = f.input :original_language_key, collection: Morph::Language.languages_supported.map{|l| [l.human, l.key, {"data-content" => "#{image_tag(l.image_path, size: '20x20')} #{l.human}"}]}, include_blank: false, hint: "The language you would like to write your scraper in. You can change this later.", label: "Language"
    .row
      .col-sm-2
        = f.input :owner_id, collection: current_user.all_owners.map{|o| [o.nickname, o.id, {"data-content" => "#{owner_image(o, 20, false)} #{o.nickname}"}]}, include_blank: false
      .col-sm-6
        -# Using long-winded form here because simple_form doesn't directly support prepends
        = f.input :name do
          .input-group
            %span.input-group-addon /
            = f.input_field :name, class: "form-control", placeholder:"city_of_sydney_development_applications"
          %span.help-block Name to give the scraper here and on GitHub

    = f.input :description, label: "Description"

    = f.button :submit

Change the description label to a question

.container
  %h1 New scraper

  = simple_form_for @scraper do |f|
    .row
      .col-sm-6
        = f.input :original_language_key, collection: Morph::Language.languages_supported.map{|l| [l.human, l.key, {"data-content" => "#{image_tag(l.image_path, size: '20x20')} #{l.human}"}]}, include_blank: false, hint: "The language you would like to write your scraper in. You can change this later.", label: "Language"
    .row
      .col-sm-2
        = f.input :owner_id, collection: current_user.all_owners.map{|o| [o.nickname, o.id, {"data-content" => "#{owner_image(o, 20, false)} #{o.nickname}"}]}, include_blank: false
      .col-sm-6
        -# Using long-winded form here because simple_form doesn't directly support prepends
        = f.input :name do
          .input-group
            %span.input-group-addon /
            = f.input_field :name, class: "form-control", placeholder:"city_of_sydney_development_applications"
          %span.help-block Name to give the scraper here and on GitHub

    = f.input :description, label: "What data will your scraper collect?"

    = f.button :submit


%ul.small-block-grid-1.info
  %li
  -#  This is to make a space above. It's a hack but it works for now.
  %li
    %a{href: '/sbmarathon/register/'}
      %img{src: '/assets/images/banner/sbm16_banner.jpg'}
  %li
    %a{href: 'http://shop.becauseofhope.org/products'}
      %img{src: '/assets/images/banner/BOH_shop.jpg'}
  %li
    %a{href: '/programs/bssp/'}
      %img{src: '/assets/images/banner/bssp_sponsor.jpg'}

%h2 Sustainably empowering widows and orphans in Uganda.

Revert "Change order of banners on front page"

%ul.small-block-grid-1.info
  %li
  -#  This is to make a space above. It's a hack but it works for now.
  %li
    %a{href: '/sbmarathon/register/'}
      %img{src: '/assets/images/banner/sbm16_banner.jpg'}
  %li
    %a{href: '/programs/bssp/'}
      %img{src: '/assets/images/banner/bssp_sponsor.jpg'}
  %li
    %a{href: 'http://shop.becauseofhope.org/products'}
      %img{src: '/assets/images/banner/BOH_shop.jpg'}

%h2 Sustainably empowering widows and orphans in Uganda.


%div.form-container
  = form_for item do |f|
    %fieldset
      %div.form-group
        %div
          = f.text_field :title, class:"form-control", placeholder:"タイトル"
      %div.form-group
        %div.row
          %div.col-sm-12
            %div.item-container
              %div.item-body
                %div.item-header.item-body-header Markdown
                %div.item-body-content
                  = f.text_area :body, id: "item-text", placeholder:"本文を入力してください"
              %div.item-preview
                %div.item-header.item-previw-header プレビュー
                %div.markdown#item-preview-content
      = f.hidden_field :advent_calendar_item_id, value: @item.advent_calendar_item_id
      %div.pull-left
        = f.submit "プレビュー", name: "preview_button", class:"btn btn-success", formtarget:"_blank"
      %div.pull-right
        = link_to "キャンセル", advent_calendar_item_path(id: @item.advent_calendar_item_id), class:"btn btn-default"
        = f.submit "登録する", class:"btn btn-primary"

Fix using local variable in partial view

%div.form-container
  = form_for item do |f|
    %fieldset
      %div.form-group
        %div
          = f.text_field :title, class:"form-control", placeholder:"タイトル"
      %div.form-group
        %div.row
          %div.col-sm-12
            %div.item-container
              %div.item-body
                %div.item-header.item-body-header Markdown
                %div.item-body-content
                  = f.text_area :body, id: "item-text", placeholder:"本文を入力してください"
              %div.item-preview
                %div.item-header.item-previw-header プレビュー
                %div.markdown#item-preview-content
      = f.hidden_field :advent_calendar_item_id, value: item.advent_calendar_item_id
      %div.pull-left
        = f.submit "プレビュー", name: "preview_button", class:"btn btn-success", formtarget:"_blank"
      %div.pull-right
        = link_to "キャンセル", advent_calendar_item_path(id: item.advent_calendar_item_id), class:"btn btn-default"
        = f.submit "登録する", class:"btn btn-primary"


- @page_title = @fabulator_edition.name + ' Edition - ' + default_page_title

- body_classes << "reversed"

- render_region :main do |main|
  - main.show_header do
    %h1= 'Edition - ' + @fabulator_edition.name
  - main.show_form do
    %p
      Size:
      = @fabulator_edition.file_size

    %h2 Download

    %p
      %a{:href => api_edition_url(:id => @fabulator_edition.id)}
        = @fabulator_edition.download_filename + ".tgz"
    %p
      N.B.: This archive opens as
      = './' + @fabulator_edition.build_dirname
      when unpacked.

Add edition description to page about edition

- @page_title = @fabulator_edition.name + ' Edition - ' + default_page_title

- body_classes << "reversed"

- render_region :main do |main|
  - main.show_header do
    %h1= 'Edition - ' + @fabulator_edition.name
  - main.show_form do
    %p
      Size:
      = @fabulator_edition.file_size

    %h2 Download

    %p
      %a{:href => api_edition_url(:id => @fabulator_edition.id)}
        = @fabulator_edition.download_filename + ".tgz"
    %p
      N.B.: This archive opens as
      = './' + @fabulator_edition.build_dirname
      when unpacked.

    = markdown @fabulator_edition.description


- content_for(:title, "Dossier bien envoyé (#{@dossier.procedure.libelle})")

- content_for :footer do
  = render partial: "new_user/dossiers/dossier_footer", locals: { dossier: @dossier }

.merci
  .container
    = image_tag('user/envoi-dossier.svg')
    %h1 Merci !
    %p.send
      Votre dossier sur la démarche
      %b= @dossier.procedure.libelle
      a bien été envoyé.
    %p
      Vous avez désormais accès à votre
      %b dossier en ligne.
    %p
      Vous pouvez
      %b le modifier
      et
      %b échanger avec un instructeur
      lors de sa construction et de son instruction

    = link_to 'Accéder à votre dossier', dossier_path(@dossier), class: 'button large primary'

Update message so that it reflects the reality

- content_for(:title, "Dossier bien envoyé (#{@dossier.procedure.libelle})")

- content_for :footer do
  = render partial: "new_user/dossiers/dossier_footer", locals: { dossier: @dossier }

.merci
  .container
    = image_tag('user/envoi-dossier.svg')
    %h1 Merci !
    %p.send
      Votre dossier sur la démarche
      %b= @dossier.procedure.libelle
      a bien été envoyé.
    %p
      Vous avez désormais accès à votre
      %b dossier en ligne.
    %p
      Vous pouvez
      %b le modifier
      et
      %b échanger avec un instructeur.

    = link_to 'Accéder à votre dossier', dossier_path(@dossier), class: 'button large primary'


.action_menu
  .action_menu_header
    .action_menu_header_left
      = form_tag url_for(:action => "index", :page => session[:page] || 1 ), :method => 'get' do
        = content_tag :label do
          = text_field_tag :search, params[:search], :size => 20
        %input{ :type => "submit", :value => "Search"}
        - if defined? extra_collection_search_fields
          %p= extra_collection_search_fields
      - if collection
        %p= page_entries_info collection, :model => collection_class.display_name
      %p.paginator
        = will_paginate collection
    .action_menu_header_right
      %ul.menu
        - if policy(@projects).create?
          %li= link_to "create #{collection_class.display_name}", :controller => collection_class.name.underscore.pluralize, :action => :new
        %li= toggle_all "#{collection_class.display_name} descriptions"

Improve policy check for project privileges.

.action_menu
  .action_menu_header
    .action_menu_header_left
      = form_tag url_for(:action => "index", :page => session[:page] || 1 ), :method => 'get' do
        = content_tag :label do
          = text_field_tag :search, params[:search], :size => 20
        %input{ :type => "submit", :value => "Search"}
        - if defined? extra_collection_search_fields
          %p= extra_collection_search_fields
      - if collection
        %p= page_entries_info collection, :model => collection_class.display_name
      %p.paginator
        = will_paginate collection
    .action_menu_header_right
      %ul.menu
        - if !@projects || policy(Admin::Project).create?
          %li= link_to "create #{collection_class.display_name}", :controller => collection_class.name.underscore.pluralize, :action => :new
        %li= toggle_all "#{collection_class.display_name} descriptions"


You can use
=link_to 'Markdown', 'http://daringfireball.net/projects/markdown/syntax/'
to format your text.
%br/
For instance, *italic*, **bold**, or a link [like this](http://to.some.site.com/).
%br/
Quick crop links: [sweet potato](crop).

Add quick member link help to markdown help

You can use
=link_to 'Markdown', 'http://daringfireball.net/projects/markdown/syntax/'
to format your text.
%br/
For instance, *italic*, **bold**, or a link [like this](http://to.some.site.com/).
%br/
Quick crop links: [sweet potato](crop).
%br/
Quick member links: @Username or [Username](member).


- content_for :note_actions do
  - if can?(current_user, :update_merge_request, @merge_request)
    - if @merge_request.open?
      = link_to 'Close merge request', merge_request_path(@merge_request, merge_request: {state_event: :close }), method: :put, class: "btn btn-nr btn-comment btn-close close-mr-link js-note-target-close", title: "Close merge request", data: {original_text: "Close merge request", alternative_text: "Comment & close merge request"}
    - if @merge_request.reopenable?
      = link_to 'Reopen merge request', merge_request_path(@merge_request, merge_request: {state_event: :reopen }), method: :put, class: "btn btn-nr btn-comment btn-reopen reopen-mr-link js-note-target-reopen", title: "Reopen merge request", data: {original_text: "Reopen merge request", alternative_text: "Comment & reopen merge request"}
  %comment-and-resolve-btn{ "inline-template" => true, ":discussion-id" => "" }
    %button.btn.btn-nr.btn-default.append-right-10.js-comment-resolve-button{ "v-if" => "showButton", type: "submit", data: { project_path: "#{project_path(@merge_request.project)}" } }
      {{ buttonText }}

#notes= render "projects/notes/notes_with_form"

Add class selector to make secondary button to work

- content_for :note_actions do
  - if can?(current_user, :update_merge_request, @merge_request)
    - if @merge_request.open?
      = link_to 'Close merge request', merge_request_path(@merge_request, merge_request: { state_event: :close }), method: :put, class: "btn btn-nr btn-comment btn-close close-mr-link js-note-target-close", title: "Close merge request", data: { original_text: "Close merge request", alternative_text: "Comment & close merge request"}
    - if @merge_request.reopenable?
      = link_to 'Reopen merge request', merge_request_path(@merge_request, merge_request: { state_event: :reopen }), method: :put, class: "btn btn-nr btn-comment btn-reopen reopen-mr-link js-note-target-close js-note-target-reopen", title: "Reopen merge request", data: { original_text: "Reopen merge request", alternative_text: "Comment & reopen merge request"}
  %comment-and-resolve-btn{ "inline-template" => true, ":discussion-id" => "" }
    %button.btn.btn-nr.btn-default.append-right-10.js-comment-resolve-button{ "v-if" => "showButton", type: "submit", data: { project_path: "#{project_path(@merge_request.project)}" } }
      {{ buttonText }}

#notes= render "projects/notes/notes_with_form"


.redactorable
  = f.input :text, label: false, as: :text, input_html: {value: forem_format(@post.text)}

- if params[:reply_to_id]
  = f.hidden_field :reply_to_id, value: params[:reply_to_id]

Fix create forum topic issue.

.redactorable
  = f.input :text, label: false, as: :text, input_html: {value: forem_format(@post.try(:text) || "")}

- if params[:reply_to_id]
  = f.hidden_field :reply_to_id, value: params[:reply_to_id]


%div.gradeUserName= grade.user.name
= gravatar_for grade.user
= form.input :score
= form.input :feedback, :as => :text
= form.input :status, :as => :select, :collection => [["New", "New"], ["Graded", "Graded"], ["Released", "Released"]]
= form.input :substantial, :as => :select
%div#badgeSelection= form.input :badges, :as => :check_boxes, :collection => @badges

Add select grade type to form

%div.gradeUserName= grade.user.name
= gravatar_for grade.user
= form.input :score
= form.input :feedback, :as => :text
= form.input :status, :as => :select, :collection => [["New", "New"], ["Graded", "Graded"], ["Released", "Released"]]
= form.input :substantial, :as => :select
= form.input :type, :as => :select, :collection => [["LFPGGrade", "LFPGGrade"]]
%div#badgeSelection= form.input :badges, :as => :check_boxes, :collection => @badges


.btn-group
  - if project.users.include? current_user
    = link_to(leave_project_path(project.id), :title => 'Stop working on this project?', :class => 'btn btn-default') do
      = project.users.length
      %i.icon-stop
  - else
    = link_to(join_project_path(project.id), :title => 'Work on this project?', :class=>'btn btn-default') do
      = project.users.length
      %i.icon-play
  - if project.kudos.include? current_user
    = link_to(dislike_project_path(project.id), :title=>'Dislike this project?', :class=> "btn btn-default") do
      = project.kudos.length
      %i.icon-heart
  - else
    =link_to(like_project_path(project.id), :title=>'Like this project', :class=> "btn btn-default") do
      = project.kudos.length
      %i.icon-heart-empty
  - if can? :edit, project
    = link_to(edit_project_path(project), :title=>'Edit this project?', :class=> "btn btn-default") do

      %i.icon-pencil
  -if can? :destroy, project
    = link_to(project_path(project), :title=>'Delete this project?', :class=> "btn btn-default", :method => :delete, data: { confirm: "Are you sure you want to delete this project? This can't be undone!" }) do

      %i.icon-remove

Use thumbs-up as like button by popular request

.btn-group
  - if project.users.include? current_user
    = link_to(leave_project_path(project.id), :title => 'Stop working on this project?', :class => 'btn btn-default') do
      = project.users.length
      %i.icon-stop
  - else
    = link_to(join_project_path(project.id), :title => 'Work on this project?', :class=>'btn btn-default') do
      = project.users.length
      %i.icon-play
  - if project.kudos.include? current_user
    = link_to(dislike_project_path(project.id), :title=>'Dislike this project?', :class=> "btn btn-default") do
      = project.kudos.length
      %i.icon-heart
  - else
    =link_to(like_project_path(project.id), :title=>'Like this project', :class=> "btn btn-default") do
      = project.kudos.length
      %i.icon-thumbs-up
  - if can? :edit, project
    = link_to(edit_project_path(project), :title=>'Edit this project?', :class=> "btn btn-default") do

      %i.icon-pencil
  -if can? :destroy, project
    = link_to(project_path(project), :title=>'Delete this project?', :class=> "btn btn-default", :method => :delete, data: { confirm: "Are you sure you want to delete this project? This can't be undone!" }) do

      %i.icon-remove


- cache ["v2", run] do
  %li.list-group-item{class: run.finished_successfully? ? "alert-success" : "alert-danger"}
    - if run.auto?
      Auto
    - else
      Manually
    ran
    - if run.git_revision
      revision
      = link_to run.git_revision[0..7], run.git_revision_github_url
    and
    - if run.finished_successfully?
      completed successfully
    - else
      failed
    = time_ago_in_words(run.finished_at)
    ago
    .pull-right
      run time
      = "%.1f s" % run.wall_time

Hide the run stat on mobiles

- cache ["v2", run] do
  %li.list-group-item{class: run.finished_successfully? ? "alert-success" : "alert-danger"}
    - if run.auto?
      Auto
    - else
      Manually
    ran
    - if run.git_revision
      revision
      = link_to run.git_revision[0..7], run.git_revision_github_url
    and
    - if run.finished_successfully?
      completed successfully
    - else
      failed
    = time_ago_in_words(run.finished_at)
    ago
    .pull-right.hidden-xs
      run time
      = "%.1f s" % run.wall_time


%h2= @image.title

= image_tag @image.image_file

%p
  = label_tag 'image-url', t('images.image_address')
  = text_field_tag 'image-url', request.original_url, readonly: 'readonly', class: 'copy-image-url-link', onclick: 'select()'

%p
  = link_to t('common.back'), images_path
  - if permitted_to? :edit, @image
    = link_to t('crud.edit'), edit_image_path
  - if permitted_to? :destroy || @image.uploader == @current_user, @image
    = link_to t('crud.destroy'), @image, confirm: t('crud.confirm'), method: :delete

%h2= t('images.tags')
- if @image.tags.any?
  - @image.tags.each do |tag|
    = link_to tag.name, search_images_path({ search: tag.name })
- else
  %p= t('images.no_tags')

%p
  = t('images.uploaded_at', time: @image.image_file_updated_at)
  = t('images.uploaded_by', name: @image.uploader.full_name)

Fix to handle uploader being nil object

%h2= @image.title

= image_tag @image.image_file

%p
  = label_tag 'image-url', t('images.image_address')
  = text_field_tag 'image-url', request.original_url, readonly: 'readonly', class: 'copy-image-url-link', onclick: 'select()'

%p
  = link_to t('common.back'), images_path
  - if permitted_to? :edit, @image
    = link_to t('crud.edit'), edit_image_path
  - if permitted_to? :destroy || @image.uploader == @current_user, @image
    = link_to t('crud.destroy'), @image, confirm: t('crud.confirm'), method: :delete

%h2= t('images.tags')
- if @image.tags.any?
  - @image.tags.each do |tag|
    = link_to tag.name, search_images_path({ search: tag.name })
- else
  %p= t('images.no_tags')

%p
  - if @image.uploader.nil?
    = t('images.uploaded_at', time: @image.image_file_updated_at)
  - else
    = t('images.uploaded_at', time: @image.image_file_updated_at)
    = t('images.uploaded_by', name: @image.uploader.full_name)


%h2.title Player Counts

%p The graph below shows the maximum number of players seen by day and server.
%p
  Servers:
  - @servers.each do |server|
    %span
      %a{:href => "/player_counts?servers=#{server}"}= server
%p
  %a{:href => "/player_counts-latest.json"} Latest player counts (JSON)

:css
  svg {
    background-color: black;
    border: 2px solid #AF7A30;
  }

  path {
    fill: none;
  }

  text {
    fill: white;
    font-weight: normal;
    font-size: 10px;
  }

  .x.axis line {
    stroke: white;
  }

  .axis label {
    fill: #CCC;
  }

  .x.axis .minor {
    stroke-opacity: 1;
  }

  .x.axis path {
    fill: none;
    stroke: white;
  }

  .y.axis line, .y.axis path {
    fill: none;
    stroke: white;
  }

  .label text {
    font-weight: normal;
    font-size: 10px;
  }

  .label rect {
    stroke: white;
  }

%script{:src => javascript_path('d3.min')}
%script{:src => javascript_path('popchart')}

:javascript
  popchart("#content", "#{@player_counts_url}");

Add note on player counts page about bots

%h2.title Player Counts

%p
  The graph below shows the maximum number of players seen by day and server.
  This includes bots and isn't an accurate count of the number of people playing
  on each server.
%p
  Servers:
  - @servers.each do |server|
    %span
      %a{:href => "/player_counts?servers=#{server}"}= server
%p
  %a{:href => "/player_counts-latest.json"} Latest player counts (JSON)

:css
  svg {
    background-color: black;
    border: 2px solid #AF7A30;
  }

  path {
    fill: none;
  }

  text {
    fill: white;
    font-weight: normal;
    font-size: 10px;
  }

  .x.axis line {
    stroke: white;
  }

  .axis label {
    fill: #CCC;
  }

  .x.axis .minor {
    stroke-opacity: 1;
  }

  .x.axis path {
    fill: none;
    stroke: white;
  }

  .y.axis line, .y.axis path {
    fill: none;
    stroke: white;
  }

  .label text {
    font-weight: normal;
    font-size: 10px;
  }

  .label rect {
    stroke: white;
  }

%script{:src => javascript_path('d3.min')}
%script{:src => javascript_path('popchart')}

:javascript
  popchart("#content", "#{@player_counts_url}");


%nav.top-bar
  %ul
    %li.name
      %h1.brand= link_to "Teikei", root_path
    %li.toggle-topbar
      %a
  %section
    - if user_signed_in?
      %ul.left
        %li
          = link_to "Höfe", farms_path
    %ul.right#user
      - if user_signed_in?
        %li
          = link_to 'Abmelden', destroy_user_session_path, :method=>'delete'
      - else
        %li
          = link_to 'Anmelden', new_user_session_path, :id=>'login'
      - if user_signed_in?
        %li
          = link_to 'Konto anpassen', edit_user_registration_path
        - if current_user.has_role? :admin
          %li
            = link_to 'Admin', users_path
      - else
        %li
          = link_to t(".sign_in", :default => "Registrieren"), new_user_registration_path

Hide "Farms" link for the average user.

%nav.top-bar
  %ul
    %li.name
      %h1.brand= link_to "Teikei", root_path
    %li.toggle-topbar
      %a
  %section
    - if user_signed_in?
      -  if current_user.has_role? :admin
        %ul.left
          %li
            = link_to "Höfe", farms_path
    %ul.right#user
      - if user_signed_in?
        %li
          = link_to 'Abmelden', destroy_user_session_path, :method=>'delete'
      - else
        %li
          = link_to 'Anmelden', new_user_session_path, :id=>'login'
      - if user_signed_in?
        %li
          = link_to 'Konto anpassen', edit_user_registration_path
        - if current_user.has_role? :admin
          %li
            = link_to 'Admin', users_path
      - else
        %li
          = link_to t(".sign_in", :default => "Registrieren"), new_user_registration_path


%nav.navbar.navbar-default.navbar-fixed-top
	.container
		.navbar-header
			%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", :type => "button"}
				%span.sr-only Toggle navigation
				%span.icon-bar
				%span.icon-bar
				%span.icon-bar
			= link_to image_tag('BitParrot_logo_GrayFont.png', width: 150, height: 50, align: 'left', style: 'margin: 0px 0px 10px 0px'), root_path
			= link_to 'Ruby and Rails', root_path, class: 'navbar-brand', style: 'margin: 0px 0px 0px 15px'
			= link_to 'Python', python_path, class: 'navbar-brand', style: 'margin: 0px 0px 0px 15px'
			= link_to 'About', about_path, class: 'navbar-brand'
			= link_to 'FAQ', faq_path, class: 'navbar-brand'
			-#= link_to 'Sign In', new_user_session_path, class: 'navbar-brand'
			-#= link_to 'Sign Up', new_user_registration_path, class: 'navbar-brand'
		.collapse.navbar-collapse
			%ul.nav.navbar-nav
				= render 'layouts/navigation_links'

Make current ROR page called Home tab in home position

%nav.navbar.navbar-default.navbar-fixed-top
	.container
		.navbar-header
			%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", :type => "button"}
				%span.sr-only Toggle navigation
				%span.icon-bar
				%span.icon-bar
				%span.icon-bar
			= link_to image_tag('BitParrot_logo_GrayFont.png', width: 150, height: 50, align: 'left', style: 'margin: 0px 0px 10px 0px'), root_path
			= link_to 'Home', root_path, class: 'navbar-brand', style: 'margin: 0px 0px 0px 15px'
			= link_to 'Python', python_path, class: 'navbar-brand', style: 'margin: 0px 0px 0px 15px'
			= link_to 'About', about_path, class: 'navbar-brand'
			= link_to 'FAQ', faq_path, class: 'navbar-brand'
			-#= link_to 'Sign In', new_user_session_path, class: 'navbar-brand'
			-#= link_to 'Sign Up', new_user_registration_path, class: 'navbar-brand'
		.collapse.navbar-collapse
			%ul.nav.navbar-nav
				= render 'layouts/navigation_links'


!!!
%html
  %head
    %title Issuet
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags
  %body
    %nav.navbar.navbar-default{'role' => 'navigation'}
      .container
        .navbar-header
          %a.navbar-brand{'href' => '#'} Issuet
    .container
      - if notice
        .alert.alert-info.alert-dissmissable
          %button.close{'aria-hidden' => 'true', 'data-dismiss' => 'alert', type: 'button'} ×
          = notice
      - if alert
        .alert.alert-warning.alert-dissmissable
          %button.close{'aria-hidden' => 'true', 'data-dismiss' => 'alert', type: 'button'} ×
          = alert
      = yield
  = javascript_include_tag '//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js'

Set navbar brand to root

!!!
%html
  %head
    %title Issuet
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags
  %body
    %nav.navbar.navbar-default{'role' => 'navigation'}
      .container
        .navbar-header
          %a.navbar-brand{'href' => '/'} Issuet
    .container
      - if notice
        .alert.alert-info.alert-dissmissable
          %button.close{'aria-hidden' => 'true', 'data-dismiss' => 'alert', type: 'button'} ×
          = notice
      - if alert
        .alert.alert-warning.alert-dissmissable
          %button.close{'aria-hidden' => 'true', 'data-dismiss' => 'alert', type: 'button'} ×
          = alert
      = yield
  = javascript_include_tag '//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js'


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

Change the user-visible project title to Cyclescape

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


#logos
  #all_container
    #two_container
      %ul.left
        - company = Partner.all.first
        %li{:timeout => 60000 }
          - href = "#{ company.link }?locale=#{ I18n.locale }"

          %a{href: href, id: company.name.downcase,
             style: "background-image: url('#{ company.img }');", target: '_blank' }
            = company.name

          .clear

          %p#subheader= t('footer.main_sponsor')

      %ul.right
        - Partner.all[1..-1].select(&:is_primary?).each do |company|
          %li{:timeout => 10000 }
            - href = "#{ company.link }?locale=#{ I18n.locale }"

            %a{href: href, id: company.name.downcase,
               style: "background-image: url('#{ company.img }');", target: '_blank' }
              = company.name

            .clear

            %p#subheader= t('footer.sponsor')

Use link_to instead of a '%a' for partners

#logos
  #all_container
    #two_container
      %ul.left
        - company = Partner.all.first
        %li{ timeout: 60000 }
          = link_to company.name, "#{ company.link }?locale=#{ I18n.locale }", id: company.name.downcase, style: "background-image: url('#{ company.img }');", target: '_blank'

          .clear

          %p#subheader= t('footer.main_sponsor')

      %ul.right
        - Partner.all[1..-1].select(&:is_primary?).each do |company|
          %li{ timeout: 10000 }
            = link_to company.name, "#{ company.link }?locale=#{ I18n.locale }", id: company.name.downcase, style: "background-image: url('#{ company.img }');", target: '_blank'

            .clear

            %p#subheader= t('footer.sponsor')


#main_div
  - url = url_for(:action => 'resize_field_changed', :id => @record.id.to_s)

  = render :partial => "layouts/flash_msg"

  %h3
    = _('Reconfigure Instance')
  .form-horizontal
    .form-group
      %label.col-md-2.control-label
        = _('Current Flavor')
      .col-md-8
        = @record.flavor.name_with_details if @record.flavor
    .form-group
      %label.col-md-2.control-label
        = _('Choose Flavor')
      .col-md-8
        = select_tag('flavor',
            options_for_select(@flavors.sort),
            :multiple          => false,
            :id                => "flavor",
            "data-miq_observe" => {:interval => '.5', :url => url}.to_json)

Fix openstack cloud instance resize

#main_div
  - url = url_for(:action => 'resize_field_changed', :id => @record.id.to_s)

  = render :partial => "layouts/flash_msg"

  %h3
    = _('Reconfigure Instance')
  .form-horizontal
    .form-group
      %label.col-md-2.control-label
        = _('Current Flavor')
      .col-md-8
        = @record.flavor.name_with_details if @record.flavor
    .form-group
      %label.col-md-2.control-label
        = _('Choose Flavor')
      .col-md-8
        = select_tag('flavor',
            options_for_select(@flavors.sort),
            :class             => "selectpicker",
            "data-miq_sparkle_on" => true, "data-miq_sparkle_off" => true,
            :multiple          => false,
            :id                => "flavor",
            "data-miq_observe" => {:interval => '.5', :url => url}.to_json)
      :javascript
        miqInitSelectPicker();
        miqSelectPickerEvent("flavor", "#{url}");


%li.nav-item{:class => get_nav_link_class(['admin'])}
  = link_to "#", :class => "dropdown-toggle", :data => {"toggle" => "dropdown"} do
    %i.fa.fa-cog.fa-2x
    %br
    Admin
    %b.caret
  %ul.dropdown-menu.multi-level{:role => 'menu'}
    %li.text-left
      = link_to policies_path do
        %i.fa.fa-thumb-tack.fa-fw
        Notices
    %li.divider
    %li.text-left
      = link_to admin_path do
        %i.fa.fa-cogs.fa-fw
        Admin Interface

Add orgs and user options to admin menu

%li.nav-item{:class => get_nav_link_class(['admin'])}
  = link_to "#", :class => "dropdown-toggle", :data => {"toggle" => "dropdown"} do
    %i.fa.fa-cog.fa-2x
    %br
    Admin
    %b.caret
  %ul.dropdown-menu{:role => 'menu'}
    %li.text-left
      = link_to policies_path do
        %i.fa.fa-thumb-tack.fa-fw
        Notices
    %li.text-left
      = link_to organizations_path do
        %i.fa.fa-building.fa-fw
        Organizations
    %li.text-left
      = link_to users_path do
        %i.fa.fa-users.fa-fw
        Users
    %li.divider
    %li.text-left
      = link_to admin_path do
        %i.fa.fa-cogs.fa-fw
        Admin Interface