@@ -1,5 +1,5 @@
|
||||
class Admin::SettingsController < Admin::BaseController
|
||||
helper_method :successful_proposal_setting, :successful_proposals
|
||||
helper_method :successful_proposal_setting, :successful_proposals, :poll_feature_short_title_setting, :poll_feature_description_setting, :poll_feature_link_setting
|
||||
|
||||
def index
|
||||
all_settings = Setting.all.group_by { |s| s.type }
|
||||
@@ -35,4 +35,16 @@ class Admin::SettingsController < Admin::BaseController
|
||||
def successful_proposals
|
||||
Proposal.successful
|
||||
end
|
||||
|
||||
def poll_feature_short_title_setting
|
||||
Setting.find_by(key: 'proposals.poll_short_title')
|
||||
end
|
||||
|
||||
def poll_feature_description_setting
|
||||
Setting.find_by(key: 'proposals.poll_description')
|
||||
end
|
||||
|
||||
def poll_feature_link_setting
|
||||
Setting.find_by(key: 'proposals.poll_link')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,5 +17,59 @@
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small-12 medium-4">
|
||||
<strong><%= t("settings.#{poll_feature_short_title_setting.key}") %></strong>
|
||||
</td>
|
||||
<td class="small-12 medium-8">
|
||||
<%= form_for poll_feature_short_title_setting,
|
||||
url: admin_setting_path(poll_feature_short_title_setting),
|
||||
html: { id: "edit_#{dom_id(poll_feature_short_title_setting)}"} do |f| %>
|
||||
<div class="small-12 medium-6 large-9 column">
|
||||
<%= f.text_field :value, label: false, id: dom_id(poll_feature_short_title_setting) %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 large-3 column">
|
||||
<%= f.submit(t('admin.settings.index.update_setting'), class: "button hollow expanded") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="small-12 medium-4">
|
||||
<strong><%= t("settings.#{poll_feature_description_setting.key}") %></strong>
|
||||
</td>
|
||||
<td class="small-12 medium-8">
|
||||
<%= form_for poll_feature_description_setting,
|
||||
url: admin_setting_path(poll_feature_description_setting),
|
||||
html: { id: "edit_#{dom_id(poll_feature_description_setting)}"} do |f| %>
|
||||
<div class="small-12 medium-6 large-9 column">
|
||||
<%= f.cktext_area :value, label: false, id: dom_id(poll_feature_description_setting) %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 large-3 column">
|
||||
<%= f.submit(t('admin.settings.index.update_setting'), class: "button hollow expanded") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="small-12 medium-4">
|
||||
<strong><%= t("settings.#{poll_feature_link_setting.key}") %></strong>
|
||||
</td>
|
||||
<td class="small-12 medium-8">
|
||||
<%= form_for poll_feature_link_setting,
|
||||
url: admin_setting_path(poll_feature_link_setting),
|
||||
html: { id: "edit_#{dom_id(poll_feature_link_setting)}"} do |f| %>
|
||||
<div class="small-12 medium-6 large-9 column">
|
||||
<%= f.text_field :value, label: false, id: dom_id(poll_feature_link_setting) %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 large-3 column">
|
||||
<%= f.submit(t('admin.settings.index.update_setting'), class: "button hollow expanded") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
<% content_for :action_title, t('.title') %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-9 column">
|
||||
<%== Setting['proposals.poll_description'] %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<% unless Setting['proposals.poll_link'].blank? %>
|
||||
<div class="proposal-dashboard-action-links">
|
||||
<h3><%= t('.links') %></h3>
|
||||
<%= link_to t('.additiontal_information'), Setting['proposals.poll_link'], target: '_blank' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= link_to t('.create'),
|
||||
new_proposal_dashboard_poll_path(proposal),
|
||||
class: 'button' %>
|
||||
|
||||
<div class="row small-12 column">
|
||||
<strong><%= t('.count', count: @polls.count) %></strong>
|
||||
<%= link_to t('.create'),
|
||||
new_proposal_dashboard_poll_path(proposal),
|
||||
class: 'button expanded' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if @polls.any? %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="row">
|
||||
<div class="column large-4">
|
||||
<div class="counter">
|
||||
<div class="counter-value"><%= proposal.votes_for.size %></div>
|
||||
<div class="counter-value"><%= number_with_delimiter(proposal.votes_for.size, delimiter: '.') %></div>
|
||||
<div class="counter-label"><%= t('.supports') %></div>
|
||||
</div>
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
</div>
|
||||
|
||||
<div class="counter">
|
||||
<div class="counter-value"><%= community_members_count %></div>
|
||||
<div class="counter-value"><%= number_with_delimiter(community_members_count, delimiter: '.') %></div>
|
||||
<div class="counter-label"><%= t('.community') %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column large-8">
|
||||
<div class="current-goal">
|
||||
<div class="counter-value">
|
||||
<%= t('.support_count', count: next_goal_supports) %>
|
||||
<%= t('.support_count', count: number_with_delimiter(next_goal_supports, delimiter: '.')) %>
|
||||
</div>
|
||||
|
||||
<div class="counter-label"><%= t('.current_goal') %></div>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<% if can?(:manage_polls, proposal) %>
|
||||
<%= polls_menu do %>
|
||||
<%= link_to proposal_dashboard_polls_path(proposal.to_param) do %>
|
||||
<span><%= t('.polls') %></span>
|
||||
<span data-tooltip title="<%= Setting['proposals.poll_short_title'] || t('.polls') %>"><%= t('.polls') %></span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
</p>
|
||||
<h4 class="text-center"><%= t('proposals_dashboard.menu.polls') %></h4>
|
||||
<p class="text-center">
|
||||
<%= Setting['proposals.poll_short_title'] %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -557,6 +557,8 @@ en:
|
||||
count:
|
||||
one: You have created %{count} poll.
|
||||
other: You have created %{count} polls.
|
||||
links: Links
|
||||
additiontal_information: Additional information
|
||||
poll:
|
||||
published_on: Published on
|
||||
responses:
|
||||
|
||||
@@ -65,3 +65,6 @@ en:
|
||||
proposal_improvement_path: Proposal improvement info internal link
|
||||
proposals:
|
||||
successful_proposal_id: Successful proposal
|
||||
poll_short_title: Subtitle for polls feature
|
||||
poll_description: Description for polls feature
|
||||
poll_link: Additional information link
|
||||
|
||||
@@ -557,6 +557,8 @@ es:
|
||||
count:
|
||||
one: Has creado %{count} encuesta.
|
||||
other: Has creado %{count} encuestas.
|
||||
links: Enlaces
|
||||
additiontal_information: Información adicional
|
||||
poll:
|
||||
published_on: Publicada
|
||||
responses:
|
||||
|
||||
@@ -65,3 +65,6 @@ es:
|
||||
proposal_improvement_path: Link a información para mejorar propuestas
|
||||
proposals:
|
||||
successful_proposal_id: Propuesta exitosa
|
||||
poll_short_title: Subtítulo funcionalidad encuestas
|
||||
poll_description: Descripción funcionalidad encuestas
|
||||
proposals.poll_link: Enlace información adicional
|
||||
|
||||
@@ -134,3 +134,5 @@ Setting['feature.homepage.widgets.feeds.processes'] = true
|
||||
|
||||
# Proposals
|
||||
Setting['proposals.successful_proposal_id'] = nil
|
||||
Setting['proposals.poll_short_title'] = nil
|
||||
Setting['proposals.poll_description'] = nil
|
||||
|
||||
@@ -13,9 +13,12 @@ namespace :proposal_actions do
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Initialize successful proposal id setting'
|
||||
task initialize_successful_proposal_id: :environment do
|
||||
Setting['proposals.successful_proposal_id'] = nil
|
||||
desc 'Initialize proposal settings'
|
||||
task initialize_settings: :environment do
|
||||
Setting['proposals.successful_proposal_id'] = nil if Setting.find_by(key: 'proposals.successful_proposal_id').nil?
|
||||
Setting['proposals.poll_short_title'] = nil if Setting.find_by(key: 'proposals.poll_short_title').nil?
|
||||
Setting['proposals.poll_description'] = nil if Setting.find_by(key: 'proposals.poll_description').nil?
|
||||
Setting['proposals.poll_link'] = nil if Setting.find_by(key: 'proposals.poll_link').nil?
|
||||
end
|
||||
|
||||
desc 'Simulate successful proposal'
|
||||
|
||||
Reference in New Issue
Block a user