<%- model_class = Project -%>

      <%= model_class.human_attribute_name(:owner_id) %>
      <%= model_class.human_attribute_name(:name) %>
      <%=t '.actions', :default => t("helpers.actions") %>

    <% @projects.each do |project| %>

        <%= project.owner.email %>
        <%= link_to project.name, project_path(project) %>

          <%= link_to t('.edit', :default => t("helpers.links.edit")),
                      edit_project_path(project), :class => 'btn btn-default btn-xs' %>
          <%= link_to t('.destroy', :default => t("helpers.links.destroy")),
                      project_path(project),
                      :method => :delete,
                      :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
                      :class => 'btn btn-xs btn-danger' %>

    <% end %>

<%- model_class = Project -%>

      <%= model_class.human_attribute_name(:owner_id) %>
      <%= model_class.human_attribute_name(:name) %>
      <%= model_class.human_attribute_name(:closed) %>
      <%=t '.actions', :default => t("helpers.actions") %>

    <% @projects.each do |project| %>

        <%= project.owner.email %>
        <%= link_to project.name, project_path(project) %>
        <%= project.closed %>

          <%= link_to t('.edit', :default => t("helpers.links.edit")),
                      edit_project_path(project), :class => 'btn btn-default btn-xs' %>
          <%= link_to t('.destroy', :default => t("helpers.links.destroy")),
                      project_path(project),
                      :method => :delete,
                      :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
                      :class => 'btn btn-xs btn-danger' %>

    <% end %>

Add closed column to projects/table partial view


<% if @databases.length == 1 -%>
slapd	slapd/domain	string	<%= @databases.keys[0].split(/,?dc=/).reject! { |c| c.empty? }.join('.') -%>
<% else -%>
slapd	slapd/no_configuration	boolean	true
<% end -%>

Add carriage return at the end of the remplate


Help

Welcome new users

      Languages

          <% tracks.each do |t| %>
            <% if t.active? %>

                <a role="menuitem" tabindex="-1" href="http://help.exercism.io/getting-started-with-<%= t.slug %>.html">
                  <%= t.language %>

            <% end %>
          <% end %>

    <% if !current_user.guest? %>
      <%= erb :"application/nav/nitpicker_languages" %>
      <%= erb :"application/nav/teams" %>
      <%= erb :"application/nav/notifications" %>
      <%= erb :"application/nav/account" %>
    <% else %>

Log in with GitHub

    <% end %>
    <% if settings.development? %>
      <%= erb :"application/nav/backdoor" %>
    <% end %>

Help

    <% unless current_user.onboarded? %>

Welcome new users

    <% end %>

      Languages

          <% tracks.each do |t| %>
            <% if t.active? %>

                <a role="menuitem" tabindex="-1" href="http://help.exercism.io/getting-started-with-<%= t.slug %>.html">
                  <%= t.language %>

            <% end %>
          <% end %>

    <% if !current_user.guest? %>
      <%= erb :"application/nav/nitpicker_languages" %>
      <%= erb :"application/nav/teams" %>
      <%= erb :"application/nav/notifications" %>
      <%= erb :"application/nav/account" %>
    <% else %>

Log in with GitHub

    <% end %>
    <% if settings.development? %>
      <%= erb :"application/nav/backdoor" %>
    <% end %>

Remove the link for "Welcome new users" for onboarded users.


Resend confirmation instructions

<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
  <%= devise_error_messages! %>

<%= f.label :email %>

  <%= f.email_field :email, :autofocus => true %>

<%= f.submit "Resend confirmation instructions" %>

<% end %>

<%= render "devise/shared/links" %>

Fix Resend Confirmation Instructions form style to match other forms


<%= form_for @user_session, :url => email_confirmation_path, :html => { :method => :patch } do |f| %>

Veuillez confirmer la modification en entrant votre mot de passe :

  <fieldset>

      <%= f.label(:email, "Ancienne adresse email") %>

        <%= text_field_tag(:new_email, @user.email, :size => 36, :disabled => true) %>

      <%= f.label(:new_email, "Nouvelle adresse email") %>

        <%= text_field_tag(:new_email, @user.new_email, :size => 36, :disabled => true) %>

      <%= f.label(:password, "Mot de passe") %>

        <%= f.password_field(:password, :size => 36) %>

  </fieldset>

    <%= button_tag("Enregistrer", :class => "btn btn-primary btn-large") %>

<%- end -%>

<%= form_for @user_session, :url => email_confirmation_path, :html => { :method => :patch } do |f| %>

Veuillez confirmer la modification en entrant votre mot de passe :

  <fieldset>

      <%= f.label(:email, "Ancienne adresse email") %>

      <%= text_field_tag(:new_email, @user.email, :class => 'form-control', :disabled => true) %>

      <%= f.label(:new_email, "Nouvelle adresse email") %>

      <%= text_field_tag(:new_email, @user.new_email, :class => 'form-control', :disabled => true) %>

      <%= f.label(:password, "Mot de passe") %>
      <%= f.password_field(:password, :class => 'form-control') %>

  </fieldset>

    <%= button_tag("Enregistrer", :class => "btn btn-primary btn-lg") %>

<%- end -%>

Fix email change confirmation form for BS3.


<% if Rails.env == 'staging' %>
  STAGING
  <!-- Global site tag (gtag.js) - Google Analytics -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=UA-12920389-5"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());

    gtag('config', 'UA-12920389-5');
  </script>

<% elsif Rails.env == 'production' %>

  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-12920389-2', 'auto');
    ga('require', 'linkid');
    ga('require', 'displayfeatures');
    ga('send', 'pageview');
  </script>

<% end %>

<% if Rails.env == 'staging' %>
  <!-- Global site tag (gtag.js) - Google Analytics -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=UA-12920389-5"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());

    gtag('config', 'UA-12920389-5');
  </script>

<% elsif Rails.env == 'production' %>

  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-12920389-2', 'auto');
    ga('require', 'linkid');
    ga('require', 'displayfeatures');
    ga('send', 'pageview');
  </script>

<% end %>

Remove the word STAGING from the head

Remove the word STAGING from the head


<%-
if @is_dynamic and (@allow_update.empty? and @allow_update_cidr.empty?)
  raise(Puppet::ParseError, "Both allow_update and allow_update_cidr are empty for dynamic zone '#{name}'")
end
-%>
# File managed by puppet
zone "<%= @name %>" IN {
  type master;
<% if @is_dynamic -%>
  file "<%= scope.lookupvar("bind::params::dynamic_directory") %>/<%= @name %>.conf";
<% else -%>
  file "<%= scope.lookupvar("bind::params::pri_directory") %>/<%= @name %>.conf";
<% end -%>
<% if @zone_xfers and not @zone_xfers.empty? -%>
  allow-transfer { <%= Array(@zone_xfers).join('; ') -%>; };
<% else -%>
  allow-transfer { none; };
<% end -%>
<% if @is_dynamic -%>
  allow-update { <% if @allow_update.empty? -%>key <%= Array(@allow_update).join('.; key ') -%>.;<% end
    -%><% if @allow_update_cidr.empty? -%> <%= Array(@allow_update_cidr).join('; ') -%>;<% end -%> };
<% end -%>
  allow-query { any; };
  notify yes;
<% if @zone_notify and not @zone_notify.empty? -%>
  also-notify { <%= Array(@zone_notify).join('; ') -%>; };
<% end -%>
};

<%-
if @is_dynamic and (@allow_update.empty? and @allow_update_cidr.empty?)
  raise(Puppet::ParseError, "Both allow_update and allow_update_cidr are empty for dynamic zone '#{name}'")
end
-%>
# File managed by puppet
zone "<%= @name %>" IN {
  type master;
<% if @is_dynamic -%>
  file "<%= scope.lookupvar("bind::params::dynamic_directory") %>/<%= @name %>.conf";
<% else -%>
  file "<%= scope.lookupvar("bind::params::pri_directory") %>/<%= @name %>.conf";
<% end -%>
<% if @zone_xfers and not @zone_xfers.empty? -%>
  allow-transfer { <%= Array(@zone_xfers).join('; ') -%>; };
<% else -%>
  allow-transfer { none; };
<% end -%>
<% if @is_dynamic -%>
  allow-update { <% if !@allow_update.empty? -%>key <%= Array(@allow_update).join('.; key ') -%>.;<% end
    -%><% if !@allow_update_cidr.empty? -%> <%= Array(@allow_update_cidr).join('; ') -%>;<% end -%> };
<% end -%>
  allow-query { any; };
  notify yes;
<% if @zone_notify and not @zone_notify.empty? -%>
  also-notify { <%= Array(@zone_notify).join('; ') -%>; };
<% end -%>
};

Use empty method to check arrays

Use empty method to check arrays


# This file was generated by Chef for <%= node.name %>
# Do NOT modify this file by hand.
# Created by the rackspace_cloudbackup cookbook
<%# Not using YAML.dump as drawing the content directly lets us stick in comments. -%>

authentication:
  apikey: <%= @api_key %>
  apiuser: <%= @api_username %>

general:
  configRevision: 2
  region: <%= @api_region %>

locations:
  ---
<%
@backup_config.each do |backup|
  # This is called here to poll the API on template generation during convergance
  # As the ID will be created when the HWRP creates the API object
  api_id = Opscode::Rackspace::CloudBackup::RcbuBackupWrapper.new(@api_username, @api_key, @api_region, backup['label']).backup_id
  raise "ERROR: nil api_id for #{backup['label']}" if api_id.nil?
-%>
  - <%= backup['location'] %>:
    # Chef label: <%= backup['label'] %>
<% if backup['comment'] -%>
    # <%= backup['comment'] %>
<% end -%>
    backupConfigurationId: <%= api_id %>
    enabled: <%= backup['enabled'] %>
<% end -%>

# This file was generated by Chef for <%= node.name %>
# Do NOT modify this file by hand.
# Created by the rackspace_cloudbackup cookbook
<%# Not using YAML.dump as drawing the content directly lets us stick in comments. -%>

authentication:
  apikey: <%= @api_key %>
  apiuser: <%= @api_username %>

general:
  configRevision: 2
  region: <%= @api_region %>

locations:
<%
@backup_config.each do |backup|
  # This is called here to poll the API on template generation during convergance
  # As the ID will be created when the HWRP creates the API object
  api_id = Opscode::Rackspace::CloudBackup::RcbuBackupWrapper.new(@api_username, @api_key, @api_region, backup['label']).backup_id
  raise "ERROR: nil api_id for #{backup['label']}" if api_id.nil?
-%>
  - <%= backup['location'] %>:
    # Chef label: <%= backup['label'] %>
<% if backup['comment'] -%>
    # <%= backup['comment'] %>
<% end -%>
    backupConfigurationId: <%= api_id %>
    enabled: <%= backup['enabled'] %>
<% end -%>

Fix YAML error in run_backup config

Fix YAML error in run_backup config


Add a New Lesson Plan

    <form action = "/lessons" method = "post">

Title:

      <input name="lesson[title]" type="text" placeholder="Lesson title">

Objective:

      <textarea name="lesson[objective]" type="text" placeholder="Please supply an objective for this lesson"></textarea>

Warmup:

      <textarea name="lesson[warmup]" type="text" placeholder="If your lesson does not include a warmup, please indicate that here"></textarea>

Main Lesson:

      <textarea name="lesson[main]" type="text" placeholder="Put the main body of your lesson plan here"></textarea>

Homework:

      <textarea name="lesson[homework]" type="text" placeholder="If there is no homework for this lesson, please indicate that here"></textarea>

    <input type="submit" value="Submit">
  </form>

Add a New Lesson Plan

    <form action = "/lessons" method = "post">

Title:

      <input name="lesson[title]" type="text" placeholder="Lesson title">

Objective:

      <textarea name="lesson[objective]" type="text" placeholder="Please supply an objective for this lesson"></textarea>

Warmup:

      <textarea name="lesson[warmup]" type="text" placeholder="If your lesson does not include a warmup, please indicate that here"></textarea>

Main Lesson:

      <textarea name="lesson[main]" type="text" placeholder="Put the main body of your lesson plan here"></textarea>

Homework:

      <textarea name="lesson[homework]" type="text" placeholder="If there is no homework for this lesson, please indicate that here"></textarea>

Category:

    <% Category.all.each do |category| %>
    <input type="radio" name="lesson[category_id]" value="<%=category.id %>"> <%=category.category%>

    <%end%>

Grade Level:

    <% GradeLevel.all.each do |level| %>
    <input type="radio" name="lesson[grade_level_id]" value="<%=level.id %>"> <%=level.level%>

    <%end%>
    <input type="submit" value="Submit">
  </form>

Add category and grade level to lesson form


---
title: 'Triangle.rb | Submit a Talk'
---

  Back to home →

Submit a Talk Proposal

    <form action="https://formforge.io/f/845c5137b216" method="POST">
      Name
      <input type="text" name="name" id="name">

      Email address
      <input type="email" name="email" id="email">

      Topic of Discussion
      <textarea name="topic" id="topic"></textarea>

      <input type="submit" value="Submit Talk">
    </form>

---
title: 'Triangle.rb | Submit a Talk'
---

  Back to home →

Submit a Talk Proposal

    <form action="https://formkeep.com/f/845c5137b216" method="POST">
      Name
      <input type="text" name="name" id="name">

      Email address
      <input type="email" name="email" id="email">

      Topic of Discussion
      <textarea name="topic" id="topic"></textarea>

      <input type="submit" value="Submit Talk">
    </form>

Update form URL to use FormKeep

Update form URL to use FormKeep

`formforge.io` has been renamed to `formkeep.com`.


{
  "service": {
<% if @service['id'] %>
    "id": "<%= @service['id'] %>",
<% end %>
<% if @service['tags'] %>
    "tags": "<%= @service['tags'] %>",
<% end %>
<% if @service['port'] %>
    "port": <%= @service['port'] %>,
<% end %>
<% if @service['type'] %>
    "check": {
  <% if @service['type'] == :script %>
      "script": "<%= @service['script'] %>",
      "interval": "<%= @service['interval'] %>"
  <% elsif @service['type'] == :ttl %>
      "ttl": "<%= @service['ttl'] %>"
  <% end %>
    }
<% end %>
    "name": "<%= @service['name'] %>"
  }
}

{
  "service": {
<% if @service['id'] %>
    "id": "<%= @service['id'] %>",
<% end %>
<% if @service['tags'] %>
    "tags": ["<%= @service['tags'].join('","') %>"],
<% end %>
<% if @service['port'] %>
    "port": <%= @service['port'] %>,
<% end %>
<% if @service['type'] %>
    "check": {
  <% if @service['type'] == :script %>
      "script": "<%= @service['script'] %>",
      "interval": "<%= @service['interval'] %>"
  <% elsif @service['type'] == :ttl %>
      "ttl": "<%= @service['ttl'] %>"
  <% end %>
    }
<% end %>
    "name": "<%= @service['name'] %>"
  }
}

Make tags expand out in templates properly.


  <%= @user.email %>

  <% @plants.each do |plant| %>

<%= link_to "#{plant.name}", plant %>

        <% if plant.latest_watering %>

Days since watering: <%= plant.days_since_watering %>

Amount: <%= plant.latest_watering.amount %>

        <% end %>
        <% if plant.needs_water? %>

Needs water

        <% end %>

  <% end %>

<%= link_to 'New Plant', new_plant_path %>

  Welcome

  Currently logged in as: <%= @user.email %>

      Plant Name

      Days Since Watering

      Amount Watered

      Needs Water

  <% @plants.each do |plant| %>

          <%= link_to "#{plant.name}", plant %>

        <% if plant.latest_watering %>

            <%= plant.days_since_watering %>

            <%= plant.latest_watering.amount %>

        <% else %>

            N/A

            N/A

        <% end %>

          <% if plant.needs_water? %>
          Yes
          <% else %>
          No
          <% end %>

  <% end %>

<%= link_to 'Add New Plant', new_plant_path %>

Move plant data from list to table

Move plant data from list to table


[user]
  name = <%= print("Your Name: "); STDOUT.flush; STDIN.gets.chomp %>
  email = <%= print("Your Email: "); STDOUT.flush; STDIN.gets.chomp %>
[color]
  ui = auto
[core]
  excludesfile = <%= ENV['HOME'] %>/.gitignore
  editor = subl -w
[apply]
  whitespace = nowarn
[branch]
  autosetuprebase = always
[grep]
  lineNumber = true
[log]
  date = relative
  decorate = short
[merge]
  ff = false
[github]
  user = <%= print("GitHub Username: "); STDOUT.flush; STDIN.gets.chomp %>
[credential]
  helper = osxkeychain
[help]
  autocorrect = 1
[alias]
  ignore = update-index --assume-unchanged
  unignore = update-index --no-assume-unchanged
  ignored = !git ls-files -v | grep "^[[:lower:]]"
  standup = !"git log --reverse --branches --since=$(if [[ "Mon" == "$(date +%a)" ]]; then echo "last friday"; else echo "yesterday"; fi) --author=$(git config --get user.email) --format=format:'%C(cyan) %ad %C(yellow)%h %Creset %s %Cgreen%d' --date=local"
  lg = !"git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

Add git log pretyfied alias

Add git log pretyfied alias


<% @codenames.each do |dist| -%>
Origin: <%= node[:reprepro][:fqdn] %>
Label: apt repository
Codename: <%= dist %>
Architectures: <%= @architectures.join(" ") %>
Components: <%= @pulls["component"] %>
Description: <%= node[:reprepro][:description] %>
SignWith: <%= node[:reprepro][:pgp_email] %>
<%   unless @pulls["name"] == dist -%>
Pull: <%= dist %>
<%   end -%>
<% end -%>

Add missing linebreak between chunks.

Add missing linebreak between chunks.


<%
  css = []
  css << "selected" if selected_page?(menu_branch) or descendant_page_selected?(menu_branch)
  css << "first" if menu_branch_counter == 0
  css << "last" if menu_branch_counter == (sibling_count ||= menu_branch.shown_siblings.size)
  domid = "item_#{menu_branch_counter}" unless menu_branch.parent_id.present? or menu_branch.title.blank?
-%>
<% if menu_branch.in_menu? %>
  <li<%= " class='#{css.join(' ')}'" if css.present? -%><%= " id='#{domid}'" if domid.present? -%>>
    <%= link_to menu_branch.title, menu_branch.url %>
    <%
      unless hide_children or
        menu_branch.parent_id.present? or
        (children = Page.find(:all, :conditions => "parent_id = #{menu_branch.id}").collect{|c| c if c.in_menu? }.compact).empty?
    -%>
      <ul class='clearfix'>
        <%= render :partial => "/shared/menu_branch",
                    :collection => children,
                    :locals => {:hide_children => hide_children, :sibling_count => children.size-1} -%>
      </ul>
    <% end -%>
  </li>
<% end -%>

<%
  css = []
  css << "selected" if selected_page?(menu_branch) or descendant_page_selected?(menu_branch)
  css << "first" if menu_branch_counter == 0
  css << "last" if menu_branch_counter == (sibling_count ||= menu_branch.shown_siblings.size)
  domid = "item_#{menu_branch_counter}" unless menu_branch.parent_id.present? or menu_branch.title.blank?
-%>
<% if menu_branch.in_menu? %>
  <li<%= " class='#{css.join(' ')}'" if css.present? -%><%= " id='#{domid}'" if domid.present? -%>>
    <%= link_to menu_branch.title, menu_branch.url %>
    <%
      unless hide_children or
        menu_branch.parent_id.present? or
        (children = menu_branch.children.collect{|c| c if c.in_menu?}.compact).empty?
    -%>
      <ul class='clearfix'>
        <%= render :partial => "/shared/menu_branch",
                    :collection => children,
                    :locals => {:hide_children => hide_children, :sibling_count => children.size-1} -%>
      </ul>
    <% end -%>
  </li>
<% end -%>

Fix bug that was introduced that threw out page ordering in the menu


//= require normalize-css/normalize.css
//= require highlightjs/styles/default

// Make sure the charset is set appropriately.
@charset "UTF-8"

//
// Fonts
//
@import fonts

// Global Foundation Settings
@import settings

// Import Foundation
@import foundation/scss/foundation

// Load this when using social buttons.
<%= '@import social-buttons' if site.config['social'] %>

// Fix Gist layout issue with Foundation.
div.gist table
  table-layout: initial

Fix Gist layout issue with Foundation.

Fix Gist layout issue with Foundation.


<%= t("ui.recent_followers") %>:

	<%= render :partial => 'conversations/user', :collection => @conversation.recent_followers %>
	<% if @conversation.users.length > 10 %>

    <%= t("ui.followers") %>:

    <% @conversation.users.each do |u| %>
      <%= link_to h(u.login), conversation_messages_path(u.personal_conversation) %>
    <% end %>
	<% end %>

Fix markup and style of header in the list of users in conversation


<% @page_title = "Admin: Categories" %>

Categories

<%# We're small enough we can recompute competitions on demand. alp -%>
<% if RacingAssociation.current.competitions.include?(:mbra_bar) -%>

  <%= form_tag "/admin/categories/recompute_bar" do -%>
      <%= submit_tag "Recompute MBRA BAR", :id => "recompute_bar" %>
    <% end -%>
    <%= form_tag "/admin/categories/recompute_team_bar" do -%>
      <%= submit_tag "Recompute MBRA BAT", :id => "recompute_bar" %>
    <% end -%>

<%- end %>

<%= RacingAssociation.current.short_name %>

    <div class="category category_root association_category_root well" id="category_<%= @category.id %>_row" data-id="<%= @category.id %>">
      <%= render :partial => "category", :collection => @category.children.sort %>

Unknown

      <%= render :partial => "category", :collection => @unknowns.sort %>

Fix bad HTML on admin categories page

Fix bad HTML on admin categories page


<% if field.blank? %>
<%= link_to field.to_s, field.url, target: '_blank' %>
<% end %>

Hide IP fields when it is empty

Hide IP fields when it is empty


<%= form_for [:admin, document], as: :document do |form| %>
  <%= form.errors %>
  <%= render partial: 'standard_fields', locals: { form: form, document: document }%>

  <fieldset class="img">
    <%= form.label :image, "Image" %>
    <%= form.file_field :image %>
    <% if document.image_cache.present? %>
      <%= File.basename(document.image_cache) %> already uploaded
    <% end %>
    <%= form.hidden_field :image_cache %>
    <% if document.persisted? && document.image.present? %>
      <%= image_tag document.image_url %>
    <% end %>
    <%= form.text_field :image_alt_text, label_text: 'Alt text' %>
    <%= form.text_area :image_caption, rows: 2 %>
  </fieldset>

  <%= render partial: 'related_policy_fields', locals: { form: form, document: document } %>
  <%= render partial: 'organisation_fields', locals: { form: form, document: document } %>
  <%= render partial: 'minister_fields', locals: { form: form, document: document } %>
  <%= render partial: 'country_fields', locals: { form: form, document: document } %>

  <fieldset>
    <%= form.text_area :notes_to_editors, "class" => "previewable", help: true %>
  </fieldset>

  <%= render partial: 'first_published_at', locals: { form: form, document: document } %>

  <%= form.save_or_cancel %>
<% end %>

<%= form_for [:admin, document], as: :document do |form| %>
  <%= form.errors %>
  <%= render partial: 'standard_fields', locals: { form: form, document: document }%>

  <fieldset class="img">
    <legend>News Image</legend>
    <%= form.label :image, "Image" %>
    <%= form.file_field :image %>
    <% if document.image_cache.present? %>
      <%= File.basename(document.image_cache) %> already uploaded
    <% end %>
    <%= form.hidden_field :image_cache %>
    <% if document.persisted? && document.image.present? %>
      <%= image_tag document.image_url %>
    <% end %>
    <%= form.text_field :image_alt_text, label_text: 'Alt text' %>
    <%= form.text_area :image_caption, rows: 2 %>
  </fieldset>

  <%= render partial: 'related_policy_fields', locals: { form: form, document: document } %>
  <%= render partial: 'organisation_fields', locals: { form: form, document: document } %>
  <%= render partial: 'minister_fields', locals: { form: form, document: document } %>
  <%= render partial: 'country_fields', locals: { form: form, document: document } %>

  <fieldset>
    <%= form.text_area :notes_to_editors, "class" => "previewable", help: true %>
  </fieldset>

  <%= render partial: 'first_published_at', locals: { form: form, document: document } %>

  <%= form.save_or_cancel %>
<% end %>

Clarify the distinction between fields.

Clarify the distinction between fields.

This is a bit confusing, just because news already has an image. I'm going
to look at migrating these images next.


SSL Service systemtest is failing

PWS platform may want to check the health of the SSL service broker.
pipeline: https://concourse.<%= domain_url %>/teams/main/pipelines/ssl-service:ssl/jobs/<%= environment %>-ssl-sli

Question: avg(last_2h):avg:pws.ssl_sli.status{*} <= 0.4

Add config file for ssl-service monitor

Add config file for ssl-service monitor


<!DOCTYPE html>

  <title>StackOverphil</title>
  <%= stylesheet_link_tag    'application', media: 'all' %>
  <%= javascript_include_tag 'application' %>
  <%= csrf_meta_tags %>

<%= link_to "stackOverphil", root_path %>

<% if logged_in? %>

<%= link_to current_user.username, user_path(current_user.id) %> | <%= link_to "logout", logout_path %> | <%= link_to 'Ask a question', new_question_path %>
<% else %>

<%= link_to "register", register_path %> | <%= link_to "login", login_path %>
<% end %>

| <%= form_tag('/search', method: 'get') do %>
  <%= text_field_tag(:terms) %>
  <%= submit_tag('Search') %>
  <% end %>

<%= yield %>

<!DOCTYPE html>

  <title>StackOverphil</title>
  <%= stylesheet_link_tag    'application', media: 'all' %>
  <%= javascript_include_tag 'application' %>
  <%= csrf_meta_tags %>

        <% if logged_in? %>

<%= link_to current_user.username, user_path(current_user.id) %> | <%= link_to "logout", logout_path %>
        <% else %>

<%= link_to "register", register_path %> | <%= link_to "login", login_path %>
        <% end %>
              | <%= form_tag('/search', method: 'get') do %>
                <%= text_field_tag(:terms) %>
                <%= submit_tag('Search') %>
                <% end %>

        <%= link_to image_tag("stackoverphil-logo.png", :border => 0), root_path %>

            <%= link_to "Ask Question", new_question_path %>

            <%= link_to "Tags", url: "#" %>

       <%= yield %>

© stackoverphil 2015

Add css tags and organize for styling

Add css tags and organize for styling


<!DOCTYPE html>
<html class="<%= @bodyId %>">
  <head>
    <title>Grotto</title>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0">
    <% if @is_mobile %>
        <% if @bodyId == 'home' %>
          <meta name="viewport" content="width=1600" />
        <% else %>
          <meta name="viewport" content="width=1120" />
        <% end %>
    <% end %>
    <script src="//cdn.optimizely.com/js/2520960085.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,400italic,300italic,600italic' rel='stylesheet' type='text/css'>
    <script>
      !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
      n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
      n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
      t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
      document,'script','//connect.facebook.net/en_US/fbevents.js');

      fbq('init', '779098715511025');
      fbq('track', "PageView");
    </script>
    <noscript>
      <img height="1" width="1" style="display:none"
      src="https://www.facebook.com/tr?id=779098715511025&ev=PageView&noscript=1"
      />
    </noscript>
    <script>
      fbq('track', 'CompleteRegistration');
    </script>
    <%= stylesheet_link_tag 'application', :media => 'all', 'data-turbolinks-track' => true %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
    <%= csrf_meta_tags %>
  </head>
  <body id="<%= @bodyId %>">
    <%= yield %>
  </body>

</html>

Build the Layout for Index page

Build the Layout for Index page


<% @posts_to_search = Post.all %>
<% @posts_to_search.each do |post| %>
  <% @words_in_body = post.body.split %>
  <% post.words_that_match = 0 %>
  <% post.save %>
  <% @foo =[] %>
  <% @search_words.each do |searched_word| %>
    <% @words_in_body.each do |word_in_body| %>
      <% if word_in_body == searched_word %>
        <% @foo << word_in_body %>
        <% end %>
    <% end %>
  <% end %>
  <% post.words_that_match = @foo.count %>
  <% post.save %>
<% end %>

<% @top_matches = @posts_to_search.where.not(words_that_match: 0).order(words_that_match: :desc).limit(10) %>
<% @top_matches.each do |matches| %>

<%= matches.title %>

<% end %>

<% @posts_to_search = Post.all %>
<% @posts_to_search.each do |post| %>
  <% @words_in_body = post.body.split %>
  <% post.words_that_match = 0 %>
  <% post.save %>
  <% @same_words =[] %>
  <% @search_words.each do |searched_word| %>
    <% @words_in_body.each do |word_in_body| %>
      <% if word_in_body == searched_word %>
        <% @foo << word_in_body %>
        <% end %>
    <% end %>
  <% end %>
<% end %>

<% if @same_words.empty? %>

Sorry no matches

<% elsif @sample_words.empty? %>
    <% post.words_that_match = @same_words.count %>
    <% post.save %>
    <% @top_matches = @posts_to_search.where.not(words_that_match: 0).order(words_that_match: :desc).limit(10) %>
    <% @top_matches.each do |matches| %>

<%= matches.title %>

    <% end %>
<% end %>

Add logic for no matches.

Add logic for no matches.


Dear <%= @user.name %>,

Thank you for registering on the Geniverse Portal!  Please click the link below to confirm your registration.
There will be additional instructions on the Portal to help you set up and manage your classes.

<%= link_to 'Confirm my account', confirmation_url(@user, :confirmation_token => @user.confirmation_token) %>

If you have any questions about your account or would like more information about using Geniverse with your students,
including Teacher Guides and Lesson Plans, please visit Geniversity.

THANKS!

Team Geniverse

Dear <%= @user.name %>,

Thank you for registering on the Geniverse Portal!  Your username is <%= @user.login %>.

Please click the link below to confirm your registration. There will be additional instructions on the Portal
to help you set up and manage your classes.

<%= link_to 'Confirm my account', confirmation_url(@user, :confirmation_token => @user.confirmation_token) %>

If you have any questions about your account or would like more information about using Geniverse with your students,
including Teacher Guides and Lesson Plans, please visit Geniversity.

THANKS!

Team Geniverse

Update Geniverse theme registration email


class GraphqlController < ApplicationController
  def execute
    variables = ensure_hash(params[:variables])
    query = params[:query]
    operation_name = params[:operationName]
    context = {
      # Query context goes here, for example:
      # current_user: current_user,
    }
    result = <%= schema_name %>.execute(query, variables: variables, context: context, operation_name: operation_name)
    render json: result
  rescue => e
    raise e unless Rails.env.development?
    handle_error_in_development e
  end

  private

  # Handle form data, JSON body, or a blank value
  def ensure_hash(ambiguous_param)
    case ambiguous_param
    when String
      if ambiguous_param.present?
        ensure_hash(JSON.parse(ambiguous_param))
      else
        {}
      end
    when Hash, ActionController::Parameters
      ambiguous_param
    when nil
      {}
    else
      raise ArgumentError, "Unexpected parameter: #{ambiguous_param}"
    end
  end

  def handle_error_in_development(e)
    logger.error e.message
    logger.error e.backtrace.join("\n")

    render json: { error: { message: e.message, backtrace: e.backtrace }, data: {} }, status: 500
  end
end

class GraphqlController < ApplicationController
  # If accessing from outside this domain, nullify the session
  # This allows for outside API access while preventing CSRF attacks,
  # but you'll have to authenticate your user separately
  protect_from_forgery with: :null_session

  def execute
    variables = ensure_hash(params[:variables])
    query = params[:query]
    operation_name = params[:operationName]
    context = {
      # Query context goes here, for example:
      # current_user: current_user,
    }
    result = <%= schema_name %>.execute(query, variables: variables, context: context, operation_name: operation_name)
    render json: result
  rescue => e
    raise e unless Rails.env.development?
    handle_error_in_development e
  end

  private

  # Handle form data, JSON body, or a blank value
  def ensure_hash(ambiguous_param)
    case ambiguous_param
    when String
      if ambiguous_param.present?
        ensure_hash(JSON.parse(ambiguous_param))
      else
        {}
      end
    when Hash, ActionController::Parameters
      ambiguous_param
    when nil
      {}
    else
      raise ArgumentError, "Unexpected parameter: #{ambiguous_param}"
    end
  end

  def handle_error_in_development(e)
    logger.error e.message
    logger.error e.backtrace.join("\n")

    render json: { error: { message: e.message, backtrace: e.backtrace }, data: {} }, status: 500
  end
end

Add nullify session CSRF protection

Add nullify session CSRF protection


mysql-apt-config mysql-apt-config/enable-repo select mysql-<%= /^\d+\.\d+/.match(node['mysql']['deb']['version'])[0] %>
mysql-apt-config mysql-apt-config/select-server select mysql-<%= /^\d+\.\d+/.match(node['mysql']['deb']['version'])[0] %>

Select server in mysql-apt-config as well

This should make all the 5.6 packages available


<% if content_for :before_javascript_libraries %>
  <% Refinery.deprecate "content_for :before_javascript_libraries", :when => '2.2', :replacement => "content_for :javascripts" %>
  <% content_for :javascripts, yield(:before_javascript_libraries) %>
<% end %>

<% if content_for :javascript_libraries %>
  <% Refinery.deprecate "content_for :javascript_libraries", :when => '2.2', :replacement => "content_for :javascripts" %>
  <% content_for :javascripts, yield(:javascript_libraries) %>
<% end %>

<% if content_for :after_javascript_libraries %>
  <% Refinery.deprecate "content_for :after_javascript_libraries", :when => '2.2', :replacement => "content_for :javascripts" %>
  <% content_for :javascripts, yield(:after_javascript_libraries) %>
<% end %>

<%= javascript_include_tag 'application' %>
<%= yield :javascripts -%>
<% if request.env['HTTP_USER_AGENT'] =~ /MSIE/ %>
  <!--[if lt IE 7 ]>
    <%= javascript_include_tag 'dd_belatedpng' %>
    <script> DD_belatedPNG.fix('img, .png_bg'); //fix any <img> or .png_bg background-images </script>
  <![endif]-->
<% end %>

<% if content_for? :before_javascript_libraries %>
  <% Refinery.deprecate "content_for :before_javascript_libraries", :when => '2.2', :replacement => "content_for :javascripts" %>
  <% content_for :javascripts, yield(:before_javascript_libraries) %>
<% end %>

<% if content_for? :javascript_libraries %>
  <% Refinery.deprecate "content_for :javascript_libraries", :when => '2.2', :replacement => "content_for :javascripts" %>
  <% content_for :javascripts, yield(:javascript_libraries) %>
<% end %>

<% if content_for? :after_javascript_libraries %>
  <% Refinery.deprecate "content_for :after_javascript_libraries", :when => '2.2', :replacement => "content_for :javascripts" %>
  <% content_for :javascripts, yield(:after_javascript_libraries) %>
<% end %>

<%= javascript_include_tag 'application' %>
<%= yield :javascripts -%>
<% if request.env['HTTP_USER_AGENT'] =~ /MSIE/ %>
  <!--[if lt IE 7 ]>
    <%= javascript_include_tag 'dd_belatedpng' %>
    <script> DD_belatedPNG.fix('img, .png_bg'); //fix any <img> or .png_bg background-images </script>
  <![endif]-->
<% end %>

Use content_for? (instead of content_for) to check if any content has been captured.


Octopub

Publish data easily, quickly and correctly

Got a dataset you want to publish, but not sure how to do it? Octopub will help you do it,
    quickly, easily and correctly.

Using the power of GitHub, we will provide you with a platform
    to publish your CSV data, as well as automatically creating a webpage for you to point people
    to.

<%= link_to " Sign in with Github".html_safe, '/auth/github', class: "btn btn-primary btn-lg" %>

    <%= link_to "Not got a Github account?", "https://github.com/join" %>

Octopub

Publish data easily, quickly and correctly

Got a dataset you want to publish, but not sure how to do it? Octopub will help you do it,
    quickly, easily and correctly.

Using the power of GitHub, we will provide you with a platform
    to publish your CSV data, as well as automatically creating a webpage for you to point people
    to.

  <% unless current_user %>

<%= link_to " Sign in with Github".html_safe, '/auth/github', class: "btn btn-primary btn-lg" %>

    <%= link_to "Not got a Github account?", "https://github.com/join" %>
  <% end %>

Hide login link if signed in

Hide login link if signed in


Thanks, you subscribed to a plan for <%= number_to_currency((@amount.to_i/ 100), :unit => "€")%> a month!

<%= link_to "See my instances", instances_path %>

Create site to show successful payment

Create site to show successful payment


  <% if @patient %>
    <%= render(partial: 'card', locals: { patient: @patient }) unless @patient.new_record? %>
  <% else %>

        <%= form_tag patients_path, method: 'get', enforce_utf8: false do %>
          <%= search_field_tag :search, params[:search], size: 23, results: 5,
            autocorrect: 'off', placeholder: t('.search_patients') %>
        <% end %>

  <% end %>

  <% if @recent %>

<%= t('.recent_patients') %>

        <%= render partial: 'shared/recent_patients',
          collection: @recent, as: :patient, cached: true %>

  <% end %>

  <% if @patient %>
    <%= render(partial: 'card', locals: { patient: @patient }) unless @patient.new_record? %>
  <% else %>

        <%= form_tag patients_path, method: 'get', enforce_utf8: false do %>
          <%= search_field_tag :search, params[:search], size: 23, results: 5,
            autosave: "search_#{current_user.username}", autocorrect: 'off', placeholder: t('.search_patients') %>
        <% end %>

  <% end %>

  <% if @recent %>

<%= t('.recent_patients') %>

        <%= render partial: 'shared/recent_patients',
          collection: @recent, as: :patient, cached: true %>

  <% end %>

Add functionality to the recent searches button

In Safari:

    <input type="search" results=5 autosave="unique" name="search">


  <% @images.each do |image| -%>
		<li id="image_<%= image.id %>" <%= "class='row-end'" if (@images.index(image)+1) % 4 == 0 %>>
			<%= image_fu image, :grid, :title => image.title %>

		    <%= link_to image_tag('refinery/icons/application_edit.png'), edit_admin_image_path(image),
		                          	:title => 'Edit this image' %>
		    <%= link_to image_tag('refinery/icons/delete.png'), admin_image_path(image),
		                           	:confirm => "Are you sure you want to delete #{image.title}?",
		                           	:class => "cancel", :method => :delete,
		                           	:title => "Remove this image forever" %>

  <% end -%>

  <% @images.each do |image| -%>
		<li id="image_<%= image.id %>" <%= "class='row-end'" if (@images.index(image)+1) % 4 == 0 %>>
			<%= image_fu image, :grid, :title => image.title %>

				<%= link_to image_tag('refinery/icons/eye.png'), image.public_filename,
                              :target => "_blank", :title => "Click to view '#{image.title}'
Opens in a new window" %>
		    <%= link_to image_tag('refinery/icons/application_edit.png'), edit_admin_image_path(image),
		                          	:title => 'Edit this image' %>
		    <%= link_to image_tag('refinery/icons/delete.png'), admin_image_path(image),
		                           	:confirm => "Are you sure you want to delete #{image.title}?",
		                           	:class => "cancel", :method => :delete,
		                           	:title => "Remove this image forever" %>

  <% end -%>

Add a view button to see fullsize image.


[HKEY_THIS_MACHINE\Services\lsass\Parameters]
"SpaceReplacement"="-"

[HKEY_THIS_MACHINE\Services\lsass\Parameters\Providers\ActiveDirectory]
"HomeDirTemplate"="%H/%D/%U"
"SpaceReplacement"="-"
"AssumeDefaultDomain"=dword:00000001
"NssGroupMembersQueryCacheOnly"=dword:00000001
"RequireMembershipOf"=sza:"<%= @ad_membership_required.join(',') %>"
"LoginShellTemplate"="/bin/bash"

[HKEY_THIS_MACHINE\Services\lsass\Parameters\Providers\ActiveDirectory]
"LoginShellTemplate"="/bin/bash"

Set bash as the default shell for likewise


<% flash.each do |message_type, message| %>
    <div class="alert alert-<%= message_type %>"><%= message %>

<% end %>

<% flash.each do |message_type, message| %>
    <div class="alert alert-<%= message_type %>">
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
      <%= message %>

<% end %>

Allow error messages to be dismissed

Allow error messages to be dismissed


<%= render "govuk_publishing_components/components/tabs", {
  panel_border: false,
  tabs: [
    {
      id: ('more-information' if transaction.more_information.present?),
      label: t('formats.transaction.more_information'),
      content: render("govuk_publishing_components/components/govspeak", {
                content: transaction.more_information.try(:html_safe)
              })
    },
    {
      id: ('what-you-need-to-know' if transaction.what_you_need_to_know.present?),
      label: t('formats.transaction.what_you_need_to_know'),
      content: render("govuk_publishing_components/components/govspeak", {
                content: transaction.what_you_need_to_know.try(:html_safe)
              })
    },
    {
     id: ('other-ways-to-apply' if transaction.other_ways_to_apply.present?),
     label: t('formats.transaction.other_ways_to_apply'),
     content: render("govuk_publishing_components/components/govspeak", {
               content: transaction.other_ways_to_apply.try(:html_safe)
             })
    }
  ].reject {|item| item[:id].blank?}
} %>

<%= render "govuk_publishing_components/components/tabs", {
  panel_border: false,
  tabs: [
    {
      id: ('more-information' if transaction.more_information.present?),
      label: t('formats.transaction.more_information'),
      content: render("govuk_publishing_components/components/govspeak", {}) do
                 sanitize(transaction.more_information)
               end
    },
    {
      id: ('what-you-need-to-know' if transaction.what_you_need_to_know.present?),
      label: t('formats.transaction.what_you_need_to_know'),
      content: render("govuk_publishing_components/components/govspeak", {}) do
                 sanitize(transaction.what_you_need_to_know)
               end
    },
    {
      id: ('other-ways-to-apply' if transaction.other_ways_to_apply.present?),
      label: t('formats.transaction.other_ways_to_apply'),
      content: render("govuk_publishing_components/components/govspeak", {}) do
                 sanitize(transaction.other_ways_to_apply)
               end
    }
  ].reject {|item| item[:id].blank?}
} %>

Fix govspeak unsanitized content error

Fix govspeak unsanitized content error

Resolves:
https://sentry.io/organizations/govuk/issues/2004100825/?project=202225&query=is%3Aunresolved

Related to:
https://github.com/alphagov/govuk_publishing_components/pull/1632/


<%= f.input attr, as: :file, wrapper_html: wrapper_opts, input_html: input_opts } %>

<%= f.input attr, as: :file, wrapper_html: wrapper_opts, input_html: input_opts %>

Fix invalid syntax in koi partial

Fix invalid syntax in koi partial

Identified by brakeman


#!/bin/bash
#
# Command to check how long ago a cron job successfully ran, and potentially
# provide helpful context for the user as to why.
#
# Utilizes the check_file_age nagios plugin.
set -u

function get_context {
  # Scans syslog for a given logger tag where we might have additional
  # information about why a cron job failed.
  echo "Some potentially helpful context from /var/log/messages: (may be empty)"
  grep "${1}: " /var/log/messages | tail | head -c 1024
}

name=$1
threshold_s=$2

<%= @check_file_age_path %> "/nail/run/success_wrapper/${name}" -w ${threshold_s} -c ${threshold_s} >/dev/null
return_code=$?

last_success=$(stat -c %z "/nail/run/success_wrapper/${name}")

if [ $return_code -ne 0 ]; then
  echo "${name} hasn't completed successfully since ${last_success}"
  get_context ${name}
else
  echo "${name} last completed successfully ${last_success}"
fi

exit $return_code

#!/bin/bash
#
# Command to check how long ago a cron job successfully ran, and potentially
# provide helpful context for the user as to why.
#
# Utilizes the check_file_age nagios plugin.
set -u

function get_context {
  # Scans syslog for a given logger tag where we might have additional
  # information about why a cron job failed.
  echo "Some potentially helpful context from /var/log/messages: (may be empty)"
  grep "${1}: " /var/log/messages | tail | head -c 1024
}

function uptime_less_than {
  local threshold=$1
  local uptime_seconds="$(cat /proc/uptime | grep -o '^[0-9]\+')"
  [[ $uptime_seconds -lt $threshold ]]
}

name=$1
threshold_s=$2

# If the server hasn't been up for long enough for the cron job to run in the
# first place, we don't need to alert people. This suppresses alerts that come
# from servers that are brought back up after reboots, downtime, or from being
# recently launched/provisioned.
if uptime_less_than $threshold_s; then
  echo "OK: Our uptime is less than $threshold_s seconds:"
  uptime
  echo "Assuming things will be OK once the script has had a chance to run."
  exit 0
fi

<%= @check_file_age_path %> "/nail/run/success_wrapper/${name}" -w ${threshold_s} -c ${threshold_s} >/dev/null
return_code=$?

last_success=$(stat -c %z "/nail/run/success_wrapper/${name}")

if [ $return_code -ne 0 ]; then
  echo "${name} hasn't completed successfully since ${last_success}"
  get_context ${name}
else
  echo "${name} last completed successfully ${last_success}"
fi

exit $return_code

Make the staleness_check wrapper 'uptime-aware'


  location <%= location %> {
<% if @location_cfg_prepend -%><% location_cfg_prepend.each do |key,value| -%>
    <%= key %> <%= value %>;
<% end -%><% end -%>
    root  <%= www_root %>;
    <% if has_variable?("try_files") then %>
    try_files <% try_files.each do |try| -%> <%= try %> <% end -%>;
    <% end %>
    index <% index_files.each do |i| %> <%= i %> <% end %>;
<% if @location_cfg_append -%><% location_cfg_append.each do |key,value| -%>
    <%= key %> <%= value %>;
<% end -%><% end -%>
  }

  location <%= location %> {
<% if @location_cfg_prepend -%><% location_cfg_prepend.each do |key,value| -%>
    <%= key %> <%= value %>;
<% end -%><% end -%>
    root  <%= www_root %>;
    <% if @try_files then %>
    try_files <% @try_files.each do |try| -%> <%= try %> <% end -%>;
    <% end %>
    index <% index_files.each do |i| %> <%= i %> <% end %>;
<% if @location_cfg_append -%><% location_cfg_append.each do |key,value| -%>
    <%= key %> <%= value %>;
<% end -%><% end -%>
  }

Fix in nginx puppet module

Fix in nginx puppet module


(function(global) {
  "use strict";

  // Load Google Analytics libraries
  GOVUK.StaticAnalytics.load();

  // Use document.domain in dev, preview and staging so that tracking works
  // Otherwise explicitly set the domain as www.gov.uk (and not gov.uk).
  var cookieDomain = (document.domain == 'www.gov.uk') ? '.www.gov.uk' : document.domain;

  var universalId = 'UA-26179049-1';

  // Configure profiles, setup custom vars, track initial pageview
  var analytics = new GOVUK.StaticAnalytics({
    universalId: universalId,
    cookieDomain: cookieDomain,
    allowLinker: true,
  });

  // Make interface public for virtual pageviews and events
  GOVUK.analytics = analytics;

  if (global.ga) {
    var ga = global.ga;
    ga('require', 'linker');
    ga('linker:autoLink', ['planforbritain.gov.uk']);
  }
})(window);

(function(global) {
  "use strict";

  // Load Google Analytics libraries
  GOVUK.StaticAnalytics.load();

  // Use document.domain in dev, preview and staging so that tracking works
  // Otherwise explicitly set the domain as www.gov.uk (and not gov.uk).
  var cookieDomain = (document.domain == 'www.gov.uk') ? '.www.gov.uk' : document.domain;

  var universalId = 'UA-26179049-1';

  // Configure profiles, setup custom vars, track initial pageview
  var analytics = new GOVUK.StaticAnalytics({
    universalId: universalId,
    cookieDomain: cookieDomain,
    allowLinker: true,
    // This is served by Fastly in production, and returns an empty 200 response
    govukTrackerGifUrl: '<%= asset_path "/static/a" %>',
  });

  // Make interface public for virtual pageviews and events
  GOVUK.analytics = analytics;

  if (global.ga) {
    var ga = global.ga;
    ga('require', 'linker');
    ga('linker:autoLink', ['planforbritain.gov.uk']);
  }
})(window);

Enable GOV.UK analytics tracker configuration

The configuration variable is misnamed and will be changed once this is
proven to work. The endpoint is now served entirely by Fastly, and
returns an empty 200 response. We only call the endpoint using
`$.get()` and ignore the response so its Content-Type doesn’t matter.


<%= form_for [:admin, @document_series.organisation, @document_series] do |form| %>
  <%= form.errors %>

  <%= form.text_field :name %>
  <%= form.text_field :summary %>
  <%= form.text_area :description, "class" => "previewable" %>

Warning: changes to document series appear instantly on the live site.

  <%= form.save_or_cancel cancel: admin_organisation_path(@document_series.organisation) %>
<% end %>

<%= form_for [:admin, @document_series.organisation, @document_series] do |form| %>
  <%= form.errors %>

  <%= form.text_field :name %>
  <%= form.text_area :summary, rows: 2, class: 'js-summary-length-counting', data: { 'count-message-threshold' => 140, 'count-message-selector' => '.summary-length-info' } %>

Summary text should be 140 characters or fewer.

  <%= form.text_area :description, "class" => "previewable" %>

Warning: changes to document series appear instantly on the live site.

  <%= form.save_or_cancel cancel: admin_organisation_path(@document_series.organisation) %>
<% end %>

Add JS length warning to document series summary field in admin


<%= content_tag_for(:article, news_article) do %>
  <% if display == "expanded" %>

<%= link_to image_tag("evil_placeholder.png"), public_document_path(news_article) %>

  <% end %>

<%= link_to news_article.title, public_document_path(news_article), class: "title" %>

    <% if display != "compact" %>

        <%= news_article.summary %>

    <% end %>

      posted <%= render_datetime_microformat(news_article, :published_at) do %>
          <%= time_ago_in_words(news_article.published_at) %> ago
        <% end %>

      <% unless news_article.policy_areas.length.zero? %>
        <%= news_article.policy_areas.map { |pa| link_to pa.name, policy_area_path(pa) }.to_sentence.html_safe %>
      <% end %>

<% end %>

<%= content_tag_for(:article, news_article) do %>
  <% if display == "expanded" %>

<%= link_to image_tag("evil_placeholder.png"), public_document_path(news_article) %>

  <% end %>

<%= link_to news_article.title, public_document_path(news_article), class: "title" %>

    <% if display != "compact" %>

        <%= news_article.summary %>

    <% end %>

      posted <%= render_datetime_microformat(news_article, :published_at) do %>
          <%= time_ago_in_words(news_article.published_at) %> ago
        <% end %>

      <% unless news_article.policy_areas.length.zero? %>
        <%= news_article.policy_areas.uniq.map { |pa| link_to pa.name, policy_area_path(pa) }.to_sentence.html_safe %>
      <% end %>

<% end %>

Fix bug with Chris's stupidity.

Fix bug with Chris's stupidity.

I wrote some tests, made the fixes, took out one of the fixes and then
committed 2b820135c975872a188dea07847b5274d62b1471. Like a fool.


<!DOCTYPE html>

  <title>CriticL</title>
  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>

        criticL

      <% if session[:user_id] %>

<%= link_to "Log Out", logout_path, method: :delete %>

Hello user!

      <% else %>

<%= link_to "Log In", login_path%>

<%= link_to "Register", new_user_path%>

      <% end %>

  <%= yield %>

    Copyright

<!DOCTYPE html>

  <title>CriticL</title>
  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>

        criticL

      <% if logged_in? %>

<%= link_to "Log Out", logout_path, method: :delete %>

<%= link_to "#{current_user.username}", current_user %>

      <% else %>

<%= link_to "Log In", login_path%>

<%= link_to "Register", new_user_path%>

      <% end %>

  <%= yield %>

    Copyright

Add link to user profile in nav bar

Add link to user profile in nav bar


<%
  applications = admin_user.applications

  if params[:application]
    applications.reject! { |a| a.parameterize != params[:application] }
  end
%>

<%= Typus::I18n.t("Dashboard") %>

  <% if applications.any? %>
    <% applications.each do |app| %>

            <%= Typus::I18n.t(app) %>

        <% admin_user.application(app).map(&:constantize).each do |klass| %>
          <% unless klass.typus_options_for(:hide_from_dashboard) %>

                <%= link_to klass.model_name.human.pluralize, :controller => "/admin/#{klass.to_resource}" %>

          <% end %>
        <% end %>

    <% end %>
  <% else %>

      <%= Typus::I18n.t("No applications detected.") %>

  <% end %>

<%
  applications = admin_user.applications

  if params[:application]
    applications.reject! { |a| a.parameterize != params[:application] }
  end
%>

<%= Typus::I18n.t("Dashboard") %>

  <% if applications.any? %>
    <% applications.each do |app| %>

            <%= Typus::I18n.t(app) %>

        <% admin_user.application(app).map(&:constantize).each do |klass| %>
          <% unless klass.typus_options_for(:hide_from_dashboard) %>

                <%= link_to klass.model_name.human(count: 2), :controller => "/admin/#{klass.to_resource}" %>

          <% end %>
        <% end %>

    <% end %>
  <% else %>

      <%= Typus::I18n.t("No applications detected.") %>

  <% end %>

Fix translations for model pluralization (some more spots still todo).


<script>
'use strict';
$(() => {

  cd.showStartingInfoDialog = () => {
    if (cd.kata.index === 1 && cd.env.STARTING_INFO_DIALOG !== 'off') {
      cd.trafficLightsButton().click();
    }
  };

});
</script>

<script>
'use strict';
$(() => {

  cd.showStartingInfoDialog = () => {
    if (cd.kata.index === 1 && !turnItOff()) {
      cd.trafficLightsButton().click();
    }
  };

  const turnItOff = () => {
    return cd.env.STARTING_INFO_DIALOG === 'off' ||
      cd.kata.manifest().starting_info_dialog === 'off';
  };

});
</script>

Allow manifest() option to turn off starting-info-dialog.


<%= notice %>

<%= link_to 'Edit', edit_list_path(@list) %> |
<%= link_to 'Back', lists_path %>

<%= "#{@list.type}: #{@list.title}" %>

 Recurring Items

<% @list.recurring_items.each do |item| %>

    Body: <%= "#{item.body}" %>
    Value: <%= "#{item.value}" %>
    Specific Day Of: <%= "#{item.specific_day_of}" %>
    Interval: <%= "#{item.interval}" %>

<% end %>

 Items

<% @list.items.each do |item| %>

    Body: <%= "#{item.body}" %>
    Value: <%= "#{item.value}" %>

<% end %>
<%= link_to 'Edit', edit_list_path(@list) %> |
<%= link_to 'Back', lists_path %>

Add rudimentary show view for lists

Add rudimentary show view for lists


<% content_for :title do %><%= local_assigns[:title] %> - GOV.UK<% end %>

<% content_for :html_classes do %>error error-40X<% end %>

<% content_for :body_classes do %>mainstream error<% end %>

<% content_for :content do %>

      <hgroup>

<%= local_assigns[:heading] %>

      </hgroup>

         <%= raw local_assigns[:intro] %>

Search GOV.UK

         <form class="search-box" action="/search" method="get" role="search">

           	Try searching
           	<input type="text" id="main_autocomplete2" value="" placeholder="Enter search text">
           	<input type="submit" value="Search" class="button">

         </form>

Explore GOV.UK

Go to the GOV.UK home page

<% end %>

<%= render partial: 'base' %>

Fix URL to GOV.UK homepage

Fix URL to GOV.UK homepage


<% if current_user %>
  <%= simple_form_for [@post, Storytime::Comment.new] do |f| %>
    <%= f.input :content %>
    <%= f.button :submit %>
  <% end %>
<% else %>
  <div class="alert alert-info" role="alert">
    <%= link_to "Sign in", main_app.new_user_session_url %> to comment.
  </div>
<% end %>

<% if current_user %>
  <%= simple_form_for [@post, Storytime::Comment.new] do |f| %>
    <%= f.input :content %>
    <%= f.button :submit %>
  <% end %>
<% else %>
  <div class="alert alert-info" role="alert">
    <%= link_to "Sign in", Storytime.login_path %> to comment.
  </div>
<% end %>

Change out new_user_session_url for login_path


#export SCALA_HOME=/opt/scala-2.9.3

<%# SPARK_MASTER_OPTS="-Dspark.deploy.spreadOut=false" %>
SPARK_JAVA_OPTS+=" -Dspark.local.dir=/raid/spark-local"
#SPARK_JAVA_OPTS+="-XX:MaxPermSize=512m"
#SPARK_JAVA_OPTS+="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9012 -Dcom.sun.management.jmxremote.local.only=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
#export SPARK_JAVA_OPTS

export SPARK_MEM=<%= @worker_mem %>
export SPARK_DAEMON_MEMORY=1g
export SPARK_LIBRARY_PATH="/usr/lib/hadoop/lib/native:$SPARK_LIBRARY_PATH"
export SPARK_CLASSPATH="/usr/lib/tachyon/target/tachyon-0.4.1-jar-with-dependencies.jar:$SPARK_CLASSPATH"

# Bind Spark's web UIs to this machine's public EC2 hostname:
#export SPARK_PUBLIC_DNS=`wget -q -O - http://instance-data.ec2.internal/latest/meta-data/public-hostname`

# Set a high ulimit for large shuffles
ulimit -n 1000000

#export SCALA_HOME=/opt/scala-2.9.3

<%# SPARK_MASTER_OPTS="-Dspark.deploy.spreadOut=false" %>
SPARK_JAVA_OPTS+=" -Dspark.local.dir=/raid/spark-local"
<%# SPARK_JAVA_OPTS+=" -Dspark.speculation=true" %>
#SPARK_JAVA_OPTS+="-XX:MaxPermSize=512m"
#SPARK_JAVA_OPTS+="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9012 -Dcom.sun.management.jmxremote.local.only=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
#export SPARK_JAVA_OPTS

export SPARK_MEM=<%= @worker_mem %>
export SPARK_DAEMON_MEMORY=1g
export SPARK_LIBRARY_PATH="/usr/lib/hadoop/lib/native:$SPARK_LIBRARY_PATH"
export SPARK_CLASSPATH="/usr/lib/tachyon/target/tachyon-0.4.1-jar-with-dependencies.jar:$SPARK_CLASSPATH"

# Bind Spark's web UIs to this machine's public EC2 hostname:
#export SPARK_PUBLIC_DNS=`wget -q -O - http://instance-data.ec2.internal/latest/meta-data/public-hostname`

# Set a high ulimit for large shuffles
ulimit -n 1000000

Add speculation option commented out.

Add speculation option commented out.


<form method="GET" action="<%= url %>" class="search_form">
  <input id="search" name="search" size="22" type="search" value="<%= params[:search] %>" />
  <input id="dialog" name="dialog" type="hidden" value="<%= from_dialog? %>" />
  <%= submit_tag t('admin.search'), :name => "" %>
</form>

<form method="GET" action="<%= url %>" class="search_form">
  <input id="search" name="search" size="22" type="search" value="<%= params[:search] %>" />
  <input id="dialog" name="dialog" type="hidden" value="<%= from_dialog? %>" />
  <%= submit_tag t('admin.search'), :name => nil %>
</form>

Make sure the required alt attribute is created.


(function() {
  var $el = $('#element_<%= @element.id %>');
  var $errors = $('#element_<%= @element.id %>_errors');
  $('> .element-content .content_editor, > .element-content .ingredient_editor', $el).removeClass('validation_failed');

<%- if @element_validated -%>

  $errors.hide();
  $el.trigger('SaveElement.Alchemy', {previewText: '<%= j sanitize(@element.preview_text) %>'});
  Alchemy.growl('<%= Alchemy.t(:element_saved) %>');
  Alchemy.PreviewWindow.refresh(function() {
    Alchemy.ElementEditors.focusElementPreview(<%= @element.id %>);
  });

<%- else -%>

  Alchemy.growl('<%= j @notice %>', 'warn');
  $errors.html('<%= j @error_message %>

<%== j @error_messages.join("

") %>

');
  $errors.show();
  $('<%= @element.contents_with_errors.map { |content| "#" + content.dom_id }.join(", ") %>').addClass('validation_failed');
  $('<%== @element.ingredients_with_errors.map { |ingredient| "[data-ingredient-id=\"#{ingredient.id}\"]" }.join(", ") %>').addClass('validation_failed');
  Alchemy.Buttons.enable($el);

<%- end -%>
})();

(function() {
  var $el = $('#element_<%= @element.id %>');
  var $errors = $('#element_<%= @element.id %>_errors');
  $('> .element-content .content_editor, > .element-content .ingredient-editor', $el).removeClass('validation_failed');

<%- if @element_validated -%>

  $errors.hide();
  $el.trigger('SaveElement.Alchemy', {previewText: '<%= j sanitize(@element.preview_text) %>'});
  Alchemy.growl('<%= Alchemy.t(:element_saved) %>');
  Alchemy.PreviewWindow.refresh(function() {
    Alchemy.ElementEditors.focusElementPreview(<%= @element.id %>);
  });

<%- else -%>

  Alchemy.growl('<%= j @notice %>', 'warn');
  $errors.html('<%= j @error_message %>

<%== j @error_messages.join("

") %>

');
  $errors.show();
  $('<%= @element.contents_with_errors.map { |content| "#" + content.dom_id }.join(", ") %>').addClass('validation_failed');
  $('<%== @element.ingredients_with_errors.map { |ingredient| "[data-ingredient-id=\"#{ingredient.id}\"]" }.join(", ") %>').addClass('validation_failed');
  Alchemy.Buttons.enable($el);

<%- end -%>
})();

Fix ingredient editor selector in element update callback

The ingredient editor class name has a hyphen. Fixes a bug
where an element with failed ingredient validation did not
updated the UI accordingly after an element updated.


Recently Invalidated Feedback

      Post
      Feedback Type
      Feedback Creator
      Invalidated At
      Invalidated By

    <% @feedbacks.each do |f| %>

        <a href="/post/<%= f.post_id %>"><%= f.title %>
        <%= f.feedback_type %>

          <% if f.user_name %>
            <a href="/admin/user_feedback?user_name=<%= f.user_name %>"><%= f.user_name %>
          <% elsif f.user.try(:email) %>
            (From Review)
          <% end %>

        <%= time_ago_in_words(f.invalidated_at) + " ago" if f.invalidated_at %>
        <% user = @users[f.invalidated_by] if f.invalidated_by %>
        <%= user.username || user.email if user %>

    <% end %>

  <%= will_paginate @feedbacks, renderer: BootstrapPagination::Rails %>

Recently Invalidated Feedback

      Post
      Feedback Type
      Feedback Creator
      Invalidated At
      Invalidated By

    <% @feedbacks.each do |f| %>

        <a href="/post/<%= f.post_id %>"><%= f.title %>
        <%= f.feedback_type %>

          <% if f.user_id %>
            <a href="/admin/user_feedback?user_name=<%= f.user_name %>"><%= f.user_id %>
          <% elsif f.user.try(:email) %>
            (From Review)
          <% elsif f.chat_user_id %>
            (Chat: <%= f.chat_host %>/<%= f.chat_user_id %>)
          <% end %>

        <%= time_ago_in_words(f.invalidated_at) + " ago" if f.invalidated_at %>
        <% user = @users[f.invalidated_by] if f.invalidated_by %>
        <%= user.username || user.email if user %>

    <% end %>

  <%= will_paginate @feedbacks, renderer: BootstrapPagination::Rails %>

Update to new feedback page format

Update to new feedback page format


Hallo <%= @participant.first_name %>,

Deine Anmeldung für den <%= "#{@performance.contest.round.name} #{@performance.contest.year}" %> in der Kategorie <%= @performance.category.name %> wurde erfolgreich gespeichert.

Bis zum Anmeldeschluss am <%= l(@performance.contest.last_signup_date, format: :long) %> kannst du daran noch Änderungen vornehmen. Dazu brauchst du den folgenden Änderungscode:

<%= @performance.tracing_code %>

Bitte gib diesen Code nur an Personen weiter, die diese Anmeldung bearbeiten dürfen, wie zum Beispiel deine Spielpartner. Deine Programmänderungen kannst du mit dem obenstehenden Code auf folgender Seite anmelden:

<%= link_to nil, signup_search_url %>

Viel Erfolg bei der Teilnahme am <%= "#{@performance.contest.round.name} #{@performance.contest.year}" %> wünscht Dir

Dein Jumu-Orgteam

Hallo <%= @participant.first_name %>,

Deine Anmeldung für den <%= "#{@performance.contest.round.name} #{@performance.contest.year}" %> in der Kategorie <%= @performance.category.name %> wurde erfolgreich gespeichert.

Bis zum Anmeldeschluss am <%= l(@performance.contest.last_signup_date, format: :long) %> kannst du daran noch Änderungen vornehmen. Dazu brauchst du den folgenden Änderungscode:

<%= @performance.tracing_code %>

Bitte gib diesen Code nur an Personen weiter, die diese Anmeldung bearbeiten dürfen, wie zum Beispiel deine Spielpartner. Deine Programmänderungen kannst du mit dem obenstehenden Code auf folgender Seite anmelden:

<%= link_to nil, signup_search_url %>

Viel Erfolg bei der Teilnahme am <%= "#{@performance.contest.round.name} #{@performance.contest.year}" %> wünscht dir

Dein Jumu-Orgteam

Fix spelling in signup confirmation mail


<% content_for(:page_title, '503') %>

  <%= @custom_header || 'Temporarily unavailable' %>

<%= @custom_body || 'Transition is unavailable due to scheduled maintenance' %>

<% content_for(:page_title, '503') %>

  <%= @custom_header || 'Temporarily unavailable' %>

<% if @custom_body %>

<%= @custom_body %>

<% else %>

Transition is unavailable due to scheduled maintenance

<a href="mailto:<%= Rails.configuration.support_email %>">Contact us for more information

<% end %>

Add contact details to the 503 maintenance page


<!DOCTYPE html>

  <title><%= t 'application_title' %></title>
  <%= csrf_meta_tags %>

  <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>

    <a class="navbar-brand pull-right" href="<%= root_path %>">
      <%= image_tag 'calendar.png', width: 30, height: 30, class: 'align-top' %>
      <%= t('application_title') %>

        <%= t('links.nav.home') %> (current)

    <%= link_to t('links.sign_out'), destroy_user_session_path, class: 'btn btn-outline-danger pull-left' %>

  <%= yield %>

<!DOCTYPE html>

  <title><%= t 'application_title' %></title>
  <%= csrf_meta_tags %>

  <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>

    <a class="navbar-brand pull-right" href="<%= root_path %>">
      <%= image_tag 'calendar.png', width: 30, height: 30, class: 'align-top' %>
      <%= t('application_title') %>

        <%= t('links.nav.home') %> (current)

    <%= link_to t('links.sign_out'), destroy_user_session_path, method: 'delete', class: 'btn btn-outline-danger pull-left' %>

  <%= yield %>

Add delete method to sign out link

Add delete method to sign out link


Items In Stock

<%= link_to "CATEGORIES", categories_path %>

  <% @items.each do |item| %>

      <%= link_to item.name, item_path(item) %>
      <% if !item.image.blank? %>
          <img src="<%= item.image %>" height="100" width="100">
        <% else %>

        <%end%>

  <% end %>

Items In Stock

<%= link_to "CATEGORIES", categories_path %>

  <% @items.each do |item| %>

      <%= link_to item.name, item_path(item) %>
      <% if !item.image.blank? %>
          <img src="<%= item.image %>" height="100" width="100">
        <% else %>

        <%end%>

      <%= link_to "Add To Cart", @item, method: :add_to_cart %>

  <% end %>

Add placeholder link, does not currently work


Companies House ETL

Port of Companies House ETL

{
  "bot_id": "companies_house_<%= @number %>",
  "title": "Companies House ETL",
  "description": "Port of Companies House ETL",
  "language": "ruby",
  "data_type": "address",
  "company_fields": {
    "name": "company"
  },
  "files": [
    "companies_house.rb"
    "scraper.rb"
  ],
  "frequency": "monthly",
  "publisher": {
    "name": "Companies House",
    "url": "http://download.companieshouse.gov.uk/",
    "terms": "Open Government License",
    "terms_url": "http://download.companieshouse.gov.uk/en_output.html"
  }
}

Add main script to manifest

Add main script to manifest


log4j.category.com.webtrends.streaming = ERROR, ERR

log4j.rootLogger=INFO, ROOT

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n

log4j.appender.ERR=org.apache.log4j.RollingFileAppender
log4j.appender.ERR.File=<%= @home_dir %>/logs/service-control.err.log
log4j.appender.ERR.MaxBackupIndex=3
log4j.appender.ERR.MaxFileSize=200MB
log4j.appender.ERR.layout=org.apache.log4j.PatternLayout
log4j.appender.ERR.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

log4j.appender.ROOT=org.apache.log4j.RollingFileAppender
log4j.appender.ROOT.File=<%= @home_dir %>/logs/service-control.log
log4j.appender.ROOT.MaxBackupIndex=3
log4j.appender.ROOT.MaxFileSize=200MB
log4j.appender.ROOT.layout=org.apache.log4j.PatternLayout
log4j.appender.ROOT.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

log4j.category.com.webtrends.streaming = ERROR, ERR

log4j.rootLogger=INFO, ROOT

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n

log4j.appender.ERR=org.apache.log4j.RollingFileAppender
log4j.appender.ERR.File=/var/log/storm/logs/service-control.err.log
log4j.appender.ERR.MaxBackupIndex=3
log4j.appender.ERR.MaxFileSize=200MB
log4j.appender.ERR.layout=org.apache.log4j.PatternLayout
log4j.appender.ERR.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

log4j.appender.ROOT=org.apache.log4j.RollingFileAppender
log4j.appender.ROOT.File=/var/log/storm/logs/service-control.log
log4j.appender.ROOT.MaxBackupIndex=3
log4j.appender.ROOT.MaxFileSize=200MB
log4j.appender.ROOT.layout=org.apache.log4j.PatternLayout
log4j.appender.ROOT.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

Modify an additional log4j file in the wt_storm cookbook to use /var/log/storm

Former-commit-id: c4d7ca27b94e0cf50ef3fe71436ac2992247274c [formerly 97def8911497f940fc1b657d1df0995c33241cdf] [formerly bbebe4067fd18a751fac48de26a7f7c1b69c79a8 [formerly c78cc001e003ae0e30c4835aa705c0a718a6622f]]
Former-commit-id: 9685744640e5fbaf70d6a4709b07e8b36d6602bd [formerly 0f3e2f647ffad03ba8df1fcaa941e17b47cfaf0f]
Former-commit-id: 8b81a9def1cb6e8061a43031c3c2ec78608e7ad1


Stats for user <%=@user.username%>

Hi <%=@user.first_name%>, here are your stats!

<%= @user.rounds.each do |round| %>
  Deck played: <%= round.cards.first.deck.name %> on: <%= round.created_at %>
  Number of first-time correct guesses: <%= round.guesses.where(is_correct:true).where.not(card_id: round.guesses.where(is_correct:false).pluck(:card_id)) %>
  Number of total guesses: <%= round.guesses.size %>
  Deck size: <%= round.cards.first.deck.cards.size %>
<% end %>

Add first draft of a user's profile view, along with stats logic


Add new post

	<form>
		<textarea class="form-control" rows="6"></textarea>

	  	<button type="submit" class="btn btn-success">Submit</button>
	</form>

Add new post

	<form action="/new" method="POST">
		<textarea class="form-control" rows="6"></textarea>

	  	<button type="submit" class="btn btn-success">Submit</button>
	</form>

Add action? method attributes to form

Add action? method attributes to form


---
layout: default
title: Categories
---

Not just Macs

There are currently <%= @site.categories.count %> categories on the site.

<% @site.categories.keys.sort.each do |slug| %>

    <a href="/categories/<%= slug %>/" title="View all the '<%= @site.categories[slug].name %>' interviews."><%= @site.categories[slug].name %>

    <%= @site.categories[slug].posts.count %> interview<% if @site.categories[slug].posts.count != 1 %>s<% end %>.

<% end %>

---
layout: default
title: Categories
---

Not just Macs

There are currently <%= @site.categories.count %> categories on the site.

<% @site.categories.keys.sort.each do |slug| %>

    <a href="/categories/<%= slug %>/" title="View all the <%= @site.categories[slug].name %> interviews."><%= @site.categories[slug].name %>

    <%= @site.categories[slug].posts.count %> interview<% if @site.categories[slug].posts.count != 1 %>s<% end %>.

<% end %>

Remove the quotes around the category name in the link.


<%
# XFCE 4 Terminal Template
# Chris Kempson (http://chriskempson.com)

%>[Configuration]
ColorCursor=<%= base["05"]["dhex"] %>
ColorForeground=#<%= base["05"]["dhex"] %>
ColorBackground=#<%= base["00"]["dhex"] %>
ColorPalette1=#<%= base["00"]["dhex"] %>
ColorPalette2=#<%= base["08"]["dhex"] %>
ColorPalette3=#<%= base["0B"]["dhex"] %>
ColorPalette4=#<%= base["0A"]["dhex"] %>
ColorPalette5=#<%= base["0D"]["dhex"] %>
ColorPalette6=#<%= base["0E"]["dhex"] %>
ColorPalette7=#<%= base["0C"]["dhex"] %>
ColorPalette8=#<%= base["05"]["dhex"] %>
ColorPalette9=#<%= base["03"]["dhex"] %>
ColorPalette10=#<%= base["09"]["dhex"] %>
ColorPalette11=#<%= base["01"]["dhex"] %>
ColorPalette12=#<%= base["02"]["dhex"] %>
ColorPalette13=#<%= base["04"]["dhex"] %>
ColorPalette14=#<%= base["06"]["dhex"] %>
ColorPalette15=#<%= base["0F"]["dhex"] %>
ColorPalette16=#<%= base["07"]["dhex"] %>
Term=xterm-color

<%
# XFCE 4 Terminal Template
# Chris Kempson (http://chriskempson.com)

%>[Configuration]
ColorCursor=#<%= base["05"]["dhex"] %>
ColorForeground=#<%= base["05"]["dhex"] %>
ColorBackground=#<%= base["00"]["dhex"] %>
ColorPalette1=#<%= base["00"]["dhex"] %>
ColorPalette2=#<%= base["08"]["dhex"] %>
ColorPalette3=#<%= base["0B"]["dhex"] %>
ColorPalette4=#<%= base["0A"]["dhex"] %>
ColorPalette5=#<%= base["0D"]["dhex"] %>
ColorPalette6=#<%= base["0E"]["dhex"] %>
ColorPalette7=#<%= base["0C"]["dhex"] %>
ColorPalette8=#<%= base["05"]["dhex"] %>
ColorPalette9=#<%= base["03"]["dhex"] %>
ColorPalette10=#<%= base["09"]["dhex"] %>
ColorPalette11=#<%= base["01"]["dhex"] %>
ColorPalette12=#<%= base["02"]["dhex"] %>
ColorPalette13=#<%= base["04"]["dhex"] %>
ColorPalette14=#<%= base["06"]["dhex"] %>
ColorPalette15=#<%= base["0F"]["dhex"] %>
ColorPalette16=#<%= base["07"]["dhex"] %>
Term=xterm-color

Fix ColorCursor setting in Xfce4-Terminal


#!/usr/bin/env sh

# Set up Rails app. Run this script immediately after cloning the codebase.
# https://github.com/thoughtbot/guides/tree/master/protocol

# Exit if any subcommand fails
set -e

# Set up Ruby dependencies via Bundler
if ! command -v bundle > /dev/null; then
  gem install bundler --no-document
fi

bundle install

# Set up configurable environment variables
if [ ! -f .env ]; then
  cp .sample.env .env
fi

# Set up database and add any development seed data
bundle exec rake dev:prime

# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
if [ ! -d .git/safe ]; then
  mkdir -p .git/safe
fi

# Pick a port for Foreman
if ! grep -qs 'port' .foreman; then
  printf 'port: <%= config[:port_number] %>\n' >> .foreman
fi

# Error out if Foreman is not installed
if ! command -v foreman > /dev/null; then
  printf 'Foreman is not installed.\n'
  printf 'See https://github.com/ddollar/foreman for install instructions.\n'
  exit 1
fi

#!/usr/bin/env sh

# Set up Rails app. Run this script immediately after cloning the codebase.
# https://github.com/thoughtbot/guides/tree/master/protocol

# Exit if any subcommand fails
set -e

# Set up Ruby dependencies via Bundler
if ! command -v bundle > /dev/null; then
  gem install bundler --no-document
fi

bundle install

# Set up configurable environment variables
if [ ! -f .env ]; then
  cp .sample.env .env
fi

# Set up database and add any development seed data
bundle exec rake dev:prime

# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
mkdir -p .git/safe

# Pick a port for Foreman
if ! grep -qs 'port' .foreman; then
  printf 'port: <%= config[:port_number] %>\n' >> .foreman
fi

# Error out if Foreman is not installed
if ! command -v foreman > /dev/null; then
  printf 'Foreman is not installed.\n'
  printf 'See https://github.com/ddollar/foreman for install instructions.\n'
  exit 1
fi

Remove unnecessary check for directory existence

`mkdir -p` will no-op if the directory already exists.


  <%= @user.email %>

  <% @plants.each do |plant| %>

<%= link_to "#{plant.name}", plant %>

        <% if plant.latest_watering %>

Days since watering: <%= plant.days_since_watering %>

Amount: <%= plant.latest_watering.amount %>

        <% end %>
        <% if plant.needs_water? %>

needs_water

        <% end %>

  <% end %>

<%= link_to 'New Plant', new_plant_path %>

  <%= @user.email %>

  <% @plants.each do |plant| %>

<%= link_to "#{plant.name}", plant %>

        <% if plant.latest_watering %>

Days since watering: <%= plant.days_since_watering %>

Amount: <%= plant.latest_watering.amount %>

        <% end %>
        <% if plant.needs_water? %>

Needs water

        <% end %>

  <% end %>

<%= link_to 'New Plant', new_plant_path %>

Clean up needs water display text

Clean up needs water display text


<%= simple_form_for(@column, url: backend_content_row_columns_path(@row)) do |f| %>

      <%= t 'b.edit_column' %>

          <%= f.input :width, as: :integer %>

          <%= f.input :content_type, collection: options_for_content_types, disabled: true, include_blank: false %>

  <%= render 'backend/form_actions', cancel_url: cancel_url %>
<% end %>

<%= simple_form_for(@column, url: backend_content_row_column_path(@row, @column)) do |f| %>

      <%= t 'b.edit_column' %>

          <%= f.input :width, as: :integer %>

          <%= f.input :content_type, collection: options_for_content_types, disabled: true, include_blank: false %>

  <%= render 'backend/form_actions', cancel_url: cancel_url %>
<% end %>

Fix column edit form action.

Fix column edit form action.


        <%= image_tag(progress_update.user.avatar.thumb.url, :class => "d-flex mr-3 avatar-small") %>

            <%= link_to progress_update.user.name, user_path(progress_update.user) %>
            posted an update for their project <%= link_to progress_update.project.title, project_path(progress_update.project) %>

            <%= time_ago_in_words(progress_update.created_at) %> ago

            <%= progress_update.content %>

            <% if progress_update.words != 0 %>

                    <%= progress_update.words %>
                    words added

            <% end %>
            <% if progress_update.hours != 0.0 %>

               <%= progress_update.hours %>
               hours worked

            <% end %>

        <%= link_to "#{progress_update.comments.count} comments", project_progress_update_path(progress_update.project, progress_update) %>

        <%= image_tag(progress_update.user.avatar.thumb.url, :class => "d-flex mr-3 avatar-small") %>

            <%= link_to progress_update.user.name, user_path(progress_update.user) %>
            posted an update for their project <%= link_to progress_update.project.title, project_path(progress_update.project) %>

            <%= time_ago_in_words(progress_update.created_at) %> ago

            <%= progress_update.content %>

            <% if progress_update.words != nil %>

                    <%= progress_update.words %>
                    words added

            <% end %>
            <% if progress_update.hours != nil %>

               <%= progress_update.hours %>
               hours worked

            <% end %>

        <%= link_to "#{progress_update.comments.count} comments", project_progress_update_path(progress_update.project, progress_update) %>

Change 0 to nil to account for refactored controller code


# This file is generated automatically by Puppet - DO NOT EDIT
# Any manual changes will be overwritten
<% @workers_file_content.sort.each do |worker,directives| -%>

<% directives.sort.each do |property,value| -%>
worker.<%= worker %>.<%= property %>=<%= value %>
<% end -%>
<% end -%>

Include template for mod_jk workers file


<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">

    <title>Mumineen Calendar</title>
    <meta name="description" content="A Hijri calendar for Dawoodi Bohra Shia Muslims who follow the 53rd Dai al-Mutlaq, His Holiness Syedna Aale Qadr Mufaddal Saifuddin (TUS).">
    <meta name="author" content="Murtaza Gulamali">

    <link rel="canonical" href="http://www.mumineencalendar.com">
    <link rel="shortcut icon" href="<%= url_for('assets/images/favicon.png') %>">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="cleartype" content="on">
    <%= stylesheet_link_tag "normalize", "all" %>

    <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
  </head>

  <body class="<%= page_classes %>">
    <%= partial 'layouts/header' %>
    <%= yield %>
    <%= partial 'layouts/footer' %>

    <%= javascript_include_tag "all" %>
    <%= google_analytics_tag %>
  </body>
</html>

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">

    <title>Mumineen Calendar</title>
    <meta name="description" content="A Hijri calendar for Dawoodi Bohra Shia Muslims who follow the 53rd Dai al-Mutlaq, His Holiness Syedna Aale Qadr Mufaddal Saifuddin (TUS).">
    <meta name="author" content="Murtaza Gulamali">

    <link rel="canonical" href="//www.mumineencalendar.com">
    <link rel="shortcut icon" href="<%= url_for('assets/images/favicon.png') %>">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="cleartype" content="on">
    <%= stylesheet_link_tag "normalize", "all" %>

    <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
  </head>

  <body class="<%= page_classes %>">
    <%= partial 'layouts/header' %>
    <%= yield %>
    <%= partial 'layouts/footer' %>

    <%= javascript_include_tag "all" %>
    <%= google_analytics_tag %>
  </body>
</html>

Remove protocol in canonical link

Remove protocol in canonical link


INTERESTING INTERVIEWS YOU MAY ALSO LIKE

<% if interviewee %>

Other Episodes

  <a class='other-episodes' href="/tags/<%= dasherize(interviewee) %>"><%= interviewee %>
<% end %>

     <% blog.articles.shuffle[0...3].each do |article| %>
       <%= article.data.interviewee %>

           <img src="//images.contentful.com/<%= article.data.contentful_index_pic %>" sizes="(min-width: 1160px) 1160px, 96vw" alt="" class="image-block__figure-image">

     <% end %>

Implement basic suggestions in blog layout footer

Extracts article frontmatter data
interviewee
contentful_pic_link


# This file is managed by Puppet.
<%# This file is very similar to install.sh from epflsti/cluster.coreos.install %>

[main]
listen          = true

[agent]
pluginsync      = true
report          = true
ignoreschedules = true
daemon          = false
ca_server       = <%= @puppet_conf_ca_server %>
certname        = <%= @fqdn %>
environment     = production
server          = <%= @puppet_conf_server %>

# This file is managed by Puppet.
<%# This file is very similar to install.sh from epflsti/cluster.coreos.install %>

[main]
listen          = true
ca_server       = <%= @puppet_conf_ca_server %>

[agent]
pluginsync      = true
report          = true
ignoreschedules = true
daemon          = false
ca_server       = <%= @puppet_conf_ca_server %>
certname        = <%= @fqdn %>
environment     = production
server          = <%= @puppet_conf_server %>

Configure ca_server also in section

Configure ca_server also in section [main]

This lets "puppet certificate" work, e.g.

1. `puppet certificate generate --ca-location remote whatever.name`
2. go to Foreman → Infrastructure → Smart proxies → your smart proxy →
   Actions drop down (right-hand side) → Certificates
3. Find the certificate request and click Sign
4. `puppet certificate find --ca-location remote whatever.name`


            <%= button_to t(:label_save_and_close), (@elective_block.new_record? ? elective_blocks_path : elective_block_path(@elective_block)), form: {class: "form-inline" }, :class => "btn btn-primary save-and-close" %>

            <% if @elective_block.new_record? %>

                    <%= button_to t(:label_save_and_add), { controller: params[:controller], action: "create", :params => {:add_another => true}}, :form => {:class => "form-inline" }, :class => "btn btn-danger save-and-add"%>

            <% end %>

Drop 'save and add another' from elective blocks form

Change-Id: I5d39ea21ff02442e880ec470b7c48d18603cb2b2


From: <%= Time.now.beginning_of_week.to_date %> - <%= Time.now.end_of_week.to_date %>

          Rank
          Name
          Minutes

      <% @leaderboards.each_with_index do |leaderboard,i| %>

          <%= i+1 %>
          <%= leaderboard.name %>
          <%= leaderboard.total_minutes %>

      <% end %>

        <%= @leaderboards.map(&:total_minutes).sum %>

From: <%= @start_date %> - <%= @end_date %>

          Rank
          Name
          Minutes

      <% @leaderboards.each_with_index do |leaderboard,i| %>

          <%= i+1 %>
          <%= leaderboard.name %>
          <%= leaderboard.total_minutes %>

      <% end %>

        <%= @leaderboards.map(&:total_minutes).sum %>

Use instance variables, not Time.now

Use instance variables, not Time.now


<script>
  Spree.routes = <%== {
    :variants_search       => spree.admin_search_variants_path(:format => 'json'),
    :taxons_search         => main_app.api_taxons_path(:format => 'json'),
    :user_search           => spree.admin_search_users_path(:format => 'json'),
    :orders_api            => main_app.api_orders_path
  }.to_json %>;
</script>

<script>
  Spree.routes = <%== {
    :variants_search       => spree.admin_search_variants_path(:format => 'json'),
    :taxons_search         => main_app.api_taxons_path(:format => 'json'),
    :orders_api            => main_app.api_orders_path
  }.to_json %>;
</script>

Remove unused route from Spree.routes

Remove unused route from Spree.routes


<% breadcrumb(@organisation) %>
<%= content_for :page_title, @organisation.title %>

      <%= @organisation.title %>

  <%= render 'in_conjunction_with' %>

<% unless @sites.empty? %>

Sites

        Old site
        Transition status
        Transition date

    <% @sites.each do |site| %>

          <%= link_to site.default_host.hostname, site_path(site), class: 'breakable' %>
          <% if site.organisation != @organisation %>

owned by
            <%= link_to site.organisation.title, site.organisation, class: 'link-muted breakable' %>
          <% end %>

          <%= render partial: 'sites/transition_status', locals: {site: site} %>

        <%= date_or_not_yet(site.launch_date) %>

    <% end %>

<% end %>

<% breadcrumb(@organisation) %>
<%= content_for :page_title, @organisation.title %>

      <%= @organisation.title %>

  <%= render 'in_conjunction_with' %>

<% unless @sites.empty? %>

Sites

        Old site
        Transition status
        Transition date

    <% @sites.each do |site| %>

          <%= link_to site.default_host.hostname, site_path(site), class: 'breakable' %>
          <% if site.organisation != @organisation %>

owned by
            <%= link_to site.organisation.title, site.organisation, class: 'link-muted' %>
          <% end %>

          <%= render partial: 'sites/transition_status', locals: {site: site} %>

        <%= date_or_not_yet(site.launch_date) %>

    <% end %>

<% end %>

Remove 'breakable' class from org title

Remove 'breakable' class from org title

This class allows URLs to split at a . if they are too long for a
single line, rather than only on spaces. Since organisation titles
have spaces in them we don't need this class here.


<%= render :partial => 'new_quiz_script' %>

New <%= @questionnaire.display_type %>

<% if @questionnaire.type == "QuizQuestionnaire" %>
    <%= form_tag :action => 'create_quiz_questionnaire', :pid => @participant_id, :aid => @assignment_id do %>
        <% $disp_flag = 1 %>
        <%= render :partial => 'questionnaire' %>
        <% $disp_flag = 0 %>

        <%= render :partial => 'new_question_template' %>

        <%= submit_tag "Create Quiz", :name=>"save" %>
    <% end %>
<% else %>
    <%= form_tag :action => 'create_questionnaire', :pid => @participant_id, :aid => @assignment_id do %>
        <%= render :partial => 'questionnaire' %>
        <%= submit_tag "Create #{@questionnaire.display_type.downcase}", :name=>"save" %>
    <% end %>
<% end %>

Back

<%= render :partial => 'new_quiz_script' %>

New <%= @questionnaire.display_type %>

<% if @questionnaire.type == "QuizQuestionnaire" %>
    <%= form_tag :action => 'create_quiz_questionnaire', :pid => @participant_id, :aid => @assignment_id do %>
        <% $disp_flag = 1 %>
        <%= render :partial => 'questionnaire' %>
        <% $disp_flag = 0 %>

        <%= render :partial => 'new_question_template' %>

        <%= submit_tag "Create Quiz", :name=>"save" %>
    <% end %>
<% else %>

<% end %>

Back

Remove useless code in if-else related to quiz creation.


<% provide(:title, "Admin::Dashboard#index") %>

Find me in app/views/admin/dashboard/index.html.erb

  <%= link_to(new_admin_user_path, :class => "btn btn-default") do %>
    <%= fa_icon(:"user-plus") %>
    Create an admin
  <% end %>

Add a button to /admin/users/new

Add a button to /admin/users/new


<% notices = flash_notices()
# static messages (i.e. ones that are present on page load) need to push
# the content down, since they don't auto-dismiss themselves. but they
# also need to be fixed so they remain visible when you scroll down so we
# put a copy of them in this hidden (but layout-ed) buffer
%>

  <%= render :partial => "shared/flash_notice", :collection => notices %>

  <%= render :partial => "shared/flash_notice", :collection => notices %>

	<%= render :partial => "shared/flash_notice", :collection => notices %>

[Accessibility] Make group flash notifications accessible for JAWS

Fixes: CNVS-12797

JAWS requires a div to exist already for it to be
accessible. The flash_screenreader_holder existed,
so adding the partial there when it's needed will
make JAWS pick it up and read it immediately.

Test-Plan:
-Use old groups by disabling new group feature flag
  in account settings of admin account
-Create a group and make sure it's set for users to
  join automatically
-Login as user and join/leave group
-Verify that notification is accessible

Change-Id: I431ebcd74b7d01dea5041b801699b0ee72ead5ea
Reviewed-on: https://gerrit.instructure.com/36183
Reviewed-by: Drew Bowman <43bd25f9469d5056946537962fe98ec04e66c401@instructure.com>
Tested-by: Jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@instructure.com>
QA-Review: Steven Shepherd <e794458448443812fb2685675aab3bbd1a3891bc@instructure.com>
Product-Review: Jayce Higgins <8f0644d105785a923e938c7b131e3ab930cb6139@instructure.com>


        <% if outcome.has_title? %>

<%= outcome.title %>

        <% end %>
        <% if outcome.has_body? %>
          <%= outcome.body %>
        <% end %>

    <% if outcome.has_next_steps? %>

Next steps

          <%= outcome.next_steps %>

    <% end %>

Use GOVUK.analytics.trackEvent instead of ga function

This replaces PR #1899.

Version 4.1.0 of the govuk_frontend_toolkit Gem introduced the ability to
specify the page when calling the `trackEvent` function.

The `GOVUK.analytics.trackEvent` function comes from the govuk_frontend_toolkit
Gem in Static. Static has been using version 4.1.0 of that Gem since 22nd
July[1] which means that we're safe to use the updated `trackEvent` function
too.

The use of `ga()` was introduced in ae2a25570d43e7686bc1ff625758273280f6bc72.
See that commit for more information about why recording the `page` is useful.

I've wrapped the call to `GOVUK.analytics.trackEvent()` in an anonymous
function to avoid polluting the global namespace. I'm executing this function
using jQuery's document ready[2] although I'm not entirely sure this adds much
over simply executing the anonymous function directly.

It's worth mentioning that the JavaScript in this _result partial is moved to
just before the closing `body` tag in the page that's rendered. It's moved by
the `Slimmer::Processors::TagMover` in the slimmer Gem.

I used the Google Analytics Debugger Chrome extension[3] to compare the events
being sent before and after this change, and confirmed that they were unchanged:

== Before

Running command: ga("send", {hitType: "event", eventCategory: "Smart Answer",
eventAction: "Completed", eventLabel: "additional-commodity-code",
nonInteraction: 1, page: "/additional-commodity-code/y/75/5/85"})

== After

Running command: ga("send", {hitType: "event", eventCategory: "Smart Answer",
eventAction: "Completed", eventLabel: "additional-commodity-code",
nonInteraction: 1, page: "/additional-commodity-code/y/75/5/85"})

[1]: https://github.com/alphagov/static/pull/623
[2]: https://learn.jquery.com/using-jquery-core/document-ready/
[3]: https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna?hl=en


<%= t("budgets.index.finished_budgets") %>

      <% budgets.each do |budget| %>

<%= budget.name %>

                <div id="budget_<%= budget.id %>_results" class="table-cell align-middle">
                  <%= link_to t("budgets.index.see_results"),
                              budget_results_path(budget.id),
                              class: "button" %>
                  <%= link_to t("budgets.index.milestones"),
                              budget_executions_path(budget.id),
                              class: "button" %>

      <% end %>

<%= t("budgets.index.finished_budgets") %>

      <% budgets.each do |budget| %>

<%= budget.name %>

                <div id="budget_<%= budget.id %>_results" class="table-cell align-middle">
                  <%= link_to t("budgets.index.see_results"),
                              budget_results_path(budget),
                              class: "button" %>
                  <%= link_to t("budgets.index.milestones"),
                              budget_executions_path(budget),
                              class: "button" %>

      <% end %>

Use the same view code for finished budgets

The differences between the custom code and the code in CONSUL didn't
make much sense anymore: the path can be passed a budget instead of an
ID (so it uses a slug) and there's no reason to hide the link to the
executions for the 2018 budget anymore. Furthermore, removing the
`status: 1` parameter makes the link consistent with the rest of the
application, since it was the only link to budget executions using that
parameter.


<%
  traces = [
    ["Application Trace", @exception.application_backtrace],
    ["Framework Trace", @exception.framework_backtrace],
    ["Full Trace", @exception.clean_backtrace]
  ]
  names = traces.collect {|name, trace| name}
%>

RAILS_ROOT: <%= defined?(RAILS_ROOT) ? RAILS_ROOT : "unset" %>

  <% names.each do |name| %>
    <%
      show = "document.getElementById('#{name.gsub /\s/, '-'}').style.display='block';"
      hide = (names - [name]).collect {|hide_name| "document.getElementById('#{hide_name.gsub /\s/, '-'}').style.display='none';"}
    %>
    <a href="#" onclick="<%= hide.join %><%= show %>; return false;"><%= name %> <%= '|' unless names.last == name %>
  <% end %>

  <% traces.each do |name, trace| %>
    <div id="<%= name.gsub /\s/, '-' %>" style="display: <%= name == "Application Trace" ? 'block' : 'none' %>;">

<%=h trace.join "\n" %>

  <% end %>

<%
  traces = [
    ["Application Trace", @exception.application_backtrace],
    ["Framework Trace", @exception.framework_backtrace],
    ["Full Trace", @exception.clean_backtrace]
  ]
  names = traces.collect {|name, trace| name}
%>

Rails.root: <%= defined?(Rails) && Rails.respond_to?(:root) ? Rails.root : "unset" %>

  <% names.each do |name| %>
    <%
      show = "document.getElementById('#{name.gsub /\s/, '-'}').style.display='block';"
      hide = (names - [name]).collect {|hide_name| "document.getElementById('#{hide_name.gsub /\s/, '-'}').style.display='none';"}
    %>
    <a href="#" onclick="<%= hide.join %><%= show %>; return false;"><%= name %> <%= '|' unless names.last == name %>
  <% end %>

  <% traces.each do |name, trace| %>
    <div id="<%= name.gsub /\s/, '-' %>" style="display: <%= name == "Application Trace" ? 'block' : 'none' %>;">

<%=h trace.join "\n" %>

  <% end %>

Update reference to deprecated constant to avoid warnings


<%%= form_for(<%= singular_table_name %>) do |f| %>
  <%% if <%= singular_table_name %>.errors.any? %>

<%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:

      <%% <%= singular_table_name %>.errors.full_messages.each do |message| %>

<%%= message %>

      <%% end %>

  <%% end %>

<% attributes.each do |attribute| -%>

<% if attribute.password_digest? -%>
    <%%= f.label :password %>

    <%%= f.password_field :password %>

    <%%= f.label :password_confirmation %>

    <%%= f.password_field :password_confirmation %>
<% else -%>
    <%%= f.label :<%= attribute.column_name %> %>

    <%%= f.<%= attribute.field_type %> :<%= attribute.column_name %> %>
<% end -%>

<% end -%>

    <%%= f.submit %>

<%% end %>

Add blank lines between divs in form scaffolding