Merge branch 'master' into legislation-module-stable

This commit is contained in:
Amaia Castro
2017-03-25 13:34:49 +01:00
23 changed files with 107 additions and 32 deletions

View File

@@ -32,7 +32,7 @@ class Management::UsersController < Management::BaseController
private
def user_params
params.require(:user).permit(:document_type, :document_number, :username, :email)
params.require(:user).permit(:document_type, :document_number, :username, :email, :date_of_birth)
end
def destroy_session

View File

@@ -2,6 +2,7 @@ module EmbedVideosHelper
def embedded_video_code
link = @proposal.video_url
title = t('proposals.show.embed_video_title', proposal: @proposal.title)
if link.match(/vimeo.*/)
server = "Vimeo"
elsif link.match(/youtu*.*/)
@@ -21,7 +22,7 @@ module EmbedVideosHelper
end
if match and match[2]
'<iframe src="' + src + match[2] + '" frameborder="0" allowfullscreen></iframe>'
'<iframe src="' + src + match[2] + '" style="border:0;" allowfullscreen title="' + title + '"></iframe>'
else
''
end

View File

@@ -10,8 +10,10 @@
<div class="small-12 medium-9 column">
<table>
<thead>
<th><%= Budget.human_attribute_name(:name) %></th>
<th><%= Budget.human_attribute_name(:phase) %></th>
<tr>
<th scope="col"><%= Budget.human_attribute_name(:name) %></th>
<th scope="col"><%= Budget.human_attribute_name(:phase) %></th>
</tr>
</thead>
<tbody>
<% @budgets.each do |budget| %>

View File

@@ -19,6 +19,7 @@
<%= f.submit(t("devise_views.confirmations.new.submit"), class: "button expanded") %>
</div>
</div>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@@ -11,6 +11,7 @@
<%= f.submit t("devise_views.passwords.new.send_submit"), class: "button expanded" %>
</div>
</div>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@@ -4,7 +4,7 @@
message: t("management.document_verifications.in_census_has_following_permissions"),
permissions: [:debates, :create_proposals, :support_proposals, :vote_proposals] %>
<div class="row">
<div class="row verification account">
<div class="small-12 medium-6 column">
<%= form_for @user, url: management_users_path do |f| %>
<%= f.hidden_field :document_type %>
@@ -15,7 +15,13 @@
<%= f.text_field :email,
label: t('management.email_label'),
placeholder: t('management.email_label') %>
<div class="date-of-birth">
<%= f.label t("management.date_of_birth") %>
<%= f.date_select :date_of_birth,
prompt: true,
start_year: 1900, end_year: 16.years.ago.year,
label: false %>
</div>
<%= f.submit t("management.users.create_user_submit"), class: "button success" %>
<% end %>
</div>

View File

@@ -11,7 +11,8 @@
</li>
<% end %>
<% if feature?(:spending_proposals) && (current_user.administrator? || current_user.valuator?) %>
<% if (feature?(:spending_proposals) || feature?(:budgets)) &&
(current_user.administrator? || current_user.valuator?) %>
<li>
<%= link_to t("layouts.header.valuation"), valuation_root_path %>
</li>