Merge branch 'master' into polls

This commit is contained in:
Juanjo Bazán
2017-01-02 12:14:40 +01:00
14 changed files with 31 additions and 19 deletions

View File

@@ -45,12 +45,12 @@ class Proposal < ActiveRecord::Base
scope :sort_by_relevance, -> { all }
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
scope :sort_by_archival_date, -> { archived.sort_by_confidence_score }
scope :archived, -> { where("proposals.created_at <= ?", Setting["months_to_archive_proposals"].to_i.months.ago)}
scope :not_archived, -> { where("proposals.created_at > ?", Setting["months_to_archive_proposals"].to_i.months.ago)}
scope :archived, -> { where("proposals.created_at <= ?", Setting["months_to_archive_proposals"].to_i.months.ago) }
scope :not_archived, -> { where("proposals.created_at > ?", Setting["months_to_archive_proposals"].to_i.months.ago) }
scope :last_week, -> { where("proposals.created_at >= ?", 7.days.ago)}
scope :retired, -> { where.not(retired_at: nil) }
scope :not_retired, -> { where(retired_at: nil) }
scope :successful, -> { where("cached_votes_up + physical_votes >= ?", Proposal.votes_needed_for_success)}
scope :successful, -> { where("cached_votes_up >= ?", Proposal.votes_needed_for_success) }
def to_param
"#{id}-#{title}".parameterize
@@ -99,7 +99,7 @@ class Proposal < ActiveRecord::Base
end
def total_votes
cached_votes_up + physical_votes
cached_votes_up
end
def voters

View File

@@ -0,0 +1,5 @@
<meta name="description"
content="<%= content_for?(:meta_description) ? yield(:meta_description) : setting["meta_description"] %>" />
<meta name="keywords"
content="<%= content_for?(:meta_keywords) ? yield(:meta_keywords) : setting["meta_keywords"] %>" />

View File

@@ -4,7 +4,8 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<%=render "layouts/tracking_data"%>
<%= render "layouts/tracking_data" %>
<%= render "layouts/meta_tags" %>
<title><%= content_for?(:title) ? yield(:title) : setting['org_name'] %></title>
<%= stylesheet_link_tag "application" %>
<!--[if lt IE 9]>

View File

@@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title><%= content_for?(:title) ? yield(:title) : "Gobierno abierto" %></title>
<%= render "layouts/meta_tags" %>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application", 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>