diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb index 4beae99fe..c8509846b 100644 --- a/app/controllers/admin/settings_controller.rb +++ b/app/controllers/admin/settings_controller.rb @@ -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 diff --git a/app/views/admin/settings/_proposals.html.erb b/app/views/admin/settings/_proposals.html.erb index c09efc1b3..b795a5208 100644 --- a/app/views/admin/settings/_proposals.html.erb +++ b/app/views/admin/settings/_proposals.html.erb @@ -17,5 +17,59 @@ <% end %> + + + <%= t("settings.#{poll_feature_short_title_setting.key}") %> + + + <%= 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| %> +
+ <%= f.text_field :value, label: false, id: dom_id(poll_feature_short_title_setting) %> +
+
+ <%= f.submit(t('admin.settings.index.update_setting'), class: "button hollow expanded") %> +
+ <% end %> + + + + + + <%= t("settings.#{poll_feature_description_setting.key}") %> + + + <%= 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| %> +
+ <%= f.cktext_area :value, label: false, id: dom_id(poll_feature_description_setting) %> +
+
+ <%= f.submit(t('admin.settings.index.update_setting'), class: "button hollow expanded") %> +
+ <% end %> + + + + + + <%= t("settings.#{poll_feature_link_setting.key}") %> + + + <%= 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| %> +
+ <%= f.text_field :value, label: false, id: dom_id(poll_feature_link_setting) %> +
+
+ <%= f.submit(t('admin.settings.index.update_setting'), class: "button hollow expanded") %> +
+ <% end %> + + + diff --git a/app/views/dashboard/polls/index.html.erb b/app/views/dashboard/polls/index.html.erb index e2a27863e..8aa583b22 100644 --- a/app/views/dashboard/polls/index.html.erb +++ b/app/views/dashboard/polls/index.html.erb @@ -1,11 +1,23 @@ <% content_for :action_title, t('.title') %> +
+
+ <%== Setting['proposals.poll_description'] %> +
-<%= link_to t('.create'), - new_proposal_dashboard_poll_path(proposal), - class: 'button' %> +
+ <% unless Setting['proposals.poll_link'].blank? %> + + <% end %> -
- <%= t('.count', count: @polls.count) %> + + <%= t('.count', count: @polls.count) %> + <%= link_to t('.create'), + new_proposal_dashboard_poll_path(proposal), + class: 'button expanded' %> +
<% if @polls.any? %> diff --git a/app/views/layouts/dashboard/_proposal_totals.html.erb b/app/views/layouts/dashboard/_proposal_totals.html.erb index df7a60388..c76d06ebc 100644 --- a/app/views/layouts/dashboard/_proposal_totals.html.erb +++ b/app/views/layouts/dashboard/_proposal_totals.html.erb @@ -2,7 +2,7 @@
-
<%= proposal.votes_for.size %>
+
<%= number_with_delimiter(proposal.votes_for.size, delimiter: '.') %>
<%= t('.supports') %>
@@ -16,14 +16,14 @@
-
<%= community_members_count %>
+
<%= number_with_delimiter(community_members_count, delimiter: '.') %>
<%= t('.community') %>
- <%= t('.support_count', count: next_goal_supports) %> + <%= t('.support_count', count: number_with_delimiter(next_goal_supports, delimiter: '.')) %>
<%= t('.current_goal') %>
diff --git a/app/views/proposals_dashboard/_menu.html.erb b/app/views/proposals_dashboard/_menu.html.erb index a56ff4a52..7c77e48c2 100644 --- a/app/views/proposals_dashboard/_menu.html.erb +++ b/app/views/proposals_dashboard/_menu.html.erb @@ -25,7 +25,7 @@ <% if can?(:manage_polls, proposal) %> <%= polls_menu do %> <%= link_to proposal_dashboard_polls_path(proposal.to_param) do %> - <%= t('.polls') %> + <%= t('.polls') %> <% end %> <% end %> <% end %> diff --git a/app/views/proposals_dashboard/_poll_resource.html.erb b/app/views/proposals_dashboard/_poll_resource.html.erb index 23cb42acc..f5c530d17 100644 --- a/app/views/proposals_dashboard/_poll_resource.html.erb +++ b/app/views/proposals_dashboard/_poll_resource.html.erb @@ -7,6 +7,7 @@

<%= t('proposals_dashboard.menu.polls') %>

+ <%= Setting['proposals.poll_short_title'] %>

diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index eca0173a2..f5de0f8dc 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -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: diff --git a/config/locales/en/settings.yml b/config/locales/en/settings.yml index 560c1b197..f4334fab0 100644 --- a/config/locales/en/settings.yml +++ b/config/locales/en/settings.yml @@ -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 diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index 3c38cd99b..48c28b069 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -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: diff --git a/config/locales/es/settings.yml b/config/locales/es/settings.yml index ccbae373d..8f76be698 100644 --- a/config/locales/es/settings.yml +++ b/config/locales/es/settings.yml @@ -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 diff --git a/db/seeds.rb b/db/seeds.rb index 35c6b6141..2de39d402 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -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 diff --git a/lib/tasks/proposal_actions.rake b/lib/tasks/proposal_actions.rake index 365312e44..ea742d61e 100644 --- a/lib/tasks/proposal_actions.rake +++ b/lib/tasks/proposal_actions.rake @@ -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'