Skip to content

Commit

Permalink
Merge pull request #601 from alphagov/support-component-string-and-sy…
Browse files Browse the repository at this point in the history
…mbol-keys

Support symbol and string keys for some components
  • Loading branch information
edds committed Jun 16, 2015
2 parents d9d042f + 0593bf6 commit 45dfd61
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions app/views/govuk_component/option_select.raw.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
<div class='options-container' id='<%= options_container_id %>'>
<div class='js-auto-height-inner'>
<% options.each do | option |%>

<label for='<%= option['id'] %>'>
<% option = option.with_indifferent_access %>
<label for='<%= option[:id] %>'>
<input
name="<%= key %>[]"
value="<%= option['value']%>"
id="<%= option['id']%>"
value="<%= option[:value]%>"
id="<%= option[:id]%>"
type="checkbox"

<% if local_assigns.include?(:aria_controls_id) %>
aria-controls="<%= aria_controls_id %>"
<% end %>

<% if option['checked'].present? %>
<% if option[:checked].present? %>
checked="checked"
<% end %>

>
<%= option['label']%>
<%= option[:label] %>
</label>
<% end %>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<nav class="govuk-previous-and-next-navigation" role="navigation" aria-label="Pagination">
<ul class="group">
<% if local_assigns.include?(:previous_page) %>
<% previous_page = previous_page.with_indifferent_access %>
<li class="previous-page">
<a href="<%= previous_page['url'] %>" rel="previous" >
<span class="pagination-part-title"><%= previous_page['title'] %></span>
<span class="pagination-label"><%= previous_page['label'] %></span>
<a href="<%= previous_page[:url] %>" rel="previous" >
<span class="pagination-part-title"><%= previous_page[:title] %></span>
<span class="pagination-label"><%= previous_page[:label] %></span>
</a>
</li>
<% end %>
<% if local_assigns.include?(:next_page) %>
<% next_page = next_page.with_indifferent_access %>
<li class="next-page">
<a href="<%= next_page['url'] %>" rel="next">
<span class="pagination-part-title"><%= next_page['title'] %></span>
<span class="pagination-label"><%= next_page['label'] %></span>
<a href="<%= next_page[:url] %>" rel="next">
<span class="pagination-part-title"><%= next_page[:title] %></span>
<span class="pagination-label"><%= next_page[:label] %></span>
</a>
</li>
<% end %>
Expand Down

0 comments on commit 45dfd61

Please sign in to comment.