%h1 Ufoods
%p What do you feel like tonight?
- @categories.each do |category|
  .temp_box
    %h3
      = category.name
    %p
      = category.description
  .temp_box2
    - category.restaurants.near(@user_location, 3, units: :km).each do |restaurant|
      = link_to restaurant.name, restaurant_path(restaurant)
      %p
        = restaurant.address
#map{style: 'width: 800px; height: 400px', data: {test: {env: "#{Rails.env.test?}"}}}
#restaurants_addresses{data: {addresses: "#{@restaurants.to_json}"}}

Remove unwanted loc from index page


%script{src:"#{url("bootstrap.file-input.js")}"}
%a{href:"/", class:"btn btn-default"} Back
%div.col-md-6.col-md-offset-3
  %h2 Import from CSV
  %form{action: "/transaction/import", method: "post", class: "form-horizontal"}
    %div.form-group
      %label.col-md-2 CSV file
      %div.col-md-10
        %input.file-inputs{type: "file"}
    %button.btn.btn-primary{type: "submit"} Import

%div.col-md-6.col-md-offset-3
  %h2 Export to CSV
  %form{action: "/transaction/export", method: "post"}
    %button.btn.btn-primary{type: "submit"} Export
%script{src: "/input.js", type: "text/javascript"}

Revert to a functioning CSV import

%script{src:"#{url("bootstrap.file-input.js")}"}
%a{href:"/", class:"btn btn-default"} Back
%div.col-md-6.col-md-offset-3
  %h2 Import from CSV
  %form{action: "/transaction/import", method: "post", enctype: "multipart/form-data",  class: "form-horizontal"}
    %div.form-group
      %label.col-md-2 CSV file
      %div.col-md-10
        %input.file-inputs{type: "file", name: "file"}
    %div.form-group
      %div.col-md-10.col-md-offset-2
        %label Default shared for imported transactions
        %input{type: "checkbox", value: "t", checked: true, name: "shared"}
    %div.form-group
      %button{type: "submit", class: "btn btn-primary"} Submit

%div.col-md-6.col-md-offset-3
  %h2 Export to CSV
  %form{action: "/transaction/export", method: "post"}
    %button.btn.btn-primary{type: "submit"} Export
%script{src: "/input.js", type: "text/javascript"}


- content_for :page_specific_javascripts do
  = webpack_bundle_tag('integrations')

.row.prepend-top-default.append-bottom-default
  .col-lg-3
    %h4.prepend-top-0
      = @service.title
      = boolean_to_icon @service.activated?

    %p= @service.description
  .col-lg-9
    = form_for(@service, as: :service, url: namespace_project_service_path(@project.namespace, @project, @service.to_param), method: :put, html: { class: 'gl-show-field-errors form-horizontal js-integration-settings-from' }) do |form|
      = render 'shared/service_settings', form: form, subject: @service
      .footer-block.row-content-block
        %button.btn.btn-save{ type: 'submit' }
          %i.fa.fa-spinner.fa-spin.hidden.js-btn-spinner{ "aria-hidden" => true }
          %span.js-btn-label
            Save changes

        - if @service.valid? && @service.activated?
          - unless @service.can_test?
            - disabled_class = 'disabled'
            - disabled_title = @service.disabled_title

        = link_to "Cancel", namespace_project_settings_integrations_path(@project.namespace, @project), class: "btn btn-cancel"

Use `@service.can_test?` to enable test before save

- content_for :page_specific_javascripts do
  = webpack_bundle_tag('integrations')

.row.prepend-top-default.append-bottom-default
  .col-lg-3
    %h4.prepend-top-0
      = @service.title
      = boolean_to_icon @service.activated?

    %p= @service.description
  .col-lg-9
    = form_for(@service, as: :service, url: namespace_project_service_path(@project.namespace, @project, @service.to_param), method: :put, html: { class: 'gl-show-field-errors form-horizontal js-integration-settings-from', data: { "can-test" => "#{@service.can_test?}" } }) do |form|
      = render 'shared/service_settings', form: form, subject: @service
      .footer-block.row-content-block
        %button.btn.btn-save{ type: 'submit' }
          %i.fa.fa-spinner.fa-spin.hidden.js-btn-spinner{ "aria-hidden" => true }
          %span.js-btn-label
            Save changes

        - if @service.valid? && @service.activated?
          - unless @service.can_test?
            - disabled_class = 'disabled'
            - disabled_title = @service.disabled_title

        = link_to "Cancel", namespace_project_settings_integrations_path(@project.namespace, @project), class: "btn btn-cancel"


.modalLog-title File "#{@filename}" for instance #{@instance} of application #{@name}
.modalLog-flash
.modalLog-content
  %table#app-logfile-table
    %thead
      %tr
        %th Log
    %tbody
      - if !@file_contents.nil?
        - @file_contents.each do |row|
          %tr
            %td= row

- if flash[:alert]
  :javascript
    $(function() {
      $('#flash-content').empty();
      $('.modalLog-flash').empty();
      $('.modalLog-flash').append('
#{escape_javascript(flash[:alert])}
');
      $('.modalLog-flash').fadeIn('slow');
    });
- else
  :javascript
    $(function() {
      $('#flash-content').empty();
      $('.modalLog-flash').empty();
      appLogfileTable_Settings = {
        'bAutoWidth':      false,
        'bProcessing':     true,
        'bFilter':         true,
        'bLengthChange':   false,
        'bSort':           true,
        'bStateSave':      false,
        'iDisplayLength':  20,
        'sPaginationType': 'full_numbers'
      };
      appLogfileTable = $('table#app-logfile-table').dataTable(appLogfileTable_Settings);
    });

Disable sorting for log files

.modalLog-title File "#{@filename}" for instance #{@instance} of application #{@name}
.modalLog-flash
.modalLog-content
  %table#app-logfile-table
    %thead
      %tr
        %th Log
    %tbody
      - if !@file_contents.nil?
        - @file_contents.each do |row|
          %tr
            %td= row

- if flash[:alert]
  :javascript
    $(function() {
      $('#flash-content').empty();
      $('.modalLog-flash').empty();
      $('.modalLog-flash').append('
#{escape_javascript(flash[:alert])}
');
      $('.modalLog-flash').fadeIn('slow');
    });
- else
  :javascript
    $(function() {
      $('#flash-content').empty();
      $('.modalLog-flash').empty();
      appLogfileTable_Settings = {
        'bAutoWidth':      false,
        'bProcessing':     true,
        'bFilter':         true,
        'bLengthChange':   false,
        'bSort':           false,
        'bStateSave':      false,
        'iDisplayLength':  20,
        'sPaginationType': 'full_numbers'
      };
      appLogfileTable = $('table#app-logfile-table').dataTable(appLogfileTable_Settings);
    });


%h2 Sign up
= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
  = devise_error_messages!
  .form-group
    = f.label :first_name
    = f.text_field :first_name, class: "form-control"
  .form-group
    = f.label :last_name
    = f.text_field :last_name, class: "form-control"
  .form-group
    = f.label :email
    %br/
    = f.email_field :email, autofocus: true, class: "form-control"
  .form-group
    = f.label :password
    - if @minimum_password_length
      %em
        (#{@minimum_password_length} characters minimum)
    %br/
    = f.password_field :password, autocomplete: "off", class: "form-control"
  .form-group
    = f.label :password_confirmation
    %br/
    = f.password_field :password_confirmation, autocomplete: "off", class: "form-control"
  .form-group
    = f.label :school_key
    = f.text_field :school_key, class: "form-control"
  .actions
    = f.submit "Sign up", class: "form-control"
= render "devise/shared/links"

Change initial focus to first form field

%h2 Sign up
= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
  = devise_error_messages!
  .form-group
    = f.label :first_name
    = f.text_field :first_name, autofocus: true, class: "form-control"
  .form-group
    = f.label :last_name
    = f.text_field :last_name, class: "form-control"
  .form-group
    = f.label :email
    %br/
    = f.email_field :email, class: "form-control"
  .form-group
    = f.label :password
    - if @minimum_password_length
      %em
        (#{@minimum_password_length} characters minimum)
    %br/
    = f.password_field :password, autocomplete: "off", class: "form-control"
  .form-group
    = f.label :password_confirmation
    %br/
    = f.password_field :password_confirmation, autocomplete: "off", class: "form-control"
  .form-group
    = f.label :school_key
    = f.text_field :school_key, class: "form-control"
  .actions
    = f.submit "Sign up", class: "form-control"
= render "devise/shared/links"


- if page.published?
  = radio_button_tag(:page_radio_button_name, page_url, false, data: { 'dough-linkinserter-value-trigger' => true })

Disable radio button when link page is not published

= radio_button_tag(:page_radio_button_name, page_url, false, disabled: !page.published?, data: { 'dough-linkinserter-value-trigger' => true })


.container
  .row
    .span2
      = render themed("sidebar-left")
    .span8
      .content
        .page-wrapper
          .page-header
            .pull-left
              %h1
                - if @page_header.present?
                  = inline_user_text @page_header
                  - if @page_hint.present?
                    %small= inline_user_text @page_hint
                - elsif !resource_is_context_resource? && resource.respond_to?(:title)
                  = inline_user_text(resource.title)
                - else
                  = t("#{controller_name}.#{action_name}.page_header")
                  %small
                    = t("#{controller_name}.#{action_name}.page_hint")
            .pull-right
              = yield(:page_header)
            .clearboth
          = yield
          .page-footer
    .span2
      .sidebar.sidebar-right
        = yield(:contextual_sidebar)
  .clearboth

Format @page_hint as multi-line user text

.container
  .row
    .span2
      = render themed("sidebar-left")
    .span8
      .content
        .page-wrapper
          .page-header
            .pull-left
              %h1
                - if @page_header.present?
                  = inline_user_text @page_header
                  - if @page_hint.present?
                    %small= user_text @page_hint
                - elsif !resource_is_context_resource? && resource.respond_to?(:title)
                  = inline_user_text(resource.title)
                - else
                  = t("#{controller_name}.#{action_name}.page_header")
                  %small
                    = t("#{controller_name}.#{action_name}.page_hint")
            .pull-right
              = yield(:page_header)
            .clearboth
          = yield
          .page-footer
    .span2
      .sidebar.sidebar-right
        = yield(:contextual_sidebar)
  .clearboth


.embeddables
  - unless embeddables.blank?
    - embeddables.each do |e|
      -# If a labbooks is included within the interactives section,
      -# dont also display that item here.
      - unless show_labbook_in_assessment_block?(e)
        - if e.show_in_runtime?
          -# e variable is actually either embeddable (for interactives, plugins, etc.) or embeddable answer
          -# (open response, multiple choice and all the question types). If the latter, get a real question object.
          - question = e.respond_to?(:question) ? e.question : e
          .question{ class: question_css_class(e), id: question.embeddable_dom_id }
            -# The embeddable-root CSS class is important as it is used by sizing calculations
            .embeddable-root
              -# The embeddable-container CSS class is important, as it is referenced by plugins and passed to a plugin instance.
              .embeddable-container
                - if Embeddable::is_interactive?(e)
                  = render_interactive(e)
                - else
                  - partial_name = "#{e.class.name.underscore.pluralize}/lightweight"
                  = render(partial: partial_name, locals: { embeddable: e })

Clarify need for all of the nested divs.

.embeddables
  - unless embeddables.blank?
    - embeddables.each do |e|
      -# If a labbooks is included within the interactives section,
      -# dont also display that item here.
      - unless show_labbook_in_assessment_block?(e)
        - if e.show_in_runtime?
          -# e variable is actually either embeddable (for interactives, plugins, etc.) or embeddable answer
          -# (open response, multiple choice and all the question types). If the latter, get a real question object.
          - question = e.respond_to?(:question) ? e.question : e
          .question{ class: question_css_class(e), id: question.embeddable_dom_id }
            -# The embeddable-root CSS class is important as it is used by sizing calculations
            -# it needs to be different than the .question div above. The div above is set to
            -# 45% width when inside of a full width page or block, and the div below
            -# width is set dynamically depending on the interactive sizing
            .embeddable-root
              -# The embeddable-container CSS class is important, as it is referenced by plugins and passed to a plugin instance.
              .embeddable-container
                - if Embeddable::is_interactive?(e)
                  = render_interactive(e)
                - else
                  - partial_name = "#{e.class.name.underscore.pluralize}/lightweight"
                  = render(partial: partial_name, locals: { embeddable: e })


- button_path = local_assigns.fetch(:button_path, false)
- project_select_button = local_assigns.fetch(:project_select_button, false)
- has_button = button_path || project_select_button

.row.empty-state.merge-requests
  .col-xs-12
    .svg-content
      = image_tag 'illustrations/merge_requests.svg'
  .col-xs-12.text-center
    .text-content
      - if has_button
        %h4
          Merge requests are a place to propose changes you've made to a project and discuss those changes with others.
        %p
          Interested parties can even contribute by pushing commits if they want to.
        - if project_select_button
          = render 'shared/new_project_item_select', path: 'merge_requests/new', label: 'New merge request', type: :merge_requests
        - else
          = link_to 'New merge request', button_path, class: 'btn btn-new', title: 'New merge request', id: 'new_merge_request_link'
      - else
        %h4.text-center
          There are no merge requests to show.

Update merge request empty state

- button_path = local_assigns.fetch(:button_path, false)
- project_select_button = local_assigns.fetch(:project_select_button, false)
- has_button = button_path || project_select_button

.row.empty-state.merge-requests
  .col-xs-12
    .svg-content
      = image_tag 'illustrations/merge_requests.svg'
  .col-xs-12
    .text-content
      - if has_button
        %h4
          Merge requests are a place to propose changes you've made to a project and discuss those changes with others
        %p
          Interested parties can even contribute by pushing commits if they want to.
        .text-center
          - if project_select_button
            = render 'shared/new_project_item_select', path: 'merge_requests/new', label: 'New merge request', type: :merge_requests
          - else
            = link_to 'New merge request', button_path, class: 'btn btn-new', title: 'New merge request', id: 'new_merge_request_link'
      - else
        %h4.text-center
          There are no merge requests to show


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

Fix missing element classes in new Idea form

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


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

Add link to cancel btn in Node edit

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


%h1= @user.name
%h2= @user.nickname

%p This is where information about this user is going to go. It will include things like the scrapers they have, their gravatar, and if the user is you the ability to add a new scraper.

%h3 Scrapers

%ul
  - @user.scrapers.each do |scraper|
    %li
      %strong
        = link_to scraper.name, scraper
      —
      = scraper.description

- if @user == current_user
  = link_to "Add scraper", new_scraper_path

Make add scraper a button

%h1= @user.name
%h2= @user.nickname

%p This is where information about this user is going to go. It will include things like the scrapers they have, their gravatar, and if the user is you the ability to add a new scraper.

%h3 Scrapers

%ul
  - @user.scrapers.each do |scraper|
    %li
      %strong
        = link_to scraper.name, scraper
      —
      = scraper.description

- if @user == current_user
  = link_to "Add scraper", new_scraper_path, class: "btn"


- if can?(:edit, crop) || can?(:destroy, crop)
  %h4 Crop wrangling
  %p
    You are a
    = succeed "." do
      %strong CROP WRANGLER
    .dropdown.crop-actions
      %button#crop-actions-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button"} Actions
      .dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "crop-actions-button"}
        = link_to edit_crop_path(crop), class: 'dropdown-item' do
          = edit_icon
          = t('.edit')
        = delete_button(crop) if can? :destroy, crop

Tidy up the delete link in crops actions

- if can?(:edit, crop) || can?(:destroy, crop)
  %h4 Crop wrangling
  %p
    You are a
    = succeed "." do
      %strong CROP WRANGLER
    .dropdown.crop-actions
      %button#crop-actions-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button"} Actions
      .dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "crop-actions-button"}
        = link_to edit_crop_path(crop), class: 'dropdown-item' do
          = edit_icon
          = t('.edit')

        - if can? :destroy, crop
          .dropdown-divider
          = link_to crop, method: :delete, class: 'dropdown-item bg-danger' do
            = delete_icon
            Delete


.jumbotron
  .container
    %h1= @data_set.name
    %h4
      .label.label-primary=@data_set.license
      .label.label-default
        =@data_set.places.count
        =t('activerecord.models.place', count: @data_set.places.count)
    %p=@data_set.description || "Leider fehlt hier die Beschreibung der Datenspende."

    %p= link_to 'Hilf jetzt mit!', admin_places_path, class: "btn btn-primary btn-lg", role: "button"

Change text on data set page.

.jumbotron
  .container
    %h1= @data_set.name
    %h4
      .label.label-primary=@data_set.license
      .label.label-default
        =@data_set.places.count
        =t('activerecord.models.place', count: @data_set.places.count)
    %p=@data_set.description || "Leider fehlt hier die Beschreibung der Datenspende."

    %p= link_to 'POIs checken', admin_places_path, class: "btn btn-primary btn-lg", role: "button"


.page-header
  %h1 Download

  %p.lead
    Download your shopping receipts data as a spreadsheet

%p
  You can load this into any spreadsheet program such as OpenOffice, Google Docs, or Microsoft Office to do your own analysis.
  This is your shopping data so you should have access to it to do
  with as you please.

%p
  And please do let us know if you do something interesting with your data! We're
  always interested to hear from you.

= link_to "Download your data", download_data_path, class: "btn btn-default"

Add a few more links and explanation

.page-header
  %h1 Download

  %p.lead
    Download your shopping receipts data as a spreadsheet

%p
  This is your shopping data so you should have access to it to do
  with as you please.

%p
  You can load this into pretty much any spreadsheet program such as
  #{link_to "OpenOffice", "https://www.openoffice.org/"},
  #{link_to "Google Docs", "https://docs.google.com/spreadsheets"},
  or
  = link_to "Microsoft Office", "https://products.office.com"
  to do your own analysis. The data is downloaded as a
  = link_to "comma-separated values (CSV)", "http://en.wikipedia.org/wiki/Comma-separated_values"
  file which is very widely supported.

%p
  And please do let us know if you do something interesting with your data! We're
  always interested to hear from you.

= link_to "Download your data", download_data_path, class: "btn btn-default"


%ul.nav.nav-list
  %li.nav-header Site Administration Tools
  %li{class: active_if(controller: 'admin', action: 'index')}
    %a{href: admin_path}
      Admin Summary
  %li{class: active_if(controller: 'questions')}
    %a{href: questions_path}
      Answer Questions
  %li{class: active_if(controller: 'admin',action: 'search_report')}
    %a{href: search_report_path}
      Frequent Search Terms
  %li{class: active_if(controller: 'admin',action: 'user_report')}
    %a{href: user_report_path}
      Administer Users
  %li= link_to 'Sign Out'.html_safe, destroy_user_session_path, method: :delete
  %li.nav-header External Tools
  %li
    %a
      Google Analytics: Site Traffic Analysis
  %li
    %a
      Github: Report an issue or bug
  %li.nav-header Technical Monitoring Tools (Steve Only)
  %li
    %a Airbrake Error Monitoring
  %li
    %a New Relic Performance Monitoring
  %li
    %a Linode Applicaiton Hosting

Add GA and Github links to admin menu.

%ul.nav.nav-list
  %li.nav-header Site Administration Tools
  %li{class: active_if(controller: 'admin', action: 'index')}
    %a{href: admin_path}
      Admin Summary
  %li{class: active_if(controller: 'questions')}
    %a{href: questions_path}
      Answer Questions
  %li{class: active_if(controller: 'admin',action: 'search_report')}
    %a{href: search_report_path}
      Frequent Search Terms
  %li{class: active_if(controller: 'admin',action: 'user_report')}
    %a{href: user_report_path}
      Administer Users
  %li= link_to 'Sign Out'.html_safe, destroy_user_session_path, method: :delete
  %li.nav-header External Tools
  %li
    %a{href: 'https://www.google.com/analytics/web/?hl=en&pli=1#dashboard/default/a8222754w63381535p65015451/'}
      Google Analytics: Site Traffic Analysis
  %li
    %a{href: 'https://github.com/shammond42/higgins-catalog/issues?labels=&milestone=&page=1&state=open'}
      Github: Report an issue or bug
  %li.nav-header Technical Monitoring Tools (Steve Only)
  %li
    %a Airbrake Error Monitoring
  %li
    %a New Relic Performance Monitoring
  %li
    %a Linode Applicaiton Hosting


- @attributes ||= collection.first.attribute_names - ['id', 'created_at', 'updated_at']
%table.list{:class => "#{collection.first.class.to_s.downcase.pluralize} collection"}
  %thead
    %tr
      - @attributes.each do |field|
        %th= t_attr field, collection.first.class
      %th.new-task= t_title(:new, Activity)
      %th.action-links

  - @attributes = @attributes - ['client_id', 'project_state_id']
  %tbody
    - collection.each do |r|
      %tr
        - @attributes.each do |field|
          %td= r.send(field) if r.respond_to?(field)
        %td= r.client
        %td= r.project_state
        %td= link_to t_title(:new, Activity), new_project_activity_url(r)
        %td.action-links
          = list_link_for(:show, r)
          = list_link_for(:edit, r)
          = list_link_for(:delete, r)

Set the project name as a link to the project with tr as href-container.

- @attributes ||= collection.first.attribute_names - ['id', 'created_at', 'updated_at']
%table.list{:class => "#{collection.first.class.to_s.downcase.pluralize} collection"}
  %thead
    %tr
      - @attributes.each do |field|
        %th= t_attr field, collection.first.class
      %th.new-task= t_title(:new, Activity)
      %th.action-links

  - @attributes = @attributes - ['name', 'client_id', 'project_state_id']
  %tbody
    - collection.each do |r|
      %tr
        %td= link_to r.name, r, {'data-href-container' => 'tr'}
        - @attributes.each do |field|
          %td= r.send(field) if r.respond_to?(field)
        %td= r.client
        %td= r.project_state
        %td= link_to t_title(:new, Activity), new_project_activity_url(r)
        %td.action-links
          = list_link_for(:show, r)
          = list_link_for(:edit, r)
          = list_link_for(:delete, r)


%div.complaint-container
  %div.center-align
    %h2.montserrat-header Complaints
  %table.bordered.responsive-table.complaint-table
    %th
      = form_tag complaints_path, method: "get", class: "status-form" do
        = select_tag "filter[status]", options_for_select(Complaint.possible_statuses.concat(["All"])), class: "filter-menu"
    -@complaints.each do |complaint|
      = render 'index_view',complaint: complaint
  %div.pagination
    = paginate @complaints

Remove responsive table from complaints index

%div.complaint-container
  %div.center-align
    %h2.montserrat-header Complaints
  %table.bordered.complaint-table
    %th
      = form_tag complaints_path, method: "get", class: "status-form" do
        = select_tag "filter[status]", options_for_select(Complaint.possible_statuses.concat(["All"])), class: "filter-menu"
    -@complaints.each do |complaint|
      = render 'index_view',complaint: complaint
  %div.pagination
    = paginate @complaints


= render partial: 'shared/dossiers/messages/message_icon', locals: { commentaire: commentaire, connected_user: connected_user }

.width-100
  %h2
    %span.mail
      = render partial: 'shared/dossiers/messages/message_issuer', locals: { commentaire: commentaire, connected_user: connected_user }
    - if commentaire_is_from_guest(commentaire)
      %span.guest Invité
    %span.date{ class: highlight_if_unseen_class(messagerie_seen_at, commentaire.created_at) }
      = commentaire_date(commentaire)
  .rich-text= sanitize(simple_format(commentaire.body))

  .message-extras.flex.justify-start
    - if commentaire.piece_jointe.attached?
      .attachment-link
        = render partial: "shared/attachment/show", locals: { attachment: commentaire.piece_jointe.attachment }
    - elsif commentaire.file.present?
      .attachment-link
        = link_to commentaire.file_url, class: "button", target: "_blank", rel: "noopener", title: "Télécharger" do
          %span.icon.attachment
          = commentaire.file_identifier

    - if show_reply_button
      = button_tag type: 'button', class: 'button small message-answer-button', onclick: 'document.querySelector("#commentaire_body").focus()' do
        %span.icon.reply
        Répondre

Remove last reference to commentaire.file

= render partial: 'shared/dossiers/messages/message_icon', locals: { commentaire: commentaire, connected_user: connected_user }

.width-100
  %h2
    %span.mail
      = render partial: 'shared/dossiers/messages/message_issuer', locals: { commentaire: commentaire, connected_user: connected_user }
    - if commentaire_is_from_guest(commentaire)
      %span.guest Invité
    %span.date{ class: highlight_if_unseen_class(messagerie_seen_at, commentaire.created_at) }
      = commentaire_date(commentaire)
  .rich-text= sanitize(simple_format(commentaire.body))

  .message-extras.flex.justify-start
    - if commentaire.piece_jointe.attached?
      .attachment-link
        = render partial: "shared/attachment/show", locals: { attachment: commentaire.piece_jointe.attachment }

    - if show_reply_button
      = button_tag type: 'button', class: 'button small message-answer-button', onclick: 'document.querySelector("#commentaire_body").focus()' do
        %span.icon.reply
        Répondre


- options = {}
- options[:url] = @form_url if @form_url
- options.deep_merge!(data: {dialog: params[:dialog]}) if params[:dialog]
- options[:namespace] = params[:namespace] if params[:namespace]

= ekylibre_form_for(resource, options) do |f|
  - if params[:redirect]
    = hidden_field_tag(:redirect, params[:redirect])
  - if local_assigns[:with_continue] && params[:continue]
    - f.add(:submit, :create_and_continue.tl, data: { disable_with: :please_wait.tl }, class: 'primary', name: :create_and_continue)
  - f.add(:submit, :create.tl, data: { disable_with: :please_wait.tl }, class: 'primary')
  - if local_assigns[:with_continue] && !params[:continue]
    - f.add(:submit, :create_and_continue.tl, data: { disable_with: :please_wait.tl }, class: 'primary', name: :create_and_continue)

  = f.fields(params[:form_partial]) if params[:form_partial]
  = f.fields unless params[:form_partial]

  - f.add(:link, :cancel.tl, (params[:redirect] || local_assigns[:cancel_url] || {action: :index}), (params[:dialog] ? {class: 'btn', data: {close_dialog: params[:dialog]}} : {class: 'btn'}))
  = f.actions

Use `if/else` instead of if + unless

- options = {}
- options[:url] = @form_url if @form_url
- options.deep_merge!(data: {dialog: params[:dialog]}) if params[:dialog]
- options[:namespace] = params[:namespace] if params[:namespace]

= ekylibre_form_for(resource, options) do |f|
  - if params[:redirect]
    = hidden_field_tag(:redirect, params[:redirect])
  - if local_assigns[:with_continue] && params[:continue]
    - f.add(:submit, :create_and_continue.tl, data: { disable_with: :please_wait.tl }, class: 'primary', name: :create_and_continue)
  - f.add(:submit, :create.tl, data: { disable_with: :please_wait.tl }, class: 'primary')
  - if local_assigns[:with_continue] && !params[:continue]
    - f.add(:submit, :create_and_continue.tl, data: { disable_with: :please_wait.tl }, class: 'primary', name: :create_and_continue)

  - if params[:form_partial]
   = f.fields(params[:form_partial])
  - else
    = f.fields

  - f.add(:link, :cancel.tl, (params[:redirect] || local_assigns[:cancel_url] || {action: :index}), (params[:dialog] ? {class: 'btn', data: {close_dialog: params[:dialog]}} : {class: 'btn'}))
  = f.actions


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

Add 'Clinic Visits' to patient subnav menu

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


- content_for(:title, "Avis · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")

= render partial: "header", locals: { dossier: @dossier }

.container
  - if !@dossier.termine?
    = render partial: "new_gestionnaire/shared/avis/form", locals: { url: avis_gestionnaire_dossier_path(@dossier.procedure, @dossier), must_be_confidentiel: false, avis: @avis }

  - if @dossier.avis.present?
    = render partial: 'new_gestionnaire/shared/avis/list', locals: { avis: @dossier.avis, avis_seen_at: @avis_seen_at }

Add a blank state message in the avis tab

- content_for(:title, "Avis · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")

= render partial: "header", locals: { dossier: @dossier }

.container
  - if !@dossier.termine?
    = render partial: "new_gestionnaire/shared/avis/form", locals: { url: avis_gestionnaire_dossier_path(@dossier.procedure, @dossier), must_be_confidentiel: false, avis: @avis }

  - if @dossier.avis.present?
    = render partial: 'new_gestionnaire/shared/avis/list', locals: { avis: @dossier.avis, avis_seen_at: @avis_seen_at }

  - if @dossier.termine? && !@dossier.avis.present?
    .blank-tab
      %h2.empty-text Aucun avis.
      %p.empty-text-details Aucun avis n'a été demandé sur ce dossier.


.btn-group.btn-group-sm.btn-group-justified
  - if controller_name != 'sessions'
    = link_to "Sign in", new_session_path(resource_name), class: 'btn btn-default'
  - if devise_mapping.registerable? && controller_name != 'registrations'
    = link_to "Sign up", new_registration_path(resource_name), class: 'btn btn-default'
  - if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
    = link_to "Forgot password?", new_password_path(resource_name), class: 'btn btn-default'
  - if devise_mapping.confirmable? && controller_name != 'confirmations'
    = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: 'btn btn-default'
  - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
    = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: 'btn btn-default'
  - if devise_mapping.omniauthable?
    - resource_class.omniauth_providers.each do |provider|
      = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), class: 'btn btn-default'
      %br/

Modify Devise shared links view

.btn-group.btn-group-sm.btn-group-justified
  - if controller_name != 'sessions'
    = link_to 'Sign in', new_session_path(resource_name), class: 'btn btn-default'
  - if devise_mapping.registerable? && controller_name != 'registrations'
    = link_to 'Sign up', new_registration_path(resource_name), class: 'btn btn-default'
  - if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
    = link_to 'Forgot password?', new_password_path(resource_name), class: 'btn btn-default'
  - if devise_mapping.confirmable? && controller_name != 'confirmations'
    = link_to 'Didn\'t receive confirmation instructions?', new_confirmation_path(resource_name), class: 'btn btn-default'
  - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
    = link_to 'Didn\'t receive unlock instructions?', new_unlock_path(resource_name), class: 'btn btn-default'
  - if devise_mapping.omniauthable?
    - resource_class.omniauth_providers.each do |provider|
      = link_to 'Sign in with #{provider.to_s.titleize}', omniauth_authorize_path(resource_name, provider), class: 'btn btn-default'
      %br/


!!! 5
%html{ lang: 'en' }
  %head
    %meta{ charset: 'utf-8' }
    %meta{ content: 'IE=edge,chrome=1', 'http-equiv' => 'X-UA-Compatible' }
    %meta{ name: 'viewport', content: 'width=device-width, initial-scale=1.0' }

    / Use title if it's in the page YAML frontmatter
    %title= current_page.data.title || 'The Middleman'

    = stylesheet_link_tag 'application'

  %body{ class: page_classes }

    = yield

    = javascript_include_tag  'vendor'
    = javascript_include_tag  'application'

Remove page_classes method from the body tag

!!! 5
%html{ lang: 'en' }
  %head
    %meta{ charset: 'utf-8' }
    %meta{ content: 'IE=edge,chrome=1', 'http-equiv' => 'X-UA-Compatible' }
    %meta{ name: 'viewport', content: 'width=device-width, initial-scale=1.0' }

    / Use title if it's in the page YAML frontmatter
    %title= current_page.data.title || 'The Middleman'

    = stylesheet_link_tag 'application'

  %body

    = yield

    = javascript_include_tag  'vendor'
    = javascript_include_tag  'application'


%p
  %input{ type: "checkbox", id: "accept_terms", ng: { model: "platform_tos_accepted", init: "platform_tos_accepted = #{platform_tos_already_accepted?}" } }
  %label.small{for: "platform_tos_accepted"}
    = t(".message_html", tos_link: link_to_platform_terms)

Make checkout terms and conditions label clickable; associate label with input using correct for attribute

%p
  %input{ type: "checkbox",
    id: "accept_terms",
    ng: {
      model: "platform_tos_accepted",
      init: "platform_tos_accepted = #{platform_tos_already_accepted?}"
    }
  }
  %label.small{for: "accept_terms"}
    = t(".message_html", tos_link: link_to_platform_terms)


%h2 Choose your organisation type
%p TODO: Explanatory text on this page.
%ul.organisations
  %li= link_to("Association", new_association_path)
  %li= link_to("Company", new_company_path)
  %li= link_to("Co-operative", new_coop_path)

Remove copy TODO on new organisation page.

%h2 Choose your organisation
%p What kind of organisation do you want to create?
%ul.organisations
  %li= link_to("Association", new_association_path)
  %li= link_to("Company", new_company_path)
  %li= link_to("Co-operative", new_coop_path)


.issues-area
  %h1 Local Issues
.groups-area
  %h1 Local Activity

Add new issue link to home page.

.issues-area
  %h1 Local Issues
  %nav
    %ul
      %li= link_to t(".new_issue"), new_issue_path
.groups-area
  %h1 Local Activity


Welcome to the Glowfic Constellation. Admire the tiny, tiny words.

%p
  There is a (work in progress) community
  = link_to 'guide to Glowfic.', 'https://docs.google.com/document/d/1_4Z2zdRKaSwZPm3S0X14DYoo7w46U_MZ4En6oOediNQ/edit'

%p
  Join our community on:
  %ul
    %li= link_to "Alicorn's forum", 'http://alicorn.elcenia.com/board/index.php', target: '_blank'
    %li= link_to "IRC", 'https://client00.chat.mibbit.com/?channel=%23glowfic&server=irc.psigenix.net', target: '_blank'
    %li= link_to "Discord", 'https://discord.gg/Z4acTQ', target: '_blank'
    %li= link_to "Tumblr", 'http://alicorn.elcenia.com/board/viewtopic.php?f=10&t=615', target: '_blank'

Update Discord link to a non-expired permanent invite link

Welcome to the Glowfic Constellation. Admire the tiny, tiny words.

%p
  There is a (work in progress) community
  = link_to 'guide to Glowfic.', 'https://docs.google.com/document/d/1_4Z2zdRKaSwZPm3S0X14DYoo7w46U_MZ4En6oOediNQ/edit'

%p
  Join our community on:
  %ul
    %li= link_to "Alicorn's forum", 'http://alicorn.elcenia.com/board/index.php', target: '_blank'
    %li= link_to "IRC", 'https://client00.chat.mibbit.com/?channel=%23glowfic&server=irc.psigenix.net', target: '_blank'
    %li= link_to "Discord", 'https://discord.gg/6vjWdWp', target: '_blank'
    %li= link_to "Tumblr", 'http://alicorn.elcenia.com/board/viewtopic.php?f=10&t=615', target: '_blank'


#settlements
  - if flash[:notice]
    %div= flash[:notice]
  = form_tag '' do
    #account_options
      = select_tag :account_id, options_for_select([['すべて', 'all']] + @credit_accounts.map{|a| [a.name_with_asset_type, a.id]}, @account.try(:id).to_s), class: %w(switcher form-control), data: {url_template: account_settlements_path(account_id: "_SWITCHER_VALUE_")}

  - if @settlements.empty?
    %p 精算データはありません。
  - else
    %table.book
      %tr
        %th.date 精算日
        %th 精算データ名
        %th 精算対象口座
        %th 対象取引数
        %th.amount 精算額
        %th 登録日時
        %th 状態
        %th 詳細
      = render :partial => 'settlement', :collection => @settlements

Add right pane to settlements/index.

#settlements_right
  = link_to "新しい精算", new_account_settlement_path(account_id: @account.id), class: %w(btn btn-primary) if @account

#settlements_main
  #settlements
    - if flash[:notice]
      %div= flash[:notice]
    = form_tag '' do
      #account_options
        = select_tag :account_id, options_for_select([['すべて', 'all']] + @credit_accounts.map{|a| [a.name_with_asset_type, a.id]}, @account.try(:id).to_s), class: %w(switcher form-control), data: {url_template: account_settlements_path(account_id: "_SWITCHER_VALUE_")}

    - if @settlements.empty?
      %p 精算データはありません。
    - else
      %table.book
        %tr
          %th.date 精算日
          %th 精算データ名
          %th 精算対象口座
          %th 対象取引数
          %th.amount 精算額
          %th 登録日時
          %th 状態
          %th 詳細
        = render :partial => 'settlement', :collection => @settlements


.modal-header
  %nav
    -help_path = yield_content!(:modal_help)
    -if !help_path.blank?
      %a.widgetbtn{ :href => "/help/#{help_path}", :'data-toggle' => 'modal-ajax', :title => "Help - What is this?"}
        %i.gcmsicon-questionmark-grey
    %a.widgetbtn{ :'data-dismiss' => 'modal', :href => '#'}
      %i.gcmsicon-x-grey
  %h1=yield_content!(:modal_title) || " ".html_safe

.modal-body.cleanlabels.compact-rows
  =yield
  -detail = yield_content!(:export_detail)
  -if detail.present?
    =detail
  -else
    -# Default export details
    %p
      When opening the CSV, settings should be:
      %dl
        %dt Separated by
        %dd Comma
        %dt Text Delimiter
        %dd " (double quotation mark).

.modal-footer
  .row-fluid
    %nav.fltlft.txtlft.span3
      %a.btn.btn-large.btn-info{:'data-dismiss' => 'modal', :href => '#' } Cancel
    .span6
    %nav.fltrt.txtrt.span3
      %a.btn.btn-large.btn-success{ :href => yield_content!(:export_url), :target => '_blank' } Export
      %a.btn.btn-large.btn-success{ :'data-dismiss' => 'modal', :href => '#' } Done

Fix message on export dialog to be more clear

.modal-header
  %nav
    -help_path = yield_content!(:modal_help)
    -if !help_path.blank?
      %a.widgetbtn{ :href => "/help/#{help_path}", :'data-toggle' => 'modal-ajax', :title => "Help - What is this?"}
        %i.gcmsicon-questionmark-grey
    %a.widgetbtn{ :'data-dismiss' => 'modal', :href => '#'}
      %i.gcmsicon-x-grey
  %h1=yield_content!(:modal_title) || " ".html_safe

.modal-body.cleanlabels.compact-rows
  =yield
  -detail = yield_content!(:export_detail)
  -if detail.present?
    =detail
  -else
    -# Default export details
    %p
      This process exports a CSV file.  If you are opening the CSV file in anything other than gSheets, your settings in the spreadsheet application should be:
      %dl
        %dt Separated by
        %dd Comma
        %dt Text Delimiter
        %dd " (double quotation mark).

.modal-footer
  .row-fluid
    %nav.fltlft.txtlft.span3
      %a.btn.btn-large.btn-info{:'data-dismiss' => 'modal', :href => '#' } Cancel
    .span6
    %nav.fltrt.txtrt.span3
      %a.btn.btn-large.btn-success{ :href => yield_content!(:export_url), :target => '_blank' } Export
      %a.btn.btn-large.btn-success{ :'data-dismiss' => 'modal', :href => '#' } Done


!!!
/[if IE 7 ] <html lang="en" class="no-js ie7">
/[if IE 8 ] <html lang="en" class="no-js ie8">
/[if IE 9 ] <html lang="en" class="no-js ie9">
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
%head
  %meta{charset: "utf-8"}
  %title Welcome to Funnies!
  = stylesheet_link_tag "funnies"
  = csrf_meta_tag
%body
  - if flash[:notice] || flash[:alert]
    %div{:class => "notice #{'alert' if flash[:alert]}"}
      = flash[:notice] || flash[:alert]
  #session
    #session-inner
      = yield
  = javascript_include_tag "application"
  = render "shared/analytics"

Add analytics and intercom to session layout

!!!
/[if IE 7 ] <html lang="en" class="no-js ie7">
/[if IE 8 ] <html lang="en" class="no-js ie8">
/[if IE 9 ] <html lang="en" class="no-js ie9">
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
%head
  %meta{charset: "utf-8"}
  %title Welcome to Funnies!
  = stylesheet_link_tag "funnies"
  = csrf_meta_tag
%body
  - if flash[:notice] || flash[:alert]
    %div{:class => "notice #{'alert' if flash[:alert]}"}
      = flash[:notice] || flash[:alert]
  #session
    #session-inner
      = yield
  = javascript_include_tag "application"
  = render "shared/analytics" if Rails.env.production? || Rails.env.staging?
  = render "shared/intercom" if Rails.env.production? || Rails.env.staging?


%html
  %head
    %title= t('adminsimple.site_title')
    %meta{ charset: "UTF-8" }
    %meta{ name: "viewport", content: "width=device-width, initial-scale=1.0" }
    = csrf_meta_tags
    = stylesheet_link_tag "#{Adminsimple.configuration.app_css_overrides ? Adminsimple.configuration.app_css_overrides : 'adminsimple'}"
  %body.sign-in

    = render partial: '/adminsimple/layout/navbar'
    #sign_in= yield
    = javascript_include_tag "#{Adminsimple.configuration.app_js_overrides ? Adminsimple.configuration.app_js_overrides : 'adminsimple'}"

Normalize site name translation keys

%html
  %head
    %title= t('adminsimple.site_name')
    %meta{ charset: "UTF-8" }
    %meta{ name: "viewport", content: "width=device-width, initial-scale=1.0" }
    = csrf_meta_tags
    = stylesheet_link_tag "#{Adminsimple.configuration.app_css_overrides ? Adminsimple.configuration.app_css_overrides : 'adminsimple'}"
  %body.sign-in

    = render partial: '/adminsimple/layout/navbar'
    #sign_in= yield
    = javascript_include_tag "#{Adminsimple.configuration.app_js_overrides ? Adminsimple.configuration.app_js_overrides : 'adminsimple'}"


.tn-tc-left-text-right-image.tn-tc-image-and-text
  = f.hidden_field :row_type
  = f.hidden_field :list_order
  = f.fields_for :pieces do |piece|
    = piece.hidden_field :piece_type
    - if piece.object.piece_type == "Text"
      .tn-tc-piece{class: piece.object.size}
        = render "tenon/tenon_content/piece_types/form/text", f: piece
    - if piece.object.piece_type == "Image"
      . tn-tc-piece.tn-tc-asset-field.omega{class: piece.object.size}
        = render "tenon/tenon_content/piece_types/form/image", f: piece, style: 'half'
  .spacer

Fix typo causing HAML error when switching image sides in Tenon Content

.tn-tc-left-text-right-image.tn-tc-image-and-text
  = f.hidden_field :row_type
  = f.hidden_field :list_order
  = f.fields_for :pieces do |piece|
    = piece.hidden_field :piece_type
    - if piece.object.piece_type == "Text"
      .tn-tc-piece{class: piece.object.size}
        = render "tenon/tenon_content/piece_types/form/text", f: piece
    - if piece.object.piece_type == "Image"
      .tn-tc-piece.tn-tc-asset-field.omega{class: piece.object.size}
        = render "tenon/tenon_content/piece_types/form/image", f: piece, style: 'half'
  .spacer


%p Use the following code snippet to get data from the API.

:coderay
  #!php
  <?php
  $key="[API KEY]";
  $query="select * from 'data' limit 10";
  $url = "https://api.morph.io/[USERNAME]/[SCRAPER NAME]/data.json";

  $response=file_get_contents($url.'?key='.$key.'&query='.urlencode($query));
  $js=json_decode($response,true);

  foreach ($js as $line){
    [DO WIZARDRY]
  }
  ?>

Use variable names consistent with other examples

%p Use the following code snippet to get data from the API.

:coderay
  #!php
  <?php
  $morph_api_url = "https://api.morph.io/[USERNAME]/[SCRAPER NAME]/data.json";
  $morph_api_key="[API KEY]";

  $query="select * from 'data' limit 10";

  $response=file_get_contents($morph_api_url.'?key='.$morph_api_key.'&query='.urlencode($query));
  $js=json_decode($response,true);

  foreach ($js as $line){
    [DO WIZARDRY]
  }
  ?>


%h3
  Authoring

%h4= link_to "#{Investigation.display_name.pluralize}", investigations_path
= field_set_tag "#{Investigation.display_name.pluralize} you've authored" do
  %ul
    - current_visitor.investigations.each do |inv|
      %li
        = link_to_container(inv)

- if current_visitor.has_role?('admin') || current_visitor.resource_pages.present?
  %h4= link_to "#{ResourcePage.display_name.pluralize}", resource_pages_path
  = field_set_tag "#{ResourcePage.display_name.pluralize} you've authored" do
    %ul
      - current_visitor.resource_pages.each do |resource_page|
        %li
          = link_to resource_page.display_name, resource_page

- if current_visitor.has_role?('admin') || current_visitor.external_activities.present?
  %h4= link_to "#{ExternalActivity.display_name.pluralize}", external_activities_path
  = field_set_tag "#{ExternalActivity.display_name.pluralize} you've authored" do
    %ul
      - current_visitor.external_activities.each do |item|
        %li
          = link_to item.name, item
%h4= link_to "#{Image.display_name.pluralize}", images_path

Hide links to activity, investigation, external_activity listings.

%h2
  Authoring

%div{:style=> "margin: 1em; padding: 1em;"}
  %h4= "#{Investigation.display_name.pluralize} you've authored"
  %ul
    - current_visitor.investigations.each do |inv|
      %li
        = link_to_container(inv)
  = link_to "Create #{Investigation.display_name}", new_investigation_path, :class => 'button'

- if current_visitor.has_role?('admin') || current_visitor.resource_pages.present?
  %div{:style=> "margin: 1em; padding: 1em;"}
    %h4= "#{ResourcePage.display_name.pluralize} you've authored"
    %ul
      - current_visitor.resource_pages.each do |resource_page|
        %li
          = link_to resource_page.display_name, resource_page
    = link_to "Create #{ResourcePage.display_name}", new_resource_page_path, :class => 'button'

- if current_visitor.has_role?('admin') || current_visitor.external_activities.present?
  %div{:style=> "margin: 1em; padding: 1em;"}
    %h4= "#{ExternalActivity.display_name.pluralize} you've authored"
    %ul
      - current_visitor.external_activities.each do |item|
        %li
          = link_to item.name, item
    = link_to "Create #{ExternalActivity.display_name}", new_external_activity_path, :class => 'button'

%div{:style=> "margin: 1em; padding: 1em;"}
  %h4= link_to "Create #{Image.display_name}", images_path, :class => 'button'


%header.header__navigation
  .navigation-wrapper
    .navigation__logo
      .logo.nav-link
        %h1= link_to "Not Bored Tonight", root_path
    .nav
      %ul#navigation-menu
        %li.browse-menu__query-item.nav-link
          = link_to "Sports", "#"
        %li.browse-menu__query-item.nav-link
          = link_to "Music", "#"
        %li.browse-menu__query-item.nav-link
          = link_to "Family", "#"
        %li.browse-menu__query-item.nav-link
          = link_to "Festivals", "#"
        %li.browse-menu__query-item.nav-link
          = link_to "More", activities_path
        - if signed_in?
          %li.nav-link.more.user
            %a #{@user.first_name}
            %ul.submenu
              %li
                = link_to "Dashboard", dashboard_path
              %li
                = link_to "Sign Out", destroy_user_session_path, method: :delete
              %li
                = link_to "Edit Profile", edit_user_registration_path
        - else
          %li.nav-link
            = link_to "Log In", new_user_session_path

Fix spacing issue of Log In link in header

%header.header__navigation
  .navigation-wrapper
    .navigation__logo
      .logo.nav-link
        %h1= link_to "Not Bored Tonight", root_path
    .nav
      %ul#navigation-menu
        %li.browse-menu__query-item.nav-link
          = link_to "Sports", "#"
        %li.browse-menu__query-item.nav-link
          = link_to "Music", "#"
        %li.browse-menu__query-item.nav-link
          = link_to "Family", "#"
        %li.browse-menu__query-item.nav-link
          = link_to "Festivals", "#"
        %li.browse-menu__query-item.nav-link
          = link_to "More", activities_path
        - if signed_in?
          %li.nav-link.more.user
            %a #{@user.first_name}
            %ul.submenu
              %li
                = link_to "Dashboard", dashboard_path
              %li
                = link_to "Sign Out", destroy_user_session_path, method: :delete
              %li
                = link_to "Edit Profile", edit_user_registration_path
        - else
          %li.nav-link.user
            = link_to "Log In", new_user_session_path


= simple_form_for @tenant do |f|
  .row-fluid
    .span6
      = f.input :subdomain, :wrapper => :append, :class => 'inline' do
        = f.input_field :subdomain, 'data-autofocus' => true, :class => 'span6', :style => 'text-align: right'
        .add-on .bookyt.ch
      = f.input :db_name, :readonly => !@tenant.new_record?, :placeholder => 'wie subdomain'

  - if @tenant.new_record?
    = simple_fields_for @user do |u|
      = u.input :role_texts, :as => :hidden
      .row-fluid
        .span6= u.input :email
        .span6= u.input :login if u.object.respond_to? :login
      .row-fluid
        .span6= u.input :password, :input_html => {:autocomplete => "off"}
        .span6= u.input :password_confirmation

  .form-actions
    = f.button :submit

Fix markup for admin tenant view.

= simple_form_for @tenant do |f|
  .row-fluid
    .span6
      = f.input :subdomain, :wrapper => :append, :class => 'inline' do
        = f.input_field :subdomain, 'data-autofocus' => true, :class => 'span6', :style => 'text-align: right'
        .add-on .bookyt.ch
    .span6
      = f.input :db_name, :readonly => !@tenant.new_record?, :placeholder => 'wie subdomain'

  - if @tenant.new_record?
    = simple_fields_for @user do |u|
      = u.input :role_texts, :as => :hidden
      .row-fluid
        .span6= u.input :email
        .span6= u.input :login if u.object.respond_to? :login
      .row-fluid
        .span6= u.input :password, :input_html => {:autocomplete => "off"}
        .span6= u.input :password_confirmation

  .form-actions
    = f.button :submit


<!-- Navigation -->
%nav.navbar.navbar-default.navbar-fixed-top
  .container
    <!-- Brand and toggle get grouped for better mobile display -->
    .navbar-header.page-scroll
      = link_to '#', class: 'navbar-toggle btn', data: {toggle: 'collapse', target: "#bs-example-navbar-collapse-1"} do
        %span.sr-only Toggle Navigation
        %span.icon-bar
        %span.icon-bar
        %span.icon-bar
      = link_to 'Anil Maurya', '#page-top', class: 'navbar-brand'

    <!-- Collect the nav links, forms, and other content for toggling -->
    .collapse.navbar-collapse{:id => "bs-example-navbar-collapse-1"}
      %ul.nav.navbar-nav.navbar-right
        %li.hidden
          = link_to '', '#page-top'
        %li.page-scroll
          = link_to 'Open Source', '#portfolio'
        %li.page-scroll
          = link_to 'About', '#about'
        %li.page-scroll
          = link_to 'Contact', '#contact'

Add blog link to page header

<!-- Navigation -->
%nav.navbar.navbar-default.navbar-fixed-top
  .container
    <!-- Brand and toggle get grouped for better mobile display -->
    .navbar-header.page-scroll
      = link_to '#', class: 'navbar-toggle btn', data: {toggle: 'collapse', target: "#bs-example-navbar-collapse-1"} do
        %span.sr-only Toggle Navigation
        %span.icon-bar
        %span.icon-bar
        %span.icon-bar
      = link_to 'Anil Maurya', '#page-top', class: 'navbar-brand'

    <!-- Collect the nav links, forms, and other content for toggling -->
    .collapse.navbar-collapse{:id => "bs-example-navbar-collapse-1"}
      %ul.nav.navbar-nav.navbar-right
        %li.hidden
          = link_to '', '#page-top'
        %li.page-scroll
          = link_to 'Open Source', '#portfolio'
        %li.page-scroll
          = link_to 'About', '#about'
        %li.page-scroll
          = link_to 'Contact', '#contact'
        %li.page-scroll
          = link_to 'Blog', 'http://programmingright.blogspot.in', target: '_blank'


!!!
%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'

Add sign in/out links to navbar

!!!
%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
          %button.navbar-toggle{'type' => 'button', 'data-toggle' => 'collapse', 'data-target' => '#main-navbar'}
            %span.sr-only Toggle Navigation
            - 3.times do
              %span.icon-bar
          %a.navbar-brand{'href' => '/'} Issuet
        .collapse.navbar-collapse#main-navbar
          %ul.nav.navbar-nav.navbar-right
            %li
              - if user_signed_in?
                = link_to 'Sign out', destroy_user_session_path, method: :delete
              - else
                = link_to 'Sign in', new_user_session_path
    .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'


- content_for :page_title do
  = t(:listing_reports)

.columns.twelve
  %table.index
    %thead
      %tr
        %th= t(:name)
        %th= t(:description)
    %tbody
      - @reports.each do |report_type, report_subtypes|
        %tr
          %td
            = I18n.t(:name, scope: [:admin, :reports, report_type])
          %td
            - if report_subtypes.empty?
              - name = I18n.t(:name, scope: [:admin, :reports, report_type])
              - url = main_app.admin_report_url(report_type: report_type)
              - report_subtypes = [[name, url]]
            = render partial: "report_subtype", locals: { report_subtypes: report_subtypes, report_type: report_type }

Fix URL generation for report without subtype

- content_for :page_title do
  = t(:listing_reports)

.columns.twelve
  %table.index
    %thead
      %tr
        %th= t(:name)
        %th= t(:description)
    %tbody
      - @reports.each do |report_type, report_subtypes|
        %tr
          %td
            = I18n.t(:name, scope: [:admin, :reports, report_type])
          %td
            - if report_subtypes.empty?
              - name = I18n.t(:name, scope: [:admin, :reports, report_type])
              - report_subtypes = [[name, nil]]
            = render partial: "report_subtype", locals: { report_subtypes: report_subtypes, report_type: report_type }


-load i18n

.modal-header
  %h3.modal-title
    - trans "Open Case"
  .modal-body
    %p
      - trans "Open a new case for this contact? This will archive all messages from the contact."

    %form{ name:"form", novalidate:"" }
      .form-group{ ng-class:'{"has-error": form.summary.$invalid}' }
        %label.control-label
          - trans "Summary"
        %textarea.form-control{ ng-model:"fields.summary.val", ng-maxlength:"fields.summary.maxLength", name:"summary", required:"" }
        .help-block{ ng-show:"form.summary.$error.required" }
          - trans "Required"
        .help-block{ ng-show:"form.summary.$error.maxlength" }
          - trans "Too long"
      .form-group{ ng-if:"partners != null" }
        %label.control-label
          - trans "Assign to"
        %select.form-control{ ng-model:"fields.assignee.val", ng-options:"p.name for p in partners track by p.id" }
  .modal-footer
    %button.btn.btn-primary{ ng-click:"ok()" }
      - trans "Open"
    %button.btn.btn-default{ ng-click:"cancel()" }
      - trans "Cancel"

Add to new case modal template dropdown to select user

-load i18n

.modal-header
  %h3.modal-title
    - trans "Open Case"
  .modal-body
    %p
      - trans "Open a new case for this contact? This will archive all messages from the contact."

    %form{ name:"form", novalidate:"" }
      .form-group{ ng-class:'{"has-error": form.summary.$invalid}' }
        %label.control-label
          - trans "Summary"
        %textarea.form-control{ ng-model:"fields.summary.val", ng-maxlength:"fields.summary.maxLength", name:"summary", required:"" }
        .help-block{ ng-show:"form.summary.$error.required" }
          - trans "Required"
        .help-block{ ng-show:"form.summary.$error.maxlength" }
          - trans "Too long"
      .form-group{ ng-if:"partners != null" }
        %label.control-label
          - trans "Assign to partner/user"
        %select.form-control{ ng-model:"fields.assignee.val", ng-options:"p.name for p in partners track by p.id", ng-change:"refreshUserList()" }
        %select.form-control{ ng-model:"fields.user.val", ng-options:"u.name for u in users track by u.id" }
  .modal-footer
    %button.btn.btn-primary{ ng-click:"ok()" }
      - trans "Open"
    %button.btn.btn-default{ ng-click:"cancel()" }
      - trans "Cancel"


#claim-form
  = form_for @claim, as: :claim, builder: AdpFormBuilder, html: { novalidate: true }, multipart: true, authenticity_token: true do |f|

    = f.hidden_field :form_id, value: @form_id || params[:claim][:form_id]
    = f.hidden_field :form_step, value: @claim.form_step

    = render partial: "#{claim.current_step}_form_step", locals: { claim: claim, f: f }

    = render partial: 'external_users/claims/buttons/continue', locals: { f: f, commit: claim.next_step? ? 'commit_continue' : 'commit_submit_claim' }

Fix missing claim variable in claims form template

#claim-form
  = form_for @claim, as: :claim, builder: AdpFormBuilder, html: { novalidate: true }, multipart: true, authenticity_token: true do |f|

    = f.hidden_field :form_id, value: @form_id || params[:claim][:form_id]
    = f.hidden_field :form_step, value: @claim.form_step

    = render partial: "#{claim.current_step}_form_step", locals: { claim: claim, f: f }

    = render partial: 'external_users/claims/buttons/continue', locals: { claim: claim, f: f }


.row
  .col-md-12
    %h2 Upload map
    %p You can upload 3 kinds of files
    %ul
      %li .bsp, the uncompressed map
      %li .bsp.bz2, a single compressed map
      %li .zip, an archive containing one or more maps

.row
  .col-md-12
    = render 'form'

Clarify required zip format for map uploads

.row
  .col-md-12
    %h2 Upload map
    %p You can upload 3 kinds of files
    %ul
      %li .bsp, the uncompressed map
      %li .bsp.bz2, a single compressed map
      %li .zip, an archive containing one or more .bsp files

.row
  .col-md-12
    = render 'form'


.nav-bar
  %a{ href: '/' }= image_tag "logo/dsi-logo-small.png"

  %ul.header-links
    %li= link_to "About", "/about"

    - PageCategory.all.each do |pc|
      %li= link_to pc.name, pc
    -# %li= link_to "Resources", "http://data.digitalsocial.eu/", :class => yield(:resource_menu_highlighted)
    %li= link_to "Resources", resources_path, :class => yield(:resource_menu_highlighted)
    %li= link_to "Community", community_path, :class => yield(:community_menu_highlighted)
    %li= link_to "Blog", "/blog"

  = render 'shared/search_form', placeholder: 'Search for organisations...', form_destination: '/organisations', input_size: 22

  - if content_for?(:sub_menu)
    .hr.hr2.hr-full{style: 'clear: both; float: left; visibility: hidden;'}
  - else
    .hr.hr2.hr-full{style: 'clear: both; float: left;'}

  = yield :sub_menu

Remove page categories from menu.

.nav-bar
  %a{ href: '/' }= image_tag "logo/dsi-logo-small.png"

  %ul.header-links
    %li= link_to "About", "/about"
    %li= link_to "Resources", resources_path, :class => yield(:resource_menu_highlighted)
    %li= link_to "Community", community_path, :class => yield(:community_menu_highlighted)
    %li= link_to "Blog", "/blog"

  = render 'shared/search_form', placeholder: 'Search for organisations...', form_destination: '/organisations', input_size: 22

  - if content_for?(:sub_menu)
    .hr.hr2.hr-full{style: 'clear: both; float: left; visibility: hidden;'}
  - else
    .hr.hr2.hr-full{style: 'clear: both; float: left;'}

  = yield :sub_menu


.panel.panel-default
  .panel-heading Note for Red Hat Decision Manager customers
  .panel-body
    %p
      The RHDM version differs from the OptaPlanner version:
    %table.tableblock.frame-all.grid-all.spread
      %colgroup
        %col(style="width: 50%;")
        %col(style="width: 50%;")
      %thead
        %tr
          %th RHDM version
          %th OptaPlanner version
      %tbody
        %tr
          %td 7.7
          %td 7.33
        %tr
          %td 7.8
          %td 7.39
        %tr
          %td 7.9
          %td 7.44

Update mapping between the product and community version

.panel.panel-default
  .panel-heading Note for Red Hat Decision Manager customers
  .panel-body
    %p
      The RHDM version differs from the OptaPlanner version:
    %table.tableblock.frame-all.grid-all.spread
      %colgroup
        %col(style="width: 50%;")
        %col(style="width: 50%;")
      %thead
        %tr
          %th RHDM version
          %th OptaPlanner version
      %tbody
        %tr
          %td 7.7
          %td 7.33
        %tr
          %td 7.8
          %td 7.39
        %tr
          %td 7.9
          %td 7.44
        %tr
          %td 7.10
          %td 7.48
        %tr
          %td 7.11
          %td 8.5


%ol.members-list.list-unstyled{:class => active_house_for_list_class(house)}
  - @members.each do |member|
    %li
      = link_to member, class: 'member-item panel-link' do
        %article.media
          = image_tag(member.small_image_url, alt: "Photo of #{member.name_without_title}", class: "member-photo pull-left")
          .media-body
            %h2.media-heading.member-name.panel-link-title= member.name_without_title
            %p.member-role
              %span.member-party.inline-post-title= member.party_name
              %span.member-electorate= member.role

            %p.member-data
              %span.member-rebellions
                -if member.person.rebellions_fraction == 0
                  Never rebels
                -else
                  -# TODO: Should this be an absolute count rather than percentage?
                  -# Maybe it's good to show it as a percentage because it highlights rarity?
                  Rebels
                  = fraction_to_percentage_display(member.person.rebellions_fraction)
                  of the time
                  -# TODO: add helper tooltip for rebellions
                  -# link_to "explain...", help_faq_path(anchor: "clarify")
              %span.member-attendance
                = fraction_to_percentage_display(member.person.attendance_fraction)
                attendance
                -# TODO: add helper tooltip for attendance
                -# link_to "explain...", help_faq_path(anchor: "clarify")

Use local passed to partial

%ol.members-list.list-unstyled{:class => active_house_for_list_class(house)}
  - members.each do |member|
    %li
      = link_to member, class: 'member-item panel-link' do
        %article.media
          = image_tag(member.small_image_url, alt: "Photo of #{member.name_without_title}", class: "member-photo pull-left")
          .media-body
            %h2.media-heading.member-name.panel-link-title= member.name_without_title
            %p.member-role
              %span.member-party.inline-post-title= member.party_name
              %span.member-electorate= member.role

            %p.member-data
              %span.member-rebellions
                -if member.person.rebellions_fraction == 0
                  Never rebels
                -else
                  -# TODO: Should this be an absolute count rather than percentage?
                  -# Maybe it's good to show it as a percentage because it highlights rarity?
                  Rebels
                  = fraction_to_percentage_display(member.person.rebellions_fraction)
                  of the time
                  -# TODO: add helper tooltip for rebellions
                  -# link_to "explain...", help_faq_path(anchor: "clarify")
              %span.member-attendance
                = fraction_to_percentage_display(member.person.attendance_fraction)
                attendance
                -# TODO: add helper tooltip for attendance
                -# link_to "explain...", help_faq_path(anchor: "clarify")


- if @provider.errors.any?
  .validation-summary
    %h2.heading-small= "#{t('.prohibited_save')} #{pluralize(@provider.errors.count, t('.error'))}"
    %ul
      - @provider.errors.full_messages.each do |message|
        %li
          = message
    %span.form-hint
      = t('.form_error_hint')

%h1.page-title
  = "Edit #{@provider.provider_type} details"

= form_for [:advocates, :admin, @provider], html: { novalidate: true } do |f|

  %fieldset.user-form
    = f.label t('.provider_name'), class: "form-label"
    = f.text_field :name
    = validation_error_message(@provider, :name)

    - if @provider.firm?
      = f.label t('.supplier_number'), class: "form-label"
      = f.text_field :supplier_number
      = validation_error_message(@provider, :supplier_number)

      %label
        = f.check_box :vat_registered
        = t('.vat_registered')

    = f.label :api_key, t('.api_key'), class: "form-label"
    = @provider.api_key

  %p
    = f.submit 'Save', class: "button"

Improve accessibility by linking the label to the text field

- if @provider.errors.any?
  .validation-summary
    %h2.heading-small= "#{t('.prohibited_save')} #{pluralize(@provider.errors.count, t('.error'))}"
    %ul
      - @provider.errors.full_messages.each do |message|
        %li
          = message
    %span.form-hint
      = t('.form_error_hint')

%h1.page-title
  = "Edit #{@provider.provider_type} details"

= form_for [:advocates, :admin, @provider], html: { novalidate: true } do |f|

  %fieldset.user-form
    = f.label :name, t('.provider_name'), class: "form-label"
    = f.text_field :name
    = validation_error_message(@provider, :name)

    - if @provider.firm?
      = f.label t('.supplier_number'), class: "form-label"
      = f.text_field :supplier_number
      = validation_error_message(@provider, :supplier_number)

    - if @provider.firm?
      %label
        = f.check_box :vat_registered
        = t('.vat_registered')

    = f.label :api_key, t('.api_key'), class: "form-label"
    = @provider.api_key

  %p
    = f.submit 'Save', class: "button"


-content_for :widget_title do
  Audit Cycles

-content_for :widget_help, 'program_cycles'

%ul.nav.nav-tabs.nav-stacked
  -program.cycles.order("start_at DESC").each do |cycle|
    %li.group
      %a{ :href => flow_cycle_path(cycle) }
        -if cycle.complete
          Complete (started #{time_ago_in_words cycle.start_at} ago)
        -else
          -if cycle.start_at <= Date.today
            Started #{time_ago_in_words cycle.start_at} ago
          -else
            Starting in #{time_ago_in_words cycle.start_at}

Add link to design/audit-manager in audit cycles list on program page

-content_for :widget_title do
  Audit Cycles

-content_for :widget_help, 'program_cycles'

-if has_feature? :BETA
  .fltnone
    %a.btn-large.btn-success{ :href => '/design/audit-manager' }
      Audit Manager (BETA)
  %br

%ul.nav.nav-tabs.nav-stacked
  -program.cycles.order("start_at DESC").each do |cycle|
    %li.group
      %a{ :href => flow_cycle_path(cycle) }
        -if cycle.complete
          Complete (started #{time_ago_in_words cycle.start_at} ago)
        -else
          -if cycle.start_at <= Date.today
            Started #{time_ago_in_words cycle.start_at} ago
          -else
            Starting in #{time_ago_in_words cycle.start_at}


:javascript
  $('.message, .message a').live('click', function(evt){
    var note = $(this).closest('.message'),
        note_id = note.attr('data-guid');

    if(note.hasClass('unread') ){
      note.removeClass('unread');
      $.ajax({
        url: 'notifications/' + note_id,
        type: 'PUT'
      });
    }
  });

.span-1
  = image_tag 'icons/mail_big.png', :height => 30, :width => 30, :style=>"margin-top:3px;"
.span-23.last
  %h2
    = t('.notifications')

.span-24.last
  %ul.stream.notifications
    - @group_days.each do |day, notes|
      %li
        %h4= day
        %ul.notifications_for_day
          - notes.each do |note|
            %li.message{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"}
              %span.from
                = link_to "#{note.person.name.titleize}", person_path(note.person)
                = object_link(note)

              %span.time= "#{t('ago', :time => time_ago_in_words(note.created_at))}"

Revert "fix for js selector"

:javascript
  $('.message').live('click', function(evt){
    var note = $(this).closest('.message'),
        note_id = note.attr('data-guid');

    if(note.hasClass('unread') ){
      note.removeClass('unread');
      $.ajax({
        url: 'notifications/' + note_id,
        type: 'PUT'
      });
    }
  });

.span-1
  = image_tag 'icons/mail_big.png', :height => 30, :width => 30, :style=>"margin-top:3px;"
.span-23.last
  %h2
    = t('.notifications')

.span-24.last
  %ul.stream.notifications
    - @group_days.each do |day, notes|
      %li
        %h4= day
        %ul.notifications_for_day
          - notes.each do |note|
            %li.message{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"}
              %span.from
                = link_to "#{note.person.name.titleize}", person_path(note.person)
                = object_link(note)

              %span.time= "#{t('ago', :time => time_ago_in_words(note.created_at))}"


=link_to tag_path(tag_detailed.name), class: 'Tag Tag--detailed u-px-2 u-py-1 u-mb-1 u-mr-1' do
  ="#{tag_detailed.name}"
  %p.u-t-muted.u-d-inline-block
    ="#{tag_detailed.taggings_count} Lists"

Adjust tags to unifomr look.

=link_to tag_path(tag_detailed.name), class: 'Tag Tag--detailed u-p-05 u-mb-05 u-mr-05' do
  ="#{tag_detailed.name}"
  %p.u-t-muted.u-d-inline-block
    ="(#{tag_detailed.taggings_count})"


- provide :title, t('devise.sessions.new.title')

.container-sm
  %h1= t('devise.sessions.new.title')

  .strong
    = simple_form_for(resource, url: user_session_path, html: { role: 'form' }, wrapper_mappings: { boolean: :vertical_boolean }) do |f|
      = f.input :email, input_html: { class: 'input-lg' }, autofocus: true, hint: link_to(t('devise.sessions.new.hints.confirmation'), new_user_confirmation_path)
      = f.input :password, input_html: { class: 'input-lg' }, hint: link_to(t('devise.sessions.new.hints.password'), new_user_password_path)
      = f.input :remember_me, as: :boolean

      .form-actions
        %button.btn.btn-lg.btn-primary(type='submit')
          = t('devise.sessions.new.submit')

Mark both fields as required in sign in page

- provide :title, t('devise.sessions.new.title')

.container-sm
  %h1= t('devise.sessions.new.title')

  .strong
    = simple_form_for(resource, url: user_session_path, html: { role: 'form' }, wrapper_mappings: { boolean: :vertical_boolean }) do |f|
      = f.input :email, input_html: { class: 'input-lg' }, autofocus: true, hint: link_to(t('devise.sessions.new.hints.confirmation'), new_user_confirmation_path), required: true
      = f.input :password, input_html: { class: 'input-lg' }, hint: link_to(t('devise.sessions.new.hints.password'), new_user_password_path), required: true
      = f.input :remember_me, as: :boolean

      .form-actions
        %button.btn.btn-lg.btn-primary(type='submit')
          = t('devise.sessions.new.submit')


%p
  %em Custom Eternal
  is a non-rotating Constructed format consisting of cards from all custom sets that are or have been in Custom Standard.

  %p
    Cards from real sets are not allowed unless reprinted in one of these sets.

Add alternate name to Custom Eternal format page

%p
  %em Custom Eternal
  also known as
  %em Custom Legacy
  is a non-rotating Constructed format consisting of cards from all custom sets that are or have been in Custom Standard.

  %p
    Cards from real sets are not allowed unless reprinted in one of these sets.


%h1 Listing questions

%table#question-table
  %thead
    %tr
      %th Creator
      %th Lectures
      %th Actions
      %th Topics

  %tbody
    - @questions.each do |question|
      %tr
        %td= get_user(question.user_id).username
        %td= question.all_lectures
        %td
          = link_to 'Show', question
          \-
          = link_to 'Edit', edit_question_path(question)
          \-
          = link_to 'Destroy', question, :method => :delete, :data => { :confirm => 'Are you sure?' }
        %td= question.all_topics

%br

- if is_instructor?
  = link_to 'New Multiple Choice Questions', new_question_path
  \|
  = link_to 'New Short Answer Question', short_question_path

Reorder cols in question list and add content col

%h1 Listing questions

%table#question-table
  %thead
    %tr
      %th Creator
      %th Lectures
      %th Topics
      %th Content
      %th Actions

  %tbody
    - @questions.each do |question|
      %tr
        %td= get_user(question.user_id).username
        %td= question.all_lectures
        %td= question.all_topics
        %td= question.content
        %td
          = link_to 'Show', question
          \-
          = link_to 'Edit', edit_question_path(question)
          \-
          = link_to 'Destroy', question, :method => :delete, :data => { :confirm => 'Are you sure?' }

%br

- if is_instructor?
  = link_to 'New Multiple Choice Questions', new_question_path
  \|
  = link_to 'New Short Answer Question', short_question_path


%div{:id => info[:id]}
:javascript
  Ext.onReady(function(){
    new Ext.FormPanel({
      renderTo: $(#{info[:id].to_json}),
      title: #{form_title.to_json},
      url: #{form_url.to_json},
      items: #{prompts_to_extjs_items(info).to_json},
      buttons: [{
        text: #{('Save ' + form_title).to_json},
        type: 'submit',
        handler: function(f) {
          var fp = this.ownerCt.ownerCt;
          var form = fp.getForm();
          if(form.isValid()) {
            form.submit({
              url: #{form_url.to_json},
              success: function() {
                fp.collapse(true);
              },
              failure: function() {
                /* do something to indicate failure */
              }
            });
          }
        }
      }, {
        text: #{('Reset ' + form_title).to_json},
        type: 'reset',
        handler: function(f) {
          var fp = this.ownerCt.ownerCt;
          var form = fp.getForm();
          form.reset();
        }
      }],
      collapsible: true,
      collapsed: #{(!info[:values].nil? && !info[:values].empty?).to_json}
    });
  });

Remove Reset button from evaluation submission form

%div{:id => info[:id]}
:javascript
  Ext.onReady(function(){
    new Ext.FormPanel({
      renderTo: $(#{info[:id].to_json}),
      title: #{form_title.to_json},
      url: #{form_url.to_json},
      items: #{prompts_to_extjs_items(info).to_json},
      buttons: [{
        text: #{('Save ' + form_title).to_json},
        type: 'submit',
        handler: function(f) {
          var fp = this.ownerCt.ownerCt;
          var form = fp.getForm();
          if(form.isValid()) {
            form.submit({
              url: #{form_url.to_json},
              success: function() {
                fp.collapse(true);
              },
              failure: function() {
                /* do something to indicate failure */
              }
            });
          }
        }
      }],
      collapsible: true,
      collapsed: #{(!info[:values].nil? && !info[:values].empty?).to_json}
    });
  });


%tr
  %th{:colspan => "2"}
    %h3= t(group, :scope => 'bookyt')
  -for @date in @dates
    %th{:style => "text-align: right"}
      %h3= currency_fmt(Account.by_type(group).saldo(@date))

= render :partial => 'account', :collection => Account.by_type(group).all.select{|a| a.bookings.by_value_period(@dates.first, @dates.last).exists?}

Fix bail in profit sheet.


= render :partial => "layouts/flash_msg"
.row
  .col-md-12.col-lg-6
    = render :partial => "shared/summary/textual", :locals => {:title => _("Properties"), :items => textual_group_properties}
    = render :partial => "shared/summary/textual_multilabel", :locals => {:title => _("Conditions"), :items => textual_group_conditions}
  .col-md-12.col-lg-6
    = render :partial => "shared/summary/textual", :locals => {:title => _("Relationships"), :items => textual_group_relationships}

Move node conditions to right side of the summary to avoid scrolling

= render :partial => "layouts/flash_msg"
.row
  .col-md-12.col-lg-6
    = render :partial => "shared/summary/textual", :locals => {:title => _("Properties"), :items => textual_group_properties}
  .col-md-12.col-lg-6
    = render :partial => "shared/summary/textual", :locals => {:title => _("Relationships"), :items => textual_group_relationships}
    = render :partial => "shared/summary/textual_multilabel", :locals => {:title => _("Conditions"), :items => textual_group_conditions}


!!!
%html
  %head
    %title= "#{@election.name} | Voxe"
    = stylesheet_link_tag "embed"
    = javascript_include_tag "embed"
  %body
    = render 'layouts/partials/facebook.html'
    :javascript
      $(function() {
        new VoxeElection({id: '#{@election.id}'});
      });
    #app

    #templates
      = render 'templates.mustache'

    = render 'layouts/partials/twitter.html'

Embed add google analytics and chartbeat scripts

!!!
%html
  %head
    %title= "#{@election.name} | Voxe"
    = stylesheet_link_tag "embed"
    = javascript_include_tag "embed"
    = render "layouts/partials/google_analytics"
    = render "layouts/partials/chartbeat_header"
  %body
    = render 'layouts/partials/facebook.html'
    :javascript
      $(function() {
        new VoxeElection({id: '#{@election.id}'});
      });
    #app

    #templates
      = render 'templates.mustache'

    = render "layouts/partials/chartbeat_body"
    = render 'layouts/partials/twitter.html'


- @no_container = true
- page_title "Contributors", "Graphs"
= render 'head'

%div{ class: container_class }
  .sub-header-block
    .tree-ref-holder
      = render 'shared/ref_switcher', destination: 'graphs'
    %ul.breadcrumb.repo-breadcrumb
      = commits_breadcrumbs

  .loading-graph
    .center
      %h3.page-title
        %i.fa.fa-spinner.fa-spin
        Building repository graph.
      %p.slead Please wait a moment, this page will automatically refresh when ready.

  .stat-graph.hide
    .header.clearfix
      %h3#date_header.page-title
      %p.light
        Commits to #{@ref}, excluding merge commits. Limited to 6,000 commits.
      %input#brush_change{:type => "hidden"}
    .graphs.row
      #contributors-master
      #contributors.clearfix
        %ol.contributors-list.clearfix

:javascript
  $.ajax({
    type: "GET",
    url: location.href,
    dataType: "json",
    success: function (data) {
      var graph = new ContributorsStatGraph();
      graph.init(data);

      $("#brush_change").change(function(){
        graph.change_date_header();
        graph.redraw_authors();
      });

      $(".stat-graph").fadeIn();
      $(".loading-graph").hide();
    }
  });

Append .json onto graph request URL (!5136)

- @no_container = true
- page_title "Contributors", "Graphs"
= render 'head'

%div{ class: container_class }
  .sub-header-block
    .tree-ref-holder
      = render 'shared/ref_switcher', destination: 'graphs'
    %ul.breadcrumb.repo-breadcrumb
      = commits_breadcrumbs

  .loading-graph
    .center
      %h3.page-title
        %i.fa.fa-spinner.fa-spin
        Building repository graph.
      %p.slead Please wait a moment, this page will automatically refresh when ready.

  .stat-graph.hide
    .header.clearfix
      %h3#date_header.page-title
      %p.light
        Commits to #{@ref}, excluding merge commits. Limited to 6,000 commits.
      %input#brush_change{:type => "hidden"}
    .graphs.row
      #contributors-master
      #contributors.clearfix
        %ol.contributors-list.clearfix

:javascript
  $.ajax({
    type: "GET",
    url: "#{namespace_project_graph_path(@project.namespace, @project, current_ref, :json)}",
    dataType: "json",
    success: function (data) {
      var graph = new ContributorsStatGraph();
      graph.init(data);

      $("#brush_change").change(function(){
        graph.change_date_header();
        graph.redraw_authors();
      });

      $(".stat-graph").fadeIn();
      $(".loading-graph").hide();
    }
  });


-# Takes a record collection and an array of symbols for column names/methods
%table.table{class: local_assigns[:class] || ""}
  %thead.thead-default
    %tr
      -columns.each do |col|
        %th
          =col.to_s.titleize
  %tbody
    -records.each do |record|
      %tr{style: "cursor: pointer", data: {url: "http://www.google.com"}}
        -columns.each do |col|
          %td
            =record.send(col)

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

    // Link to appropriate feedback detail on row click
    $('table tbody tr').click(function() {
      window.location = $(this).data("url");
    });
  });

Stop Geographies from linking to Google

-# Takes a record collection and an array of symbols for column names/methods
%table.table{class: local_assigns[:class] || ""}
  %thead.thead-default
    %tr
      -columns.each do |col|
        %th
          =col.to_s.titleize
  %tbody
    -records.each do |record|
      %tr
        -columns.each do |col|
          %td
            =record.send(col)


- if @project.generated_yaml_config
  %p.alert.alert-danger
    CI Jobs are deprecated now, you can #{link_to "download", dumped_yaml_ci_project(@project)}
    or
    %a.preview-yml{:href => "#yaml-content", "data-toggle" => "modal"} preview
    yaml file which is based on your old jobs.
    Put this file to the root of your project and name it .gitlab-ci.yml

= render 'form'

- if @project.generated_yaml_config
  #yaml-content.modal.fade{"aria-hidden" => "true", "aria-labelledby" => ".gitlab-ci.yml", :role => "dialog", :tabindex => "-1"}
    .modal-dialog
      .modal-content
        .modal-header
          %button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} ×
          %h4.modal-title Content of .gitlab-ci.yml
        .modal-body
          = text_area_tag :yaml, @project.generated_yaml_config, size: "70x25", class: "form-control"
        .modal-footer
          %button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Close

Fix 500 on CI project settings

- if @project.generated_yaml_config
  %p.alert.alert-danger
    CI Jobs are deprecated now, you can #{link_to "download", dumped_yaml_ci_project_path(@project)}
    or
    %a.preview-yml{:href => "#yaml-content", "data-toggle" => "modal"} preview
    yaml file which is based on your old jobs.
    Put this file to the root of your project and name it .gitlab-ci.yml

= render 'form'

- if @project.generated_yaml_config
  #yaml-content.modal.fade{"aria-hidden" => "true", "aria-labelledby" => ".gitlab-ci.yml", :role => "dialog", :tabindex => "-1"}
    .modal-dialog
      .modal-content
        .modal-header
          %button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} ×
          %h4.modal-title Content of .gitlab-ci.yml
        .modal-body
          = text_area_tag :yaml, @project.generated_yaml_config, size: "70x25", class: "form-control"
        .modal-footer
          %button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Close


---
layout: default
---
%body.index.bg-light-gray
  %nav.navbar.navbar-default.navbar-fixed-top.navbar-shrink
    .container
      .navbar-header
        %button.navbar-toggle{type:"button",data:{toggle:"collapse", target:"#bs-example-navbar-collapse-1"}}
          %span.sr-only Toggle Navigation
          %span.icon-bar
          %span.icon-bar
          %span.icon-bar
        %a.navbar-brand{href:"/"} {{ site.title }}

      .collapse.navbar-collapse#bs-example-navbar-collapse-1
        %ul.nav.navbar-nav.navbar-right
          %li.hidden
            %a{href:"/"}
          %li
            %a{href:"/blog"} Blog
  %section.container
    {{ content }}
    {% include footer.html %}

Fix nav links on blog pages

---
layout: default
---
%body.index.bg-light-gray
  %nav.navbar.navbar-default.navbar-fixed-top.navbar-shrink
    .container
      .navbar-header
        %button.navbar-toggle{type:"button",data:{toggle:"collapse", target:"#bs-example-navbar-collapse-1"}}
          %span.sr-only Toggle Navigation
          %span.icon-bar
          %span.icon-bar
          %span.icon-bar
        %a.navbar-brand{href:"/"} {{ site.title }}

      .collapse.navbar-collapse#bs-example-navbar-collapse-1
        %ul.nav.navbar-nav.navbar-right
          %li.hidden
            %a{href:"/"}
          %li.active
            %a{href:"/blog"} Blog
          %li
            %a{href:"/#services"} Services
          %li
            %a{href:"/#portfolio"} Portfolio
          %li
            %a{href:"/#about"} About
          %li
            %a{href:"/#team"} Team
          %li
            %a{href:"/#contact"} Contact
  %section.container
    {{ content }}
    {% include footer.html %}


%ul.media-list
  - comments.each do |c|
    %li.media-body
      .well.well-small
        .row
          .col-xs-1
            %i.fa.fa-comment.fa-3x
          .col-xs-11
            .col-xs-9
              %h5.media-heading.pull-left
                = "#{c.creator.name} at #{format_as_date_time(c.created_at)}"
            .col-xs-3
              .pull-right
                - if can? :update, c
                  = link_to edit_comment_path(c), :class => "btn btn-primary btn-xs pull-right", :style => "margin-left: 5px;" do
                    %i.fa.fa-edit
                    Edit
                - if can? :delete, c
                  = link_to c, :method => :delete, :class => "btn btn-warning btn-xs pull-right", :style => "margin-left: 5px;", :data => { :confirm => 'Are you sure you want to remove this comment?' } do
                    %i.fa.fa-trash
                    Delete

            .col-xs-12
              %p= c.comment.html_safe

Revise layout for comments repeater

%ul.list-group
  - comments.each do |c|
    %li.list-group-item
      %span.title.text-muted{:style => 'min-width: 140px; display:inline-block;'}= "#{c.creator.name}<br/>#{format_as_date_time(c.created_at)}".html_safe
      %span.title{:style => 'display:inline-block;vertical-align:top'}= c.comment.html_safe.truncate(128)
      %span.pull-right{:style => 'min-width: 80px; display:inline-block;vertical-align:top'}
        - if can? :delete, c
          = link_to c, :method => :delete, :class => "btn btn-warning btn-xs pull-right", :style => "margin-left: 5px;", :data => { :confirm => 'Are you sure you want to remove this comment?' } do
            %i.fa.fa-trash
            Delete


- # TODO consolidate this view code with replies#_single and message#_message
.post-container.news-container{class: cycle('even', 'odd')}
  .padding-10
    .post-edit-box
      - if news.editable_by?(current_user)
        = link_to edit_news_path(news) do
          = image_tag "icons/pencil.png".freeze, title: 'Edit'.freeze, alt: 'Edit'.freeze
      - if news.deletable_by?(current_user)
        = link_to news_path(news), method: :delete, data: { confirm: "Are you sure you wish to delete this news post?" } do
          = image_tag "icons/cross.png".freeze, title: 'Delete'.freeze, alt: 'Delete'.freeze
      = link_to news_path(news), title: 'Pemalink'.freeze, alt: 'Permalink'.freeze do
        = image_tag "icons/link.png".freeze, title: 'Delete'.freeze, alt: 'Delete'.freeze
    .message-content= sanitize_written_content(news.content)
  .subber
    Posted on
    = pretty_time(news.created_at)
    by
    = user_link(news.user)

Reorder news links so they display in the same link-edit-delete order as replies; also update the copy/pasted titles from Delete to the more accurate Permalink

- # TODO consolidate this view code with replies#_single and message#_message
.post-container.news-container{class: cycle('even', 'odd')}
  .padding-10
    .post-edit-box
      = link_to news_path(news), rel: 'alternate'.freeze do
        = image_tag "icons/link.png".freeze, title: 'Permalink'.freeze, alt: 'Permalink'.freeze
      - if news.editable_by?(current_user)
        = link_to edit_news_path(news) do
          = image_tag "icons/pencil.png".freeze, title: 'Edit'.freeze, alt: 'Edit'.freeze
      - if news.deletable_by?(current_user)
        = link_to news_path(news), method: :delete, data: { confirm: "Are you sure you wish to delete this news post?" } do
          = image_tag "icons/cross.png".freeze, title: 'Delete'.freeze, alt: 'Delete'.freeze
    .message-content= sanitize_written_content(news.content)
  .subber
    Posted on
    = pretty_time(news.created_at)
    by
    = user_link(news.user)


%nav.top-bar(data-topbar role = "navigation")
  %ul.title-area
    %li.name.has-dropdown.active
      %h1
        = link_to "Renalwarev2", patients_path, :title => "Home"

  - if user_signed_in?
    %section.top-bar-section
      = render partial: 'navigation/patient_admin'
      = render partial: 'navigation/patient_search'
      = render partial: 'navigation/sign_out'
      = render partial: 'navigation/help_items'
      = render partial: 'navigation/patients_admin'
      = render partial: 'navigation/renalware_admin'

Make home main nav link more compact

%nav.top-bar(data-topbar role = "navigation")
  %ul.title-area
    %li.name.has-dropdown.active
      %h1
        = link_to "RW2.0", patients_path, :title => "Home"

  - if user_signed_in?
    %section.top-bar-section
      = render partial: 'navigation/patient_admin'
      = render partial: 'navigation/patient_search'
      = render partial: 'navigation/sign_out'
      = render partial: 'navigation/help_items'
      = render partial: 'navigation/patients_admin'
      = render partial: 'navigation/renalware_admin'


= f.inputs 'Additional Info' do
  - @conference.questions.each do |q|
    - if q.question_type.id == 1  || q.question_type.id == 2 # yes/no or single choice
      = f.input :qanswers, :collection => q.qanswers, :as => :select, :input_html => { :multiple => false }, label: q.title, :include_blank => "Please make your choice",
                :member_label => Proc.new {|a| a.answer.title}
    - if q.question_type.id == 3  # multiple choice
      = f.input :qanswers, :collection => q.qanswers, :as => :check_boxes, label: q.title,
                :member_label => Proc.new {|a| a.answer.title}

Replace usage of deprecated member_label option in forms with Array of label/value pairs

= f.inputs 'Additional Info' do
  - @conference.questions.each do |q|
    - if q.question_type.id == 1  || q.question_type.id == 2 # yes/no or single choice
      = f.input :qanswers, :collection => q.qanswers.joins(:answer).pluck("answers.title, qanswers.id"), :as => :select, :input_html => { :multiple => false },
                label: q.title, :include_blank => "Please make your choice"
    - if q.question_type.id == 3  # multiple choice
      = f.input :qanswers, :collection => q.qanswers.joins(:answer).pluck("answers.title, qanswers.id"), :as => :check_boxes, label: q.title


- content_for :head_javascripts do
  :coffeescript
    if window.opener
      window.close()
      window.opener.location.reload(true)

%section#home-index
  .row#main-row
    .span16#header
      .header
        = image_tag 'githeroes-600x170.png'
        .blurb
          Vote for your hero on Github!
      .heroes
        = render :partial => 'heroes/list', :locals => { :heroes => @heroes }

      .nominate
        %a{:class => 'btn success large', :id => 'nominate-hero', 'data-controls-modal' => "nominate-hero-modal", 'data-backdrop' => 'static', :href => '#'}
          Nominate your Own Hero!

Update the blurb on the page

- content_for :head_javascripts do
  :coffeescript
    if window.opener
      window.close()
      window.opener.location.reload(true)

%section#home-index
  .row#main-row
    .span16#header
      .header
        = image_tag 'githeroes-600x170.png'
        .blurb
          Vote for your Github Hero!
      .heroes
        = render :partial => 'heroes/list', :locals => { :heroes => @heroes }

      .nominate
        %a{:class => 'btn success large', :id => 'nominate-hero', 'data-controls-modal' => "nominate-hero-modal", 'data-backdrop' => 'static', :href => '#'}
          Nominate your Own Hero!