<?xml version="1.0" encoding="UTF-8"?>
<!-- DO NOT EDIT: File is auto-generated -->
<module>
  <inherits name="com.google.gwt.inject.Inject"/>
  <inherits name="org.realityforge.gwt.lognice.LogniceEventBus"/>
<% if repository.appcache? -%>
  <inherits name="org.realityforge.gwt.appcache.Appcache"/>
<% end -%>

  <set-configuration-property name="CssResource.enableGss" value="true" />
  <set-configuration-property name="CssResource.conversionMode" value="strict"/>
  <set-configuration-property name="CssResource.gssDefaultInUiBinder" value="true"/>
  <set-configuration-property name="CssResource.obfuscationPrefix" value="<%= repository.gwt.css_obfuscation_prefix %>" />
</module>

<?xml version="1.0" encoding="UTF-8"?>
<!-- DO NOT EDIT: File is auto-generated -->
<module>
  <inherits name="com.google.gwt.inject.Inject"/>
  <inherits name="org.realityforge.gwt.lognice.BrowserExceptionUtil"/>
  <inherits name="org.realityforge.gwt.lognice.LogniceEventBus"/>
<% if repository.appcache? -%>
  <inherits name="org.realityforge.gwt.appcache.Appcache"/>
<% end -%>

  <set-configuration-property name="CssResource.enableGss" value="true" />
  <set-configuration-property name="CssResource.conversionMode" value="strict"/>
  <set-configuration-property name="CssResource.gssDefaultInUiBinder" value="true"/>
  <set-configuration-property name="CssResource.obfuscationPrefix" value="<%= repository.gwt.css_obfuscation_prefix %>" />
</module>

Upgrade to the next version of lognice

Upgrade to the next version of lognice


<%= stylesheet_link_tag "/alavetelitheme/stylesheets/custom" %>
<% if request.ssl? %>
<link href='https://fonts.googleapis.com/css?family=Maven+Pro:400,700|Actor' rel='stylesheet' type='text/css'>
<% else %>
<link href='http://fonts.googleapis.com/css?family=Maven+Pro:400,700|Actor' rel='stylesheet' type='text/css'>
<% end %>

Remove link to missing stylesheet

Remove link to missing stylesheet

We don't need this any more, the stylesheet is delivered via the asset
pipeline


---
title: Martin Costello's Blog
---

<%= blog_title %>

<%= blog_subtitle %>

    <% article_count = blog.articles.length %>
    <% blog.articles[0..2].each do |article| %>
    <div class="col-md-<%= article_count == 1 ? "12" : (article_count == 2 ? "6" : "4") %>">

<%= link_to article.title, article %>

<%= article.date.strftime('%e %B %Y') %>

<%= article.body %>

    <% end %>

---
title: Martin Costello's Blog
---

<%= blog_title %>

<%= blog_subtitle %>

    <% article_count = blog.articles.length %>
    <% blog.articles[0..2].each do |article| %>
    <div class="col-md-<%= article_count == 1 ? "12" : (article_count == 2 ? "6" : "4") %>">

<%= link_to article.title, article %>

<%= article.date.strftime('%e %B %Y') %>

<%= article.summary %>

<a href="<%= article.url %>" alt="Read more" title="Read more">Read more...

    <% end %>

Use article summary on home page.

Use article summary on home page.


This is the index page for orders.

<% current_user %>
<% if !@current_user.shopping_cart.blank? %>

<%= @current_user.shopping_cart.each do |item| %>

    <%= item %>
  <% end %>
<% else %>
  Can't see cart contents :{

<% end %>

<% if  !current_user.orders.blank? %>
  <% current_user.orders.each do |order| %>

    order.user_id
  <% end %>
<% end %>

<% current_user %>
<% if !@current_user.shopping_cart.blank? %>

<%= @current_user.shopping_cart.each do |item| %>

    <%= item %>
  <% end %>
<% else %>
  Shopping Cart is currently empty!  Go add some items!

<% end %>

<% if  !current_user.orders.blank? %>
  <% current_user.orders.each do |order| %>

    order.user_id
  <% end %>
<% end %>

Change text from empty cart conditional

Change text from empty cart conditional


<%= @story.snippet.content %>(<%= link_to "link", @story.snippet %>)

<% if @story.title %>
  <%= @story.title.html_safe %>

<% end %>
<% if @story.content %>
<%= @story.content.html_safe %>
<% end %>
<%= @story.vote_count %>

  <% if current_user %>

    <% if @vote != nil && @vote.user_id == current_user.id %>
      <%= button_to "Delete",vote_delete_path(@vote), :method => :delete, :class => "delete", :confirm => "Are you sure ?"%>
    <% else %>
      <%= render "votes/new" %>
    <% end %>

  <% end %>

<% if current_user.id == @story.author_id %>

  <% if !@story.published %>

    <%= link_to "Edit", edit_story_path(@story) %>

    <%= link_to "Delete", root_path, :method => :delete %>
  <% end %>
<% end %>

  <% @story.tags.each do |tag| %>
    <%= link_to "#{tag.name}", tags_show_path(tag) %>
  <% end %>
  <%= render :partial => 'tags/tagform'%>

<%= @story.snippet.content %>(<%= link_to "link", @story.snippet %>)

<% if @story.title %>
  <%= @story.title.html_safe %>

<% end %>
<% if @story.content %>
<%= @story.content.html_safe %>
<% end %>
<%= @story.vote_count %>

  <% if current_user %>

    <% if @vote != nil && @vote.user_id == current_user.id %>
      <%= button_to "Delete",vote_delete_path(@vote), :method => :delete, :class => "delete", :confirm => "Are you sure ?"%>
    <% else %>
      <%= render "votes/new" %>
    <% end %>

  <% end %>

<% if current_user.id == @story.author_id %>

  <% if !@story.published %>

    <%= link_to "Edit", edit_story_path(@story) %>

    <%= link_to "Delete", root_path, :method => :delete %>
  <% end %>
<% end %>

<%= form_for @story do |f| %>
  <%= f.hidden_field :title, :value => @story.title %>
  <%= f.hidden_field :content, :value => @story.content %>
  <%= f.hidden_field :flagged, :value => true %>
<%= f.submit "Report inappropriate" %>
<% end %>

  <% @story.tags.each do |tag| %>
    <%= link_to "#{tag.name}", tags_show_path(tag) %>
  <% end %>
  <%= render :partial => 'tags/tagform'%>

Add form with hidden fields to report story inappropriate


-- Generated by Chef for <%= node["hostname"] %>.
-- Local modifications will be overwritten.

GRANT REPLICATION SLAVE ON *.* TO '<%=node["percona"]["server"]["replication"]["username"]%>'@'%'
      IDENTIFIED BY '<%= @replication_password %>';
FLUSH PRIVILEGES;
STOP SLAVE;
RESET SLAVE;

Fix template to support master-master replication


      <%= link_to t("valuation.menu.title"), valuation_root_path %>

    <% if feature?(:budgets) %>
      <li <%= "class=is-active" if controller_name == "budget_investments" %>>
        <%= link_to t("valuation.menu.budgets"), valuation_budgets_path, class: "budgets-link" %>

    <% end %>

Fix double <nav> tag in valuation menu

Fix double <nav> tag in valuation menu

We were defining a <nav> tag which was already defined in the admin
layout.


<!DOCTYPE html>

  <title>OUTPUT</title>
  <% links.each do |link| %>
  <%= link  %>
  <% end %>

          FILE_NAME

            <%= body %>

Add basic output erb template for full page rendering


---
- scm:
    name: deploy-lag-badger-repo
    scm:
        - git:
            url: git@github.com:alphagov/govuk-deploy-lag-badger.git
            branches:
              - master

- job:
    name: run-deploy-lag-badger
    display-name: Run deploy lag badger
    project-type: freestyle
    description: "The deploy lag badger notifies developers that there are undeployed PRs"
    scm:
      - deploy-lag-badger-repo
    logrotate:
        numToKeep: 100
    triggers:
        - timed: |
            TZ=Europe/London
            0 13 * * 1-5
    properties:
        - build-discarder:
            days-to-keep: 30
            artifact-num-to-keep: 5
    builders:
        - shell: |
            export REALLY_POST_TO_SLACK=1
            bundle install --path "${HOME}/bundles/${JOB_NAME}" --deployment
            bundle exec rake run
    wrappers:
      - ansicolor:
          colormap: xterm
      - inject-passwords:
          global: false
          mask-password-params: true
          job-passwords:
            - name: GITHUB_TOKEN
              password:
                '<%= @github_token %>'

---
- scm:
    name: deploy-lag-badger-repo
    scm:
        - git:
            url: git@github.com:alphagov/govuk-deploy-lag-badger.git
            branches:
              - main

- job:
    name: run-deploy-lag-badger
    display-name: Run deploy lag badger
    project-type: freestyle
    description: "The deploy lag badger notifies developers that there are undeployed PRs"
    scm:
      - deploy-lag-badger-repo
    logrotate:
        numToKeep: 100
    triggers:
        - timed: |
            TZ=Europe/London
            0 13 * * 1-5
    properties:
        - build-discarder:
            days-to-keep: 30
            artifact-num-to-keep: 5
    builders:
        - shell: |
            export REALLY_POST_TO_SLACK=1
            bundle install --path "${HOME}/bundles/${JOB_NAME}" --deployment
            bundle exec rake run
    wrappers:
      - ansicolor:
          colormap: xterm
      - inject-passwords:
          global: false
          mask-password-params: true
          job-passwords:
            - name: GITHUB_TOKEN
              password:
                '<%= @github_token %>'

Update deploy-lag-badger job to use main branch

This is in preparation to switch the deploy-lag-badger-repo to use
`main` as its default branch.


<!DOCTYPE html>
<html>
  <head>
    <title>Collections publisher</title>

    <% content_for :head do %>
      <%= stylesheet_link_tag 'application', media: 'all' %>
    <% end %>

    <% content_for :body_end do %>
      <%= javascript_include_tag 'application' %>
    <% end %>

    <%= csrf_meta_tags %>
  </head>

  <body>
    <%= render template: 'layouts/govuk_admin_template' %>
  </body>
</html>

<% content_for :app_title, 'GOV.UK Collections Publisher' %>
<% content_for :page_title, ' | GOV.UK Collections Publisher' %>

<% content_for :head do %>
  <%= csrf_meta_tags %>
  <%= stylesheet_link_tag 'application', media: 'all' %>
<% end %>

<% if user_signed_in? %>
  <% content_for :navbar_right do %>
    <%= link_to current_user.name, Plek.current.find('signon') %>
    • <%= link_to 'Sign out', gds_sign_out_path %>
  <% end %>
<% end %>

<% content_for :body_end do %>
  <%= javascript_include_tag 'application' %>
<% end %>

<% content_for :content do %>
  <% flash.each do |key,message| %>
    <div class="alert alert-<%= key == :notice || key == :alert ? 'warning' : key %>">
      <%= message %>
    </div>
  <% end %>
  <%= yield %>
<% end %>

<%= render template: 'layouts/govuk_admin_template' %>

Set up the application layout for an admin app

This adds the name of the app and a sign out link to the navbar.


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

<% else %>

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

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

        <%= 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>
  <head>
    <title>JuliaObserver</title>
    <%= csrf_meta_tags %>

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

    <script>
      var customInit = function() {
        $.material.init();
      };

      $(document).ready(customInit);
      $(document).on('turbolinks:load', customInit);
    </script>

  </head>

  <body>
    <%= yield %>
  </body>
</html>

<!DOCTYPE html>
<html>
  <head>
    <title>JuliaObserver</title>

    <%= csrf_meta_tags %>

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

    <%= stylesheet_link_tag "http://fonts.googleapis.com/css?family=Roboto:300,400,500,700", media: 'all', 'data-turbolinks-track': 'reload' %>

    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/icon?family=Material+Icons">

    <script>
      var customInit = function() {
        $.material.init();
      };

      $(document).ready(customInit);
      $(document).on('turbolinks:load', customInit);
    </script>

  </head>

  <body>
    <%= yield %>
  </body>
</html>

Add Roboto and material icon fonts

Add Roboto and material icon fonts


<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title><%= content_for?(:title) ? yield(:title) : "foundation-rails" %></title>

    <%= stylesheet_link_tag    "application" %>
    <%= javascript_include_tag "vendor/modernizr" %>
    <%= csrf_meta_tags %>

Wine Tasting App

Tutorial

      <% if session[:user_id] %>

My Events

My Account

Log Out

      <% end %>

    <%= yield %>
    <%= javascript_include_tag "application" %>

<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title><%= content_for?(:title) ? yield(:title) : "foundation-rails" %></title>

    <%= stylesheet_link_tag    "application" %>
    <%= javascript_include_tag "vendor/modernizr" %>
    <%= csrf_meta_tags %>

Wine Tasting App

Tutorial

      <% if session[:user_id] %>

My Events

<a href='/users/<%="#{session[:user_id]}"%>/edit'>My Account

Log Out

      <% end %>

    <%= yield %>
    <%= javascript_include_tag "application" %>

Add my account link to edit user page

Add my account link to edit user page


<!DOCTYPE html>

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

<% if user_signed_in? %>
  Logged in as <%= current_user.email %>.
  <%= link_to 'Edit profile', edit_user_registration_path, :class => 'navbar-link' %> |
  <%= link_to "Logout", destroy_user_session_path, method: :delete, :class => 'navbar-link'  %>
<% else %>
  <%= link_to "Sign up", new_user_registration_path, :class => 'navbar-link'  %> |
  <%= link_to "Login", new_user_session_path, :class => 'navbar-link'  %>
<% end %>

<%= link_to "All Events", events_path %>

<% if notice %>

<%= notice %>

<% end %>
<% if alert %>

<%= alert %>

<% end %>

<%= yield %>

<!DOCTYPE html>

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

<% if user_signed_in? %>
  Logged in as <%= current_user.email %>.
  <%= link_to 'Edit profile', edit_user_registration_path, :class => 'navbar-link' %> |
  <%= link_to "Logout", destroy_user_session_path, method: :delete, :class => 'navbar-link'  %>
<% else %>
  <%= link_to "Sign up", new_user_registration_path, :class => 'navbar-link'  %> |
  <%= link_to "Login", new_user_session_path, :class => 'navbar-link'  %>
<% end %>

<%= link_to "Join Events", events_path %>

<% if notice %>

<%= notice %>

<% end %>
<% if alert %>

<%= alert %>

<% end %>

<%= yield %>

Change link name from All Events to Join Events


<!DOCTYPE html>

  <title>Mountain Chat</title>

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

Mountain Chat Header

<%= yield %>

    <% if current_user %>

Welcome, <%= current_user.name%>

    <% else %>

Login

    <% end %>

<!DOCTYPE html>

  <title>Mountain Chat</title>

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

Mountain Chat Header

<%= yield %>

    <% if current_user %>

Welcome, <%= current_user.name %>

    <% else %>

<%= link_to 'Login', new_user_path %>

    <% end %>

Replace text within link_to for login

Replace text within link_to for login


start on runlevel [2345]
stop on shutdown
respawn
respawn limit 3 30

script
exec su - <%=@user%> -c "/opt/chef/embedded/bin/chef-rundeck -c <%=@chef_config%> -f <%=@project_config%> -w <%=@chef_webui_url%> -o <%=@chef_rundeck_host%> -p <%=@chef_rundeck_port%> -u <%= node['rundeck']['user'] %> -t <%= @chef_rundeck_cachetime %> <% if @chef_rundeck_partial_search %>--partial-search true<% end %> 2>&1" > <%=@log_dir%>/server.log
end script

start on runlevel [2345]
stop on shutdown
respawn
respawn limit 3 30

exec su - <%=@user%> -c 'exec "$0" "$@"' -- "/opt/chef/embedded/bin/chef-rundeck" -c <%=@chef_config%> -f <%=@project_config%> -w <%=@chef_webui_url%> -o <%=@chef_rundeck_host%> -p <%=@chef_rundeck_port%> -u <%= node['rundeck']['user'] %> -t <%= @chef_rundeck_cachetime %> <% if @chef_rundeck_partial_search %>--partial-search true<% end %> 2>&1 > <%=@log_dir%>/server.log

Use 'exec' to substitute calling process instead of forking.

Restarting the process does not kill the child process, so new configuration are not loaded unless someone kills the child process manually.
Proposed change fixes the restarting issue.

Former-commit-id: 62e5a80f604c1d5f109da5b259dca094c8eae578


Welcome to Trailmix.

  You're now well on your way to a journaling habit that will stick. You don't
  have any entries yet, but you'll be creating one soon.

Entries are created using email.

  We email you to ask how your day was and you just hit reply and start typing.
  Your entries will be saved here automatically.

  Your first email is probably already in your inbox. Try writing just a
  sentence or two at first. It's fine to write more, but even short entries
  will be interesting when you read them later.

Miss OhLife?

  You can import your <%= link_to "OhLife entries here", new_import_path %>.

<% content_for :header do %>

Welcome to Trailmix.

<% end %>

  You're now well on your way to a journaling habit that will stick. You don't
  have any entries yet, but you'll be creating one soon.

Entries are created using email.

  We email you to ask how your day was and you just hit reply and start typing.
  Your entries will be saved here automatically.

  Your first email is probably already in your inbox. Try writing just a
  sentence or two at first. It's fine to write more, but even short entries
  will be interesting when you read them later.

Miss OhLife?

  You can import your <%= link_to "OhLife entries here", new_import_path %>.

Update formatting of welcome page to match landing


[Unit]
Description=Logitech Media Server
After=network.target

[Service]
Type=simple
User=<%= @user_name %>
Group=<%= @user_name %>
ExecStart=<% if @custom_perl != '' %><%= @custom_perl %> <% end -%>
<%= @service_bin %>\
 --cachedir=<%= @data_dir %>\
 --prefsdir=<%= @pref_dir %>\
 --logdir=<%= @log_dir %>\
 --charset=<%= @service_charset %>\
 <%= @service_options %>
RestartSec=5
Restart=on-failure

[Install]
WantedBy=multi-user.target

[Unit]
Description=Logitech Media Server
After=network.target

[Service]
Type=simple
User=<%= @user_name %>
Group=<%= @user_name %>
Environment=LANG=en_US.utf8
ExecStart=<% if @custom_perl != '' %><%= @custom_perl %> <% end -%>
<%= @service_bin %>\
 --cachedir=<%= @data_dir %>\
 --prefsdir=<%= @pref_dir %>\
 --logdir=<%= @log_dir %>\
 --charset=<%= @service_charset %>\
 <%= @service_options %>
RestartSec=5
Restart=on-failure

[Install]
WantedBy=multi-user.target

Fix issue with Ubuntu 15.04 and LANG

Fix issue with Ubuntu 15.04 and LANG

perl complains when starting squeezeboxserver from systemd.  Initial
database creation and subsequent COLLATE pieces of SQL messed up.

Adding an explicit LANG=en_US.utf8 setting to the service file fixes.
Not sure why the LANG="en_US.UTF-8" in /etc/default/locale not working.
Doesn't cause a problem on CentOS 7, so leaving it in for now.

TODO: make the actual locale set be an option.


<%= title('Settings') %>

Settings

      <%= render 'devise/registrations/profile', user: @user %>
      <%= render 'devise/registrations/learning_goal', user: @user %>

      <% unless @user.user_providers.any? %>
        <%= render 'devise/registrations/password', user: @user %>
      <% end %>

      <%= render 'devise/registrations/danger_zone', user: @user %>

Add mx-auto class to setting page's heading


<%= form_tag(main_app.newsletter_subscription_path, class: 'newsletter-signup t-newsletter', remote: true) do %>
  <%= hidden_field_tag :authenticity_token, form_authenticity_token -%>

<%= t('newsletter_subscriptions.title') %>

    <% t('newsletter_subscriptions.benefits').each do |benefit| %>

<%= benefit %>

    <% end %>

  <fieldset class="newsletter-signup__form js-newsletter-form">
    <legend class="visually-hidden"><%= t('newsletter_subscriptions.hidden_title') %></legend>
    <%= label_tag('subscription[email]', t('newsletter_subscriptions.label'), class: 'newsletter-signup__label') %>
    <%= text_field_tag('subscription[email]', nil, class: 't-newsletter-email js-newsletter-input newsletter-signup__input') %>
    <%= button_tag(t('newsletter_subscriptions.button'), type: 'submit', class: 't-newsletter-button button button--inline-input newsletter-signup__button') %>
  </fieldset>
<% end %>

<%= form_tag(main_app.newsletter_subscription_path, class: 'newsletter-signup t-newsletter', remote: true) do %>
  <%= hidden_field_tag :authenticity_token, form_authenticity_token -%>

  <%= heading_tag t('newsletter_subscriptions.title'), level: 2, class: 'newsletter-signup__heading' %>

    <% t('newsletter_subscriptions.benefits').each do |benefit| %>

<%= benefit %>

    <% end %>

  <fieldset class="newsletter-signup__form js-newsletter-form">
    <legend class="visually-hidden"><%= t('newsletter_subscriptions.hidden_title') %></legend>
    <%= label_tag('subscription[email]', t('newsletter_subscriptions.label'), class: 'newsletter-signup__label') %>
    <%= text_field_tag('subscription[email]', nil, class: 't-newsletter-email js-newsletter-input newsletter-signup__input') %>
    <%= button_tag(t('newsletter_subscriptions.button'), type: 'submit', class: 't-newsletter-button button button--inline-input newsletter-signup__button') %>
  </fieldset>
<% end %>

Add role and aria-level attributes to newsletter_signup partial headings


Help pages

<%= link_to_unless_current "Introduction", "/help/about" %>

<%= link_to_unless_current "Making requests", "/help/requesting" %>

<%= link_to_unless_current "Your privacy", "/help/privacy" %>

<%= link_to_unless_current "FOI officers", "/help/officers" %>

<%= link_to_unless_current "About the software", "/help/alaveteli" %>

<%= link_to_unless_current "Credits", "/help/credits" %>

<%= link_to_unless_current "Programmers API", "/help/api" %>

<%= link_to_unless_current "Help us", "/help/help_out" %>

<%= link_to_unless_current "Advanced search", "/advancedsearch" %>

Contact us

If your question isn't answered here, or you just wanted to let us know
    something about the site, contact us.

Help pages

<%= link_to_unless_current "Introduction", help_about_path %>

<%= link_to_unless_current "Making requests", help_requesting_path %>

<%= link_to_unless_current "Your privacy", help_privacy_path %>

<%= link_to_unless_current "FOI officers", help_officers_path %>

<%= link_to_unless_current "About the software", help_alaveteli_path %>

<%= link_to_unless_current "Credits", help_credits_path %>

<%= link_to_unless_current "Programmers API", help_api_path %>

<%= link_to_unless_current "Help us", help_general_path(:action => 'help_out') %>

<%= link_to_unless_current "Advanced search", advanced_search_path %>

Contact us

If your question isn't answered here, or you just wanted to let us know
    something about the site, <a href="<%= help_contact_path %>">contact us.

Use url helpers in the sidebar.

Use url helpers in the sidebar.

Generally good practice.


<% content_for :title, Course.model_name.human(count:2) %>

        <%= Course.human_attribute_name('code') %>
        <%= t 'name' %>

    <% @courses.each do |course| %>

        <%= link_to course.code, course %>
        <%= course.name %>
        <%= link_to t('edit'), edit_course_path(course) %>
        <%= link_to t('delete'), course, method: :delete, data: { confirm: t('confirm') } %>

    <% end %>

<% if policy(Course).create? %>
  <%= link_to t('new', name:Course.model_name.human), new_course_path %>
<% end %>

<% content_for :title, Course.model_name.human(count:2) %>

        <%= Course.human_attribute_name('code') %>
        <%= t 'name' %>
        <% if policy(Course).update? %>

        <% end %>

    <% @courses.each do |course| %>

        <%= link_to course.code, course %>
        <%= course.name %>
        <% if policy(Course).update? %>
          <%= link_to t('edit'), edit_course_path(course) %>
        <% end %>
        <% if policy(Course).destroy? %>
          <%= link_to t('delete'), course, method: :delete, data: { confirm: t('confirm') } %>
        <% end %>

    <% end %>

<% if policy(Course).create? %>
  <%= link_to t('new', name:Course.model_name.human), new_course_path %>
<% end %>

Make edit, destroy for courses show if authorized


<script type="text/javascript" charset="utf-8">
<!--
    $(document).ready(function() {
      if ($('#<%= focus %>:visible')) {
        $('#<%= focus %>').select();
      }
    });
// -->
</script>

<% javascript_tag do %>
  $(document).ready(function() {
    if ($('#<%= focus %>:visible')) {
      $('#<%= focus %>').select();
    }
  });
<% end -%>

Use javascript_tag for focus helper

Use javascript_tag for focus helper


<VirtualHost *:80>
  ServerName <%= @params[:server_name] %>

  <Location /svn>
    DAV svn
    SVNParentPath <%= node[:svn][:svn_home] %>/repositories
    AuthType Basic
    AuthName "Subversion repository"
    AuthUserFile <%= @params[:htpasswd_path] %>
    Require valid-user

    AuthzSVNAccessFile <%= node[:svn][:svn_home] %>/auth.conf

  </Location>

  LogLevel info
  ErrorLog <%= node[:apache][:log_dir] %>/<%= @params[:server_name] %>-error.log
  CustomLog <%= node[:apache][:log_dir] %>/<%= @params[:server_name] %>-access.log combined

</VirtualHost>

<VirtualHost *:80>
  ServerName <%= @params[:server_name] %>
  ServerAlias localhost

  <Location /svn>
    DAV svn
    SVNParentPath <%= node[:svn][:svn_home] %>/repositories
    AuthType Basic
    AuthName "Subversion repository"
    AuthUserFile <%= @params[:htpasswd_path] %>
    Require valid-user

    AuthzSVNAccessFile <%= node[:svn][:svn_home] %>/auth.conf

  </Location>

  LogLevel info
  ErrorLog <%= node[:apache][:log_dir] %>/<%= @params[:server_name] %>-error.log
  CustomLog <%= node[:apache][:log_dir] %>/<%= @params[:server_name] %>-access.log combined

</VirtualHost>

Support the slightly perverse use case of a server checking out application code from itself


 This is all of your tweets

<form action="/users/<%=@user.id%>/tweets" method="post">
Post a New Tweet:
<input type="text" name="body" placeholder="Your Tweet here"><input type="submit" value="Tweet">
</form>

<%@user.tweets.each do |tweet|  %>

<%= tweet.body %>

<% end %>

 This is all of your tweets

<form action="/users/<%=@user.id%>/tweets" method="post">
Post a New Tweet:
<input type="text" name="body" placeholder="Your Tweet here"><input type="submit" value="Tweet">
</form>

<%@user.tweets.each do |tweet|  %>

<%= tweet.body %>

  <form action= '/users/<%= @user.id %>/tweets/<%=tweet.id %>/edit' method="post">
  <input type="hidden" name="_method" value="put">
  <input type="text" name="tweet" placeholder="Edit tweet">
  <input type="submit" value="Edit">
  </form>

  <form action= '/users/<%= @user.id %>/tweets/<%=tweet.id %>/edit' method="post">
  <input type="hidden" name="_method" value="delete">
  <input type="submit" value="Delete">
  </form>
<% end %>

Add update and delete forms.

Add update and delete forms.


<!DOCTYPE html>
<%= content_tag(:html, lang: I18n.locale, dir: @page_text_direction) do %>
<head>
  <title><%= @page_title.presence || 'Pageflow' %></title>

  <script>
    window.PAGEFLOW_EDITOR = <%= @editor_scope ? 'true' : 'false' %>;
  </script>

  <%= javascript_include_tag 'pageflow/vendor', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'pageflow/application', 'data-turbolinks-track' => true %>

  <%= csrf_meta_tags %>
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1" />
  <meta name="apple-mobile-web-app-capable" content="yes" />

  <%= yield :head %>

  <%= stylesheet_link_tag 'pageflow/print_view', media: 'print', 'data-turbolinks-track' => true %>
  <%= render 'layouts/pageflow/loading_spinner_inline_script' %>

  <%= render 'layouts/pageflow/ie_include_tags' %>
</head>

<body class="load_all_images has_no_mobile_platform non_js">
  <script>
    jQuery('body').removeClass('load_all_images');
    jQuery("body").removeClass('non_js').addClass('js');
  </script>
  <%= yield %>
  <%= render 'layouts/pageflow/theme_probes' %>
</body>
<% end %>

<!DOCTYPE html>
<%= content_tag(:html, lang: I18n.locale) do %>
<head>
  <title><%= @page_title.presence || 'Pageflow' %></title>

  <script>
    window.PAGEFLOW_EDITOR = <%= @editor_scope ? 'true' : 'false' %>;
  </script>

  <%= javascript_include_tag 'pageflow/vendor', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'pageflow/application', 'data-turbolinks-track' => true %>

  <%= csrf_meta_tags %>
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1" />
  <meta name="apple-mobile-web-app-capable" content="yes" />

  <%= yield :head %>

  <%= render 'layouts/pageflow/ie_include_tags' %>
</head>

<body class="js">
  <%= yield %>
  <%= render 'layouts/pageflow/theme_probes' %>
</body>
<% end %>

Remove unused code from editor layout

Remove unused code from editor layout

`@page_text_direction`, print view and loading spinner scripts are
only set when rendering outside the editor.

There is also no non-js case for the editor.

REDMINE-17269


<%= link_to _("ABOUT"), help_about_path %>

<%= link_to _("HOW TO ASK THE EU"), help_requesting_path %>

<%= link_to _("SEND A REQUEST"), body_index_path, :class => 'make-request-link' %>

   SEARCH

<%= link_to _("NEWS & CAMPAIGNS"), blog_url %>

Fix search link on English topbar (previously only worked from the front page).


Organize...

...your ink. Upload an image of your tattoo. Add information, such as
      the artist, the shop where you got the tattoo, or the inspiration behind your
      tattoo.

Browse...

...other user's tattoos. Tag your favorites. View most favorited tattoos,
      artists, and shops.

Ready to get started?

<%= link_to("Click here", new_user_path) %> to sign up for an account.

Already signed up? <%= link_to("Click here", signin_path) %> to sign in.

Add equalizer to panels on landing/home page.


namespace :after_party do
  desc '<%= task_description %>'
  task <%= file_name %>: :environment do
    puts "Running deploy task '<%= file_name %>'"

    # Put your task implementation HERE.

    # Update task as completed.  If you remove the line below, the task will
    # run with every deploy (or every time you call after_party:run).
    AfterParty::TaskRecord.create version: '<%= timestamp %>'
  end  # task :<%= file_name %>
end  # namespace :after_party

Remove double space in task template

Remove double space in task template


  Each test run creates a new traffic-light:

      red
       some tests failed

      amber
       tests didn't run

      green
       all tests passed

  Each test run creates a new traffic-light:

      red
       some tests failed

      amber
       tests did not run

      green
       all tests passed

Tweak traffic-lights dialog text to match predict buttons text.


<%= form_for([course, enrollment]) do |f| %>
  <% if enrollment.errors.any? %>

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

      <% enrollment.errors.full_messages.each do |message| %>

<%= message %>

      <% end %>

  <% end %>

    <%= f.label :student_id %>
    <%= f.select :student, options_for_select(course.students.all.map{|s|[s.to_s, s.id]}) %>

    <%= f.submit %>

<% end %>

<%= form_for([course, enrollment]) do |f| %>
  <% if enrollment.errors.any? %>

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

      <% enrollment.errors.full_messages.each do |message| %>

<%= message %>

      <% end %>

  <% end %>

    <%= f.label :student_id %>
    <% student_ids = course.students.pluck(:id) %>
    <% if student_ids.length > 0 %>
      <% missing_students = Person.where('id NOT IN (?)', course.students.pluck(:id)) %>
    <% else %>
      <% missing_students = Person.all %>
    <% end %>
    <%= f.select :student, options_for_select(missing_students.all.map{|s|[s.to_s, s.id]}), {}, class: 'form-control' %>

    <%= f.submit class: 'btn btn-primary' %>

<% end %>

Fix person query on enrollment form

Fix person query on enrollment form


      <% items.each do |item| %>

          <a class="directory__item__heading" href="<%= item['url'] %>"><%= item['title'] %>

<%= item['description'] %>

      <% end %>

    <% items.each do |item| %>

<a href="<%= item['url'] %>"><%= item['title'] %>

<%= item['description'] %>

    <% end %>

Adjust structure of the directory

Adjust structure of the directory


# file is managed by puppet
#
# remote anaconda logs, uses predefined Fuel templates
$template RemoteLog, "%$NOW%T%TIMESTAMP:8:$% %syslogseverity-text%: %msg%\n"
# Would match 'kernel:'  -> 'kernel'    ;  'rsyslog[12345]:'  -> 'rsyslog' ; '<180>(nova.api.wsgi):'  ->  'nova.api.wsgi'
$template RemoteLogFile, "/var/log/remote/%FROMHOST%/%syslogtag:R,ERE,1,DFLT:([A-Za-z-].*(\.)?.*[A-Za-z])--end%.log"

:FROMHOST, regex, "^[1-9]" ?RemoteLogFile;RemoteLog
# Drop message here and do not forward
:FROMHOST, regex, "^[1-9]" ~

# file is managed by puppet
#
# remote anaconda logs, uses predefined Fuel templates
$template RemoteLog, "%$NOW%T%TIMESTAMP:8:$% %syslogseverity-text%: %msg%\n"
# Would match 'kernel:'  -> 'kernel'    ;  'rsyslog[12345]:'  -> 'rsyslog' ; '<180>(nova.api.wsgi):'  ->  'nova.api.wsgi'
$template RemoteLogFile, "/var/log/remote/%FROMHOST%/%syslogtag:R,ERE,1,DFLT:([A-Za-z][A-Za-z0-9_.-]*)--end%.log"

:FROMHOST, regex, "^[1-9]" ?RemoteLogFile;RemoteLog
# Drop message here and do not forward
:FROMHOST, regex, "^[1-9]" ~

Fix reqexp for log file names parsing

Fix reqexp for log file names parsing

Signed-off-by: Bogdan Dobrelya <62b3a3e71fe69d786a0eb2bf561b6ce08e31d2cc@mail.ru>


<% provide(:title, 'Reset password') %>

Reset password

    <%= form_for(@user, url: reset_path(params[:id])) do |f| %>
      <%= render 'shared/error_messages', object: f.object %>

      <%= hidden_field_tag :email, @user.email %>

      <%= f.label :password %>
      <%= f.password_field :password, class: 'form-control' %>

      <%= f.label :password_confirmation, 'Confirm password' %>
      <%= f.password_field :password_confirmation, class: 'form-control' %>

      <%= f.submit "Update password", class: 'btn btn-primary' %>
    <% end %>

<% provide(:title, 'Reset password') %>

Reset password

    <%= form_for(@user, url: reset_path(params[:id])) do |f| %>
      <%= render 'shared/error_messages', object: f.object %>

      <%= hidden_field_tag :email, @user.email %>

      <%= f.label :password, 'Choose a new password' %>
      <%= f.password_field :password, class: 'form-control' %>

      <%= f.label :password_confirmation, 'Confirm new password' %>
      <%= f.password_field :password_confirmation, class: 'form-control' %>

      <%= f.submit "Update password", class: 'btn btn-primary' %>
    <% end %>

Improve verbiage on password reset edit page


<%= semantic_form_for @resource, :url => admin_edition_path(@resource), :as => :edition do |f| %>
  <%= f.inputs do %>
    <%= render :partial => 'admin/shared/title_etc', :locals => {:f => f} %>
  <% end %>

Parts

        <% f.object.parts.replace f.object.parts.sort_by(&:order) %>

        <%= f.semantic_fields_for :parts do |part| %>
          <%= render :partial => '/admin/shared/part', :locals => {:f => part, :editable => false } %>
        <% end %>

Govspeak help

        <%= render "../shared/govspeak_help" %>

<% end %>

<%= semantic_nested_form_for @resource, :url => admin_edition_path(@resource), :as => :edition do |f| %>
  <%= f.inputs do %>
    <%= render :partial => 'admin/shared/title_etc', :locals => {:f => f} %>
  <% end %>

Parts

        <% f.object.parts.replace f.object.parts.sort_by(&:order) %>

        <%= f.semantic_fields_for :parts do |part| %>
          <%= render :partial => '/admin/shared/part', :locals => {:f => part, :editable => false } %>
        <% end %>

Govspeak help

        <%= render "../shared/govspeak_help" %>

<% end %>

Make programmes form support nested forms

It needs to be a semantic_nested_form_for in order to support the remove link


DSpace Communities

         <% @community_presenter.root_communities.each do |community| %>
           <tr class='clickable-row' data-url='<%= url_for(community) %>'><%= community.name %>

         <% end %>

Add navigation arrow to community list

Add navigation arrow to community list


<%= milestone.title %>

  <% if milestone.description %>

      <%= milestone.description.html_safe %>

  <% end %>
  <% if (can? :manage, LessonPlanEntry) && milestone.is_virtual != true %>
      <%= link_to edit_course_lesson_plan_milestone_path(@course, milestone), class: 'btn' do %>

      <% end %>
      <%= link_to course_lesson_plan_milestone_path(@course, milestone),
            method: :delete,
            data: { confirm: t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
            class: 'btn btn-danger' do %>

      <% end %>
  <% end %>

    <% entries = milestone.entries.sort { |a, b| a.start_at <=> b.start_at } %>
    <% entries.each {|entry| %>
    <%= render :partial => 'lesson_plan/entry', locals: { :entry => entry } %>
    <% } %>

Move milestone Edit/Delete buttons to right. Using table :|


<% table = {} %>
<% 2015.downto(2000).each do |y| %>
    <% table[y] = {} %>
<% end %>

<%  @membership_years.each do |m| %>
    <% table[m.year][m.region] = m.count %>
<% end %>

            Year
            Total
            Bay Area
            Southern California
            Other

        <% table.each do |y, h| %>
            <% total = 0 %>
            <% h.each { |r, c| total = total + c } %>

                 <%= y %>
                 <%= total %>
                 <%= h['Bay Area'] %>
                 <%= h['Southern California'] %>
                 <%= h['Other'] %>

        <% end %>

<% table = {} %>
<% 2025.downto(2000).each do |y| %>
    <% table[y] = {} %>
<% end %>

<%  @membership_years.each do |m| %>
    <% table[m.year][m.region] = m.count %>
<% end %>

            Year
            Total
            Bay Area
            Southern California
            Other

        <% table.each do |y, h| %>
            <% total = 0 %>
            <% h.each { |r, c| total = total + c } %>

                 <%= y %>
                 <%= total %>
                 <%= h['Bay Area'] %>
                 <%= h['Southern California'] %>
                 <%= h['Other'] %>

        <% end %>

Add space for future membership years

Add space for future membership years


  # Set expires headers for assets
  # Assets with a digest (32 char hex string in filename) get max expires
  # Non-digest assets get 30 mins
  location ^~ /<%= @asset_pipeline_prefix %>/ {
    expires 30m;
    add_header Cache-Control public;
    gzip_static on;

    location ~ "-[0-9a-f]{32}\." {
      expires max;
    }
  }

<%= @nginx_extra_config %>

  # Set expires headers for assets
  # Assets with a digest (32+ char hex string in filename) get max expires
  # Non-digest assets get 30 mins
  location ^~ /<%= @asset_pipeline_prefix %>/ {
    expires 30m;
    add_header Cache-Control public;
    gzip_static on;

    location ~ "-[0-9a-f]{32,}\." {
      expires max;
    }
  }

<%= @nginx_extra_config %>

Fix assets cache-control header for Rails 4 assets.

Starting with Rails 4, the digested asset files now use a 64 character
digest instead of the 32 character one that Rails 3 used. This meant
that they weren't matching the regex here, and therefore only getting a
30 minute cache TTL.

This updates the regex to match a digest that is 32 characters or longer
so that these assets also get a maximum cache TTL.


  <%= image_tag('logo-dark.svg') %>

	This website is currently functional yet still under development. You may find that there are bugs. If you find any please submit an issue on github, or send us a <%= link_to 'message', contact_path %> so that we can resolve the issue ASAP. This is an Open Source project and we encourage you to contribute on github.

  <%= link_to "about", about_path, {:class=>"textItem"} %> ||  donate via gittip

  <%= image_tag('logo-dark.svg') %>

	This website is currently functional yet still under development. You may find that there are bugs. If you find any please submit an issue on GitHub, or send us a <%= link_to 'message', contact_path %> so that we can resolve the issue ASAP. This is an Open Source project and we encourage you to contribute on GitHub.

  <%= link_to "about", about_path, {:class=>"textItem"} %> ||  donate via gittip

Fix typo in about page

Fix typo in about page


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

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

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

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

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

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

Add wrapper for sections with school info


---
- job:
    name: deploy-emergency-banner
    display-name: Deploy the emergency banner
    project-type: freestyle
    description: "Deploy the emergency banner on GOV.UK."
    builders:
      # The argument to `-c` is in this case `frontend` but the value is used by both `static` and `frontend` applications
      - shell: ssh deploy@$(govuk_node_list -c frontend --single-node) 'cd /var/apps/static && govuk_setenv static bundle exec rake emergency_banner:deploy[\"$CAMPAIGN_CLASS\",\"$HEADING\",\"$SHORT_DESCRIPTION\",\"$LINK\"]'
    wrappers:
      - ansicolor:
          colormap: xterm
    parameters:
      - choice:
          name: CAMPAIGN_CLASS
          description: Choose the colour of banner to deploy
          choices:
            - black
            - green
            - red
      - string:
          name: HEADING
          description: The title of the banner
      - string:
          name: SHORT_DESCRIPTION
          description: The text that appears under the title
      - string:
          name: LINK
          description: The more information link

---
- job:
    name: deploy-emergency-banner
    display-name: Deploy the emergency banner
    project-type: freestyle
    description: "Deploy the emergency banner on GOV.UK."
    builders:
      # The argument to `-c` is in this case `frontend` but the value is used by both `static` and `frontend` applications
      - shell: ssh deploy@$(govuk_node_list -c frontend --single-node) "cd /var/apps/static && govuk_setenv static bundle exec rake emergency_banner:deploy['"$CAMPAIGN_CLASS"','"$HEADING"','"$SHORT_DESCRIPTION"','"$LINK"']"
    wrappers:
      - ansicolor:
          colormap: xterm
    parameters:
      - choice:
          name: CAMPAIGN_CLASS
          description: Choose the colour of banner to deploy
          choices:
            - black
            - green
            - red
      - string:
          name: HEADING
          description: The title of the banner
      - string:
          name: SHORT_DESCRIPTION
          description: The text that appears under the title
      - string:
          name: LINK
          description: The more information link

Fix how params are passed to the rake task

The "Deploy emergency banner" should pass quoted string parameters
to the `emergency_banner:deploy` rake task.

This final attempt of wrapping quotes in quotes, which has been tested
by manually updating the config in Jenkins, seems to work.


  <%= form_for :variant_search, url: form_path, method: :get do |f| %>

        <%= label_tag nil, Spree.t(:stock_location) %>
        <%= select_tag :stock_location_id, options_from_collection_for_select(stock_locations, :id, :name, params[:stock_location_id]), { :include_blank => true, :class => 'select2 fullwidth', "data-placeholder" => Spree.t(:select_a_stock_location) } %>

    <div data-hook="add_product_name" class="field <%= if content_for?(:sidebar) then 'eight' else 'twelve' end %> columns alpha">
      <%= label_tag :add_variant_id, Spree.t(:variant) %>
      <%= text_field_tag :variant_search_term, params[:variant_search_term], :class => "fullwidth", :placeholder => Spree.t(:variant_search_placeholder) %>

        <%= button Spree.t(:filter_results), 'search' %>

  <% end %>

  <%= form_for :variant_search, url: form_path, method: :get do |f| %>

        <%= label_tag nil, Spree::StockLocation.model_name.human %>
        <%= select_tag :stock_location_id, options_from_collection_for_select(stock_locations, :id, :name, params[:stock_location_id]), { :include_blank => true, :class => 'select2 fullwidth', "data-placeholder" => Spree.t(:select_a_stock_location) } %>

    <div data-hook="add_product_name" class="field <%= if content_for?(:sidebar) then 'eight' else 'twelve' end %> columns alpha">
      <%= label_tag :add_variant_id, Spree::Variant.model_name.human %>
      <%= text_field_tag :variant_search_term, params[:variant_search_term], :class => "fullwidth", :placeholder => Spree.t(:variant_search_placeholder) %>

        <%= button Spree.t(:filter_results), 'search' %>

  <% end %>

Improve I18n in variant search partial

Improve I18n in variant search partial

Use model name translations.


#!/usr/bin/env sh

# Set up Rails app. Run this script immediately after cloning the codebase.

# Exit if any subcommand fails
set -e

# Set up Ruby dependencies via Bundler
gem install bundler --conservative
bundle check || bundle install

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

# Set up the database
bundle exec rake db:setup

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

#!/usr/bin/env sh

# Set up Rails app. Run this script immediately after cloning the codebase.

# Exit if any subcommand fails
set -e

# Set up Ruby dependencies via Bundler
gem install bundler --conservative
bundle check || bundle install

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

# Set up the database
bundle exec rake db:setup

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

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

Make the `.git/safe` directory in `bin/setup`

Assuming the binstubs for a project are in the local `bin/` directory,
we can add the directory to shell `$PATH` so that `rspec` can be invoked
without the `bin/` prefix:

    export PATH="./bin:$PATH"

Doing so on a system that other people have write access to (such as a
shared host) is a security risk:

sstephenson/rbenv#309

The `.git/safe` convention addresses the security problem:

https://twitter.com/tpope/status/165631968996900865

I used to do this manually before, as I have it in my `$PATH`
https://github.com/mehlah/dotfiles/blob/master/zshenv#L12-13


<%= "# This file is managed with Puppet." %>

[sssd]
config_file_version = 2
domains = intranet.epfl.ch
services = nss, pam
debug_level = 0

[nss]

[pam]

[domain/intranet.epfl.ch]
# Unless you know you need referrals, turn them off
ldap_referrals = false
# Uncomment if you need offline logins
# cache_credentials = true
enumerate = false

id_provider = ldap
auth_provider = krb5
chpass_provider = krb5
access_provider = ldap

ldap_uri = ldap://scoldap.epfl.ch/

ldap_schema = rfc2307

ldap_user_search_base = O=epfl,C=ch
ldap_group_search_base = O=epfl,C=ch
ldap_group_object_class = EPFLGroupOfPersons

ldap_access_order = expire
ldap_account_expire_policy = ad
ldap_force_upper_case_realm = true

krb5_realm = INTRANET.EPFL.CH

# Probably required with sssd 1.8.x and newer
krb5_canonicalize = false

<%= "# This file is managed with Puppet." %>

[sssd]
config_file_version = 2
domains = intranet.epfl.ch
services = nss, pam
<%= @debug ? "debug_level = 9" : "" %>

[nss]
<%= @debug ? "debug_level = 9" : "" %>

[pam]
<%= @debug ? "debug_level = 9" : "" %>

[domain/intranet.epfl.ch]
# Unless you know you need referrals, turn them off
ldap_referrals = false
# Uncomment if you need offline logins
# cache_credentials = true
enumerate = false

id_provider = ldap
auth_provider = krb5
chpass_provider = krb5
access_provider = ldap

ldap_uri = ldap://scoldap.epfl.ch/

ldap_schema = rfc2307

ldap_user_search_base = O=epfl,C=ch
ldap_group_search_base = O=epfl,C=ch
ldap_group_object_class = EPFLGroupOfPersons

ldap_access_order = expire
ldap_account_expire_policy = ad
ldap_force_upper_case_realm = true

krb5_realm = INTRANET.EPFL.CH

# Probably required with sssd 1.8.x and newer
krb5_canonicalize = false

<%= @debug ? "debug_level = 9" : "" %>

Introduce a debug_level in each section

Introduce a debug_level in each section

This is keyed on @debug being set in caller


All Questions

<% @questions.each do |question| %>

0

votes

        <%= question.answers.count %>

answers

0

views

    <%= link_to question.title, question_path(question) %>

  <% end %>

All Questions

<% @questions.each do |question| %>

<%= question.sum_of_votes %>

votes

        <%= question.answers.count %>

answers

0

views

    <%= link_to question.title, question_path(question) %>

  <% end %>

Implement vote count on questions index page


# Generated by Chef for <%= node["fqdn"] %>.
# Local modifications will be overwritten.

<% if node["platform_family"] == "debian" -%>
# debian-sys-maint user for administration
  <% [['SELECT', 'mysql.user'], ['SHUTDOWN', '*.*']].each do |priv, loc| %>
<%= "GRANT #{priv} ON #{loc} TO '#{@debian_user}'@'localhost';" %>
  <% end -%>
SET PASSWORD FOR '<%= @debian_user %>'@'localhost' = PASSWORD('<%= @debian_password %>');
<% end -%>

<% if node["percona"]["backup"]["configure"] %>
# Grant permissions for the XtraBackup user
# Ensure the user exists, then revoke all grants, then re-grant specific permissions
GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO '<%= node["percona"]["backup"]["username"] %>'@'localhost' IDENTIFIED BY '<%= @backup_password %>';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM '<%= node["percona"]["backup"]["username"] %>'@'localhost';
GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO '<%= node["percona"]["backup"]["username"] %>'@'localhost' IDENTIFIED BY '<%= @backup_password %>';
<% end -%>

# Set the server root password. This should be preseeded by the package installation.
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('<%= @root_password %>');

FLUSH PRIVILEGES;

# Generated by Chef for <%= node["fqdn"] %>.
# Local modifications will be overwritten.

<% if node["platform_family"] == "debian" -%>
# debian-sys-maint user for administration
  <% if node["percona"]["version"] >= "5.7" -%>
CREATE USER '<%= @debian_user %>'@'localhost' IDENTIFIED BY '<%= @debian_password %>';
  <% end -%>
  <% [['SELECT', 'mysql.user'], ['SHUTDOWN', '*.*']].each do |priv, loc| %>
<%= "GRANT #{priv} ON #{loc} TO '#{@debian_user}'@'localhost';" %>
  <% end -%>
SET PASSWORD FOR '<%= @debian_user %>'@'localhost' = PASSWORD('<%= @debian_password %>');
<% end -%>

<% if node["percona"]["backup"]["configure"] %>
# Grant permissions for the XtraBackup user
# Ensure the user exists, then revoke all grants, then re-grant specific permissions
GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO '<%= node["percona"]["backup"]["username"] %>'@'localhost' IDENTIFIED BY '<%= @backup_password %>';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM '<%= node["percona"]["backup"]["username"] %>'@'localhost';
GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO '<%= node["percona"]["backup"]["username"] %>'@'localhost' IDENTIFIED BY '<%= @backup_password %>';
<% end -%>

# Set the server root password. This should be preseeded by the package installation.
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('<%= @root_password %>');

FLUSH PRIVILEGES;

Create the user in MySQL 5.7+ before adding GRANTs


# file managed by Puppet
<%= @catalina_base %>/logs/catalina.out {
      copytruncate
      size 500M
      dateext
      rotate 53
      compress
      delaycompress
      missingok
      create 644 <%= @owner %> <%= @group %>
      su <%= @owner %> <%= @group %>
}

# file managed by Puppet
<%= @catalina_base %>/logs/catalina.out {
      copytruncate
      dateext
      rotate 53
      compress
      delaycompress
      missingok
      create 644 <%= @owner %> <%= @group %>
      su <%= @owner %> <%= @group %>
}

Remove logrotate 500M minimum limit

Remove logrotate 500M minimum limit

Browsing through 500M of logs is painful, so lets rotate every week
without minimum size.


<% if fetch(:stage) == :production %>
server {
  listen 80;
  listen [::]:80;

  server_name  <%= fetch(:domain_name).sub(/www\./, '') %>;
  return       301 http://<%= fetch(:domain_name) %>$request_uri;
}
<% end %>

server {
  listen 80;
  listen [::]:80;

  root /var/www/<%= fetch(:stage) %>/<%= fetch(:application) %>/public;
  index index.html index.htm;

  # Make site accessible from http://<%= fetch(:domain_name) %>
  server_name <%= fetch(:domain_name) %>;

  # Passenger
  passenger_enabled on;
  passenger_app_env <%= fetch(:stage) %>;
  passenger_friendly_error_pages on;

  # Logs
  error_log /var/log/nginx/<%= fetch(:application) %>.<%= fetch(:stage) %>.log notice;
  # access_log off;
}

Add Nginx redirection from no www to www in url


[wazuh]
name = WAZUH OSSEC Repository - www.wazuh.com
baseurl = https://packages.wazuh.com/3.x/yum/
gpgcheck = 1
<% if @operatingsystem == 'CentOS' and @operatingsystemmajrelease == '5' -%>
gpgkey = http://ossec.wazuh.com/key/RPM-GPG-KEY-OSSEC-RHEL5
<% else -%>
gpgkey = https://packages.wazuh.com/key/GPG-KEY-WAZUH
<% end -%>
enabled = 1
protect = 1
priority=<%= @priority %>
<% unless @exclude.empty? -%>
exclude=<%= @exclude.to_a.join(' ') %>
<% end -%>
<% unless @include.empty? -%>
includepkgs=<%= @include.to_a.join(' ') %>
<% end -%>

[wazuh]
name = WAZUH OSSEC Repository - www.wazuh.com
baseurl = https://packages.wazuh.com/3.x/yum/
gpgcheck = 1
<% if @operatingsystem == 'CentOS' and @operatingsystemmajrelease == '5' -%>
gpgkey = http://ossec.wazuh.com/key/RPM-GPG-KEY-OSSEC-RHEL5
<% else -%>
gpgkey = https://packages.wazuh.com/key/GPG-KEY-WAZUH
<% end -%>
enabled = 1
<% if @operatingsystem == 'CentOS' and @operatingsystemmajrelease < '8' -%>
protect = 1
<% end -%>
priority=<%= @priority %>
<% unless @exclude.empty? -%>
exclude=<%= @exclude.to_a.join(' ') %>
<% end -%>
<% unless @include.empty? -%>
includepkgs=<%= @include.to_a.join(' ') %>
<% end -%>

Disable protect in Wazuh repo for CentOS 8 and newer


# Wait Step

<%= toc %>

A *wait* step waits for all previous steps to have successfully completed before allowing following jobs to continue.

<%= image "wait-step.png", width: 1070/2, height: 508/2, alt: "Screenshot of a basic wait step" %>

A basic wait step can be defined in your pipeline settings, or in your [pipeline.yml](/docs/pipelines/uploading-pipelines) file. It can be placed between steps to ensure that previous steps are successful before continuing to run the rest.

```yml
- command: "command.sh"
- wait
- command: "echo The command passed"
```

You can also configure the *wait* step to continue even if the previous steps failed. If the previous steps failed, the build will be marked as failed after the steps after the `wait` have completed.

```yml
- command: "command.sh"
- wait: ~
  continue_on_failure: true
- command: "echo This runs regardless of the success or failure"
```

# Wait Step

<%= toc %>

A *wait* step waits for all previous steps to have successfully completed before allowing following jobs to continue.

<%= image "wait-step.png", width: 1070/2, height: 508/2, alt: "Screenshot of a basic wait step" %>

A basic wait step can be defined in your pipeline settings, or in your [pipeline.yml](/docs/pipelines/uploading-pipelines) file. It can be placed between steps to ensure that previous steps are successful before continuing to run the rest.

```yml
- command: "command.sh"
- wait
- command: "echo The command passed"
```

You can also configure the *wait* step to continue even if the previous steps failed. If the previous steps failed, the build will be marked as failed after the steps after the `wait` have completed.

```yml
- command: "command.sh"
- wait: ~
  continue_on_failure: true
- command: "echo This runs regardless of the success or failure"
- wait
- command: "echo The command passed"
```

In this example, if `command.sh` succeeds, both of the following command steps will be run. If `command.sh` fails, only the first will be run, and the build will then be marked as failed.

Clarify the behaviour of wait steps

Clarify the behaviour of wait steps


daemon off;

user <%= scope.lookupvar "::boxen_user" %> staff;

worker_processes 2;
pid <%= scope.lookupvar "nginx::config::pidfile" %>;

events {
  worker_connections 1024;
}

http {
  include mime.types;
  default_type application/octet-stream;

  log_format main '$remote_addr - $remote_user [$time_local] $status '
                  '"$request" $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "http_x_forwarded_for"';

  access_log <%= scope.lookupvar "nginx::config::logdir" %>/access.log main;
  error_log  <%= scope.lookupvar "nginx::config::logdir" %>/error.log debug;

  sendfile on;

  tcp_nopush  on;
  tcp_nodelay off;

  gzip              on;
  gzip_http_version 1.0;
  gzip_comp_level   2;
  gzip_proxied      any;

  server {
    listen      80;
    server_name localhost;

    location / {
      root   <%= scope.lookupvar "nginx::config::configdir" %>/public;
    }
  }

  include <%= scope.lookupvar "nginx::config::sitesdir" %>/*;
}

daemon off;

user <%= scope.lookupvar "::boxen_user" %> staff;

worker_processes 2;
pid <%= scope.lookupvar "nginx::config::pidfile" %>;

events {
  worker_connections 1024;
}

http {
  include mime.types;
  default_type application/octet-stream;

  log_format main '$remote_addr - $remote_user [$time_local] $status '
                  '"$request" $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "http_x_forwarded_for"';

  access_log <%= scope.lookupvar "nginx::config::logdir" %>/access.log main;
  error_log  <%= scope.lookupvar "nginx::config::logdir" %>/error.log debug;

  sendfile on;

  tcp_nopush  on;
  tcp_nodelay off;

  gzip              on;
  gzip_http_version 1.0;
  gzip_comp_level   2;
  gzip_proxied      any;

  server_names_hash_bucket_size 128;
  server_names_hash_max_size 20000;
  proxy_headers_hash_bucket_size 128;
  proxy_headers_hash_max_size 20000;

  server {
    listen      80;
    server_name localhost;

    location / {
      root   <%= scope.lookupvar "nginx::config::configdir" %>/public;
    }
  }

  include <%= scope.lookupvar "nginx::config::sitesdir" %>/*;
}

Increase the max sizes for proxy headers and server names.

This way nginx doesn't drop headers in the way to send request to application servers.


[Unit]
Description=<%= @daemon_name %> daemon

[Service]
User=<%= @user %>
EnvironmentFile=/etc/sysconfig/<%= @daemon_name %>
ExecStart=/bin/bash $KAFKA_RUN $KAFKA_ARGS $KAFKA_CONFIG
TimeoutSec=10

[Install]
WantedBy=multi-user.target

Add `multi-user.target` to systemd service file


<script>
  Spree.routes = <%== {
    :variants_search       => spree.admin_search_variants_path(:format => 'json'),
    :taxons_search         => spree.api_taxons_path(:format => 'json'),
    :user_search           => spree.admin_search_users_path(:format => 'json'),
    :product_search        => spree.api_products_path(:format => 'json'),
    :option_type_search    => spree.api_option_types_path(:format => 'json'),
    :states_search         => spree.api_states_path(:format => 'json'),
    :orders_api            => spree.api_orders_path(:format => 'json'),
    :stock_locations_api   => spree.api_stock_locations_path(:format => 'json'),
    :variants_api          => spree.api_variants_path(:format => 'json')
  }.to_json %>;
</script>

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

Remove unused api routes from views/spree/admin/shared/routes view


<% start_node = @presenter.start_node %>

<% if start_node.meta_description.present? %>
  <% content_for :head do %>
    <meta name="description" content="<%= start_node.meta_description %>">
  <% end %>
<% end %>

    <%= render "govuk_publishing_components/components/title", {
      title: start_node.title
    } %>

        <%= start_node.body %>

        <%= render "govuk_publishing_components/components/button", {
          text: start_node.start_button_text,
          href: @presenter.start_page_link,
          rel: "nofollow",
          start: true,
          margin_bottom: true,
        } %>

      <% unless start_node.post_body.blank? %>

            <%= render "govuk_publishing_components/components/heading", {
              text: "Before you start",
              padding: true
            } %>
            <%= start_node.post_body %>

      <% end %>

    <%= render 'govuk_publishing_components/components/contextual_footer', content_item: @content_item %>

    <%= render 'govuk_publishing_components/components/contextual_sidebar', content_item: @content_item %>

Add contextual footer and sidebar to landing pages


<!DOCTYPE html>

  <meta http-equiv="Content-type" content="text/html; charset=utf-8">

  <title><%= [@page_title, "Site Title"].join(" | ") %></title>

  <%= stylesheet_link_tag *ActiveAdmin.stylesheets %>
  <%= javascript_include_tag *ActiveAdmin.javascripts %>

<%= ActiveAdmin.site_title %>

    <%= ActiveAdmin.tabs_renderer.new(self).to_html(ActiveAdmin.menus[active_admin_config.menu_name]) %>

        <%= yield %>

      <%= yield :sidebar %>

<!DOCTYPE html>

  <meta http-equiv="Content-type" content="text/html; charset=utf-8">

  <title><%= [@page_title, ActiveAdmin.site_title].join(" | ") %></title>

  <%= stylesheet_link_tag *ActiveAdmin.stylesheets %>
  <%= javascript_include_tag *ActiveAdmin.javascripts %>

<%= ActiveAdmin.site_title %>

    <%= ActiveAdmin.tabs_renderer.new(self).to_html(ActiveAdmin.menus[active_admin_config.menu_name]) %>

        <%= yield %>

      <%= yield :sidebar %>

Use the ActiveAdmin.site_title for the site title


<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName><%= SiteSetting.title %> Search</ShortName>
  <Description>Search for posts on <%= SiteSetting.title %></Description>
  <Tags>discourse forum</Tags>
  <% if SiteSetting.favicon_url =~ /\.ico$/ -%>
  <Image height="16" width="16" type="image/vnd.microsoft.icon"><%= UrlHelper.absolute SiteSetting.favicon_url %></Image>
  <%- else -%>
  <Image type="image/png"><%= UrlHelper.absolute SiteSetting.favicon_url %></Image>
  <%- end %>
  <Url type="text/html" method="get" template="<%= Discourse.base_url %>/search?q={searchTerms}"/>
  <Query role="example" searchTerms="search term"/>
</OpenSearchDescription>

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName><%= SiteSetting.title %> Search</ShortName>
  <Description>Search for posts on <%= SiteSetting.title %></Description>
  <Tags>discourse forum</Tags>
  <% if SiteSetting.favicon_url =~ /\.ico$/ -%>
  <Image height="16" width="16" type="image/vnd.microsoft.icon"><%= UrlHelper.absolute SiteSetting.favicon_url %></Image>
  <%- else -%>
  <Image type="image/png"><%= UrlHelper.absolute SiteSetting.favicon_url %></Image>
  <%- end %>
  <Url type="application/opensearchdescription+xml" rel="self" template="<%= Discourse.base_url %>/opensearch.xml"/>
  <Url type="text/html" template="<%= Discourse.base_url %>/search?q={searchTerms}"/>
  <Query role="example" searchTerms="search term"/>
</OpenSearchDescription>

Allow for search engine updates

Allow for search engine updates


var addClickTouchEvent = function(element, handler) {
  var wrapper = function(e) {
    handler(e);
    e.preventDefault();
  };
  element.on({
    'touchstart': wrapper,
    'click': wrapper
  });
};

function onURLBlocked(base_url, callback) {
  $('<img width="0" height="0">')
      .on("error", callback)
      .attr("src", base_url + "?" + Math.random())
      .css("position", "absolute")
      .css("bottom", 0)
      .css("right", 0)
      .css("z-index", -1)
      .css("width", 0)
      .css("height", 0)
      .appendTo("body");
}

var addClickTouchEvent = function(element, handler) {
  var wrapper = function(e) {
    handler(e);
    e.preventDefault();
  };
  element.on({
    'touchstart': wrapper,
    'click': wrapper
  });
};

function onURLBlocked(base_url, callback) {
  $('<img>')
      .on("error", callback)
      .attr("src", base_url + "?" + Math.random())
      .css("position", "absolute")
      .css("bottom", 0)
      .css("right", 0)
      .css("z-index", -1)
      .css("width", 0)
      .css("height", 0)
      .appendTo("body");
}

Remove inline attributes from HTTPS test image


Two Factor Authentication

  <%= form_for(resource, as: resource_name, url: session_path(resource_name), method: :post) do |f| %>
    <%= f.label :otp_attempt, class: "c-input" do %>
      OTP
      <%= f.text_field :otp_attempt %>
    <% end %>

      <%= f.submit "Login", class: "c-btn c-btn--yellow" %>

  <% end %>

Two Factor Authentication

  <%= form_for(resource, as: resource_name, url: session_path(resource_name), method: :post) do |f| %>
    <%= f.label :otp_attempt, class: "c-input" do %>
      OTP
      <%= f.text_field :otp_attempt %>
    <% end %>

      <%= f.submit "Verify", class: "c-btn c-btn--yellow" %>

  <% end %>

Use Verify instead of Login

Use Verify instead of Login


<fieldset id='location' data-international-only="<%= params[:international_only] %>" <%= 'class=require' if @require_location -%>>

        <%= f.text_field :zipcode, class: 'form-control', placeholder: "#{t(:zip_code)} #{@require_location || t(:optional)}",
          title: t('petition_errors.required.zip_code') -%>

          <%= t :outside_the_us -%>

      <%= f.text_field :city, placeholder: t(:city),
        class: 'form-control input-pair', pattern: '.*\S+.*', title: t('petition_errors.required.city')
      -%>
      <%= t :in_the_us -%>
      <%= f.select :country_code, country_codes, { prompt: t(:country) },
        class: 'form-control' -%>

</fieldset>

<fieldset id='location' data-international-only="<%= params[:international_only] %>" <%= 'class=require' if @require_location -%>>

        <%= f.text_field :zipcode, class: 'form-control', placeholder: "#{t(:zip_code)} #{@require_location ? '' : t(:optional)}",
          title: t('petition_errors.required.zip_code') -%>

          <%= t :outside_the_us -%>

      <%= f.text_field :city, placeholder: t(:city),
        class: 'form-control input-pair', pattern: '.*\S+.*', title: t('petition_errors.required.city')
      -%>
      <%= t :in_the_us -%>
      <%= f.select :country_code, country_codes, { prompt: t(:country) },
        class: 'form-control' -%>

</fieldset>

Fix location zip code placeholder

Fix location zip code placeholder


<% if edition.force_published? %>

Warning This edition was force published and has not yet been reviewed by a second pair of eyes.

    <% if edition.approvable_retrospectively_by?(current_user) %>

<%= link_to "View this on the website", preview_document_path(@edition), target: '_blank' %> and check everything thoroughly.

<%= approve_retrospectively_edition_button(edition) %>

    <% end %>

<% end %>
<% if edition.pre_publication? && edition.scheduled_publication.present? %>

    <% if edition.scheduled? %>

Scheduled for publication on <%= l edition.scheduled_publication, format: :long %>.

    <% else %>

Scheduled publication proposed for <%= l edition.scheduled_publication, format: :long %>.

    <% end %>

<% end %>
<% if warn_about_lack_of_contacts_in_body?(edition) %>

This press release has no contact information embedded in the
        body. You may want to edit it and add some.

<% end %>

<% if edition.force_published? %>

Warning This edition was force published and has not yet been reviewed by a second pair of eyes.

    <% if edition.approvable_retrospectively_by?(current_user) %>

<%= link_to "View this on the website", preview_document_path(@edition), target: '_blank' %> and check everything thoroughly.

<%= approve_retrospectively_edition_button(edition) %>

    <% else %>

 Please have an editor other than the original publisher review the document to clear this warning.

 <% end %>

<% end %>
<% if edition.pre_publication? && edition.scheduled_publication.present? %>

    <% if edition.scheduled? %>

Scheduled for publication on <%= l edition.scheduled_publication, format: :long %>.

    <% else %>

Scheduled publication proposed for <%= l edition.scheduled_publication, format: :long %>.

    <% end %>

<% end %>
<% if warn_about_lack_of_contacts_in_body?(edition) %>

This press release has no contact information embedded in the
        body. You may want to edit it and add some.

<% end %>

Edit warning for force publish flag

Edit warning for force publish flag

https://www.pivotaltracker.com/story/show/56117956


<% object_with_attachments.attachments.each do |attachment| %>
  <%= content_tag_for(:div, attachment, class: "attachment embedded") do %>
    <%= link_to(url: attachment.url) do %>
      <% if attachment.pdf? %>
        <%= image_tag(attachment.url(:thumbnail), alt: "") %>
      <% else %>
        <%= image_tag('pub-cover.png', alt: "") %>
      <% end %>
      Download <%= attachment.title %>
    <% end %>

Type

<%= humanized_content_type(attachment.file_extension) %>

Size

<%= number_to_human_size(attachment.file_size) %>

      <% if attachment.number_of_pages.present? %>

Length

<%= pluralize(attachment.number_of_pages, "page") %>

      <% end %>

    <% unless attachment.accessible? %>
      This file may not be accessible
    <% end %>
  <% end %>
<% end %>

<% object_with_attachments.attachments.each do |attachment| %>
  <%= render partial: "attachment" %>
<% end %>

Refactor attachments partial to just include attachment


<!DOCTYPE html>

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title><%= this_blog.blog_name %> – <%= controller.controller_name %></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="imagetoolbar" content="no" />
    <%= javascript_include_tag 'publify_admin', async: Rails.env.production? %>
    <%= stylesheet_link_tag 'publify_admin' %>
    <%= csrf_meta_tags %>

    <%= render 'admin/shared/menu' %>

            <%= render 'shared/flash', flash: flash %>

          <% if content_for?(:page_heading) %>

              <%= yield :page_heading %>

          <% end %>
          <%= yield %>

            <%= link_to(this_blog.blog_name, this_blog.base_url) %> <%= t('.powered_by') %> Publify <%= h PublifyCore::VERSION %>

Remove unneeded wrapping elements from admin layout


<%= render partial: 'toolbar/subject' %>

<% content_for :toolbar_menu do %>

    <%= link_to image_tag("btn/btn_group.png") + t('group.other'), '#', :id => "toolbar_menu-groups", :class => "btn-blue" %>

    <%= link_to(image_tag("btn/btn_group.png")+t('group.new.action'), new_group_path) %>

<% end %>

<%= render partial: 'toolbar/menu' %>

<%= render partial: 'toolbar/subject' %>

<% content_for :toolbar_menu do %>
  <div class="base_items"/>
<% end %>

<%= render partial: 'toolbar/menu' %>

Remove old group toolbar menu entries

Remove old group toolbar menu entries


  Name:
  <%= @domain.name %>

  Traffic Rank:
  <%= @domain.last_rank.traffic_rank %>

<% @domain.ranks.each do |rank| %>

  <%= rank.traffic_rank %>
  <%= time_ago_in_words(rank.created_at) %>

<% end %>

Add minor UI change to domain show.

Add minor UI change to domain show.


<%= form_for @event do |f|%>

  <%= text_area_tag :emails, "", {:placeholder => "Invite guests by entering emails separated by commas!"} %>

  <fieldset>
    <%= f.text_field :name, placeholder: "Event Name" %>
    <%= f.date_field :date %>
    <%= f.time_field :time %>
    <%= f.text_field :location, placeholder: "Event Location" %>
    <%= f.submit 'Save', class: 'button' %>
  </fieldset>
<% end %>

<%= form_for @event do |f|%>
  <fieldset>
    <%= f.text_field :name, placeholder: "Event Name" %>
    <%= f.date_field :date %>
    <%= f.time_field :time %>
    <%= f.text_field :location, placeholder: "Event Location" %>
    <%= text_area_tag :emails, "", {:placeholder => "Invite guests by entering emails separated by commas!"} %>
    <%= f.submit 'Save', class: 'button' %>
  </fieldset>
<% end %>

Move email box within field for event

Move email box within field for event


Messages#new

<%= form_for(:message, url: new_message_path) do |f| %>
  <%= f.label :name %>
  <%= f.text_field :name %>
  <%= f.label :bio %>
  <%= f.text_field :bio %>
  <%= f.label :profile_img %>
  <%= f.text_field :profile_img %>
  <%= f.hidden_field :author_id, :value => @user.id %>
  <%= f.hidden_field :location, :value =>  %>
  <%= f.submit %>
<% end %>

Add small change to new messages form

Add small change to new messages form


<% content_for :title, "Orders" %>

<% content_for :content do %>

        <%= link_to 'New Order', {controller: "orders", action: "new"}, class: 'btn btn-primary pull-right' %>

        Order Number
        County
        Organization Name
        Date Received
        Status

      <% @orders.each do |order| %>
        <tr class="order <%= "danger" if order.order_details.empty? %>" data-order-id="<%= order.id %>" data-click-fn="orderRowClicked">
          <%= order.id %>
          <%= order.organization.county %>
          <%= order.organization.name %>
          <%= order.formatted_order_date %>
          <%= order.status.titleize %>

      <% end %>

  <%= render partial: "details_modal" %>
<% end %>

<% content_for :title, "Orders" %>

<% content_for :content do %>

        <%= link_to 'New Order', {controller: "orders", action: "new"}, class: 'btn btn-primary pull-right' %>

        Order Number
        County
        Organization Name
        Date Received
        Status

      <% @orders.each do |order| %>
        <tr class="order <%= "danger" if order.order_details.empty? %>" data-order-id="<%= order.id %>" data-href="<%= edit_order_path(order) %>">
          <%= order.id %>
          <%= order.organization.county %>
          <%= order.organization.name %>
          <%= order.formatted_order_date %>
          <%= order.status.titleize %>

      <% end %>

<% end %>

Move away from the order detail modal

Move away from the order detail modal

We decided to not use modals so this is the removal of one more.


<% #TODO: Session necesita mostrarse como en AA en vez de mostrar el id  %>
<% #TODO: Autocompletar: AREA Y SESSION  %>
<% #TODO: Arreglar los datepicker que estan de mas  %>
<%= simple_form_for  [:backend, resource] do |f| %>
  <%= f.input :numero, :label =>"Numero" %>
  <%= f.association :organization, input_html: {class: 'select2'}, label: "Tipo de iniciador" %>
  <%= f.simple_fields_for :initiator do |initiator| %>
    <%= initiator.input :name, :label => "Iniciador"%>
  <% end %>
  <%= f.simple_fields_for :pases do |pases_form| %>
    <%= pases_form.association :area, input_html: {class: 'select2'} %>
    <%= pases_form.association :session, input_html: {class: 'select2'} %>
    <%= pases_form.input :ingreso, as: :date_picker %>
    <%= pases_form.input :fojas %>
    <%= pases_form.input :descripcion %>
  <% end %>
  <%= f.association :tags, input_html: {multiple: true, class: 'chzn-select',
      "data-pre"  => f.object.tags.to_json(methods: :name), only: [:id, :name]} %>
<br>
<%= f.submit %>
<% end %>

<% #TODO: Session necesita mostrarse como en AA en vez de mostrar el id  %>
<% #TODO: Autocompletar: AREA Y SESSION  %>
<% #TODO: Arreglar los datepicker que estan de mas  %>
<%= simple_form_for  [:backend, resource] do |f| %>

      <%= f.input :numero, :label =>"Numero" %>
      <%= f.association :organization, input_html: { class: 'select2' }, label: "Tipo de iniciador" %>
      <%= f.simple_fields_for :initiator do |initiator| %>
        <%= initiator.input :name, :label => "Iniciador"%>
      <% end %>
      <%= f.association :tags, input_html: { multiple: true, class: 'chzn-select',
          "data-pre"  => f.object.tags.to_json(methods: :name), only: [:id, :name] } %>

      <%= f.simple_fields_for :pases do |pases_form| %>
        <%= pases_form.association :area, input_html: { class: 'select2' } %>
        <%= pases_form.association :session, input_html: { class: 'select2' } %>
        <%= pases_form.input :ingreso, as: :date_picker %>
        <%= pases_form.input :fojas %>
        <%= pases_form.input :descripcion, input_html: { rows: 6 } %>
      <% end %>

    <%= f.button :submit, 'Crear Nota', :class => 'btn-primary' %>

<% end %>

Change the notas form into columns

Change the notas form into columns


<%=h @project.name %>

        <% if !User.current.logged? %>
        Login
        <% end %>
        Back

Issues > <%= @tracker.name %>

        <% @issues.each do |issue| %>

<%= link_to issue.subject, :action => "show", :id => issue.id %> <%= issue.tracker.name %>

        <% end %>

<%=h @project.name %>

        <% if !User.current.logged? %>
        Login
        <% end %>
        Back

Issues > <%= @tracker.name %>

        <% @issues.each do |issue| %>

<%= link_to issue.subject, :action => "show", :id => issue.id %>

        <% end %>

Remove the mini-label of tracker name

Remove the mini-label of tracker name


<!DOCTYPE html>

    <title>My Restaurant Review</title>
    <%= csrf_meta_tags %>

    <%= stylesheet_link_tag    'application', media: 'all' %>
    <%= javascript_include_tag 'application' %>

      <%= link_to "Home", root_path %>
      <%= link_to "See Reviews", reviews_path %>
      <%= link_to "See Restaurants", restaurants_path %>
      <% if logged_in? %>
        <%= link_to "#{current_user.email.upcase_first}", user_path(current_user) %>
        <%= link_to "New Review", new_review_path %>
        <%= link_to "Settings", edit_user_path(current_user) %>
        <%= link_to "Logout", logout_path, method: :delete %>
      <% else %>
        <%= link_to "Sign Up", signup_path %>
      <% end %>

      <% flash.each do |name, msg| -%>
        <%= content_tag :div, msg, class: name %>
      <% end -%>

My Restaurant Review

      <%= yield %>

        <%= link_to "Back", root_path %>
        <% if !logged_in? %>
          <%= link_to "Log In", login_path %>
        <% end %>
        <%= render '/users/links' %>
        <%= render '/reviews/links' %>

<!DOCTYPE html>

    <title>My Restaurant Review</title>
    <%= csrf_meta_tags %>

    <%= stylesheet_link_tag    'application', media: 'all' %>
    <%= javascript_include_tag 'application' %>

      <%= link_to "Home", root_path %>
      <%= link_to "See Reviews", reviews_path %>
      <%= link_to "See Restaurants", restaurants_path %>
      <% if logged_in? %>
        <%= link_to "#{current_user.email.upcase_first}", user_path(current_user) %>
        <%= link_to "New Review", new_review_path %>
        <%= link_to "Settings", edit_user_path(current_user) %>
        <%= link_to "Logout", logout_path, method: :delete %>
      <% else %>
        <%= link_to "Sign Up", signup_path %>
      <% end %>

      <% flash.each do |name, msg| -%>
        <%= content_tag :div, msg, class: name %>
      <% end -%>

My Restaurant Review

      <%= yield %>

        <%= link_to "Back", root_path %>
        <%= render '/users/links' %>
        <%= render '/reviews/links' %>
        <% if !logged_in? %>
          <%= link_to "Log In", login_path %>
        <% end %>

Move login link to last place in footer of layout


<!DOCTYPE html>

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

  <a id="create_account" href="<%= new_user_registration_path %>">Create an Account
  <a id="sign_in" href="<%= new_user_session_path %>">Sign in
  <%= link_to('Sign out', destroy_user_session_path, method: :delete, id: :sign_out) %>

<% [:notice, :alert].each do |type| %>
  <%= render partial: "shared/flash", locals: { type: type } %>
<% end %>

<%= yield %>

<!DOCTYPE html>
<html>
<head>
  <title>ExampleRailsImageGallery</title>
  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>
</head>
<body>
<nav>
  <%= link_to("Create an Account", new_user_registration_path, id: :create_account) %>
  <%= link_to("Sign in", new_user_session_path, id: :sign_in) %>
  <%= link_to('Sign out', destroy_user_session_path, method: :delete, id: :sign_out) %>
</nav>

<% [:notice, :alert].each do |type| %>
  <%= render partial: "shared/flash", locals: { type: type } %>
<% end %>

<%= yield %>

</body>
</html>

Use `link_to` in place of <a> tags.

Use `link_to` in place of <a> tags.

Sometimes I forget to Rails. This is because I <3 sinatra and clojure
and don't find much value in the form and html helpers that come with
rails.


<!DOCTYPE html>

  <title>Data Verification Tool</title>
  <link href='http://fonts.googleapis.com/css?family=Press+Start+2P' rel='stylesheet' type='text/css'>
  <%= stylesheet_link_tag    "application", :media => "all" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <%= render 'layouts/nav' %>

      <%= render 'subnav' %>

      <%= render_flash(flash) %>

    <%= yield %>

Department of Planning & Infrastructure

Contact Us

<!DOCTYPE html>

  <title>Data Verification Tool</title>
  <%= stylesheet_link_tag    "application", :media => "all" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <%= render 'layouts/nav' %>

      <%= render 'subnav' %>

      <%= render_flash(flash) %>

    <%= yield %>

Department of Planning & Infrastructure

Contact Us

Remove obsolete google webfont link to Press Start 2P


<!DOCTYPE html>
<html>
<head>
  <title>Rock Enroll</title>
  <%= stylesheet_link_tag('application', media: 'all', 'data-turbolinks-track' => true) %>
  <%= javascript_include_tag('application', 'data-turbolinks-track' => true) %>
  <%= csrf_meta_tags %>
</head>
<body>
  <header class='navigation' role='banner'>
    <%= render template: 'navigation/header' %>
  </header>
  <div class='container main'>
    <%= yield %>
  </div>
</body>
</html>

<!DOCTYPE html>
<html lang='en'>
<head>
  <title>Rock Enroll</title>
  <meta charset='utf-8' />
  <meta name='viewport' content='width=device-width, initial-scale=1' />
  <%= stylesheet_link_tag('application', media: 'all', 'data-turbolinks-track' => true) %>
  <%= javascript_include_tag('application', 'data-turbolinks-track' => true) %>
  <%= csrf_meta_tags %>
</head>
<body>
  <header class='navigation' role='banner'>
    <%= render template: 'navigation/header' %>
  </header>
  <div class='container main'>
    <%= yield %>
  </div>
</body>
</html>

Add some tags & attributes to application layout

Specifying viewport attribute will let responsive rules kick in as needed.


---
- job:
    name: content_performance_manager_import_etl_master_process
    display-name: Content Performance Manager - ETL master
    project-type: freestyle
    description: "
Run the etl:master rake task.
"
    builders:
      - shell: ssh deploy@$(govuk_node_list -c backend --single-node) "cd /var/apps/content-performance-manager && govuk_setenv content-performance-manager bundle exec rake etl:master"
    wrappers:
      - ansicolor:
          colormap: xterm
    publishers:
      - email:
          recipients: govuk-ci-notifications@digital.cabinet-office.gov.uk
  <% if @rake_etl_master_process_cron_schedule %>
    triggers:
      - timed: <%= @rake_etl_master_process_cron_schedule %>
  <% end %>
    logrotate:
        numToKeep: 10
    publishers:
      - trigger-parameterized-builds:
          - project: Success_Passive_Check
            condition: 'SUCCESS'
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> success
          - project: Failure_Passive_Check
            condition: 'FAILED'
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> failed
                NSCA_CODE=2

---
- job:
    name: content_performance_manager_import_etl_master_process
    display-name: Content Performance Manager - ETL master
    project-type: freestyle
    description: "
Run the etl:master rake task.
"
    builders:
      - trigger-builds:
          - project: run-rake-task
            block: true
            predefined-parameters: |
              TARGET_APPLICATION=content-performance-manager
              MACHINE_CLASS=backend
              RAKE_TASK=etl:master
    wrappers:
      - ansicolor:
          colormap: xterm
    publishers:
      - email:
          recipients: govuk-ci-notifications@digital.cabinet-office.gov.uk
  <% if @rake_etl_master_process_cron_schedule %>
    triggers:
      - timed: <%= @rake_etl_master_process_cron_schedule %>
  <% end %>
    logrotate:
        numToKeep: 10
    publishers:
      - trigger-parameterized-builds:
          - project: Success_Passive_Check
            condition: 'SUCCESS'
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> success
          - project: Failure_Passive_Check
            condition: 'FAILED'
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> failed
                NSCA_CODE=2

Use run-rake-task in content-performance-manager jobs


  Flag logs
  <% if @individual_post.present? %>
    for <%= link_to @individual_post.title, "/post/#{@individual_post.id}" %>
  <% end %>

<% if @individual_post.nil? %>
  <%= line_chart FlagLog.group_by_day(:created_at, :range => 1.month.ago.to_date..Time.now).count %>
<% end %>

    User
    Post
    Result

  <% @flag_logs.each do |log| %>

      <%= log.user.try(:username) %>
      <%= render "posts/post", :post => log.post, :wrap_in_tr => false %>
      <td class='<%= "success" if log.success %>'><%= log.success ? "Success" : "Fail" %><%= " (dry run)" if log.is_dry_run %><%= " - #{log.error_message}" if log.error_message.present? %>

  <% end %>

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

  Flag logs
  <% if @individual_post.present? %>
    for <%= link_to @individual_post.title, "/post/#{@individual_post.id}" %>
  <% end %>

<% if @individual_post.nil? %>
  <%= line_chart FlagLog.group_by_day(:created_at, :range => 1.month.ago.to_date..Time.now).count %>
<% end %>

    User
    Post
    Result

  <% @flag_logs.each do |log| %>

      <%= log.user.try(:username) %>
      <%= render "posts/post", :post => log.post, :wrap_in_tr => false %>
      <td class='<%= "success" if log.success %>' title="<%= log.error_message %>"><%= log.success ? "Success" : "Fail" %><%= " (dry run)" if log.is_dry_run %>

  <% end %>

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

Move flag log error message to tooltip

Move flag log error message to tooltip


<%= @user.first_name %>'s Account

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil, sed culpa animi dignissimos ab aspernatur ex quam aperiam quae ipsum impedit officiis, fugit, adipisci, delectus aliquam quod consequatur quo voluptatem.

Add basic user profile view

Add basic user profile view


<%= render @question %>
<%= render "votes/vote_count", :object => @question%>
<%= render "votes/questions_vote_form", :object => @question, :vote => @vote %>
<%= link_to "comment", new_question_response_path(@question) %>
<% if @question.responses %>
  <%= render :partial => "responses/response", :collection => @question.responses %>
<% end %>
<%= render "answers/answer_form.html", :question => @question %>

<% @question.sorted_answers.each do |answer| %>
  <% if @question.best_answer_id == answer.id %>
    <%= render "answers/best_answer_identifier" %>

  <% end %>
  <%= render answer %>
  <% if @question.best_answer_id == nil && @question.asker_id == current_user.id %>
    <%= render "answers/best_answer_form", :answer => answer %>

  <% end %>

<% end %>

<%= render @question %>
<%= render "votes/vote_count", :object => @question%>
<%= render "votes/vote_form", :object => @question, :vote => @vote %>
<%= link_to "comment", new_question_response_path(@question) %>
<% if @question.responses %>
  <%= render :partial => "responses/response", :collection => @question.responses %>
<% end %>
<%= render "answers/answer_form.html", :question => @question %>

<% @question.sorted_answers.each do |answer| %>
  <% if @question.best_answer_id == answer.id %>
    <%= render "answers/best_answer_identifier" %>

  <% end %>
  <%= render answer %>
  <% if @question.best_answer_id == nil && @question.asker_id == current_user.id %>
    <%= render "answers/best_answer_form", :answer => answer %>

  <% end %>

<% end %>

Update questions/show view with updated name of partial vote form


 Question:

 <%= @question.title %>

 * * *

 <%= @question.content %>

 Tags:

 <%= raw @question.tag_list.map {|t| link_to t, tag_path(t) }.join(", ") %>

  <% if !@question.answers.empty? %>
    <% @question.answers.each do |answer| %>

<%= answer.content %>

      <%= link_to_image(answer.responder.image_url, user_path(answer.responder_id)) %>

<%= link_to('thumbs up!', vote_up_answer_path(answer), :method => :post, class: "btn btn-primary btn-sm") %><%= pluralize(answer.votes.count, 'vote') %>
    <%end%>
  <%end%>

<%= form_for([@question, Answer.new]) do |f| %>
 <%= f.label :content, "Submit your answer" %>
 <%= f.text_field :content  %>

<%= f.submit "Submit", class: "btn btn-primary" %>

<% end %>

<%= link_to 'Edit', edit_question_path(@question), class: "btn btn-primary" %> |
<%= link_to 'Back', questions_path, class: "btn btn-primary" %>

 <%= @question.title %>

  * * *

  <%= @question.content %>

Asked by <%= @question.asker.name %>

<%= raw @question.tag_list.map {|t| link_to t, tag_path(t) }.join(", ") %>

  <% if !@question.answers.empty? %>
    <% @question.answers.each do |answer| %>

<%= answer.content %>

      <%= link_to_image(answer.responder.image_url, user_path(answer.responder_id)) %>

<%= link_to('thumbs up!', vote_up_answer_path(answer), :method => :post, class: "btn btn-primary btn-sm") %><%= pluralize(answer.votes.count, 'vote') %>
    <%end%>
  <%end%>

<%= form_for([@question, Answer.new]) do |f| %>
  <%= f.label :content, "Submit your answer" %>
  <%= f.text_field :content  %>

<%= f.submit "Submit", class: "btn btn-primary" %>

<% end %>

<% if @question.asker_id == current_user.id %>
<%= link_to 'Edit', edit_question_path(@question), class: "btn btn-primary" %> |
<% end %>
<%= link_to 'Back', questions_path, class: "btn btn-primary" %>

Add name to question show page

Add name to question show page


Expense

<%= form_tag(session_path, method: :post, id: "new_session") do %>
  E-mail

  <%= text_field_tag :email %>

  Password

  <%= password_field_tag %>

  <button type="submit">Log In</button>
<% end %>

Expense

<%= form_tag(session_path, method: :post, id: "new_session") do %>
  E-mail

  <input id="email" name="email" type="email" />

  Password

  <%= password_field_tag %>

  <button type="submit">Log In</button>
<% end %>

Use an e-mail field for the iPhone.

Use an e-mail field for the iPhone.


<% if Feature.active?(:new_header) %>

      <%= link_to root_path do %>
        <%= image_tag("mas-logo.png", alt: 'the Money Advice Service', class: 'mas-logo') %>
      <% end %>

        <%= render 'shared/mobile_nav' %>

        <% if display_search_box_in_header? %>
          <%= render 'shared/search' %>
        <% end %>

<% else %>

      <%= link_to root_path do %>
        <%= image_tag("mas-logo.png", alt: 'the Money Advice Service', class: 'mas-logo') %>
      <% end %>

        <%= render 'shared/mobile_nav' %>
        <%= render 'shared/primary_nav' %>

    <% if display_search_box_in_header? %>

        <%= render 'shared/search_box' %>

    <% end %>

<% end %>

Add new search component to header inside feature flag


### THIS FILE IS MANAGED BY PUPPET. ANY MANUAL CHANGES WILL GET OVERWRITTEN.

# Apache2 Trac configuration, specific to a particular project.

WSGIScriptAlias /<%= @projectname %> /var/lib/projects/<%= @projectname %>/wsgi/<%= @projectname %>.wsgi

<Directory /var/lib/projects/<%= @projectname %>/wsgi>
    WSGIApplicationGroup %{GLOBAL}
    Order deny,allow
    Allow from all
</Directory>

<LocationMatch ^/<%= @projectname %>/login$>
   AuthType Basic
   AuthName "Login to <%= @projectname %> Trac wiki/tracker"
   Order Allow,Deny
   Allow from All

   # Here we setup Apache2 authentication
<% @apache2_auth_lines.each do |line| -%>
   <%= line %>
<% end -%>

   Require valid-user
</LocationMatch>

### THIS FILE IS MANAGED BY PUPPET. ANY MANUAL CHANGES WILL GET OVERWRITTEN.

# Apache2 Trac configuration, specific to a particular project.

WSGIScriptAlias /<%= @projectname %> /var/lib/projects/<%= @projectname %>/wsgi/<%= @projectname %>.wsgi

<Directory /var/lib/projects/<%= @projectname %>/wsgi>
    WSGIApplicationGroup %{GLOBAL}
    Require all granted
</Directory>

<LocationMatch ^/<%= @projectname %>/login$>
   AuthType Basic
   AuthName "Login to <%= @projectname %> Trac wiki/tracker"

   # Here we setup Apache2 authentication
<% @apache2_auth_lines.each do |line| -%>
   <%= line %>
<% end -%>

   Require all granted
   Require valid-user
</LocationMatch>

Upgrade deprecated Apache2 authentication settings

Signed-off-by: Samuli Seppänen <be49b59234361de284476e9a2215fb6477f46673@openvpn.net>


Is something wrong with this page?

Help us improve GOV.UK by telling us:

  <form accept-charset="UTF-8" action="/feedback" method="post">

<input name="utf8" type="hidden" value="✓">

    <input id="url" name="url" type="hidden" value="<%= h request_url %>">

      What you were doing
      <input id="what_doing" name="what_doing" type="text" />

      What went wrong
      <input id="what_wrong" name="what_wrong" type="text" />

<input name="commit" type="submit" value="Send" class="button" />

  </form>

Is something wrong with this page?

Help us improve GOV.UK by telling us:

  <form accept-charset="UTF-8" action="/feedback" method="post">

<input name="utf8" type="hidden" value="✓">

    <input id="url" name="url" type="hidden" value="<%= h request_url %>">

      What you were doing
      <input id="what_doing" name="what_doing" type="text" />

      What went wrong
      <input id="what_wrong" name="what_wrong" type="text" />

<button name="commit" type="submit" class="button">Send</button>

  </form>

Change input submits to buttons

Change input submits to buttons

To allow CSS changes to work from:

alphagov/static#124


<% if article.error %>

    <%= article.error %>

<% end %>

    <form accept-charset="UTF-8" action="/editor/articles/<%= article.id %>" method="post">
      <input type="hidden" name="_method" value="delete" />
      <button type="submit" class="btn btn-success">Delete</button>
    </form>

Edit Article

<form role="form" accept-charset="UTF-8" action="/editor/articles/<%= article.id %>" method="post">
  <input type="hidden" name="_method" value="put" />

  <%= erb :article_fields, :locals => { :article => article, :categories => categories } %>

  <button type="submit" class="btn btn-default">Save</button>
</form>

<% if article.error %>

    <%= article.error %>

<% end %>

    <form accept-charset="UTF-8" action="/editor/articles/<%= article.id %>" method="post">
      <input type="hidden" name="_method" value="delete" />
      <button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure you want to delete this?')">
        Delete
      </button>
    </form>

Edit Article

<form role="form" accept-charset="UTF-8" action="/editor/articles/<%= article.id %>" method="post">
  <input type="hidden" name="_method" value="put" />

  <%= erb :article_fields, :locals => { :article => article, :categories => categories } %>

  <button type="submit" class="btn btn-default">Save</button>
</form>

Add confirm prompt to delete

Add confirm prompt to delete


  <% @banners.each do |banner| %>
  <% if banner.link.blank? %>

<%= image_tag(  banner.imagem,size: "900x300", alt: "Imagem capa" )%>

  <% else %>

<%= link_to  image_tag(   banner.imagem,size: "900x300", alt: "Imagem capa" ), banner.link, :title => banner.titulo, :target => "_blank" %>

  <% end %>

  <% end %>

<% content_for :js do %>
  $(function() {
   $(".rslides").responsiveSlides({
     speed: 1500,
     pause: true,
     random: true
   });
 });
<% end %>

  <% @banners.each do |banner| %>
  <% if banner.link.blank? %>

<%= image_tag(  banner.imagem,size: "900x300", alt: banner.titulo )%>

  <% else %>

<%= link_to  image_tag(   banner.imagem,size: "900x300", alt: banner.titulo ), banner.link, :title => banner.titulo, :target => "_blank" %>

  <% end %>

  <% end %>

<% content_for :js do %>
  $(function() {
   $(".rslides").responsiveSlides({
     speed: 1500,
     pause: true,
     random: true
   });
 });
<% end %>

Deploy de aplicação Ruby on Rails no Heroku