    <% if answer.is_best_answer?(answer.question) %>

<%= render "answers/best_answer_identifier" %>

    <% end %>
    <% if logged_in? %>
      <% if answer.vote_on_this?(current_user.id)  %>

<%= render "votes/vote_form", :object => answer, :vote => @vote %>

      <% end %>
      <% if answer.best_answerable?(answer.question, current_user.id) %>
        <%= render "answers/best_answer_form", :answer => answer %>

      <% end %>
    <% end %>

<%= answer.content %>

<%= time_ago_in_words(answer.updated_at) %>

<%= link_to answer.answerer.username, user_path(answer.answerer) %>

    <%= render :partial => "responses/response", :collection => answer.responses %>

<%= link_to "comment", new_answer_response_path(answer) %>

    <% if answer.is_best_answer?(answer.question) %>

<%= render "answers/best_answer_identifier" %>

    <% end %>
    <% if logged_in? %>
      <% if answer.vote_on_this?(current_user.id)  %>

<%= render "votes/vote_form", :object => answer, :vote => @vote %>

      <% else %>

<%= image_tag("gray-arrow.png")%>

<%= answer.vote_count %>

<%= image_tag("gray-arrow.png")%>

      <% end %>
      <% if answer.best_answerable?(answer.question, current_user.id) %>
        <%= render "answers/best_answer_form", :answer => answer %>

      <% end %>
    <% end %>

<%= answer.content %>

<%= time_ago_in_words(answer.updated_at) %>

<%= link_to answer.answerer.username, user_path(answer.answerer) %>

    <%= render :partial => "responses/response", :collection => answer.responses %>

<%= link_to "comment", new_answer_response_path(answer) %>

Add vote display if user already voted on a question or answer


Featured Companies

  <% if @companies.any? %>
    <% @companies.each do |company| %>

<%= link_to  company.name , company_path(company)%>

        <img class="company-img" src="<%= company.profile_image_url %>" alt="<%= company.name %>" />
        <%= company.avg_rating %>

    <% end %>
  <% end %>

  <% if current_user && current_user.admin == true %>
    <%= link_to "Create Company", new_company_path %>
  <% end %>

<div class="company-data" data="<%= autocomplete_data %>">

Add data to view to be used on page load


       <% link_to '/' do %>
         <%= image_tag 'Between_Screens_Logo_Cube_Up.svg', alt: 'Logo cube' %>
       <% end %>

<%= link_to 'about', '/pages/about.html' %>

<%= link_to 'design', '/design.html' %>

<%= link_to 'code', '/code.html' %>

       <% link_to '/' do %>
         <%= image_tag 'Between_Screens_Logo_Cube_Up.svg', alt: 'Logo cube' %>
       <% end %>

<%= link_to 'fork!', '#' %>

<%= link_to 'about', '/pages/about.html' %>

<%= link_to 'design', '/design.html' %>

<%= link_to 'code', '/code.html' %>

Add dummy link for forking to navbar

Add dummy link for forking to navbar


<%
  paginated_products = Spree::Config.searcher.products if params.key?(:keywords)
  paginated_products ||= products
%>
<% if products.empty? %>
  <%= t(:no_products_found) %>
<% end %>

<% if products.any? %>

  <% products.each do |product| %>
    <% if Spree::Config[:show_zero_stock_products] || product.has_stock? %>
      <li id="product_<%= product.id %>">
        <%= link_to small_image(product), product %>
        <%= link_to product.name + "#{product_price(product)}", product, :class => 'info' %>

    <% end %>
  <% end %>

<% end %>

<% if paginated_products.is_a?(WillPaginate::Collection)
      params.delete(:search)
      params.delete(:taxon)

%><%= will_paginate(paginated_products,
                    :previous_label => "« #{t('previous')}",
                    :next_label => "#{t('next')} »") %>
<% end -%>

<%
  paginated_products = Spree::Config.searcher.products if params.key?(:keywords)
  paginated_products ||= products
%>
<% if products.empty? %>
  <%= t(:no_products_found) %>
<% end %>

<% if products.any? %>

  <% products.each do |product| %>
    <% if Spree::Config[:show_zero_stock_products] || product.has_stock? %>
      <li id="product_<%= product.id %>">
        <%= link_to small_image(product), product %>
        <%= link_to product.name + "#{product_price(product)}", product, :class => 'info' %>

    <% end %>
  <% end %>

<% end %>

<% if paginated_products.respond_to?(:paginate)
      params.delete(:search)
      params.delete(:taxon)

%><%= will_paginate(paginated_products,
                    :previous_label => "« #{t('previous')}",
                    :next_label => "#{t('next')} »") %>
<% end -%>

Use duck typing for paginated_products.

Use duck typing for paginated_products.


<% if role.current_holder %>
  <%= render "govuk_publishing_components/components/heading", {
    text: "Current role holder:",
    id: "current-role-holder-title",
  } %>

    <%= render "govuk_publishing_components/components/heading", {
      text: role.current_holder["title"],
      id: "current-role-holder-title",
    } %>

    <%= render "govuk_publishing_components/components/govspeak", {
    } do %>
      <%= role.current_holder_biography.html_safe %>
    <% end %>

    <%= link_to "More about this person", role.link_to_person, class: "govuk-link" %>

<% end %>

<% if role.current_holder.present? %>

    <%= render "govuk_publishing_components/components/heading", {
      text: "Current role holder:",
      id: "current-role-holder-title",
    } %>

    <%= render "govuk_publishing_components/components/heading", {
      text: role.current_holder["title"],
      id: "current-role-holder-title",
    } %>

    <%= render "govuk_publishing_components/components/govspeak", {
    } do %>
      <%= role.current_holder_biography.html_safe %>
    <% end %>

      <%= link_to "More about this person", role.link_to_person, class: "govuk-link" %>

<% end %>

Add bottom padding to current role holder section


<% provide :page_title, construct_page_title("Edit Collection #{@form.title.first}") %>

<%= provide :page_header do %>

Edit Collection: <%= @form.title.first %>

<% end %>

<% unless has_collection_search_parameters? %>

      <%= render 'collections/form' %>

      <%= render 'collections/media_display', collection: @collection %>
      <%= render 'collections/edit_actions' %>

<% end %>

Manage Items in this Collection

<%= render 'search_collection_dashboard_form'%>
<%= render 'my/did_you_mean' %>
<%= render 'my/facet_selected' %>
<%= render 'collections/sort_and_per_page', collection: @collection %>
<%= render 'document_list', documents: @member_docs, document_list_format: "dashboard" %>
<%= render 'paginate' %>

<% provide :page_title, construct_page_title("Edit Collection #{@form.title.first}") %>

<%= provide :page_header do %>

Edit Collection: <%= @form.title.first %>

<% end %>

<% unless has_collection_search_parameters? %>

      <%= render 'collections/form' %>

      <%= render 'collections/media_display', collection: @collection %>
      <%= render 'collections/edit_actions' %>

<% end %>

Manage Items in this Collection

<%= render 'search_form', presenter: @collection %>
<%= render 'my/did_you_mean' %>
<%= render 'my/facet_selected' %>
<%= render 'collections/sort_and_per_page', collection: @collection %>
<%= render 'document_list', documents: @member_docs, document_list_format: "dashboard" %>
<%= render 'paginate' %>

Make use of existing form for collections searchbox

TODO: containerize the invocation of curation concerns' template.
Make it match our other one.


      <%= link_to  thumb_for(excursion, 130), excursion, :class => "container" %>

<%= excursion.slide_count %>

<%= link_to truncate_name(excursion.title, :length => 40), excursion %>

<%=type_excursion%>

<%=t('follow.followers')%>: <%=num_followers%>

<%= image_tag('star.png') %>

      <%= link_to  thumb_for(excursion, 130), excursion, :class => "container" %>

<%= excursion.slide_count %>

<%= link_to truncate_name(excursion.title, :length => 40), excursion %>

<%=t('follow.followers')%>: <%=num_followers%>

<%= image_tag('star.png') %>

Remove type_excursion causing view to crash


name: <%= name %>----{{user `image_name`}}
type: wakamevdc
api_endpoint: <%= cloud.entry_point %>
hypervisor: kvm
host_node_id: hn-demo1
cpu_cores: 1
memory_size: 512
network_id: nw-global
image_id: <%= source_image %>
ssh_username: <%= ssh_username %>
ssh_timeout: 60m
backup_storage_id: bkst-demo1

Add wakame-vdc builder to create image by packer


<%- presenter = TransactionPresenter.new(@publication) -%>

    <hgroup>

Service Advertise a job with Universal Jobmatch

    </hgroup>

      Not what you're looking for? ↓

Universal Jobmatch is currently unavailable.

Call 0845 601 2001 for help advertising job.

   <%= render 'publication_metadata', :publication => @publication, :artefact => @artefact, :api_links => { 'application/json' => publication_api_path(@publication, :edition => @edition) } %>

<%- presenter = TransactionPresenter.new(@publication) -%>

    <hgroup>

Service Advertise a job with Universal Jobmatch

    </hgroup>

      Not what you're looking for? ↓

Universal Jobmatch is currently unavailable.

Call 0845 601 2001 for help advertising a job.

   <%= render 'publication_metadata', :publication => @publication, :artefact => @artefact, :api_links => { 'application/json' => publication_api_path(@publication, :edition => @edition) } %>

Fix typo on /advertise-job page

Fix typo on /advertise-job page


<%# render 'static_pages_links' %>
<%# render 'login_logout' %>

<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Mailman</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<meta charset="utf-8">
<%= favicon_link_tag %>
<%= csrf_meta_tags %>
<%= yield :meta_data %>
<%= stylesheet_link_tag 'application', media: 'all' %>

<!-- <link rel="icon" href="/mailman-frontend/images/favicon.png" /> -->
<link rel="stylesheet" href="/mailman-frontend/css/global.css" class="" type="text/css" />
</head>
<body>
<%= yield %>
</body>
</html>

<%# render 'static_pages_links' %>
<%# render 'login_logout' %>

<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Mailman</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<meta charset="utf-8">
<%= favicon_link_tag %>
<%= csrf_meta_tags %>
<%= yield :meta_data %>
<%= stylesheet_link_tag 'application', media: 'all' %>
</head>
<body>
<%= yield %>
<%= javascript_include_tag "application" %>
</body>
</html>

Add javascript in static pages layout

Add javascript in static pages layout


  <%= link_to comment.user.username, comment.user %> <%= comment.created_at.strftime("Posted on %d %a %Y at %T") %>

  <%= comment.content %>
  <% if current_user.admin == true %>

      <% id = "part_com"+comment.id.to_s %>
      <a data-reveal-id="<%= id %>" class="button tiny alert right expand">Delete
      <%= render partial: 'layouts/delete_confirm', locals: {id: id, name: 'comment', link: comment.path+[comment]} %>

  <% end %>

  <%= link_to comment.user.username, comment.user %> <%= comment.created_at.strftime("Posted on %d %a %Y at %T") %>

  <%= comment.content %>
  <% if current_user.try(:admin) == true %>

      <% id = "part_com"+comment.id.to_s %>
      <a data-reveal-id="<%= id %>" class="button tiny alert right expand">Delete
      <%= render partial: 'layouts/delete_confirm', locals: {id: id, name: 'comment', link: comment.path+[comment]} %>

  <% end %>

Correct admin bug when there is no admin param


var video           = document.getElementById("video-stream");
var decisionTime    = 15;
var decicsionActive = false;

ws.onmessage = function(message) {
  var data = JSON.parse(message.data);
  // console.log(data)
  if (data.video) {
    var source = document.querySelectorAll("#video-player video source");
    source[0].src = data.video;
    video.load();
    video.play();
    $("#decision-logo ").hide();
    if (data.question != null) { decicsionActive = false; }
  } else if (data.the_end) {
    $("#decision-logo").html('The End');
    $("#decision-logo").fadeIn( 3000 );
  }
};

$("#video-stream").on("timeupdate", function() {
    // TODO: Just calculate that once
    var decicsionTime = this.duration - decisionTime;

    if (this.currentTime > decicsionTime && decicsionActive == false) {
      $("#decision-logo").fadeIn( 3000 );
      ws.send(JSON.stringify({ decision_active: true }));
      decicsionActive = true;
    }
});

$("#video-stream").on("ended", function() {
  ws.send(JSON.stringify({ video: 'ended' }));
});

$(document).ready(function() {
  $("#decision-logo").hide();
});

var video           = document.getElementById("video-stream");
var decisionTime    = 15;
var decicsionActive = false;

ws.onmessage = function(message) {
  var data = JSON.parse(message.data);
  // console.log(data)
  if (data.video) {
    var source = document.querySelectorAll("#video-player video source");
    source[0].src = data.video;
    video.load();
    video.play();
    $("#decision-logo ").hide();
    if (data.question != null) { decicsionActive = false; }
  } else if (data.the_end) {
    $("#decision-logo").html('

Ende

 Bitte nimm dir kurz Zeit uns Feedback zu geben.

 Mit deiner Hilfe können wir den Film weiter verbessern.

 Danke!

 Klicke hier um zur Onlineumfrage zu gelangen!
');
    $("#decision-logo").fadeIn( 3000 );
  }
};

$("#video-stream").on("timeupdate", function() {
    // TODO: Just calculate that once
    var decicsionTime = this.duration - decisionTime;

    if (this.currentTime > decicsionTime && decicsionActive == false) {
      $("#decision-logo").fadeIn( 3000 );
      ws.send(JSON.stringify({ decision_active: true }));
      decicsionActive = true;
    }
});

$("#video-stream").on("ended", function() {
  ws.send(JSON.stringify({ video: 'ended' }));
});

$(document).ready(function() {
  $("#decision-logo").hide();
});

Add online survey link add the end for usability test


<% content_for :subheader do %>

People a collection of creative talent from P.R.

<% end %>

      <% @users.each do |user| %>
        <%= render 'user_card', user: user %>
      <% end %>

<% content_for :subheader do %>

People a collection of creative talent from P.R.

<% end %>

      <% @users.in_groups_of(3) do |group| %>

          <% group.compact.each do |user| %>
            <%= render 'user_card', user: user %>
          <% end %>

      <% end %>

Add grid rows for people list

Add grid rows for people list


    <%= nav_link_to "All Actions", admin_action_pages_path %>

    <%= nav_link_to "Create new action", new_admin_action_page_path %>

    <%= nav_link_to "Featured Actions", homepage_admin_action_pages_path %>

    <%= nav_link_to "Site Analytics", admin_events_path %>

<%= nav_link_to "Partners Admin", admin_partners_path %>

<%= nav_link_to "Congress Topics", admin_topics_path %>

<%= nav_link_to "Users", admin_users_path %>

<%= nav_link_to "Image Gallery", admin_source_files_path %>

<%= nav_link_to "Categories", admin_categories_path %>

    <%= nav_link_to "All Actions", admin_action_pages_path %>

    <%= nav_link_to "Create new action", new_admin_action_page_path %>

    <%= nav_link_to "Featured Actions", homepage_admin_action_pages_path %>

    <%= nav_link_to "Site Analytics", admin_events_path %>

<%= nav_link_to "Congress Topics", admin_topics_path %>

<%= nav_link_to "Users", admin_users_path %>

<%= nav_link_to "Categories", admin_categories_path %>

Remove admin menu links for in-progress pages


<% content_for :page_title, title %>
<%= breadcrumb(hits.first || site.default_host.hits.build) %>

<%= title %>

<%= render partial: 'hits_tabs', locals: { active: active } %>

<%= pluralize(number_with_delimiter(hits.total_count, :delimiter => ','), 'hit', 'hits') %>

<%= paginate hits %>

<% if hits.total_count > 0 # already eval'd above, saves a DB call with #any? %>
  <%= render partial: 'hits_table', locals: { hits: hits } %>
<% else %>

    <%= no_content_message %>

<% end %>

<%= paginate hits %>

<% content_for :page_title, title %>
<%= breadcrumb(hits.first || site.default_host.hits.build) %>

<%= title %>

<%= render partial: 'hits_tabs', locals: { active: active } %>

<%= pluralize(number_with_delimiter(hits.total_count, :delimiter => ','), 'path', 'paths') %>

<%= paginate hits %>

<% if hits.total_count > 0 # already eval'd above, saves a DB call with #any? %>
  <%= render partial: 'hits_table', locals: { hits: hits } %>
<% else %>

    <%= no_content_message %>

<% end %>

<%= paginate hits %>

Update copy to say paths, not hits

Update copy to say paths, not hits

* We are showing a paginated list of unique paths, not hits
* A count of hits would be much higher


Your cart:

  <%= render(cart.line_items) %>

<%= button_to 'Empty cart', cart, method: :delete, data: { confirm: 'Are you sure?' } %>
<%= button_to 'Download forms', "/download" %>

Your cart:

  <%= render(cart.line_items) %>

<%= button_to 'Empty cart', cart, method: :delete %>
<%= button_to 'Download forms', "/download" %>

Remove irritating "Are you sure?" alert from "Empty Cart" button


  mallard

    About
    Sign up
    Sign in
    Sign out

Share your holy experience

      <%= render template: "accounts/new" %>

  mallard

    About
    Sign up
    Sign out

Share your holy experience

      <%= render template: "accounts/new" %>

Remove sign in menu from nav bar.

Remove sign in menu from nav bar.


<script type="text/javascript" id="js-nexaas-async-collector-<%= unique_id %>">
  var requestContent = function() {
    $.ajax({
      url: '<%= nexaas_async_collector.async_resource_path(collect_id) %>',
      dataType: 'script',
      data: { unique_id: '<%= unique_id %>' }
    })
  }

  window.nexaas_async_interval = setInterval(requestContent, 3000);
</script>

<%= render partial: "nexaas/async/collector/async_resource/loading", locals: { unique_id: unique_id } %>

<script type="text/javascript" id="js-nexaas-async-collector-<%= unique_id %>">
  if (!!window.nexaas_async_interval)
    clearInterval(window.nexaas_async_interval);

  var requestContent = function() {
    $.ajax({
      url: '<%= nexaas_async_collector.async_resource_path(collect_id) %>',
      dataType: 'script',
      data: { unique_id: '<%= unique_id %>' }
    })
  }

  window.nexaas_async_interval = setInterval(requestContent, 3000);
</script>

<%= render partial: "nexaas/async/collector/async_resource/loading", locals: { unique_id: unique_id } %>

Clear interval when rendering loading and the interval already exists


Mathio Party

  <% if current_user %>
  	<%= link_to 'Logout', destroy_user_session_path, method: :delete %>
  	<% if !player2_logged_in? %>
  		<%= link_to 'Player 2 Login', players_new_path %>
  	<% else %>
  		<%= link_to 'Player 2 Logout', players_logout_path, method: :delete %>
  	<% end %>
  <% else %>
  	<%= link_to 'Login', new_user_session_path %>
    <%= link_to 'Sign Up', new_user_registration_path  %>
  <% end %>

Mathio Party

  <% if current_user %>
  	<%= link_to "Logout, #{current_user.username} ", destroy_user_session_path, method: :delete %>
  	<% if !player2_logged_in? %>
  		<%= link_to 'Player 2 Login', players_new_path %>
  	<% else %>
  		<%= link_to "Logout", players_logout_path, method: :delete %>
  	<% end %>
  <% else %>
  	<%= link_to 'Login', new_user_session_path %>
    <%= link_to 'Sign Up', new_user_registration_path  %>
  <% end %>

Add username for logout player 1

Add username for logout player 1


<%
  css_file = local_assigns[:css_file] || 'static'
%>
<!--[if gt IE 8]><!--><%= stylesheet_link_tag css_file, integrity: false %><!--<![endif]-->
<!--[if IE 8]><%= stylesheet_link_tag "#{css_file}-ie8" %><script>var ieVersion = 8;</script><![endif]-->

<%= stylesheet_link_tag "#{css_file}-print", media: "print", integrity: false %>

<%
  css_file = local_assigns[:css_file] || 'static'
%>
<%= stylesheet_link_tag css_file, integrity: false %>
<!--[if lte IE 8]><%= stylesheet_link_tag "#{css_file}-ie8" %><script>var ieVersion = 8;</script><![endif]-->

<%= stylesheet_link_tag "#{css_file}-print", media: "print", integrity: false %>

Modify logic for IE stylesheet inclusion

- since the IE stylesheet now contains only the IE specific changes and not the whole of the stylesheet plus the IE specific changes, call the regular stylesheet always and the IE specific stylesheet only if we're viewed in IE8 and below


<% if publication.draft? %>
  <%= semantic_bootstrap_nested_form_for(@artefact, :html => { :class => 'artefact', :id => 'edit_artefact'}) do |f| %>

        <%= f.input :id, as: :hidden, input_html: { value: @artefact.id } %>
        <%= f.input :slug, :input_html => { :class => "input-md-6" } %>

    <%= f.submit 'Update metadata', class: "btn btn-success btn-large" %>
  <% end %>
<% else %>

      <% @artefact.attributes.slice('slug', 'language').each do |key, value| %>
        <%= content_tag :label, key.humanize, for: key %>
        <%= text_field_tag key, value, class: "form-control add-bottom-margin", disabled: 'disabled' %>
      <% end %>

<% end %>

<% if Edition::PUBLISHING_API_DRAFT_STATES.include? publication.state %>
  <%= semantic_bootstrap_nested_form_for(@artefact, :html => { :class => 'artefact', :id => 'edit_artefact'}) do |f| %>

        <%= f.input :id, as: :hidden, input_html: { value: @artefact.id } %>
        <%= f.input :slug, :input_html => { :class => "input-md-6" } %>

    <%= f.submit 'Update metadata', class: "btn btn-success btn-large" %>
  <% end %>
<% else %>

      <% @artefact.attributes.slice('slug', 'language').each do |key, value| %>
        <%= content_tag :label, key.humanize, for: key %>
        <%= text_field_tag key, value, class: "form-control add-bottom-margin", disabled: 'disabled' %>
      <% end %>

<% end %>

Allow editing slug if in any draft state


<%= link_to h(entry.title), entry.url %> published <%= time_ago_in_words entry.published %> ago by <%= link_to h(entry.feed.user.name), entry.feed.user %>

<%= link_to h(entry.title), entry.url %> published<%= " #{time_ago_in_words entry.published} ago" if entry.published %> by <%= link_to h(entry.feed.user.name), entry.feed.user %>

Patch entries to handle nil publish dates


<% current_committee = nil if local_assigns[:current_committee].nil? %>
<% current_page = nil if local_assigns[:current_page].nil? %>

<%= t("about_section") %>

    <% @pages.where(parent_id: nil).each do |parent_page| %>
      <% if current_page == parent_page %>

<%= parent_page.title %>

      <% else %>
        <%= link_to parent_page.title, path_to_page(parent_page) %>
      <% end %>
      <% @pages.where(parent_id: parent_page.id).each do |child_page| %>

        <% if current_page == child_page %>

<%= child_page.title %>

        <% else %>
          <%= link_to child_page.title, path_to_page(child_page), class: "child"%>
        <% end %>
      <% end %>

    <% end %>

<%= t("committees_assoiciations") %>

    <% @committees.each do |committee| %>
      <% if committee == current_committee %>

<%= committee.name %>

      <% else %>
        <%= link_to committee.name, committee %>
      <% end %>

    <% end %>

Move hr in sidebar partial, looks better


<%= render @question %>
<%= 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/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 %>

Add vote count partial and vote form partial to questions show view


<%= render @question %>
<%= render "votes/vote_count", :object => @question%>
<% if @question.vote_on_this?(current_user.id)  %>
  <%= render "votes/vote_form", :object => @question, :vote => @vote %>
<% end %>
<%= 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%>
<% if @question.vote_on_this?(current_user.id)  %>
  <%= render "votes/vote_form", :object => @question, :vote => @vote %>
<% end %>
<%= 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 && answer.answerer.id != current_user.id %>
    <%= render "answers/best_answer_form", :answer => answer %>

  <% end %>

<% end %>

Add logic to prohibit answerer from marking own answer as best


<%= @question.question %>

Comments:

<% @question.comments.each do |comment| %>

<%= comment.text %>

<% end %>

Write a comment:

<%= form_for ([@question, @question.comments.build]) do |f| %>

      <%= f.label :text %>

      <%= f.text_area :text %>

      <%= f.submit %>

<% end %>

<%= @question.question %>

  <%= link_to 'Edit', edit_question_path(@question) %> |
  <%= link_to 'Delete', question_path(@question), method: :delete, data: {confirm: 'Are you sure?'} %>

Comments:

<% @question.comments.each do |comment| %>

<%= comment.text %>

<% end %>

Write a comment:

<%= form_for ([@question, @question.comments.build]) do |f| %>

      <%= f.label :text %>

      <%= f.text_area :text %>

      <%= f.submit %>

<% end %>

Add links for edit, delete to question

Add links for edit, delete to question


<% if event.races_with_results.many? %>

      <%- event.races_with_results.sort.each_row do |first_race, second_race| -%>

          <%= link_to first_race.name, "#race_#{first_race.id}" %>

          <%= link_to(second_race.name, "#race_#{second_race.id}") if second_race %>

      <%- end -%>

<%- end -%>

<% if races.select(&:results_present?).many? %>

      <%- races.select(&:results_present?).sort.each_row do |first_race, second_race| -%>

          <%= link_to first_race.name, "#race_#{first_race.id}" %>

          <%= link_to(second_race.name, "#race_#{second_race.id}") if second_race %>

      <%- end -%>

<%- end -%>

Use races local, not event.races

Use races local, not event.races


      Copyright © <%= current_tenant.copyright_range -%>
      <% unless user_signed_in? || !multi_tenancy? %>
        · <%= link_to "Login", new_user_session_url %>
      <% end %>

<% if user_signed_in? and current_tenant != current_user %>
  <%= render :partial => 'shared/userbar' %>
<% else %>

  π

    Powered by Resumis. A cool thing by Max Fierke.

<% end %>

      Copyright © <%= current_tenant.copyright_range -%>
      <% unless user_signed_in? || !ResumisConfig.multi_tenant? %>
        · <%= link_to "Login", new_user_session_url %>
      <% end %>

<% if user_signed_in? and current_tenant != current_user %>
  <%= render :partial => 'shared/userbar' %>
<% else %>

  π

    Powered by Resumis. A cool thing by Max Fierke.

<% end %>

Fix NameError in footer partial

Fix NameError in footer partial


<% toolbar :profile => current_subject %>

<% content_for :headers do %>
  <%= stylesheet_link_tag "avatars.css", :media => "screen, projection" %>
  <%= javascript_include_tag 'jquery.Jcrop.min' %>
  <%= javascript_include_tag 'jquery.form' %>
  <%= javascript_include_tag 'jquery.fileupload' %>
  <%= javascript_include_tag 'jquery.fileupload-ui' %>
  <%= javascript_include_tag 'avatars.js' %>

  <%= stylesheet_link_tag "jquery.Jcrop", :media => "screen, projection" %>
  <%= stylesheet_link_tag "avatars", :media => "screen, projection" %><br/>
  <%= stylesheet_link_tag "jquery.fileupload-ui", :media => "screen, projection" %>
<% end %>

<% content_for :title do%>
  <%= current_subject.name %>
<% end%>
<% content_for :sidebar do %>
  <%= render :partial => 'home/sidebar' %>
<% end %>

<%= location(
 	link_to(image_tag("btn/btn_edit.png", :class => "menu_icon")+t('profile.one'), [current_subject,:profile]),
 	link_to(image_tag("btn/edit.png", :class => "menu_icon")+t('avatar.other'), avatars_path)
) %>

<%= render :partial => 'list' %>
<%= render :partial => 'form' %>

<% toolbar :profile => current_subject %>

<% content_for :headers do %>
  <%= stylesheet_link_tag "avatars.css", :media => "screen, projection" %>
  <%= javascript_include_tag 'jquery.Jcrop.min' %>
  <%= javascript_include_tag 'jquery.form' %>
  <%= javascript_include_tag 'jquery.fileupload' %>
  <%= javascript_include_tag 'jquery.fileupload-ui' %>
  <%= javascript_include_tag 'avatars.js' %>

  <%= stylesheet_link_tag "jquery.Jcrop", :media => "screen, projection" %>
  <%= stylesheet_link_tag "avatars", :media => "screen, projection" %>
  <%= stylesheet_link_tag "jquery.fileupload-ui", :media => "screen, projection" %>
<% end %>

<% content_for :title do%>
  <%= current_subject.name %>
<% end%>
<% content_for :sidebar do %>
  <%= render :partial => 'home/sidebar' %>
<% end %>

<%= location(
 	link_to(image_tag("btn/btn_edit.png", :class => "menu_icon")+t('profile.one'), [current_subject,:profile]),
 	link_to(image_tag("btn/edit.png", :class => "menu_icon")+t('avatar.other'), avatars_path)
) %>

<%= render :partial => 'list' %>
<%= render :partial => 'form' %>

Delete <br/> from avatars view

Delete <br/> from avatars view


/* DO NOT EDIT: File is auto-generated */
package <%= to_package(repository.graphql.qualified_abstract_endpoint_name) %>;

@javax.annotation.Generated( "Domgen" )
@java.lang.SuppressWarnings( { "UnusedDeclaration", "JavaDoc" } )
public abstract class <%= repository.graphql.abstract_endpoint_name %>
  extends org.realityforge.graphql.domgen.AbstractDomgenGraphQLEndpoint
{
  public static final String API_ENDPOINT = "<%= repository.graphql.api_endpoint %>";
<% if repository.graphql.graphiql? -%>
  public static final String INTERACTIVE_API_ENDPOINT = "<%= repository.graphql.graphiql_api_endpoint %>";
<% end -%>

  @java.lang.Override
  protected void preSchemaBuild()
  {
<% repository.graphql.schema_builders.keys.each do |name| -%>
    addSchemaBuilder( new<%= name %>SchemaBuilder() );
<% end -%>
  }
<% repository.graphql.schema_builders.each_pair do |name, classname| -%>

  @javax.annotation.Nullable
  protected org.realityforge.graphql.domgen.GraphQLSchemaBuilder new<%= name %>SchemaBuilder()
  {
    return new <%= classname =~ /\(/ ? classname : "#{classname}()" %>;
  }
<% end -%>
}

/* DO NOT EDIT: File is auto-generated */
package <%= to_package(repository.graphql.qualified_abstract_endpoint_name) %>;

@javax.annotation.Generated( "Domgen" )
@java.lang.SuppressWarnings( { "UnusedDeclaration", "JavaDoc" } )
public abstract class <%= repository.graphql.abstract_endpoint_name %>
  extends org.realityforge.graphql.domgen.AbstractDomgenGraphQLEndpoint
{
  public static final String API_ENDPOINT = "<%= repository.graphql.api_endpoint %>";
<% if repository.graphql.graphiql? -%>
  public static final String INTERACTIVE_API_ENDPOINT = "<%= repository.graphql.graphiql_api_endpoint %>";
<% end -%>

  @java.lang.Override
  protected void preSchemaBuild()
  {
    addSchemaBuilder( this::addStandardScalars );
<% repository.graphql.schema_builders.keys.each do |name| -%>
    addSchemaBuilder( new<%= name %>SchemaBuilder() );
<% end -%>
  }
<% repository.graphql.schema_builders.each_pair do |name, classname| -%>

  @javax.annotation.Nullable
  protected org.realityforge.graphql.domgen.GraphQLSchemaBuilder new<%= name %>SchemaBuilder()
  {
    return new <%= classname =~ /\(/ ? classname : "#{classname}()" %>;
  }
<% end -%>

  protected void addStandardScalars( @javax.annotation.Nonnull final com.coxautodev.graphql.tools.SchemaParserBuilder b )
  {
<% repository.graphql.non_standard_scalars.each do |scalar| -%>
    b.scalars( org.realityforge.graphql.domgen.Scalars.<%= Reality::Naming.uppercase_constantize(scalar) %> );
<% end -%>
  }
}

Add mechanism for defining standard scalars across the system


<% content_for :header do %>

Factlink on your site

By integrating Factlink into your website you enable your visitors to interact and discuss about statements that are made on your website. Integration of Factlink is very easy!

<% end %>

<% content_for :title do %>
  Factlink — On your site
<% end %>

<% content_for :content do %>

Wordpress

Other sites

<% end %>

<% content_for :header do %>

Factlink on your site

By integrating Factlink into your website you enable your visitors to interact and discuss about statements that are made on your website. Integration of Factlink is very easy!

<% end %>

<% content_for :title do %>
  Factlink — On your site
<% end %>

<% content_for :content do %>

Empower your visitors

Give people more control over the content that is on your website. Let your visitors discuss about specific statements within your page. Factlink is a powerfool tool to determine the reliability of the sources you aggregate. Using Factlink will not only generate more traffic to your website but also increases your authority on the subjects your writing about.

Factlink plugin

Here are instructions

Wordpress plugin

This plugin enables you to create and view Factlinks on your WordPress website. You can annotate any statement on your website by selecting the statement and clicking the add Factlink button.

      Use wordpress plugin

Factlink counter

Add the factlink counter to your website. The Factlink counter enables users to identify the Factlinks on your webpage.

<% end %>

Write copy for on your site page

Write copy for on your site page


<%= label %>

    <%= s3_uploader_form id: "s3-uploader#{'-primary' if local_assigns[:primary]}",
      callback_url: vehicle_images_url(vehicle, primary: local_assigns[:primary]),
      callback_param: "image[direct_upload_url]",
      expiration: 24.hours.from_now.utc.iso8601,
      max_file_size: 10.megabytes do %>
      <%= file_field_tag :file, multiple: !local_assigns[:primary] %>
    <% end %>

<div id="uploads_container<%= '_primary' if local_assigns[:primary] %>" class="row">

<%= label %>

    <%= s3_uploader_form id: "s3-uploader#{'-primary' if local_assigns[:primary]}",
      callback_url: vehicle_images_url(vehicle, primary: local_assigns[:primary]),
      callback_param: "image[direct_upload_url]",
      expiration: 24.hours.from_now.utc.iso8601,
      max_file_size: 10.megabytes do %>
      <%= file_field_tag :file, multiple: !local_assigns[:primary], accept: 'image/*', capture: 'camera' %>
    <% end %>

<div id="uploads_container<%= '_primary' if local_assigns[:primary] %>" class="row">

Add some tags to file uploads to see if uploaded images are easier from phone


    <% @src_sets.each do |ss| %>

            <%= render :partial => ss %>

    <% end %>

  <% if current_page? root_url %>
      <%= link_to 'More sets', :src_sets %>
  <% else %>
      <%= paginate @src_sets %>
  <% end %>

    <% @src_sets.each do |ss| %>

            <%= render(partial: ss) %>

    <% end %>

  <% if current_page?(root_url) %>
      <%= link_to('More sets', :src_sets) %>
  <% else %>
      <%= paginate(@src_sets) %>
  <% end %>

Use ruby 1.9 style hashes.

Use ruby 1.9 style hashes.


<!DOCTYPE html>

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

        <%= render partial: "common/navbar", locals: { active: @active_tab } %>

    <%= render partial: "common/flash" %>

        <%= yield %>

<!DOCTYPE html>

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

<body class="<%= controller.controller_name %> <%= controller.action_name %>">

        <%= render partial: "common/navbar", locals: { active: @active_tab } %>

    <%= render partial: "common/flash" %>

        <%= yield %>

Add some classes to help identify controllers and actions

This is intended to prevent JS from running on pages
it doesn't belong.


<!DOCTYPE html>
<html>
<head>
  <title>FAQrator</title>
  <!--Import materialize.css-->
  <link type="text/css" rel="stylesheet" href="css/materialize.css"  media="screen,projection"/>

  <!--Let browser know website is optimized for mobile-->
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>
</head>
<body>
<body class="grey lighten-3">
<%= yield %>
 <!--Import jQuery before materialize.js-->
 <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
 <script type="text/javascript" src="js/materialize.js"></script>
</body>
</html>

<!DOCTYPE html>

  <title>FAQrator</title>

  <link type="text/css" rel="stylesheet" href="css/materialize.css"  media="screen,projection"/>

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

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

        FAQrator

Sass

Components

JavaScript

<%= yield %>

Add nav bar to layout

Add nav bar to layout


<% if @event.races_with_results.many? %>

      <%- @event.races_with_results.sort.each do |race| -%>

          <%= link_to race.name, "#race_#{race.id}" %>

      <%- end -%>

<%- end -%>

<% if races.select(&:results_present?).many? %>

      <%- races.select(&:results_present?).sort.each_row do |first_race, second_race| -%>

          <%= link_to race.name, "#race_#{race.id}" %>

      <%- end -%>

<%- end -%>

Use local variable races, not @event.races


if [ "$E" == "0" ]; then
  NAGIOS_CODE=1
  NAGIOS_MESSAGE="OK: automysqlbackup succeeded"
elif [ -n "$E" ]; then
  NAGIOS_CODE=2
  NAGIOS_MESSAGE="CRITICAL: automysqlbackup encountered errors"
else
  NAGIOS_CODE=2
  NAGIOS_MESSAGE="CRITICAL: unable to determine automysqlbackup status"
fi

printf "<%= @fqdn %>\t<%= @service_desc %>\t$NAGIOS_CODE\t$NAGIOS_MESSAGE\n" \
  | /usr/sbin/send_nsca -H alert.cluster >/dev/null

tar -C /var/lib/automysqlbackup -jcf /var/lib/automysqlbackup/tmp.tbz2 latest/
mv /var/lib/automysqlbackup/tmp.tbz2 /var/lib/automysqlbackup/latest.tbz2
FINISHEPOCH=`date +%s`
TOTALTIME=$(expr $FINISHEPOCH - $STARTEPOCH)
logger -t automysqlbackup "MySQL backed up in T:$TOTALTIME seconds"

# Remove the temporary file added by the prebackup
rm /var/lock/mysql-backup.lock

if [ "$E" == "0" ]; then
  NAGIOS_CODE=0
  NAGIOS_MESSAGE="OK: automysqlbackup succeeded"
elif [ -n "$E" ]; then
  NAGIOS_CODE=2
  NAGIOS_MESSAGE="CRITICAL: automysqlbackup encountered errors"
else
  NAGIOS_CODE=2
  NAGIOS_MESSAGE="CRITICAL: unable to determine automysqlbackup status"
fi

printf "<%= @fqdn %>\t<%= @service_desc %>\t$NAGIOS_CODE\t$NAGIOS_MESSAGE\n" \
  | /usr/sbin/send_nsca -H alert.cluster >/dev/null

tar -C /var/lib/automysqlbackup -jcf /var/lib/automysqlbackup/tmp.tbz2 latest/
mv /var/lib/automysqlbackup/tmp.tbz2 /var/lib/automysqlbackup/latest.tbz2
FINISHEPOCH=`date +%s`
TOTALTIME=$(expr $FINISHEPOCH - $STARTEPOCH)
logger -t automysqlbackup "MySQL backed up in T:$TOTALTIME seconds"

# Remove the temporary file added by the prebackup
rm /var/lock/mysql-backup.lock

Change code for automysqlbackup passive check

Returning a code of 1 means that we have warnings for backups succeeding:

> WARNING          OK: automysqlbackup succeeded

Change this to 0 to indicate that the script was OK.


<%
  @title = show_article_title(@article)

  tabs = [
    link_to(:article_index.t, action: :index),
    link_to(:create_article.t, action: :create_article),
    link_to(:edit_article.t, action: :edit_article, id: @article.id)
  ]
  @tabsets = { right: draw_tab_set(tabs) }
%>

      <%= @article.body.tpl %>
      <%= "#{:AUTHOR.t}: #{@article.author}" %>

        <%= :footer_created_at.t(date: @article.created_at.web_time) %>

        <%= :footer_last_updated_at.t(date: @article.updated_at.web_time) %>

<%
  @title = show_article_title(@article)
  @tabsets = { right: draw_tab_set(show_article_tabs) }
%>

      <%= @article.body.tpl %>
      <%= "#{:AUTHOR.t}: #{@article.author}" %>

        <%= :footer_created_at.t(date: @article.created_at.web_time) %>

        <%= :footer_last_updated_at.t(date: @article.updated_at.web_time) %>

Use helper to get article tabs

Use helper to get article tabs


Add layout class to HTML

Add layout class to HTML


Originally conceived and built by Ruth John with help from Ben Scott

    Contribute

Add links to hrefs for Ruth and Ben

Add links to hrefs for Ruth and Ben


<% @page_title = "#{@article_category.name.capitalize}" %>

<%= tabnav :article_categories %>

  <% for article in @article_category.articles %>

<%= link_to article.title, article %>

<%= truncate(article.body, 500) %>

        <%- if article.body.length > 500 %>

<%= link_to "more", article %>

        <%- end %>

  <% end %>

<% @page_title = "#{@article_category.name.capitalize}" %>

<%= tabnav :article_categories %>

  <% for article in @article_category.articles %>

<%= link_to article.title, article %>

<%= truncate(article.body, :length => 500).html_safe %>

        <%- if article.body.length > 500 %>

<%= link_to "more", article %>

        <%- end %>

  <% end %>

Mark article content as HTML safe

Mark article content as HTML safe


<%= form_tag reorder_project_design_path(@design.project, @design), method: :post, remote: true, id: 'reorder_design_form' do %>

  <% @design.options.each_with_index do |option, position| %>
    <% if option[:variable_id].blank? %>
      <li id="option_<%= position %>" class="li-section">

<%= option[:section_name] %>

    <% elsif variable = Variable.current.find_by_id(option[:variable_id]) %>
      <li id="option_<%= position %>" class="li-variable">

¤

<%= link_to variable.name, [variable.project, variable] %>

<%= variable.display_name %>

<span class="label label-<%= variable.variable_type %>"><%= variable.variable_type %>

    <% end %>
  <% end %>

<% end %>

<%= form_tag reorder_project_design_path(@design.project, @design), method: :post, remote: true, id: 'reorder_design_form' do %>

  <% @design.options.each_with_index do |option, position| %>
    <% if option[:variable_id].blank? %>
      <li id="option_<%= position %>" class="li-section">

<%= option[:section_name] %>

    <% elsif variable = Variable.current.find_by_id(option[:variable_id]) %>
      <li id="option_<%= position %>" class="li-variable">

¤

<%= link_to variable.name, [variable.project, variable] %>

<%= variable.display_name %>

<span class="label label-<%= variable.variable_type == 'scale' ? variable.scale_type : variable.variable_type %>"><%= variable.variable_type == 'scale' ? "scale " + variable.scale_type : variable.variable_type %>

    <% end %>
  <% end %>

<% end %>

Change how the variable labels are displayed


Listing events

Category: <%= @category.to_s %>

      Name
      Description
      Position

    <% @events.each do |event| %>

        <%= event.name %>
        <%= event.description %>
        <%= event.position %>
        <%= link_to 'Event Choices', event_event_choices_path(event) %>
        <%= link_to 'Edit', edit_event_path(event) %>
        <%= link_to 'Destroy', event, method: :delete, data: { confirm: 'Are you sure?' } %>

      <% event.event_choices.each do |event_choice| %>

          Event Choice
          <%= event_choice.label %>
          <%= event_choice.cell_type %>
          <%= event_choice.position %>

      <% end %>
    <% end %>

New Event

  <%= render :partial => "form" %>

  <%= render :partial => "/attending/preview" %>

Listing events

Category: <%= @category.to_s %>

      Name
      Description
      Position

    <% @events.each do |event| %>

        <%= event.name %>
        <%= event.description %>
        <%= event.position %>
        <%= link_to 'Event Choices', event_event_choices_path(event) %>
        <%= link_to 'Edit', edit_event_path(event) %>
        <%= link_to 'Destroy', event, method: :delete, data: { confirm: 'Are you sure?' } %>

      <% event.event_choices.each do |event_choice| %>

          Event Choice
          <%= event_choice.label %>
          <%= event_choice.cell_type %>
          <%= event_choice.position %>

      <% end %>
    <% end %>

New Event

  <%= render :partial => "form" %>
  <%= link_to 'Back', categories_path %>

  <%= render :partial => "/attending/preview" %>

Add link from Events page to Categories page


  ProxyRequests on
  ProxyVia On
  AllowCONNECT 443 563
  HostnameLookups off
  <Proxy *>
    Order Deny,Allow
    <% if @master_ip.kind_of?(Array) -%>
    Allow from <%= @master_ip.join(",") %>
    <% else -%>
    Allow from <%= @master_ip %>
    <% end -%>
    Deny from all
  </Proxy>

  ProxyRequests on
  ProxyVia On
  AllowCONNECT 443 563 5000 8000 8003 8004 8080 8082 8386 8773 8774 8776 8777 9292 9696
  HostnameLookups off
  <Proxy *>
    Order Deny,Allow
    <% if @master_ip.kind_of?(Array) -%>
    Allow from <%= @master_ip.join(",") %>
    <% else -%>
    Allow from <%= @master_ip %>
    <% end -%>
    Deny from all
  </Proxy>

Add services ports to AllowConnect in Apache

OSTF needs to check services via HTTPS. To achieve this,
extra ports were added to Apache proxy:

* 5000 - keystone
* 8000, 8003, 8004 - heat
* 8080 - ceph radosgw (or swift)
* 8082 - murano
* 8386 - sahara
* 8773, 8774 - nova
* 8776 - cinder
* 8777 - ceilometer
* 9292 - glance
* 9696 - neutron

Closes-Bug: #1489408
Change-Id: If599d8eead56d340583e46602373f7ddb2842b00


# file is managed by puppet
<% unless scope.lookupvar('rsyslog::client::high_precision_timestamps') -%>
#
# Use traditional timestamp format date-rfc3164 (Dec 5 02:21:13).
# To enable high precision timestamps date-rfc3339 (2010-12-05T02:21:41.889482+01:00), comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>

if $programname == 'puppet-agent' then /var/log/puppet/agent.log

# file is managed by puppet
<% unless @high_precision_timestamps -%>
#
# Use traditional timestamp format date-rfc3164 (Dec 5 02:21:13).
# To enable high precision timestamps date-rfc3339 (2010-12-05T02:21:41.889482+01:00), comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>

if $programname == 'puppet-agent' then /var/log/puppet/agent.log

Fix scope warnings in rsyslog module

Fix scope warnings in rsyslog module


<% content_for :head do -%>
  <%= stylesheet_link_tag 'products_page.css' %>
<% end %>

      <% @products.each_with_index do |product, i| %>
        <li id='interesting_product_<%= i %>' class='left-text padding-5'>

            <%= link_to  image_tag(product.featured_image(:small)), product_path(product) %>

<%= product.name %>

          ( <%= number_to_currency product.price_range.first %>
            <% if product.price_range? %>
                to <%= number_to_currency product.price_range.last %>
            <% end %>)

      <% end %>

    Join our web site and get additional Savings....  <%= image_tag "logos/#{Image::MAIN_LOGO}.png", :alt => 'hadean image.'%>

<% content_for :head do -%>
  <%= stylesheet_link_tag 'products_page.css' %>
<% end %>

      <% @products.each_with_index do |product, i| %>
        <li id='interesting_product_<%= i %>' class='left-text padding-5'>

            <%= link_to image_tag(product.featured_image(:small)), product_path(product), title: product.name %>

<%= product.name %>

          ( <%= number_to_currency product.price_range.first %>
            <% if product.price_range? %>
                to <%= number_to_currency product.price_range.last %>
            <% end %>)

      <% end %>

    Join our web site and get additional Savings....  <%= image_tag "logos/#{Image::MAIN_LOGO}.png", :alt => 'hadean image.'%>

Add title tag to product links for accessibility reason


<%= simple_form_for @tracker do |f| %>
  <%= f.input :logged_date, input_html: { class: "datepicker" } %>
  <%= f.input :duration %>
  <%= f.association :project, collection: current_user.projects.order(:name), prompt: "Choose a Project" %>
  <%= f.input :description %>
  <%= f.button :submit %>
  <%= link_to "Cancel", :back, class: "modal-action modal-close waves-effect waves-green btn-flat"%>
<% end %>

<%= simple_form_for @tracker do |f| %>
  <%= f.input :logged_date, as: :string, input_html: { class: "datepicker" } %>
  <%= f.input :duration %>
  <%= f.association :project, collection: current_user.projects.order(:name), prompt: "Choose a Project" %>
  <%= f.input :description %>
  <%= f.button :submit %>
  <%= link_to "Cancel", :back, class: "modal-action modal-close waves-effect waves-green btn-flat"%>
<% end %>

Fix Datepicker on tracker form

Fix Datepicker on tracker form


# /etc/environment
#
# DO NOT CHANGE THIS FILE MANUALLY!
#
# This file is managed by the Chef `sys` cookbook.

<% node['sys']['env'].each_pair do |key,value| %>
<% raise "Whitespace in environment variable name" if key =~ /\s/ %>
<%= key %>="<%= value %>"
<% end %>

# /etc/environment
#
# DO NOT CHANGE THIS FILE MANUALLY!
#
# This file is managed by the Chef `sys` cookbook.

<% node['sys']['env'].keys.sort_by(&:downcase) do |key| %>
<% raise "Whitespace in environment variable name" if key =~ /\s/ %>
<%= key %>="<%= node['sys']['env'][key] %>
<% end %>

Sort lines in /etc/environment ignoring case


The appointment was changed by an agent

<%= p do %>
  Reference number:

    <%= @appointment.reference %>

<% end %>

<%= p do %>
  The following details were changed:
<% end %>

  <% @appointment.audits.last.audited_changes.keys.map(&:humanize).each do |key| %>

<%= key %>

  <% end %>

<%= h2 do %>
  The appointment was changed by an agent
<% end %>

<%= p do %>
  Reference number:

    <%= @appointment.reference %>

<% end %>

<%= p do %>
  The following details were changed:
<% end %>

<%= ul do %>
  <% @appointment.audits.last.audited_changes.keys.map(&:humanize).each do |key| %>

<%= key %>

  <% end %>
<% end %>

Update booking manager appointment change email


<%= f.label field.attribute %>
<%= f.attachment_field field.attribute, presigned: field.presigned?, direct: field.direct? %>
<progress value="0" max="100"></progress>

<%= f.label field.attribute %>
<%= f.attachment_field field.attribute, presigned: field.presigned?, direct: field.direct? %>
<% if field.direct? %>
  <progress value="0" max="100"></progress>
<% end %>

Hide progress bar for a direct upload

Hide progress bar for a direct upload


#!/bin/sh
#
# MySQL Backup Script
#  Dumps mysql databases to a file for another backup tool to pick up.
#
# MySQL code:
# GRANT SELECT, RELOAD, LOCK TABLES ON *.* TO 'user'@'localhost'
# IDENTIFIED BY 'password';
# FLUSH PRIVILEGES;
#
##### START CONFIG ###################################################

USER=<%= backupuser %>
PASS=<%= backuppassword %>
DIR=<%= backupdir %>

##### STOP CONFIG ####################################################
PATH=/usr/bin:/usr/sbin:/bin:/sbin

find $DIR -mtime +30 -exec rm -f {} \;
mysqldump -u${USER} -p${PASS} --opt --flush-logs --single-transaction \
 --all-databases <% if backupcompress %> | bzcat -zc <% end %> > ${DIR}/mysql_backup_`date +%Y%m%d-%H%M%S`.sql<% if backupcompress %>.bz2<% end  %>

#!/bin/sh
#
# MySQL Backup Script
#  Dumps mysql databases to a file for another backup tool to pick up.
#
# MySQL code:
# GRANT SELECT, RELOAD, LOCK TABLES ON *.* TO 'user'@'localhost'
# IDENTIFIED BY 'password';
# FLUSH PRIVILEGES;
#
##### START CONFIG ###################################################

USER=<%= backupuser %>
PASS=<%= backuppassword %>
DIR=<%= backupdir %>

##### STOP CONFIG ####################################################
PATH=/usr/bin:/usr/sbin:/bin:/sbin

find $DIR -mtime +30 -exec rm -f {} \;
mysqldump -u${USER} -p${PASS} --opt --flush-logs --single-transaction \
 --all-databases <% if backupcompress %>| bzcat -zc <% end %>> ${DIR}/mysql_backup_`date +%Y%m%d-%H%M%S`.sql<% if backupcompress %>.bz2<% end  %>

Tweak template spacing to pass spec tests with clean output


---
- job:
    name: Success_Passive_Check
    display-name: Success_Passive_Check
    project-type: freestyle
    description: "This job should be used to send a passive check to Icinga with a SUCCESS
      status. As such this should only be used as a triggered build for a stable (or related)
      condition."
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    builders:
      - shell: |
          IPADDRESS=$(facter ipaddress)
          NSCA_CODE=0
          printf "$IPADDRESS\t$NSCA_CHECK_DESCRIPTION\t$NSCA_CODE\t$NSCA_OUTPUT\n" | /usr/sbin/send_nsca -H <%= @alert_hostname %> >/dev/null
    wrappers:
        - ansicolor:
            colormap: xterm
    parameters:
        - string:
            name: NSCA_CHECK_DESCRIPTION
            description: 'Descriptive name of job triggering this alert'
        - string:
            name: NSCA_OUTPUT
            description: 'Description for the condition of the success'

---
- job:
    name: Success_Passive_Check
    display-name: Success_Passive_Check
    project-type: freestyle
    description: "This job should be used to send a passive check to Icinga with a SUCCESS
      status. As such this should only be used as a triggered build for a stable (or related)
      condition."
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    builders:
      - shell: |
          IPADDRESS=$(facter ipaddress_eth0)
          NSCA_CODE=0
          printf "$IPADDRESS\t$NSCA_CHECK_DESCRIPTION\t$NSCA_CODE\t$NSCA_OUTPUT\n" | /usr/sbin/send_nsca -H <%= @alert_hostname %> >/dev/null
    wrappers:
        - ansicolor:
            colormap: xterm
    parameters:
        - string:
            name: NSCA_CHECK_DESCRIPTION
            description: 'Descriptive name of job triggering this alert'
        - string:
            name: NSCA_OUTPUT
            description: 'Description for the condition of the success'

Use facter ipaddress_eth0 instead of ipaddress

ipaddress is a bad choice here because it might guess wrong when
picking an interface, the result we really want is for eth0.


<% if notice %>

<%= notice %>

<% end %>

Your Pragmatic Catalog

<% @products.each do |product| %>

	<%= image_tag(product.image_url) %>

<%= product.title %>

	<%= sanitize(product.description) %>

	    <%= number_to_currency(product.price) %>
	    <%= button_to "Add to Cart", line_items_path(:product_id => product) %>

<% end %>

<% if notice %>

<%= notice %>

<% end %>

Your Pragmatic Catalog

<% @products.each do |product| %>

        <%= link_to(image_tag(product.image_url),
                    line_items_path(:product_id => product.id),
                    html_options = {:method => :post}) %>

<%= product.title %>

	<%= sanitize(product.description) %>

	    <%= number_to_currency(product.price) %>
	    <%= button_to "Add to Cart", line_items_path(:product_id => product) %>

<% end %>

Add to cart when click the link of the image


<li<%= ' class="active"' if current == "Parts" %>>
  <%= link_to t("parts"), admin_product_parts_url(@product) %>
</li>

<% if @product.assembly? %>
  <% content_for :head do %>
    <script type="text/javascript">
      jQuery(document).ready(function(){
        $("ul.product-menu a:contains('<%= t("variants") %>')").parent().hide();
        $("ul.product-menu a:contains('<%= t("option_types") %>')").parent().hide();
      });
    </script>
  <% end %>
<% end %>

<li<%= ' class="active"' if current == "Parts" %>>
  <%= link_to_with_icon 'icon-sitemap', t("parts"), admin_product_parts_url(@product) %>
</li>

Use an icon for the Parts tab

Use an icon for the Parts tab


<!DOCTYPE html>

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

<%= notice %>

<%= alert %>

<%= yield %>

<!DOCTYPE html>

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

<%= notice %>

<%= alert %>

<% if user_signed_in? %>
    Здравствуйте, <%= current_user.email %>
    <%= link_to 'Выйти', destroy_user_session_path, :method => :delete %>
<% else %>
    <%= link_to 'Войти', new_user_session_path %> или <%= link_to 'Зарегистрироваться', new_user_registration_path %>
<% end %>

<%= yield %>

Add links to "sign_in" and "sign_up"

Add links to "sign_in" and "sign_up"


<div class="jumbotron jumbotron-about visible-sm visible-md visible-lg"
     style="background-image: url(<%= user.header_image_url %>);">

                    <%= user.first_name %>
                    <%= user.last_name %>

                    <%= user.tagline %>

<div class="jumbotron jumbotron-about visible-sm visible-md visible-lg"
     style="background-image: url(<%= user.header_image_url %>);">

                    <%= user.first_name %>
                    <%= user.last_name %>

                <% if user.tagline and user.tagline.length > 0 %>

                    <%= user.tagline %>

                <% end %>

Hide the tagline h2 if user has no tagline

Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>


<%= template_header -%>

node_name        '<%= node['fqdn'] %>'

chef_server_url  '<%= @server_url %>'
client_key       '<%= @client_key %>'

<% if @trusted_certs_dir -%>
trusted_certs_dir '<%= @trusted_certs_dir %>'
<% end -%>
<%- if @verify_ssl == 'all' -%>
# Verify all HTTPS connections
ssl_verify_mode :verify_peer
<%- elsif @verify_ssl == 'chef-server' -%>
# Verify only connections to chef-server
verify_api_cert true
<%- end -%>

validation_client_name '<%= @validation_client_name %>'
validation_key   '<%= @validation_key %>'

log_level        <%= @log_level %>
log_location     <%= @use_syslog?'SyslogLogger.new("chef-client")':'STDOUT' %>

file_backup_path '/var/backups/chef'
file_cache_path  '/var/cache/chef'
pid_file         '/var/run/chef/client.pid'

# configuration for Ohai:
<%- unless @odisable.empty? -%>
<%#   Make sure to write symbols into the configuration file %>
<%-   plugins = @odisable.map { |p| p.capitalize.to_sym } -%>
ohai.disabled_plugins =  <%= plugins %>
<%- end %>
ohai.plugin_path << '<%= @opath %>'

<%= @custom_config -%>

<%= template_header -%>

<%- nodename = @node_name || node['fqdn'] -%>
<%- if nodename
node_name        '<%= nodename %>'

<%- end -%>
chef_server_url  '<%= @server_url %>'
client_key       '<%= @client_key %>'

<% if @trusted_certs_dir -%>
trusted_certs_dir '<%= @trusted_certs_dir %>'
<% end -%>
<%- if @verify_ssl == 'all' -%>
# Verify all HTTPS connections
ssl_verify_mode :verify_peer
<%- elsif @verify_ssl == 'chef-server' -%>
# Verify only connections to chef-server
verify_api_cert true
<%- end -%>

validation_client_name '<%= @validation_client_name %>'
validation_key   '<%= @validation_key %>'

log_level        <%= @log_level %>
log_location     <%= @use_syslog?'SyslogLogger.new("chef-client")':'STDOUT' %>

file_backup_path '/var/backups/chef'
file_cache_path  '/var/cache/chef'
pid_file         '/var/run/chef/client.pid'

# configuration for Ohai:
<%- unless @odisable.empty? -%>
<%#   Make sure to write symbols into the configuration file %>
<%-   plugins = @odisable.map { |p| p.capitalize.to_sym } -%>
ohai.disabled_plugins =  <%= plugins %>
<%- end %>
ohai.plugin_path << '<%= @opath %>'

<%= @custom_config -%>

Make node name configurable and catch empty node['fqdn']


<% content_for :title do %>
  VAT payment deadline calculator
<% end %>

<% content_for :meta_description do %>
  Work out the VAT payment deadline for your accounting period.
<% end %>

<% content_for :body do %>
  Work out the VAT payment deadline for your accounting period.

  You can't use this calculator if you make payments on account or use the annual
  accounting scheme.

^ From 1 April 2019, most businesses will need to [keep digital VAT records and use
software to submit VAT Returns](/guidance/check-when-a-business-must-follow-the-rules-for-making-tax-digital-for-vat).
<% end %>

Update to smart answer start page

Update to smart answer start page

Telling users about forthcoming changes to VAT records and returns. They need to be able to act on these now.


---
- job:
    name: smart_answers_broken_links_report
    display-name: Smart Answers Broken Links Report
    project-type: freestyle
    description: "
Searches Smart Answer flows for broken links, by quering link checker api and sends a report to zendesk
"
    builders:
      - trigger-builds:
          - project: run-rake-task
            block: true
            predefined-parameters: |
              TARGET_APPLICATION=smartanswers
              MACHINE_CLASS=calculators_frontend
              RAKE_TASK=links:send_report[govuk-coronavirus-nsv@govuk.zendesk.com]
    wrappers:
      - ansicolor:
          colormap: xterm
  <% if @cron_schedule %>
    triggers:
      - timed: <%= @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: smart_answers_broken_links_report
    display-name: Smart Answers Broken Links Report
    project-type: freestyle
    description: "
Searches Smart Answer flows for broken links, by quering link checker api and sends a report to zendesk
"
    builders:
      - trigger-builds:
          - project: run-rake-task
            block: true
            predefined-parameters: |
              TARGET_APPLICATION=smartanswers
              MACHINE_CLASS=calculators_frontend
              RAKE_TASK=links:send_report[govuk-smart-answers@digital.cabinet-office.gov.uk]
    wrappers:
      - ansicolor:
          colormap: xterm
  <% if @cron_schedule %>
    triggers:
      - timed: <%= @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

Update requester email used to send smart answers broken link report to zendesk


<% zk_properties = scope.lookupvar('zookeeper::_properties') -%>
<%# sort the properties list for ruby <= 1.8 #-%>
<% rv=RUBY_VERSION.split('.') -%>
<% if rv[0] <= '1' and rv[1] <= '8' -%>
<% zk_properties_keys = zk_properties.keys.sort -%>
<% else -%>
<% zk_properties_keys = zk_properties.keys -%>
<% end -%>
export JVMFLAGS="<% zk_properties_keys.each do |p| -%>
<% value = zk_properties[p] -%>
<% if value != '::undef' -%>
-D<%= p -%>=<%= value.gsub(/([\$\\ "])/, '\\1').gsub(/\n/, '') -%> <% end -%>
<% end -%>
"

<% zk_properties = scope.lookupvar('zookeeper::_properties') -%>
<%# sort the properties list for ruby <= 1.8 #-%>
<% rv=RUBY_VERSION.split('.') -%>
<% if rv[0] <= '1' and rv[1] <= '8' -%>
<% zk_properties_keys = zk_properties.keys.sort -%>
<% else -%>
<% zk_properties_keys = zk_properties.keys -%>
<% end -%>
export JVMFLAGS="<% zk_properties_keys.each do |p| -%>
<% value = zk_properties[p] -%>
<% if value != '::undef' -%>
-D<%= p -%>=<%= value.gsub(/([\$\\ "])/, '\\\\\\1').gsub(/\n/, '') -%> <% end -%>
<% end -%>
"

Fix escaping in auth_to_local Kerberos rules.


digraph G {
  charset="UTF-8";
  graph [truecolor=true,bgcolor=transparent];
  root [label="",shape=circle];
  rankdir="<%= @direction -%>";

  <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
    <%= node token.id, token.relation.to_s.upcase,                 shape: :box -%>

    <%- if token.relation -%>
      <%= edge (token.head ? token.head.id : :root), token.id, '', weight: 1.0, color: :orange -%>
    <%- end -%>

    <%- token.slashes.each do |(relation, target)| -%>
      <%= edge token.id, target, relation.to_s.upcase, weight: 0.0, color: :blue, style: :dashed %>
    <%- end -%>
  <%- end -%>

  <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
    <%= edge token.id, "T#{token.id}", nil, weight: 10, arrowhead: :none -%>
  <%- end -%>

  {
    rank="same";

    <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
      <%= node "T#{token.id}", token.form, shape: :none -%>
    <%- end -%>
  }
}

digraph G {
  charset="UTF-8";
  graph [truecolor=true,bgcolor=transparent];
  root [label="",shape=circle];
  rankdir="<%= @direction -%>";

  <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
    <%= node token.id, token.relation.to_s.upcase,                 shape: :box -%>

    <%- if token.relation -%>
      <%= edge (token.head ? token.head.id : :root), token.id, '', weight: 1.0, color: :orange -%>
    <%- end -%>

    <%- token.slashes.each do |(relation, target)| -%>
      <%= edge token.id, target, relation.to_s.upcase, weight: 0.0, color: :blue, style: :dashed %>
    <%- end -%>
  <%- end -%>

  <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
    <%= edge token.id, "T#{token.id}", nil, weight: 10, arrowhead: :none -%>
  <%- end -%>

  {
    rank="same";

    <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
      <%= node "T#{token.id}", token.form, shape: :none -%>
    <%- end -%>

    <%= @graph.tokens.select { |t| t.empty_token_sort != 'P' }.map { |token| "T#{token.id}" }.join('->') -%> [style="invis"];
  }
}

Enforce linear order in "modern" viz

Enforce linear order in "modern" viz


<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId><%= group_id %></groupId>
  <artifactId><%= artifact_id %></artifactId>
  <version><%= version %></version>
  <name><%= artifact_id %></name>
  <% if type != 'jar' %><packaging><%= type %></packaging><% end %>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
<% dependencies.each do |d| if d %><%= render('_dependency.xml.erb', d) %><% end;
 end %>  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId><%= group_id %></groupId>
  <artifactId><%= artifact_id %></artifactId>
  <version><%= version %></version>
  <name><%= artifact_id %></name>
  <% if type != 'jar' %><packaging><%= type %></packaging><% end %>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
<% dependencies.each do |d| if d %><%= render('_dependency.xml.erb', d) %><% end;
 end %>  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

Upgrade compiler plugin to 3.8.0

Upgrade compiler plugin to 3.8.0


module Refinery
  class <%= extension_plural_class_name %>Generator < Rails::Generators::Base

    def rake_db
      rake("refinery_<%= extension_plural_name %>:install:migrations")
    end

    def append_load_seed_data
      create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
      append_file 'db/seeds.rb', :verbose => true do
        <<-EOH

# Added by Refinery CMS <%= plural_name.titleize %> extension
Refinery::<%= namespacing %>::Engine.load_seed
        EOH
      end
    end
  end
end

module Refinery
  class <%= extension_plural_class_name %>Generator < Rails::Generators::Base

    def rake_db
      rake("refinery_<%= extension_plural_name %>:install:migrations")
    end

    def append_load_seed_data
      create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
      append_file 'db/seeds.rb', :verbose => true do
        <<-EOH

# Added by Refinery CMS <%= namespacing %> extension
Refinery::<%= namespacing %>::Engine.load_seed
        EOH
      end
    end
  end
end

Use namespace instead of extension resource plural name, which is often wrong in the case of nested resources.

Fixes #2016


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.


<!DOCTYPE html>
<html lang="en">
  <head>
    <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" %>
    <%= javascript_include_tag "application", 'data-turbolinks-track' => true %>
    <%= csrf_meta_tags %>
  </head>

  <body>

    <%= yield %>

  </body>
</html>

<!DOCTYPE html>

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

    <title><%= content_for?(:title) ? yield(:title) : "YesAnd" %></title>

    <%= stylesheet_link_tag    "application" %>
    <%= javascript_include_tag "vendor/modernizr" %>
    <%= javascript_include_tag "application", 'data-turbolinks-track' => true %>
    <%= csrf_meta_tags %>

YesAnd

          <% if current_user %>

          <% else %>

          <% end %>

    <%= yield %>

Add navigation bar and logic

Add navigation bar and logic


<!DOCTYPE html>
<html>
<head>
  <title>Faxomat</title>
  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

</body>
</html>

<!DOCTYPE html>

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

    Achtung: Wegen Wartungsarbeiten gehen Faxe momentan mit Verzögerung raus! Aber keine Panik: Alles wird gut...

<%= yield %>

Add warning dialog for users.

Add warning dialog for users.


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

<% content_for :page_title, "Specialist Publisher" %>

<% content_for :navbar_items do %>

<%= nav_link_to 'Manuals', '/manuals' %>

  <% if user_can_edit_documents? %>

<%= nav_link_to 'Documents', '/specialist-documents' %>

  <% end -%>
<% end %>

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

<% content_for :content do %>
  <% flash.each do |type, msg| %>
    <%= content_tag :div, msg, class: "alert #{bootstrap_class_for(type)}" %>
  <% end -%>
  <%= render(:partial => 'shared/breadcrumbs') %>
  <%= yield %>
<% end %>
<%= javascript_include_tag "application" %>

<%# use the govuk_admin_foundation layout %>
<%= render :template => 'layouts/govuk_admin_template' %>

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

<% content_for :page_title, "Specialist Publisher" %>

<% content_for :navbar_items do %>

<%= nav_link_to 'Manuals', '/manuals' %>

  <% if user_can_edit_documents? %>

<%= nav_link_to 'Documents', '/specialist-documents' %>

  <% end -%>
<% end %>

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

<% content_for :content do %>
  <% flash.each do |type, msg| %>
    <%= content_tag :div, msg, class: "alert #{bootstrap_class_for(type)}" %>
  <% end -%>
  <%= render(:partial => 'shared/breadcrumbs') %>
  <%= yield %>

<% end %>

<%# use the govuk_admin_foundation layout %>
<%= render :template => 'layouts/govuk_admin_template' %>

Stop JS from rendering outside of head tag

When I moved to the govuk_admin_template I accidentally left some things outside of content_for tags which meant that there were a whole bunch of script tags at the top of the page before the <head> this caused ie^ and 7 to get very confused, naturally.


Commitment

  We are currently asking everyone that starts one of these relationships to commit for a time of 4 weeks. (If both parties want to continue on past 4 weeks, that is very cool, but we feel like this is a good time frame to start with.)

  This commitment will run until close to <%= display_date Time.now.advance(:weeks => 4) %>. (Depending on if/when it's accepted.)

Availability

  <%= not_current_user.name %> is currently available for <%= not_current_user.remote_availability %> remotely and <%= not_current_user.local_availability %> locally.

Commitment

  We ask everyone to sign up for mentoring segments in 4 week chunks. If you and your mentor want to continue for additional 4 week segments, please renew the relationship at the end of the initial 4 weeks.

  This commitment will run until close to <%= display_date Time.now.advance(:weeks => 4) %>. (Depending on if/when it's accepted.)

Availability

  <%= not_current_user.name %> is currently available for <%= not_current_user.remote_availability %> remotely and <%= not_current_user.local_availability %> locally.

Copy changes on the mentorship details

Copy changes on the mentorship details


<%= error_messages_for 'forum' %>

<%= _('My Forum') %>

<%= render :file => 'shared/tiny_mce' %>

<%= required f.text_field(:name, :size => '64', :maxlength => 150, :onchange => "updateUrlField(this, 'article_slug')") %>

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

<%= labelled_form_field(_('Description:'), text_area(:article, :body, :cols => 64, :rows => 10)) %>

<%= labelled_form_field(_('Posts per page:'), f.select(:posts_per_page, Forum.posts_per_page_options)) %>

<%= labelled_form_field(_('Has terms of use:'), check_box(:article, :has_terms_of_use))%>

  <%= labelled_form_field(_('Terms of use:'), text_area(:article, :terms_of_use, :class => 'mceEditor',:cols => 64, :rows => 10)) %>

<%= error_messages_for 'forum' %>

<%= _('My Forum') %>

<%= required_fields_message %>

<%= render :file => 'shared/tiny_mce' %>

<%= required f.text_field(:name, :size => '64', :maxlength => 150, :onchange => "updateUrlField(this, 'article_slug')") %>

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

<%= labelled_form_field(_('Description:'), text_area(:article, :body, :cols => 64, :rows => 10)) %>

<%= labelled_form_field(_('Posts per page:'), f.select(:posts_per_page, Forum.posts_per_page_options)) %>

<%= labelled_form_field(_('Has terms of use:'), check_box(:article, :has_terms_of_use))%>

  <%= labelled_form_field(_('Terms of use:'), text_area(:article, :terms_of_use, :class => 'mceEditor',:cols => 64, :rows => 10)) %>

Fix the required_fields_message for forums. It was overlaying the title field

Signed-off-by: Fabio Teixeira <a90b0aa793b4509973a022e6fee8cf8a263dd84e@gmail.com>
Signed-off-by: Gabriela Navarro <61c2bac069eee966d94f5b4095f9a2d9fa323d86@gmail.com>


Let's play 500!

First, we will deal the cards.

Your cards:

  <% @game.hands[:south].each do |card| %>

<%= unicode_card(card.to_s) %>

  <% end %>

Now is the bidding phase.

West passes.

North passes.

East passes.

It is now your chance to make a bid.

For now, let's ignore trump suits.

For now, you must make a bid. You cannot pass.

<select>
  <option>6</option>
  <option>7</option>
  <option>8</option>
  <option>9</option>
  <option>10</option>
</select>
<select>
  <option disabled>Spades</option>
  <option disabled>Hearts</option>
  <option disabled>Clubs</option>
  <option disabled>Diamonds</option>
  <option>No Trumps</option>
</select>

Remove unused bidding phase content

Remove unused bidding phase content


<%= @game.name %>

  <% @game.participants.each do |player| %>

<%= player.display_name %>

  <% end %>

 <%= render 'cards/form', card: Card.new, game: @game %>
 <%= render 'start', game: @game %>

<%= @game.name %>

  <% @game.participants.each do |player| %>

<%= player.display_name %>

  <% end %>

 <%= render 'cards/form', card: Card.new, game: @game %>
 <%= render 'games/start', game: @game %>

Add full path to games/start

Add full path to games/start


For ODI membership information, please visit <%= link_to 'http://theodi.org/join-us', 'http://theodi.org/join-us'%>

Add link back to main website on frontpage.


<%= render partial: 'lessons/sub_header' %>

<%= render partial: 'lessons/edit_sub_nav' %>

<%= render partial: 'steps/step_list' %>

<%= form_tag(edit_lesson_step_path(lesson_id: @lesson_obj.id, id: @step_obj.id, form_step:4), method: :patch, multipart: true, class: "Form") do %>

  <%= render partial: 'steps/form' %>

        Back to details
        <button class="Form__footer__action Button Button--primary Button--small Button--icon Button--icon--right Button--arrow--right">Add some outcomes</button>

<% end %>

<%= render partial: 'lessons/sub_header' %>

<%= render partial: 'lessons/edit_sub_nav' %>

<%= render partial: 'steps/step_list' %>

<%= form_tag(lesson_step_path(lesson_id: @lesson_obj.id, id: @step_obj.id, form_step:4), method: :patch, multipart: true, class: "Form") do %>

  <%= render partial: 'steps/form' %>

        Back to details
        <button class="Form__footer__action Button Button--primary Button--small Button--icon Button--icon--right Button--arrow--right">Add some outcomes</button>

<% end %>

Patch to lesson_step_path not edit_lesson_step_path


<%= location.name %>

<%= location.address %>

  <%= image_tag(location.icon.url(:map_icon)) %>

<%= number_to_phone(location.phone, area_code: true) %>

<%= link_to("Website", location.website, :target => "_blank") %>

<%= link_to("Get Directions", "https://www.google.com/maps/dir/Current+Location/#{location.latitude},#{location.longitude}", :target => "_blank") %>

<%= location.description %>

  <%= link_to_if(location.coupon_url?, "Print Coupon", location.coupon_url, class: "button radius button right") %>

<%= location.name %>

<%= location.address %>

  <%= image_tag(location.icon.url(:map_icon)) %>

<%= number_to_phone(location.phone, area_code: true) %>

<%= link_to("Website", location.website, :target => "_blank") %>

<%= link_to("Get Directions", "https://www.google.com/maps/dir/Current+Location/#{location.latitude},#{location.longitude}", :target => "_blank") %>

<%= location.description %>

  <% unless location.coupon_url.empty? %>
    <%= link_to("Print Coupon", location.coupon_url, class: "button radius button right") %>
  <% end %>

Resolve print coupon button issue

Resolve print coupon button issue


Gallery Homepage

Featured Pieces:

	<% @random_pieces.each do |piece| %>

 <%= link_to image_tag(piece.img), artist_piece_path(piece.artist_id, piece.id) %>

	<% end %>

Featured Scenes:

	<% @random_scenes.each do |scene| %>
		<%= link_to image_tag(scene.img), organization_space_path(scene.organization_id, scene.id) %>
	<% end %>

Pieces by Category

	<% @gallery_images.each do |image| %>
		<%= image %>
	<% end %>

Remove categories from gallery homepage

Remove categories from gallery homepage


  <% test_results.each_with_index do |test_result, index| %>

      <% if test_result[:status] == :failed %>

          <%= status_icon(test_result[:status]) %>
          <%= test_result[:title] %>
          <a data-toggle="collapse" href="#example-result-<%= index %>"  class="example-see-more">Ver detalles

      <% else %>

          <%= status_icon(test_result[:status]) %>
          <%= test_result[:title] %>

      <% end %>

      <div class="example-result collapse <%= 'in' if visible_success_output %>" id="example-result-<%= index %>">
        <%= output_content_type.to_html test_result[:result] %>

  <% end %>

  <% test_results.each_with_index do |test_result, index| %>

      <% if test_result[:status] == :failed %>

          <%= status_icon(test_result[:status]) %>
          <%= test_result[:title] %>
          <% unless visible_success_output %>
            <a data-toggle="collapse" href="#example-result-<%= index %>"  class="example-see-more">Ver detalles
          <% end %>

      <% else %>

          <%= status_icon(test_result[:status]) %>
          <%= test_result[:title] %>

      <% end %>

      <div class="example-result collapse <%= 'in' if visible_success_output %>" id="example-result-<%= index %>">
        <%= output_content_type.to_html test_result[:result] %>

  <% end %>

Hide details in visible output

Hide details in visible output


Change your password

<%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
  <%= f.error_notification %>

  <%= f.input :reset_password_token, :as => :hidden %>
  <%= f.full_error :reset_password_token %>

    <%= f.input :password, :label => "New password", :required => true %>
    <%= f.input :password_confirmation, :label => "Confirm your new password", :required => true %>

    <%= f.button :submit, "Change my password" %>

<% end %>

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

Change your password

  <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
    <%= f.error_notification %>

    <%= f.input :reset_password_token, :as => :hidden %>
    <%= f.full_error :reset_password_token %>

      <%= f.input :password, :label => "New password", :required => true %>
      <%= f.input :password_confirmation, :label => "Confirm your new password", :required => true %>

      <%= f.button :submit, "Change my password", :class => "btn btn-primary" %>

  <% end %>

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

Add the container on the password reset

Add the container on the password reset


My Profile

      <%= form_for(@admin, :url => save_profile_admin_path) do |f| %>
        <% if @admin.errors.any? %>

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

            <% @admin.errors.full_messages.each do |msg| %>

<%= msg %>

            <% end %>

        <% end %>

<%= f.label :email %>

<%= f.email_field :email, :class => 'input-xlarge' %>

<%= f.label :password %>

<%= f.password_field :password, :class => 'input-xlarge' %>

<%= f.label :password_confirmation %>

<%= f.password_field :password_confirmation, :class => 'input-xlarge' %>

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

      <% end %>

<%= link_to raw('« Back'), admins_path, :class => 'btn btn-mini' %>

My Profile

      <%= form_for(@admin, :url => save_profile_admin_path) do |f| %>
        <% if @admin.errors.any? %>

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

            <% @admin.errors.full_messages.each do |msg| %>

<%= msg %>

            <% end %>

        <% end %>

<%= f.label :password %>

<%= f.password_field :password, :class => 'input-xlarge' %>

<%= f.label :password_confirmation %>

<%= f.password_field :password_confirmation, :class => 'input-xlarge' %>

<%= f.submit('Change Password', :class => 'btn btn-primary') %>

      <% end %>

<%= link_to raw('« Back'), admins_path, :class => 'btn btn-mini' %>

Change profile to only change password field


All contacts

    <% for contact in @contacts.in_alphabetical_order %>

<%= link_to contact.name, contact_path(contact) %>

    <% end %>

<%= link_to 'Create new contact', new_contact_path, :class => 'button' %>

Clean up contacts index template

Clean up contacts index template


upstream <%= domain %> {
  server unix:<%= shared_path %>/unicorn/tmp/sockets/unicorn.sock fail_timeout=0;
}

server {
  listen 80;
  server_name <%= domain %> ;
  root <%= current_path %>/public;

  location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }

  try_files $uri/index.html $uri @<%= domain %>;
  location @<%= domain %>{
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://<%= domain %>;
  }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;
}

upstream <%= domain %> {
  server unix:<%= shared_path %>/unicorn/tmp/sockets/unicorn.sock fail_timeout=0;
}

server {
  listen 80;
  server_name <%= domains.join(" ") %>;
  root <%= current_path %>/public;

  location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }

  try_files $uri/index.html $uri @<%= domain %>;
  location @<%= domain %>{
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://<%= domain %>;
  }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;
}

Fix the multiple nginx domain problem

Fix the multiple nginx domain problem


Welcome#index

Find me in app/views/welcome/index.html.erb

<%= flash.notice %>

  <% if current_user %>
    User Info,

    <%= current_user %>

    <%= link_to "Sign Out", destroy_user_session_path, method: :delete %>
  <% else %>
    <%= link_to "Sign in with Google", user_omniauth_authorize_path(:google, nil) %>
  <% end %>

Add 'Sign out' and 'Sign in with Google' links on the welcome page.


<% if completed && !completed.empty? %>

Completed

  <% completed.each do |work| %>

      <% if work.submitted? %>
        <%= language_icon(work.language) %>
        <a href="/<%= current_user.username %>/<%= work.language %>/<%= work.slug %>">

<%= work.slug %>

      <% elsif work.slug == 'congratulations' %>
        <%= language_icon(work.language) %>
        No more Assignments
      <% end %>

  <% end %>
<% end %>

<% unless completed.empty? %>

Completed

  <% completed.each do |work| %>

      <% if work.submitted? %>
        <%= language_icon(work.language) %>
        <a href="/<%= current_user.username %>/<%= work.language %>/<%= work.slug %>">

<%= work.slug %>

      <% elsif work.slug == 'congratulations' %>
        <%= language_icon(work.language) %>
        No more Assignments
      <% end %>

  <% end %>
<% end %>

Remove check for empty completed assignments

Completed assignments coming from the User are always an array so we
don't need to check for nil.

Amos King @adkron <amos.l.king@gmail.com>
Zach Briggs @TheOtherZach <briggszj@gmail.com>


<!DOCTYPE html>
<html>
<head>
  <title>Dummy</title>
  <%= stylesheet_link_tag    "discerner/application", :media => "all" %>
  <%= javascript_include_tag "discerner/application" %>
  <%= csrf_meta_tags %>
</head>
<body class="discerner">
   <% flash.each do |message_type, message| %>
      <div class="<%= message %>", id="<%= message_type %>">
         <%= message %>
      </div>
   <% end %>
   <%= yield %>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
  <title>Dummy</title>
  <%= stylesheet_link_tag    "discerner/application", :media => "all" %>
  <%= javascript_include_tag "discerner/application" %>
  <%= csrf_meta_tags %>
</head>
<body class="discerner">
   <% flash.each do |message_type, message| %>
      <div class="message" id="<%= message_type %>">
         <%= message %>
      </div>
   <% end %>
   <%= yield %>
</body>
</html>

Fix dummy application layout template

Fix dummy application layout template


<%= t('drgcms.dc_help.help') %>: <%= dc_form_title %>

    <% if params[:type] == 'form' %>
      <button onclick="location.href='#fields'; return false;"><%= t('drgcms.dc_help.fields_button') %></button>
    <% end %>
    <% if @commnets %>
      <button onclick="location.href='#comments'; return false;"><%= t('drgcms.dc_help.comments_button') %></button>
    <% end %>

<%= dc_help_body if @help %>

<%= dc_help_fields if params[:type] == 'form' %>

<%= fa_icon('arrow-up') %>

<%= t('drgcms.dc_help.help') %>: <%= dc_form_title %>

    <% if params[:type] == 'form' %>
      <button onclick="location.href='#fields'; return false;"><%= t('drgcms.dc_help.fields_button') %></button>
    <% end %>
    <% if @commnets %>
      <button onclick="location.href='#comments'; return false;"><%= t('drgcms.dc_help.comments_button') %></button>
    <% end %>

<%= fa_icon('close', class: 'dc-link') %>

<%= dc_help_body if @help %>

<%= dc_help_fields if params[:type] == 'form' %>

<%= fa_icon('arrow-up') %>

Add close button to help popup.

Add close button to help popup.


<a href="<%= country_path(iso: model.iso) %>"><%= cover model %>

    <a href="<%= country_path(iso: model.iso) %>"><%= model.name %>
    <%= commaify model.protected_areas.count %> Protected Areas in this country

    <%= StatisticPresenter.new(model).percentage_total_pa_cover.round(2) %> % covered by Protected Areas

<a href="<%= country_path(iso: model.iso) %>"><%= cover model %>

    <a href="<%= country_path(iso: model.iso) %>"><%= model.name %>
    <%= commaify model.protected_areas.count %> Protected Areas in this country

    <%= StatisticPresenter.new(model).percentage_total_pa_cover.round(2) %>% covered by Protected Areas

Remove additional space in pa total percentage


  <% (@tabs.keys).reject { |x| skip.include?(x) }.each do |tab| %>
    <% is_current = tab == params[:tab] %>
    <div class="tab col-md-2 <%= 'tab-current' if is_current %>">
      <%= link_to_unless(is_current, tab.titlecase, tab) %>

  <% end %>

<% anchor = 'tabs' %>
<div class="row" id="<%= anchor %>">
  <% (@tabs.keys).reject { |x| skip.include?(x) }.each do |tab| %>
    <% is_current = tab == params[:tab] %>
    <div class="tab col-md-2 <%= 'tab-current' if is_current %>">
      <%= link_to_unless(is_current, tab.titlecase, "#{tab}##{anchor}") %>

  <% end %>

Make tabs anchor links so the header can be long.


<%= link_to resource['title'], resource['uri'] %>

<%= resource['description'] %>

<% children = resource['studies'] || resource['assays'] || resource['assets'] || [] %>
<% children.each do |child| %>

      <%= render :partial => 'tree', locals: { resource: child } %>

<% end %>
<% if resource['contains'] %>

      <% resource['contains'].each do |file| %>

<%= file.split('/').last %>

      <% end %>

<% end %>

<%= link_to resource['title'], resource['uri'] %>

<%= text_or_not_specified resource['description'], description: true, auto_link: true, length: 500 %>

<% children = resource['studies'] || resource['assays'] || resource['assets'] || [] %>
<% children.each do |child| %>

      <%= render :partial => 'tree', locals: { resource: child } %>

<% end %>
<% if resource['contains'] %>

      <% resource['contains'].each do |file| %>

<%= file.split('/').last %>

      <% end %>

<% end %>

Truncate descriptions in snapshot tree

Truncate descriptions in snapshot tree


<% content_for :title, person.title %>

<%= render partial: "header", locals: { person: person } %>

    <%= render "govuk_publishing_components/components/image_card", {
      href: "#",
      image_src: person.image_url,
      image_alt: person.image_alt_text,
      description: "Contents",
      extra_links: [
        {
          text: "Biography",
          href: "#biography"
        },
        person.has_previous_roles? ? {
          text: "Previous roles",
          href: "#previous-roles"
        } : nil,
      ].compact
    } %>

  <%= render partial: "biography", locals: { person: person } %>

  <%= render partial: "previous_roles", locals: { person: person } %>

<% content_for :title, person.title %>

<%= render partial: "header", locals: { person: person } %>

    <%= render "govuk_publishing_components/components/image_card", {
      href: "#",
      image_src: person.image_url,
      image_alt: person.image_alt_text,
    } %>

    <%= render "govuk_publishing_components/components/contents_list", {
      contents: [
        {
          text: "Biography",
          href: "#biography"
        },
        person.has_previous_roles? ? {
          text: "Previous roles",
          href: "#previous-roles"
        } : nil,
      ].compact
    } %>

  <%= render partial: "biography", locals: { person: person } %>

  <%= render partial: "previous_roles", locals: { person: person } %>

Use contents_list component for page contents

This is a better component to use than the image card links.


<% if @sublibrary %>

<%= @sublibrary.web_text.html_safe %>

<div id="permissions_<%=@sublibrary.code%>" class="permissions_list">

  		Privilege

  	<% unless @patron_status_permissions.count == 0 %>
    	<% @patron_status_permissions.each do | ps_perm | %>
      	<%= content_tag(:tr) do |c| %>
      	  <%= ps_perm.permission_web_text.html_safe %>
          <%= ps_perm.permission_value_web_text.html_safe %>
  	    <% end %>
  	  <% end %>
    <% else %>

No privileges

    <% end %>

<% end %>

<% if @sublibrary %>

<%= @sublibrary.web_text.html_safe %>

<div id="permissions_<%=@sublibrary.code%>" class="permissions_list">

  		Privilege

  	<% unless @patron_status_permissions.blank? %>
    	<% @patron_status_permissions.each do | ps_perm | %>
      	<%= content_tag(:tr) do |c| %>
      	  <%= ps_perm.permission_web_text.html_safe %>
          <%= ps_perm.permission_value_web_text.html_safe %>
  	    <% end %>
  	  <% end %>
    <% else %>

No privileges

    <% end %>

<% end %>

Check for blank instead of checking count==0 for the patron status permissions in the access grid


Sign up

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

    <%= f.label :email %>

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

    <%= f.label :password %>
    <% if @minimum_password_length %>
    (<%= @minimum_password_length %> characters minimum)
    <% end %>

    <%= f.password_field :password, autocomplete: "off" %>

    <%= f.label :password_confirmation %>

    <%= f.password_field :password_confirmation, autocomplete: "off" %>

    <%= f.submit "Sign up" %>

<% end %>

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

Sign up

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

    <%= f.label :name %>

    <%= f.text_field :name, autofocus: true %>

    <%= f.label :email %>

    <%= f.email_field :email %>

    <%= f.label :password %>
    <% if @minimum_password_length %>
    (<%= @minimum_password_length %> characters minimum)
    <% end %>

    <%= f.password_field :password, autocomplete: "off" %>

    <%= f.label :password_confirmation %>

    <%= f.password_field :password_confirmation, autocomplete: "off" %>

    <%= f.submit "Sign up" %>

<% end %>

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

Add name field in registration view

Add name field in registration view