Merge branch 'master' into iagirre-display-datepicker-arrows

This commit is contained in:
BertoCQ
2017-09-14 17:53:29 +02:00
committed by GitHub
42 changed files with 111 additions and 1109 deletions

View File

@@ -5,6 +5,8 @@ App.Comments =
this.update_comments_count()
add_reply: (parent_id, response_html) ->
if $("##{parent_id} .comment-children").length == 0
$("##{parent_id}").append("<li><ul id='#{parent_id}_children' class='no-bullet comment-children'></ul></li>")
$("##{parent_id} .comment-children:first").prepend($(response_html))
this.update_comments_count()

View File

@@ -205,7 +205,7 @@ a {
.menu.simple {
border-bottom: 1px solid $border;
margin: $line-height 0;
margin-bottom: $line-height;
li {
padding-bottom: rem-calc(7);

View File

@@ -896,9 +896,14 @@
}
.help-header {
background: #fafafa;
border-bottom: 1px solid #eee;
padding-bottom: $line-height / 2;
padding-top: $line-height;
h1 {
font-size: rem-calc(24);
text-transform: uppercase;
}
}

View File

@@ -1,5 +1,8 @@
module EmbedVideosHelper
VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
YOUTUBE_REGEX = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
def embedded_video_code
link = @proposal.video_url
title = t('proposals.show.embed_video_title', proposal: @proposal.title)
@@ -10,10 +13,10 @@ module EmbedVideosHelper
end
if server == "Vimeo"
reg_exp = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
reg_exp = VIMEO_REGEX
src = "https://player.vimeo.com/video/"
elsif server == "YouTube"
reg_exp = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
reg_exp = YOUTUBE_REGEX
src = "https://www.youtube.com/embed/"
end
@@ -28,4 +31,11 @@ module EmbedVideosHelper
end
end
end
def valid_video_url?
return if video_url.blank?
return if video_url.match(VIMEO_REGEX)
return if video_url.match(YOUTUBE_REGEX)
errors.add(:video_url, :invalid)
end
end

View File

@@ -15,6 +15,7 @@ class Proposal < ActiveRecord::Base
max_file_size: 3.megabytes,
accepted_content_types: [ "application/pdf" ]
accepts_nested_attributes_for :documents, allow_destroy: true
include EmbedVideosHelper
acts_as_votable
acts_as_paranoid column: :hidden_at
@@ -41,6 +42,8 @@ class Proposal < ActiveRecord::Base
validates :terms_of_service, acceptance: { allow_nil: false }, on: :create
validate :valid_video_url?
before_validation :set_responsible_name
before_save :calculate_hot_score, :calculate_confidence_score

View File

@@ -32,6 +32,7 @@
<p class="lead">
<strong><%= t("budgets.index.section_footer.title") %></strong>
</p>
<p><%= t("budgets.index.section_footer.description") %></p>
<p><%= t("budgets.index.section_footer.help_text_1") %></p>
<p><%= t("budgets.index.section_footer.help_text_2") %></p>
<p><%= t("budgets.index.section_footer.help_text_3",

View File

@@ -93,6 +93,7 @@
</div>
<% end %>
</li>
<% unless child_comments_of(comment).empty? %>
<li>
<ul id="<%= dom_id(comment) %>_children" class="no-bullet comment-children">
<% child_comments_of(comment).each do |child| %>
@@ -102,5 +103,6 @@
<% end %>
</ul>
</li>
<% end %>
</ul>
<% end %>

View File

@@ -62,6 +62,7 @@
<p class="lead">
<strong><%= t("debates.index.section_footer.title") %></strong>
</p>
<p><%= t("debates.index.section_footer.description") %></p>
<p><%= t("debates.index.section_footer.help_text_1") %></p>
<p><%= t("debates.index.section_footer.help_text_2",
org: link_to(setting['org_name'], new_user_registration_path)).html_safe %></p>

View File

@@ -23,6 +23,7 @@
<p class="lead">
<strong><%= t("legislation.processes.index.section_footer.title") %></strong>
</p>
<p><%= t("legislation.processes.index.section_footer.description") %></p>
<p><%= t("legislation.processes.index.section_footer.help_text_1") %></p>
<p><%= t("legislation.processes.index.section_footer.help_text_2",
org: setting['org_name']) %></p>

View File

@@ -27,6 +27,7 @@
<p class="lead">
<strong><%= t("polls.index.section_footer.title") %></strong>
</p>
<p><%= t("polls.index.section_footer.description") %></p>
<p><%= t("polls.index.section_footer.help_text_1") %></p>
<p><%= t("polls.index.section_footer.help_text_2",
org: link_to(setting['org_name'], new_user_registration_path)).html_safe %></p>

View File

@@ -76,6 +76,7 @@
<p class="lead">
<strong><%= t("proposals.index.section_footer.title") %></strong>
</p>
<p><%= t("proposals.index.section_footer.description") %></p>
<p><%= t("proposals.index.section_footer.help_text_1") %></p>
<p><%= t("proposals.index.section_footer.help_text_2",
org: link_to(setting['org_name'], new_user_registration_path)).html_safe %></p>

View File

@@ -1,12 +1,9 @@
<div class="highlight jumbo help-header">
<div class="help-header no-margin-top margin-bottom">
<div class="row">
<div class="small-12 medium-9 column" data-magellan>
<div class="small-12 column" data-magellan>
<%= image_tag "help/help_icon_#{image}.png", alt: t("#{i18n_namespace}.icon_alt"), class: "align-top" %>
<h1 class="inline-block"><%= t("#{i18n_namespace}.title") %></h1>
<p>
<%= t("#{i18n_namespace}.description") %><br>
<%= link_to t("#{i18n_namespace}.help"), "#section_help" %>
</p>
<%= link_to t("#{i18n_namespace}.help"), "#section_help", class: "float-right" %>
</div>
</div>
</div>