Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 12 commits
  • 39 files changed
  • 0 commit comments
  • 2 contributors
Showing with 597 additions and 270 deletions.
  1. 0  app/assets/images/{logo.png → logo_en.png}
  2. BIN  app/assets/images/logo_fi.png
  3. +2 −4 app/assets/stylesheets/application.css.scss
  4. +4 −0 app/assets/stylesheets/ideas.css.scss
  5. +10 −0 app/controllers/admin/languages_controller.rb
  6. +10 −0 app/controllers/admin/locations_controller.rb
  7. +11 −1 app/controllers/ideas_controller.rb
  8. +30 −32 app/controllers/pages_controller.rb
  9. +11 −5 app/helpers/admin/changelogs_helper.rb
  10. +2 −0  app/models/forked_idea.rb
  11. +16 −0 app/models/language.rb
  12. +32 −2 app/models/translated_idea.rb
  13. +1 −0  app/views/admin/languages/index.html.haml
  14. +5 −0 app/views/admin/languages/new.html.haml
  15. +1 −1  app/views/admin/locations/edit.html.haml
  16. +1 −0  app/views/admin/locations/index.html.haml
  17. +7 −0 app/views/admin/locations/new.html.haml
  18. +11 −8 app/views/citizens/sessions/new.html.erb
  19. +1 −10 app/views/forked_ideas/_form.html.haml
  20. +11 −11 app/views/forked_ideas/index.html.haml
  21. +3 −12 app/views/forked_ideas/merge.html.haml
  22. +11 −11 app/views/forked_ideas/pull_requests.html.haml
  23. +3 −2 app/views/forked_ideas/show.html.haml
  24. +7 −6 app/views/ideas/_translations.html.haml
  25. +11 −1 app/views/ideas/index.html.haml
  26. +1 −4 app/views/layouts/application.html.haml
  27. +2 −1  app/views/pages/_headline.html.haml
  28. +0 −9 app/views/translated_ideas/_form.html.haml
  29. +1 −1  app/views/translated_ideas/_original.html.haml
  30. +11 −11 app/views/translated_ideas/index.html.haml
  31. +3 −3 app/views/translated_ideas/show.html.haml
  32. +85 −43 config/locales/en.yml
  33. +99 −45 config/locales/fi.yml
  34. +46 −46 db/schema.rb
  35. +68 −1 db/seeds.rb
  36. +15 −0 spec/acceptance/ideas/index_spec.rb
  37. +47 −0 spec/acceptance/pages/index_citizen_spec.rb
  38. +13 −0 spec/acceptance/pages/index_guest_spec.rb
  39. +5 −0 spec/factories.rb
View
0  app/assets/images/logo.png → app/assets/images/logo_en.png
File renamed without changes
View
BIN  app/assets/images/logo_fi.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
6 app/assets/stylesheets/application.css.scss
@@ -78,7 +78,6 @@ footer > a:visited {
text-decoration: none;
}
-
.inputs > .input > input {
width: 100%;
}
@@ -565,9 +564,8 @@ top_proposals h2 {
}
.forget-password {
- position: absolute;
- float: left;
- margin-left: 0.5%;
+ margin-top: 15px;
+ margin-bottom: 15px;
}
.idea-heading-link {
View
4 app/assets/stylesheets/ideas.css.scss
@@ -440,4 +440,8 @@ a.default_url {
border-top: 3px solid #000;
padding-top: 20px;
text-align: center;
+}
+
+.languages {
+ margin-bottom: 15px;
}
View
10 app/controllers/admin/languages_controller.rb
@@ -7,6 +7,16 @@ def index
respond_with @languages = Language.order(:name).paginate(page: params[:page], per_page: 500)
end
+ def new
+ @language = Language.new
+ end
+
+ def create
+ @language = Language.new(params[:language])
+ @language.save
+ redirect_to admin_languages_path
+ end
+
def destroy
@language = Language.find(params[:id])
@language.destroy
View
10 app/controllers/admin/locations_controller.rb
@@ -22,6 +22,16 @@ def update
end
end
+ def new
+ @location = Location.new
+ end
+
+ def create
+ @location = Location.new(params[:location])
+ @location.save
+ redirect_to admin_locations_path
+ end
+
def destroy
@location = Location.find(params[:id])
@location.destroy
View
12 app/controllers/ideas_controller.rb
@@ -24,6 +24,8 @@ def index
@ideas_around = filtered_and_ordered.offset([(on_page*page - extras), 0].max).limit(on_page+extras*2)
@ideas_around_ids = @ideas_around.select(:id).map{|ia| ia.id}
+ @language = Language.list
+
session[:sorting_orders] ||= {}
# always update the ids for certain sorting order (for every pagination and sorting)
# ie. this also remembers just the last, which also means next page, back and open idea gives wrong
@@ -40,7 +42,13 @@ def index
else
@ideas = filtered_and_ordered.paginate(page: page, per_page: on_page)
end
-
+
+ if params[:language_reorder]
+ @ideas = Idea.published.sort_by{ |idea| idea.language == params[:language_reorder] ? 0 : 1 }.paginate(page: page, per_page: on_page)
+ else
+ @ideas = filtered_and_ordered.paginate(page: page, per_page: on_page)
+ end
+
KM.identify(current_citizen)
# TODO: track which sorting options are most commonly used
KM.push("record", "idea list viewed", page: params[:page] || 1)
@@ -90,6 +98,8 @@ def setup_filtering_and_sorting_options
[:half_year, t('.time_period.half_year')],
[:year, t('.time_period.year')]
]
+
+ @language_fields = Language.sorting_options
end
def impressions_order(impression_reorder = 'today', reorder)
View
62 app/controllers/pages_controller.rb
@@ -5,10 +5,9 @@ class PagesController < ApplicationController
def load(state)
if state == "proposal"
items = Idea.published.where(state: "proposal",
- collecting_started: true).
- sort_by{|idea| [idea.collecting_ended ? 0 : 1, (idea.signatures.where(state: "signed").count + idea.additional_signatures_count)]}.reverse
+ collecting_started: true).sort_by{|idea| [ idea.language == I18n.locale.to_s ? 1 : 0, idea.collecting_ended ? 0 : 1, (idea.signatures.where(state: "signed").count + idea.additional_signatures_count)]}.reverse
else
- items = Idea.published.where(state: state).order("RANDOM()").includes(:votes).all
+ items = Idea.published.where(state: state).sort_by{|idea| [ idea.language == I18n.locale.to_s ? 1 : 0]}.reverse
end
item_counts = {}
@@ -51,40 +50,39 @@ def home
@drafts, @draft_counts = load("draft")
# Ideas either newest or random sampling
- if @newest_ideas = (rand() < 0.1)
- idea_count = 4
- @ideas = Idea.published.where(state: 'idea').order("created_at DESC").limit(idea_count).includes(:votes).all
+ #if @newest_ideas = (rand() < 0.1)
+ @ideas = Idea.published.where(state: 'idea').sort_by{|idea| [ idea.language == I18n.locale.to_s ? 0 : 1, idea.created_at ] }.first(6)
@idea_counts = {}
@ideas.each do |idea|
formatted_idea_counts(idea, @idea_counts)
end
- else
- idea_count = 6
- # this solution builds on few facts: most ideas are published and in state idea, and
- # there's not too many to pick from (memory requirement) and very few to be picked (<< pool)
- max_id = Idea.maximum(:id)
- probability_good = 0.90
- picking_ids = (1..max_id).to_a.shuffle
- @ideas = []
- while @ideas.size < idea_count
- picks_at_time = ((idea_count - @ideas.size)/(probability_good**2.0)).to_i + 1 # 2.0 just makes it even more rare to require two loads
- picks_at_time = 1 if picks_at_time < 1
- picks = picking_ids.slice!(0, picks_at_time)
- # originally this didn't work: @ideas = Idea.published.where(state: 'idea').random_by_id_shuffle(idea_count)'
- published_ideas = Idea.find_all_by_id(picks).find_all do |i|
- vote_count = i.vote_count || 1
- vote_count = 1 if vote_count == 0
- keep_as_too_few_votes_to_skip = (Math.log(vote_count)/Math.log(30)/2.0) < rand()
- i.published? and i.state == 'idea' and keep_as_too_few_votes_to_skip
- end
- @ideas.concat published_ideas[0,[idea_count - @ideas.size, published_ideas.size].min]
- end
+ #else
+ # idea_count = 6
+ # # this solution builds on few facts: most ideas are published and in state idea, and
+ # # there's not too many to pick from (memory requirement) and very few to be picked (<< pool)
+ # max_id = Idea.maximum(:id)
+ # probability_good = 0.90
+ # picking_ids = (1..max_id).to_a.shuffle
+ # @ideas = []
+ # while @ideas.size < idea_count
+ # picks_at_time = ((idea_count - @ideas.size)/(probability_good**2.0)).to_i + 1 # 2.0 just makes it even more rare to require two loads
+ # picks_at_time = 1 if picks_at_time < 1
+ # picks = picking_ids.slice!(0, picks_at_time)
+ # # originally this didn't work: @ideas = Idea.published.where(state: 'idea').random_by_id_shuffle(idea_count)'
+ # published_ideas = Idea.find_all_by_id(picks).find_all do |i|
+ # vote_count = i.vote_count || 1
+ # vote_count = 1 if vote_count == 0
+ # keep_as_too_few_votes_to_skip = (Math.log(vote_count)/Math.log(30)/2.0) < rand()
+ # i.published? and i.state == 'idea' and keep_as_too_few_votes_to_skip
+ # end
+ # @ideas.concat published_ideas[0,[idea_count - @ideas.size, published_ideas.size].min]
+ # end
- @idea_counts = {}
- @ideas.each do |idea|
- formatted_idea_counts(idea, @idea_counts)
- end
- end
+ # @idea_counts = {}
+ # @ideas.each do |idea|
+ # formatted_idea_counts(idea, @idea_counts)
+ # end
+ #end
@blog_articles = Article.published.where(article_type: 'blog').order("created_at DESC").limit(3).all
View
16 app/helpers/admin/changelogs_helper.rb
@@ -1,6 +1,6 @@
module Admin::ChangelogsHelper
CHARACTERS_AROUND_DIFF = 40
-
+
def changelogged_link_for(changelog)
link_text = "#{I18n.t('activerecord.models.'+changelog.changelogged_type.downcase)} ##{changelog.changelogged_id}"
if changelog.changelogged.class == Comment
@@ -10,26 +10,32 @@ def changelogged_link_for(changelog)
elsif comment.commentable.class == Article
link_to link_text, article_path(comment.commentable, anchor: "comments")
end
+ elsif changelog.changelogged.class == TranslatedIdea
+ translated_idea = changelog.changelogged
+ link_to link_text, idea_translated_idea_path(translated_idea.idea, translated_idea)
+ elsif changelog.changelogged.class == ForkedIdea
+ translated_idea = changelog.changelogged.class.find(changelog.changelogged_id).translated_idea
+ link_to link_text, idea_translated_idea_forked_idea_path(translated_idea.idea, translated_idea, changelog.changelogged)
else
link_to link_text, changelog.changelogged
end
end
-
+
def short_diff(change)
if change.first.present? && change.last.present?
diffed = Differ.diff(change.last.to_s, change.first.to_s, '').to_s
-
+
# location of the actual diff
diff_start = diffed.index("<del class=\"differ\">")
diff_start ||= diffed.index("<ins class=\"differ\">")
diff_end = diffed.rindex("</ins>") && (diffed.rindex("</ins>") + "</ins>".length - 1) || nil
diff_end ||= diffed.rindex("</del>") + "</del>".length - 1
-
+
# take along some extra chars around the diff
from = [0, diff_start - CHARACTERS_AROUND_DIFF].max
to = [diffed.to_s.length, diff_end + CHARACTERS_AROUND_DIFF].min
diff = diffed[from..to]
-
+
# add "&hellip;"s to indicate there is more text out there
diff.insert(0, '&hellip; ') if from > 0
diff << ' &hellip;' if to < diffed.length
View
2  app/models/forked_idea.rb
@@ -1,4 +1,6 @@
class ForkedIdea < ActiveRecord::Base
+ include Changelogger
+
attr_accessible :author_id, :body, :summary, :title, :translated_idea_id, :pull_request_at, :is_closed
belongs_to :translated_idea
View
16 app/models/language.rb
@@ -1,3 +1,19 @@
class Language < ActiveRecord::Base
attr_accessible :name, :full_name
+
+ def self.sorting_options
+ @languages = []
+ self.all.each do |language|
+ @languages << [ language.name.to_sym, language.full_name ]
+ end
+ return @languages
+ end
+
+ def self.list
+ @languages = Array.new
+ self.all.each do |language|
+ @languages << language.name.to_sym
+ end
+ return @languages
+ end
end
View
34 app/models/translated_idea.rb
@@ -1,9 +1,39 @@
class TranslatedIdea < ActiveRecord::Base
+ include Changelogger
+
belongs_to :idea
belongs_to :author, class_name: "Citizen", foreign_key: "author_id"
-
+
has_many :forked_ideas, :dependent => :destroy
attr_accessible :author_id, :body, :idea_id, :language, :summary, :title
-
+
validates_uniqueness_of :idea_id, :scope => [:language]
+
+ def collecting_ended
+ self.idea.collecting_ended
+ end
+
+ def signatures
+ self.idea.signatures
+ end
+
+ def additional_signatures_count
+ self.idea.additional_signatures_count
+ end
+
+ def vote_counts
+ self.idea.vote_counts
+ end
+
+ def comments
+ self.idea.comments
+ end
+
+ def collecting_start_date
+ self.idea.collecting_start_date
+ end
+
+ def collecting_end_date
+ self.idea.collecting_end_date
+ end
end
View
1  app/views/admin/languages/index.html.haml
@@ -1,3 +1,4 @@
+= link_to "Create new", new_admin_language_path, class: "btn btn-success"
.row-fluid
.span12
%h1 Languages
View
5 app/views/admin/languages/new.html.haml
@@ -0,0 +1,5 @@
+= simple_form_for @language, url: [:admin, @language] do |f|
+ = f.error_notification
+ = f.input :full_name, label: "Full name (for example: English)"
+ = f.input :name, label: "Name (for example: en)"
+ = f.button :submit, "Create"
View
2  app/views/admin/locations/edit.html.haml
@@ -4,4 +4,4 @@
= f.input :address, label: "Keruupisteen osoite"
= f.input :latitude
= f.input :longitude
- = f.button :submit, "Lisää keruuspiste"
+ = f.button :submit, "Edit"
View
1  app/views/admin/locations/index.html.haml
@@ -1,3 +1,4 @@
+= link_to "Create new", new_admin_location_path, class: "btn btn-success"
.row-fluid
.span12
%h1 Locations
View
7 app/views/admin/locations/new.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for @location, url: [:admin, @location] do |f|
+ = f.error_notification
+ = f.input :name, label: "Keruupisteen nimi (esim. 'Järventauksen kirjasto')"
+ = f.input :address, label: "Keruupisteen osoite"
+ = f.input :latitude
+ = f.input :longitude
+ = f.button :submit, "Create"
View
19 app/views/citizens/sessions/new.html.erb
@@ -22,15 +22,18 @@
</div>
<% if devise_mapping.rememberable? -%>
- <div class="input checkbox">
- <%= f.check_box :remember_me %> <%= f.label :remember_me, t('.remember_me') %>
+ <div class="input_checkbox">
+ <%= f.label :remember_me, t('.remember_me') %>
+ <%= f.check_box :remember_me %>
</div>
<% end -%>
- <div class='forget-password'>
- <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
- <%= link_to "Unohditko salasanasi?", new_password_path(resource_name) %>
- <% end -%>
- </div>
+
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
+ <div class='forget-password'>
+ <%= link_to "Unohditko salasanasi?", new_password_path(resource_name) %>
+ </div>
+ <% end -%>
+
+ <%= f.submit t('.login_button'), :class => "login_button" %>
</div>
- <div class="actions grid_16"><%= f.submit t('.login_button') %></div>
<% end %>
View
11 app/views/forked_ideas/_form.html.haml
@@ -3,20 +3,11 @@
= simple_form_for [Idea.find(params[:idea_id]), @translated_idea, @forked_idea] do |f|
.grid_12
= f.input :title, label: I18n.t("forked_idea.new.title"), :input_html => { :id => "forked_translated_idea_title" }
- .grid_8.help_cont
- #title_help
- %p= t('.title_help')
.grid_16
= f.input :summary, as: :text
- .grid_8.help_cont
- #summary_help
- %p= t('.summary_help')
.grid_16
= f.input :body, as: :text
- = "Language: #{@language}"
- .grid_8.help_cont
- #body_help
- %p= t('.body_help')
+ = "#{t('.language')}: #{@language}"
.grid_16
= f.submit I18n.t("buttons.update")
View
22 app/views/forked_ideas/index.html.haml
@@ -1,12 +1,12 @@
-%h1 Listing Forked Ideas
+%h1=t('.title')
%table{:style => 'width:100%'}
%tr
- %th Author
- %th Title
- %th Body
- %th Summary
- %th{:colspan => '3'} Actions
+ %th=t('.author')
+ %th=t('.title')
+ %th=t('.body')
+ %th=t('.summary')
+ %th{:colspan => '3'}=t('.actions')
- @forked_ideas.each do |forked_idea|
%tr
@@ -15,10 +15,10 @@
%td= forked_idea.body.truncate(30)
%td= forked_idea.summary.truncate(30)
%td
- = link_to 'Show', idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], forked_idea)
- = link_to 'Edit', edit_idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], forked_idea)
- = link_to 'Original Translation', idea_translated_idea_path(params[:idea_id], params[:translated_idea_id])
+ = link_to t('.show'), idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], forked_idea)
+ = link_to t('.edit'), edit_idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], forked_idea)
+ = link_to t('.original_translation'), idea_translated_idea_path(params[:idea_id], params[:translated_idea_id])
- if forked_idea.author_id == current_citizen.id && !forked_idea.pull_request_at
- = link_to 'Send Pull Request', send_pull_request_idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], forked_idea)
+ = link_to t('.send_pull_request'), send_pull_request_idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], forked_idea)
-= link_to 'Pull Requests', pull_requests_idea_translated_idea_forked_ideas_path(params[:idea_id], params[:translated_idea_id])
+= link_to t('.pull_requests'), pull_requests_idea_translated_idea_forked_ideas_path(params[:idea_id], params[:translated_idea_id])
View
15 app/views/forked_ideas/merge.html.haml
@@ -1,30 +1,21 @@
-%h4 You can copy from forked version and paste to master translation
+%h4=t(".title")
#forked_translated_idea_form
%h1= t(".master_translation")
= simple_form_for [Idea.find(params[:idea_id]), @translated_idea] do |f|
.grid_12
- = f.input :title, label: I18n.t("title"), :input_html => { :id => "forked_translated_idea_title" }
- .grid_8.help_cont
- #title_help
- %p= t('.title_help')
+ = f.input :title, :input_html => { :id => "forked_translated_idea_title" }
.grid_16
= f.input :summary, as: :text
- .grid_8.help_cont
- #summary_help
- %p= t('.summary_help')
.grid_16
= f.input :body, as: :text
= f.label :language
= f.select :language, Language.all.map{ |language| [language.full_name, language.name] }, :selected => current_citizen.profile.preferred_language
- .grid_8.help_cont
- #body_help
- %p= t('.body_help')
.grid_16
= f.submit I18n.t("buttons.update")
#original_translated_idea
- %h1= t(".translation_from_#{@forked_idea.author.name.underscore}")
+ %h1= " #{t('.translation_from')} #{@forked_idea.author.name} "
.grid_12
%br
= text_field_tag :original_title, @forked_idea.title, :disabled => true
View
22 app/views/forked_ideas/pull_requests.html.haml
@@ -1,12 +1,12 @@
-%h1 Listing Pull Requets
+%h1=t('.title')
%table{:style => 'width:100%'}
%tr
- %th Author
- %th Title
- %th Body
- %th Summary
- %th Actions
+ %th=t('.author')
+ %th=t('.pr_title')
+ %th=t('.body')
+ %th=t('.summary')
+ %th=t('.actions')
- @pull_requests.each do |pull_request|
%tr
@@ -15,11 +15,11 @@
%td= pull_request.body.truncate(30)
%td= pull_request.summary.truncate(30)
%td
- = link_to 'Show', idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], pull_request)
+ = link_to t('.show'), idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], pull_request)
- unless params[:closed]
- = link_to 'Edit', edit_idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], pull_request)
- = link_to 'Merge', merge_idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], pull_request) if pull_request.author_id == current_citizen.id
- = link_to 'Close', close_pr_idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], pull_request) if pull_request.author_id == current_citizen.id
+ = link_to t('.edit'), edit_idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], pull_request)
+ = link_to t('.merge'), merge_idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], pull_request) if pull_request.author_id == current_citizen.id
+ = link_to t('.close'), close_pr_idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], pull_request) if pull_request.author_id == current_citizen.id
-= link_to 'Closed Pull Requests', pull_requests_idea_translated_idea_forked_ideas_path(params[:idea_id], params[:translated_idea_id], :closed => true) unless params[:closed]
+= link_to t('.closed_pull_requests'), pull_requests_idea_translated_idea_forked_ideas_path(params[:idea_id], params[:translated_idea_id], :closed => true) unless params[:closed]
View
5 app/views/forked_ideas/show.html.haml
@@ -45,10 +45,11 @@
.body
- if @forked_idea.author == current_citizen or administrator_signed_in?
- if @forked_idea.is_closed
- = highlight('Already Closed', 'Already Closed')
+ = t('.already_closed')
- else
= link_to I18n.t("idea.links.edit_idea"), edit_idea_translated_idea_forked_idea_path(params[:idea_id], params[:translated_idea_id], @forked_idea)
- = link_to 'Fork List', idea_translated_idea_forked_ideas_path(params[:idea_id], params[:translated_idea_id])
+ %br
+ = link_to t('.fork_list'), idea_translated_idea_forked_ideas_path(params[:idea_id], params[:translated_idea_id])
= render "ideas/share", idea: @idea
View
13 app/views/ideas/_translations.html.haml
@@ -1,10 +1,11 @@
.translations
- - if @idea.translated_ideas != []
- This initiative have a translated versions:
- %br
- - @idea.translated_ideas.each do |translated|
- = link_to translated.language, translated
+ .languages
+ - if @idea.translated_ideas != nil
+ = t('.notification')
%br
+ - @idea.translated_ideas.each do |translation|
+ = link_to translation.language, idea_translated_idea_path(@idea.id, translation.id)
+ %br
= link_to t(".translate_button"), new_idea_translated_idea_path(@idea)
%br
- = link_to "All Translations", idea_translated_ideas_path(@idea)
+ = link_to t(".show_all"), idea_translated_ideas_path(@idea)
View
12 app/views/ideas/index.html.haml
@@ -33,7 +33,7 @@
/ New version with static order
-[:age, :comments, :voted, :votes_for, :support, :tilt].each do |field|
- order = @sorting_order.find{|so| so.first == field}[1]
- - if field == @sorting_order.first.first && params[:impression_reorder].nil?
+ - if field == @sorting_order.first.first && params[:impression_reorder].nil? && params[:language_reorder].nil?
%span.selected= link_to @field_names[field][order.first], reorder: field
- else
=link_to @field_names[field][order.first], reorder: field
@@ -49,6 +49,16 @@
= link_to @impression_fields[index][1], impression_reorder: field.to_s
- unless field == :year
|
+ .grid_3
+ = t('.languages')
+ .grid_20
+ -@language.each_with_index do |field, index|
+ - if field.to_s == params[:language_reorder]
+ %span.selected= link_to @language_fields[index][1]
+ - else
+ = link_to @language_fields[index][1], language_reorder: field.to_s
+ - unless field == @language.last
+ |
/- if ENV['Feature_Searchbox']
.grid_24.search
.search
View
5 app/views/layouts/application.html.haml
@@ -35,10 +35,7 @@
%header.container_24.top_row_container
.container_24.top_row
%header.container_24
- - if I18n.locale == :fi
- = link_to image_tag("logo.png"), "/pages/etusivulle", id: "logo", class: "grid_12"
- - elsif I18n.locale = :en
- = link_to image_tag("logo.png"), "/pages/home", id: "logo", class: "grid_12"
+ = link_to image_tag("logo_" + I18n.locale.to_s + ".png"), root_path, id: "logo", class: "grid_12"
= render partial: 'shared/login_actions'
= render partial: 'shared/facebook_js'
.idea_actions.bottom_row
View
3  app/views/pages/_headline.html.haml
@@ -4,5 +4,6 @@
%h2= @headline_2[rand(@headline_2.size)]
.actions.grid_6
= link_to t('.ideas'), ideas_path, class: "button"
- = image_tag "ficora.png", class: "stamp-show"
+ - if I18n.locale == :fi
+ = image_tag "ficora.png", class: "stamp-show"
= link_to t('.FAQ'), "/artikkelit/20-usein-kysyttyja-kysymyksia", class: "button"
View
9 app/views/translated_ideas/_form.html.haml
@@ -3,21 +3,12 @@
= simple_form_for [@idea, @translated_idea] do |f|
.grid_12
= f.input :title, label: I18n.t("idea.new.title")
- .grid_8.help_cont
- #title_help
- %p= t('.title_help')
.grid_16
= f.input :summary, as: :text
- .grid_8.help_cont
- #summary_help
- %p= t('.summary_help')
.grid_16
= f.input :body, as: :text
= f.label :language
= f.select :language, Language.all.map{ |language| [language.full_name, language.name] }, :selected => @translated_idea.language
- .grid_8.help_cont
- #body_help
- %p= t('.body_help')
.grid_16
= f.hidden_field :idea_id, :value => @idea.id
%br
View
2  app/views/translated_ideas/_original.html.haml
@@ -1,2 +1,2 @@
.translations
- = link_to "Original idea", @idea
+ = link_to t(".original"), @idea
View
22 app/views/translated_ideas/index.html.haml
@@ -2,19 +2,19 @@
%thead
%tr
%th
- Language
+ = t('.language')
%th
- Title
+ = t('.title')
%th
- Body
+ = t('.body')
%th
- Summary
+ = t('.summary')
%th
- Created At
+ = t('.created_at')
%th
- Updated At
+ = t('.updated_at')
%th
- Actions
+ = t('.actions')
%tbody
%tr
- @translated_ideas.each do |translated_idea|
@@ -31,8 +31,8 @@
%td
= finnishDate(translated_idea.updated_at)
%td
- = link_to 'Original Idea', translated_idea.idea
- = link_to t(".fork"), fork_idea_translated_idea_forked_ideas_path(params[:idea_id], translated_idea.id)
- = link_to t(".fork_list"), idea_translated_idea_forked_ideas_path(params[:idea_id], translated_idea.id)
+ = link_to t('.original'), translated_idea.idea
+ = link_to t('.fork'), fork_idea_translated_idea_forked_ideas_path(params[:idea_id], translated_idea.id)
+ = link_to t('.fork_list'), idea_translated_idea_forked_ideas_path(params[:idea_id], translated_idea.id)
-= link_to t(".new_translation"), new_idea_translated_idea_path(params[:idea_id])
+= link_to t('.new_translation'), new_idea_translated_idea_path(params[:idea_id])
View
6 app/views/translated_ideas/show.html.haml
@@ -45,9 +45,9 @@
.body
- if @translated_idea.author == current_citizen or administrator_signed_in?
= link_to I18n.t("idea.links.edit_idea"), edit_translated_idea_path(@translated_idea)
- = link_to 'Fork', fork_idea_translated_idea_forked_ideas_path(params[:idea_id], params[:id])
- = link_to 'Fork List', idea_translated_idea_forked_ideas_path(params[:idea_id], params[:id])
- = link_to 'Pull Requests', pull_requests_idea_translated_idea_forked_ideas_path(params[:idea_id], params[:id])
+ = link_to t(".fork"), fork_idea_translated_idea_forked_ideas_path(params[:idea_id], params[:id])
+ = link_to t(".fork_list"), idea_translated_idea_forked_ideas_path(params[:idea_id], params[:id])
+ = link_to t(".pull_requests"), pull_requests_idea_translated_idea_forked_ideas_path(params[:idea_id], params[:id])
= render "ideas/share", idea: @idea
View
128 config/locales/en.yml
@@ -96,6 +96,7 @@ en:
title: "Open ministry ideas"
filtering: "Filter: "
ordering: "Order: "
+ languages: "Languages: "
time_period: "Time period: "
search: "Search: "
search_example: "(eg. law)"
@@ -110,22 +111,6 @@ en:
hidden_title: "hidden"
hidden_summary_part_1: "This idea is hidden at the moment. You can turn to"
hidden_summary_part_2: "you can turn to... if you have any questions"
- unsupport_idea: "You get more support for your idea when you share it forward"
- support_idea: "You get much more support for your idea when you share it"
- share_idea: "Share your idea! You increase its value and it doesnt matter if youre against it or not!"
- voted_idea: "You can add more value to your view by sharing the iniative actively!"
- supported: "You gave your support"
- change_vote: "You can change your stand if you want to"
- notification_idea: "We inform everyone who has supported the idea, when the idea has progressed into a law draft."
- notification_draft: "We inform everyone who has supported the idea, when the iniative has officially started and you can sign the official notification of support. We inform everyone who has supported the idea "
- billing: "Are you supporting the law iniative?"
- proposal_support_problem: "Official electronic announciation of support isnt possible yet in Open Ministry's services. We pursue to finish it as soon as possible. Check from the bottom how you can sign the paper version of the notification of support"
- non_official_support: "Meanwhile you can inform your informal support for the law iniative. We inform everyone when the electrical notifications of support are also possible."
- official_support_not_yet_possible: "Official electronic notification of support is not possible yet in the Open Ministrys services. This iniative is presented here for official testing."
- support_notification: "Notice that youre not doing an official signature of a notification of support."
- not_supported_idea: "The idea has not been in the Open Ministry or there is no support for it."
- supported_idea: "The idea has been in the Open Ministry or there is already some (unofficial) support for it."
- law_idea: "The idea is already a law"
expert_opinions: "Expert Opinions"
are_you_expert: "Are you an expert?"
suggest_experts: "Suggest an expert"
@@ -139,6 +124,8 @@ en:
nearest_collection_points: "Nearest collection points"
translations:
translate_button: "Create a translation"
+ show_all: "All Translations"
+ notification: "The current initiative is translated in several languages:"
geolocation:
view_full_map: "View full map"
addresses: "Collection point addresses"
@@ -193,7 +180,7 @@ en:
this_rate: "At this rate the collection will probably take a total of"
days: "days"
that_is: "That is, even"
- target_dat: "Objective would be an estimated"
+ target_day: "Objective would be an estimated"
at_this_rate: "At this rate"
time_to_collect_ads: "there is time to collect ads"
no_time_to_collect_ads: "there is no time to collect enough ads"
@@ -202,6 +189,24 @@ en:
support_is_over: "Support for the collection of ads is over"
average_rate: "The votes were collected on average"
estimate_duration: "It would be gathering pace of the estimated duration"
+ voting:
+ voted_idea: "You can add more value to your view by sharing the iniative actively!"
+ supported: "You gave your support"
+ change_vote: "You can change your stand if you want to"
+ notification_idea: "We inform everyone who has supported the idea, when the idea has progressed into a law draft."
+ notification_draft: "We inform everyone who has supported the idea, when the iniative has officially started and you can sign the official notification of support. We inform everyone who has supported the idea "
+ billing: "Are you supporting the law iniative?"
+ proposal_support_problem: "Official electronic announciation of support isnt possible yet in Open Ministry's services. We pursue to finish it as soon as possible. Check from the bottom how you can sign the paper version of the notification of support"
+ non_official_support: "Meanwhile you can inform your informal support for the law iniative. We inform everyone when the electrical notifications of support are also possible."
+ official_support_not_yet_possible: "Official electronic notification of support is not possible yet in the Open Ministrys services. This iniative is presented here for official testing."
+ support_notification: "Notice that youre not doing an official signature of a notification of support."
+ not_supported_idea: "The idea has not been in the Open Ministry or there is no support for it."
+ supported_idea: "The idea has been in the Open Ministry or there is already some (unofficial) support for it."
+ law_idea: "The idea is already a law"
+ share:
+ unsupport_idea: "You get more support for your idea when you share it forward"
+ support_idea: "You get much more support for your idea when you share it"
+ share_idea: "Share your idea! You increase its value and it doesnt matter if youre against it or not!"
profiles:
show:
voted_ideas: "Ideas, that you voted for"
@@ -330,40 +335,77 @@ en:
share: "Share your knowledge"
spread: "Spread the initiative"
translated_ideas:
+ index:
+ language: "Language"
+ title: "Title"
+ body: "Body"
+ summary: "Summary"
+ created_at: "Created at"
+ updated_at: "Updated at"
+ actions: "Actions"
+ new_translation: "New translation"
+ original: "Original idea"
+ fork: "Fork"
+ fork_list: "Fork list"
form:
translation: "Translation"
original: "Original"
show:
title: "Open ministry"
- previous: "previous"
- next: "next"
- hidden_title: "hidden"
- hidden_summary_part_1: "This idea is hidden at the moment. You can turn to"
- hidden_summary_part_2: "you can turn to... if you have any questions"
- unsupport_idea: "You get more support for your idea when you share it forward"
- support_idea: "You get much more support for your idea when you share it"
- share_idea: "Share your idea! You increase its value and it doesnt matter if youre against it or not!"
- voted_idea: "You can add more value to your view by sharing the iniative actively!"
- supported: "You gave your support"
- change_vote: "You can change your stand if you want to"
- notification_idea: "We inform everyone who has supported the idea, when the idea has progressed into a law draft."
- notification_draft: "We inform everyone who has supported the idea, when the iniative has officially started and you can sign the official notification of support. We inform everyone who has supported the idea "
- billing: "Are you supporting the law iniative?"
- proposal_support_problem: "Official electronic announciation of support isnt possible yet in Open Ministry's services. We pursue to finish it as soon as possible. Check from the bottom how you can sign the paper version of the notification of support"
- non_official_support: "Meanwhile you can inform your informal support for the law iniative. We inform everyone when the electrical notifications of support are also possible."
- official_support_not_yet_possible: "Official electronic notification of support is not possible yet in the Open Ministrys services. This iniative is presented here for official testing."
- support_notification: "Notice that youre not doing an official signature of a notification of support."
- not_supported_idea: "The idea has not been in the Open Ministry or there is no support for it."
- supported_idea: "The idea has been in the Open Ministry or there is already some (unofficial) support for it."
- law_idea: "The idea is already a law"
+ impression_count: "Viewed in the last 1 month"
+ fork_list: "Fork list"
+ already_closed: "Already closed"
expert_opinions: "Expert Opinions"
are_you_expert: "Are you an expert?"
suggest_experts: "Suggest an expert"
no_statements: "No statements yet"
comments: "Comments"
- vote_yes: "Yes"
- vote_no: "No"
- do_you_believe: "Are you supporting the law draft"
- support: "Give your support!"
+ fork: "Fork"
+ pull_requests: "Pull Requests"
+ original:
+ original: "Original idea"
+ forked_ideas:
+ merge:
+ title: "You can copy from forked version and paste to master translation"
+ master_translation: "Master translation"
+ translation_from: "Translation from"
+ form:
+ translation: "Translation"
+ originally_translated: "Originally translated"
+ language: "Language"
+ index:
+ title: "Listing Forked Ideas"
+ author: "Author"
+ body: "Body"
+ summary: "Summary"
+ actions: "Actions"
+ show: "Show"
+ edit: "Edit"
+ original_translation: "Original Translations"
+ send_pull_request: "Send Pull Requests"
+ pull_requests: "Pull Requests"
+ pull_requests:
+ title: "Listing Pull Requests"
+ author: "Author"
+ pr_title: "PR title"
+ body: "Body"
+ summary: "Summary"
+ actions: "Actions"
+ show: "Show"
+ edit: "Edit"
+ merge: "Merge"
+ close: "Close"
+ closed_pull_requests: "Closed Pull Requests"
+ show:
+ title: "Open ministry"
impression_count: "Viewed in the last 1 month"
- nearest_collection_points: "Nearest collection points"
+ fork_list: "Fork list"
+ already_closed: "Already closed"
+ expert_opinions: "Expert Opinions"
+ are_you_expert: "Are you an expert?"
+ suggest_experts: "Suggest an expert"
+ no_statements: "No statements yet"
+ comments: "Comments"
+ forked_idea:
+ new:
+ title: "Title"
View
144 config/locales/fi.yml
@@ -94,6 +94,7 @@ fi:
filtering: "Valittu: "
ordering: "Järjestys: "
time_period: "Aikaväli: "
+ languages: "Kieli: "
search: "Haku: "
search_example: "(esim. tasa*tai koira ja vero)"
no_title: "Ei otsikkoa"
@@ -107,22 +108,7 @@ fi:
hidden_title: "Piilotettu"
hidden_summary_part_1: "Tämä idea on tällä hetkellä piilotettu. Voit kääntyä "
hidden_summary_part_2: "puoleen mahdollisilla kysymyksilläsi."
- unsupport_idea: "Saat tukea ideaa vastaan huomattavasti enemmän, kun jaat sitä eteenpäin."
- support_idea: "Saat idealle huomattavasti enemmän tukea, kun jaat sitä eteenpäin."
- share_idea: "Jaa ideaa aktiivisesti eteenpäin! Lisäät sen painoarvoa, oletpa puolesta tai vastaan!"
- voted_idea: "Voit lisätä kantasi painoa jakamalla aloitetta aktiivisesti eteenpäin!"
- supported: "Annoit tukesi"
- change_vote: "voit halutessasi vaihtaa kantaasi."
- notification_idea: "Ilmoitamme ideaa tukeneille, kun idea on kehittynyt lakiluonnokseksi."
- notification_draft: "Ilmoitamme kaikille tukeneille, kun aloite on virallisesti käynnistynyt ja voit täyttää virallisen kannatusilmoituksen."
- billing: "Kannatatko lakiehdotusta?"
- proposal_support_problem: "Virallinen sähköinen kannatuksen ilmoittaminen ei ole vielä mahdollista Avoimen ministeriön palvelussa. Pyrimme valmistelemaan sen mahdollisimman pian. Tarkista aloitteen lopusta kuinka voit allekirjoittaa paperisen kannatusilmoituksen."
- non_official_support: "Sillä välin voit ilmoittaa epämuodollisen tukesi lakiehdotukselle. Ilmoitamme kaikille tukeneille kun myös sähköiset kannatusilmoitukset ovat mahdollisia."
- official_support_not_yet_possible: "Virallinen sähköinen kannatuksen ilmoittaminen ei ole vielä mahdollista Avoimen ministeriön palvelussa. Tämä aloite on esillä virallista testausta varten."
- support_notification: "Huomaa että et ole tekemässä virallista kannatusilmoituksen allekirjoitusta."
- not_supported_idea: "Idea ei ollut Avoimessa ministeriössa kehitettävänä tai se sille ei ole kannatusta"
- supported_idea: "Idea on ollut Avoimessa ministeriössa ja sille on aiempaa (epävirallista) kannatusta"
- law_idea: "Idea on jo laki"
+ impression_count: "Katsottu viimeisten 1 kuukausi"
expert_opinions: "Asiantuntijalausunnot"
are_you_expert: "Oletko asiantuntija"
suggest_experts: "Ehdota asiantuntijaa"
@@ -132,10 +118,11 @@ fi:
vote_no: "Ei"
do_you_believe: "Kannatatko lakiluonnosta?"
support: "Anna tukesi!"
- impression_count: "Katsottu viimeisten 1 kuukausi"
nearest_collection_points: "Lähimmät keräyspisteet"
translations:
translate_button: "Luo käännös"
+ show_all: "Kaikki käännökset"
+ notification: "Nykyinen aloite on käännetty useille kielille:"
geolocation:
view_full_map: "Näytä koko kartta"
addresses: "Keräyspisteet osoitteineen"
@@ -155,6 +142,10 @@ fi:
citizens: "Kansalaiset"
one_result: "1 tulos"
results: "tulosta"
+ share:
+ unsupport_idea: "Saat tukea ideaa vastaan huomattavasti enemmän, kun jaat sitä eteenpäin."
+ support_idea: "Saat idealle huomattavasti enemmän tukea, kun jaat sitä eteenpäin."
+ share_idea: "Jaa ideaa aktiivisesti eteenpäin! Lisäät sen painoarvoa, oletpa puolesta tai vastaan!"
signature_info:
already_sent: "Olet jo jättänyt kannatusilmoituksen onnistuneesti. Et voi jättää sitä uudelleen, mutta nyt koska kyseessä on demo niin sallimme uusia ilmoituksia."
collecting_ended: "Tämän aloitteen kannatusilmoitusten keräysaika on jo päättynyt, mutta keräämme käyttäjien tukea silti siltä varalta että aloite aktivoidaan uudelleen. Siinä tapauksessa lähetämme sinulle sähköpostin että voit jättää sen uudelleen."
@@ -180,7 +171,7 @@ fi:
in_am: "Avoimessa ministeriössä"
collected_elsewhere: "Kerätty muualla n."
collected_total: "Kerätty yhteensä siis n."
- pc_estimate: "kpl (arvio)"
+ pieces_estimate: "kpl (arvio)"
collected_about_target: "Tavoitteesta kerätty n."
updates: "Arvio lukumäärästä päivitetty"
rest_of_collection: "Kerääminen muualla:"
@@ -192,13 +183,37 @@ fi:
that_is: "Eli vielä"
target_day: "Tavoite täyttyisi arviolta"
at_this_rate: "Tällä tahdilla"
- time_to_collect_reports: "ehditään kerätä ilmoitukset"
+ time_to_collect_ads: "ehditään kerätä ilmoitukset"
no_time_to_collects_ads: "ei ehditä kerätä ilmoituksia riittävästi"
before_the_end: "ennen päättymispäivää"
goal_reached: "Tavoite on täyttynyt"
support_is_over: "Kannatusilmoitusten keräys on päättynyt"
average_rate: "Ilmoituksia kerättiin keskimäärin"
estimate_duration: "Sillä tahdilla kerääminen olisi arvioidusti kestänyt"
+ voting:
+ voted_idea: "Voit lisätä kantasi painoa jakamalla aloitetta aktiivisesti eteenpäin!"
+ supported: "Annoit tukesi"
+ change_vote: "voit halutessasi vaihtaa kantaasi."
+ notification_idea: "Ilmoitamme ideaa tukeneille, kun idea on kehittynyt lakiluonnokseksi."
+ notification_draft: "Ilmoitamme kaikille tukeneille, kun aloite on virallisesti käynnistynyt ja voit täyttää virallisen kannatusilmoituksen."
+ billing: "Kannatatko lakiehdotusta?"
+ proposal_support_problem: "Virallinen sähköinen kannatuksen ilmoittaminen ei ole vielä mahdollista Avoimen ministeriön palvelussa. Pyrimme valmistelemaan sen mahdollisimman pian. Tarkista aloitteen lopusta kuinka voit allekirjoittaa paperisen kannatusilmoituksen."
+ non_official_support: "Sillä välin voit ilmoittaa epämuodollisen tukesi lakiehdotukselle. Ilmoitamme kaikille tukeneille kun myös sähköiset kannatusilmoitukset ovat mahdollisia."
+ official_support_not_yet_possible: "Virallinen sähköinen kannatuksen ilmoittaminen ei ole vielä mahdollista Avoimen ministeriön palvelussa. Tämä aloite on esillä virallista testausta varten."
+ support_notification: "Huomaa että et ole tekemässä virallista kannatusilmoituksen allekirjoitusta."
+ not_supported_idea: "Idea ei ollut Avoimessa ministeriössa kehitettävänä tai se sille ei ole kannatusta"
+ supported_idea: "Idea on ollut Avoimessa ministeriössa ja sille on aiempaa (epävirallista) kannatusta"
+ law_idea: "Idea on jo laki"
+ expert_opinions: "Asiantuntijalausunnot"
+ are_you_expert: "Oletko asiantuntija"
+ suggest_experts: "Ehdota asiantuntijaa"
+ no_statements: "Ei vielä lausuntoja"
+ comments: "Kommentit"
+ vote_yes: "Kyllä"
+ vote_no: "Ei"
+ do_you_believe: "Kannatatko lakiluonnosta?"
+ support: "Anna tukesi!"
+ nearest_collection_points: "Lähimmät keräyspisteet"
profiles:
show:
voted_ideas: "Ideat, joita olet äänestänyt"
@@ -258,6 +273,10 @@ fi:
title: "Otsikko"
summary: "Tiivistelmä"
body: "Kuvaus"
+ forked_idea:
+ title: "Otsikko"
+ summary: "Tiivistelmä"
+ body: "Kuvaus"
translated_idea:
title: "Otsikko"
summary: "Tiivistelmä"
@@ -415,40 +434,75 @@ fi:
share: "Jaa tietoa"
spread: "Levitä aloitetta"
translated_ideas:
+ index:
+ language: "Kieli"
+ title: "Otsikko"
+ summary: "Tiivistelmä"
+ body: "Kuvaus"
+ created_at: "Luotu"
+ updated_at: "Päivitetty klo"
+ actions: "Toiminnot"
+ new_translation: "Uusi käännös"
+ original: "Alkuperäinen idea"
+ fork: "Haarukka"
+ fork_list: "Fork lista"
form:
translation: "Käännös"
original: "Alkuperäinen"
show:
title: "@Avoinministerio"
- previous: "Edellinen"
- next: "Seuraava"
- hidden_title: "Piilotettu"
- hidden_summary_part_1: "Tämä idea on tällä hetkellä piilotettu. Voit kääntyä "
- hidden_summary_part_2: "puoleen mahdollisilla kysymyksilläsi."
- unsupport_idea: "Saat tukea ideaa vastaan huomattavasti enemmän, kun jaat sitä eteenpäin."
- support_idea: "Saat idealle huomattavasti enemmän tukea, kun jaat sitä eteenpäin."
- share_idea: "Jaa ideaa aktiivisesti eteenpäin! Lisäät sen painoarvoa, oletpa puolesta tai vastaan!"
- voted_idea: "Voit lisätä kantasi painoa jakamalla aloitetta aktiivisesti eteenpäin!"
- supported: "Annoit tukesi"
- change_vote: "voit halutessasi vaihtaa kantaasi."
- notification_idea: "Ilmoitamme ideaa tukeneille, kun idea on kehittynyt lakiluonnokseksi."
- notification_draft: "Ilmoitamme kaikille tukeneille, kun aloite on virallisesti käynnistynyt ja voit täyttää virallisen kannatusilmoituksen."
- billing: "Kannatatko lakiehdotusta?"
- proposal_support_problem: "Virallinen sähköinen kannatuksen ilmoittaminen ei ole vielä mahdollista Avoimen ministeriön palvelussa. Pyrimme valmistelemaan sen mahdollisimman pian. Tarkista aloitteen lopusta kuinka voit allekirjoittaa paperisen kannatusilmoituksen."
- non_official_support: "Sillä välin voit ilmoittaa epämuodollisen tukesi lakiehdotukselle. Ilmoitamme kaikille tukeneille kun myös sähköiset kannatusilmoitukset ovat mahdollisia."
- official_support_not_yet_possible: "Virallinen sähköinen kannatuksen ilmoittaminen ei ole vielä mahdollista Avoimen ministeriön palvelussa. Tämä aloite on esillä virallista testausta varten."
- support_notification: "Huomaa että et ole tekemässä virallista kannatusilmoituksen allekirjoitusta."
- not_supported_idea: "Idea ei ollut Avoimessa ministeriössa kehitettävänä tai se sille ei ole kannatusta"
- supported_idea: "Idea on ollut Avoimessa ministeriössa ja sille on aiempaa (epävirallista) kannatusta"
- law_idea: "Idea on jo laki"
+ impression_count: "Katsottu viimeisten 1 kuukausi"
expert_opinions: "Asiantuntijalausunnot"
are_you_expert: "Oletko asiantuntija"
suggest_experts: "Ehdota asiantuntijaa"
no_statements: "Ei vielä lausuntoja"
comments: "Kommentit"
- vote_yes: "Kyllä"
- vote_no: "Ei"
- do_you_believe: "Kannatatko lakiluonnosta?"
- support: "Anna tukesi!"
+ fork: "Haarukka"
+ pull_requests: "Vedä pyynnöt"
+ original:
+ original: "Alkuperäinen idea"
+ forked_ideas:
+ merge:
+ title: "Voit kopioida kaksihaarainen versio ja liitä hallita käännös"
+ master_translation: "Master käännös"
+ translation_from: "Käännös"
+ form:
+ translation: "Käännös"
+ originally_translated: "Alunperin käännetty"
+ language: "Kieli"
+ index:
+ title: "Listing Forked Ideat"
+ author: "Kirjoittaja"
+ summary: "Tiivistelmä"
+ body: "Kuvaus"
+ actions: "Toiminnot"
+ show: "Näyttää"
+ edit: "Muokata"
+ original_translation: "Alkuperäinen Käännökset"
+ send_pull_request: "Lähetä Vedä Pyynnöt"
+ pull_requests: "Vedä Pyynnöt"
+ pull_requests:
+ title: "Listaus Pull pyynnöt"
+ author: "Kirjoittaja"
+ pr_title: "PR otsikko"
+ summary: "Tiivistelmä"
+ body: "Kuvaus"
+ actions: "Toiminnot"
+ show: "Näyttää"
+ edit: "Muokata"
+ merge: "Yhdistää"
+ close: "Lähellä"
+ closed_pull_requests: "Suljettu Pull pyynnöt"
+ show:
+ title: "@Avoinministerio"
impression_count: "Katsottu viimeisten 1 kuukausi"
- nearest_collection_points: "Lähimmät keräyspisteet"
+ fork_list: "Fork lista"
+ already_closed: "Jo suljettu"
+ expert_opinions: "Asiantuntijalausunnot"
+ are_you_expert: "Oletko asiantuntija"
+ suggest_experts: "Ehdota asiantuntijaa"
+ no_statements: "Ei vielä lausuntoja"
+ comments: "Kommentit"
+ forked_idea:
+ new:
+ title: "Otsikko"
View
92 db/schema.rb
@@ -28,8 +28,8 @@
t.string "unlock_token"
t.datetime "locked_at"
t.string "password"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "administrators", ["email"], :name => "index_administrators_on_email", :unique => true
@@ -51,8 +51,8 @@
t.integer "display_length"
t.string "custom_class"
t.string "custom_renderer"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "default_value"
t.string "api_id"
t.string "display_type"
@@ -82,8 +82,8 @@
t.text "credentials"
t.text "extra"
t.integer "citizen_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "authentications", ["citizen_id"], :name => "index_authentications_on_citizen_id"
@@ -96,8 +96,8 @@
t.integer "changelogged_id"
t.string "change_type"
t.text "attribute_changes"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "changelogs", ["changelogged_type", "changelogged_id"], :name => "index_changelogs_on_changelogged_type_and_changelogged_id"
@@ -117,8 +117,8 @@
t.string "password"
t.string "first_name"
t.string "last_name"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.datetime "locked_at"
end
@@ -131,8 +131,8 @@
t.boolean "published", :default => true
t.integer "commentable_id"
t.string "commentable_type"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "publish_state", :default => "published"
end
@@ -150,8 +150,8 @@
t.integer "question_id"
t.integer "question_group_id"
t.string "rule"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "dependency_conditions", :force => true do |t|
@@ -167,8 +167,8 @@
t.text "text_value"
t.string "string_value"
t.string "response_other"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "expert_suggestions", :force => true do |t|
@@ -181,8 +181,8 @@
t.string "recommendation"
t.integer "citizen_id"
t.integer "idea_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "forked_ideas", :force => true do |t|
@@ -204,8 +204,8 @@
t.text "body"
t.string "state", :default => "idea"
t.integer "author_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.text "summary"
t.string "publish_state", :default => "published"
t.string "slug"
@@ -277,8 +277,8 @@
t.integer "citizen_id"
t.decimal "amount", :precision => 8, :scale => 2
t.string "description"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "unique_identifier"
end
@@ -304,8 +304,8 @@
t.integer "citizen_id"
t.string "first_name"
t.string "last_name"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "image"
t.boolean "receive_newsletter", :default => true
t.boolean "receive_other_announcements", :default => true
@@ -333,8 +333,8 @@
t.string "display_type"
t.string "custom_class"
t.string "custom_renderer"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "api_id"
end
@@ -357,8 +357,8 @@
t.integer "display_width"
t.string "custom_class"
t.string "custom_renderer"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.integer "correct_answer_id"
t.string "api_id"
end
@@ -385,8 +385,8 @@
t.string "access_code"
t.datetime "started_at"
t.datetime "completed_at"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "api_id"
t.string "user_state"
end
@@ -406,8 +406,8 @@
t.string "string_value"
t.string "response_other"
t.string "response_group"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.integer "survey_section_id"
t.string "api_id"
end
@@ -418,8 +418,8 @@
create_table "sessions", :force => true do |t|
t.string "session_id", :null => false
t.text "data"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
@@ -435,8 +435,8 @@
t.boolean "vow"
t.date "signing_date"
t.string "state"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "stamp"
t.datetime "started"
t.string "firstnames"
@@ -459,8 +459,8 @@
t.string "common_identifier"
t.integer "display_order"
t.string "custom_class"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "surveys", :force => true do |t|
@@ -475,8 +475,8 @@
t.datetime "inactive_at"
t.string "css_url"
t.string "custom_class"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.integer "display_order"
t.string "api_id"
t.integer "survey_version", :default => 0
@@ -510,24 +510,24 @@
t.string "string_value"
t.string "response_other"
t.string "regexp"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "validations", :force => true do |t|
t.integer "answer_id"
t.string "rule"
t.string "message"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "votes", :force => true do |t|
t.integer "option"
t.integer "idea_id"
t.integer "citizen_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "votes", ["citizen_id"], :name => "index_votes_on_citizen_id"
View
69 db/seeds.rb
@@ -255,7 +255,59 @@ def random_citizen
collecting_ended: false,
collecting_start_date: Time.now,
collecting_end_date: 1.year.from_now,
- additional_signatures_count: 0,
+ additional_signatures_count: rand(10000),
+ additional_signatures_count_date: 1.year.from_now,
+ target_count: 10000,
+ collecting_in_service: false
+ })
+
+ idea.publish_state = 'published'
+ idea.author = random_citizen
+ idea.save
+end
+
+9.times do |i|
+ inx = i + 1
+ idea = Idea.new({
+ title: "Suomi draft #{inx}",
+ summary: "Joku roti!",
+ body: "Suuremmat rangaistukset olisivat linjakkaampia!",
+ state: "draft"
+ })
+
+ idea.publish_state = 'published'
+ idea.author = random_citizen
+ idea.save
+end
+
+9.times do |i|
+ inx = i + 1
+ idea = Idea.new({
+ title: "English draft #{inx}",
+ summary: "Some text!",
+ body: "Another text!",
+ state: "draft",
+ language: "en"
+ })
+
+ idea.publish_state = 'published'
+ idea.author = random_citizen
+ idea.save
+end
+
+9.times do |i|
+ inx = i + 1
+ idea = Idea.new({
+ title: "English proposal #{inx}",
+ summary: "Some text!",
+ body: "Another text!",
+ state: "proposal",
+ language: "en",
+ collecting_started: true,
+ collecting_ended: false,
+ collecting_start_date: Time.now,
+ collecting_end_date: 1.year.from_now,
+ additional_signatures_count: rand(10000),
additional_signatures_count_date: 1.year.from_now,
target_count: 10000,
collecting_in_service: false
@@ -280,6 +332,21 @@ def random_citizen
idea.save!
end
+20.times do |i|
+ idea = Idea.create(
+ { title: "English-idea #{i}",
+ summary: "Some text",
+ body: "Another text",
+ language: "en",
+ created_at: Time.now - (60*60*24),
+ updated_at: Time.now - (60*60*24),
+ })
+
+ idea.state = "idea"
+ idea.author = random_citizen
+ idea.save!
+end
+
voters = (0..100).map do |i|
Citizen.find_or_create_by_email(
email: "voter#{i}@voter.com",
View
15 spec/acceptance/ideas/index_spec.rb
@@ -0,0 +1,15 @@
+# -*- encoding: utf-8 -*-
+require "acceptance/acceptance_helper"
+
+feature "Ideas#index" do
+ let(:citizen_password) { '123456789' }
+ let(:citizen_email) { 'citizen-kane@example.com'}
+
+ scenario "Switching between order, should change the link" do
+ citizen = create_logged_in_citizen({ :password => citizen_password, :email => citizen_email })
+ visit ideas_path
+ page.should have_content "Uusimmat ideat"
+ click_link "Uusimmat ideat"
+ page.should have_content "Vanhimmat ideat"
+ end
+end
View
47 spec/acceptance/pages/index_citizen_spec.rb
@@ -0,0 +1,47 @@
+# -*- encoding: utf-8 -*-
+require "acceptance/acceptance_helper"
+
+feature "i18n" do
+ let(:citizen_password) { '123456789' }
+ let(:citizen_email) { 'citizen-kane@example.com'}
+ let(:fi_language) { "fi" }
+ let(:en_language) { "en" }
+
+ scenario "Visit home page as registered user with preferred language 'fi'" do
+ citizen = create_logged_in_citizen({ password: citizen_password, email: citizen_email })
+ citizen.profile.preferred_language = fi_language
+ visit root_path
+ page.should have_content "Profiili"
+ end
+
+ scenario "Visit home page as registered user with preferred language 'en'" do
+ citizen = create_logged_in_citizen({ password: citizen_password, email: citizen_email })
+ citizen.profile.preferred_language = en_language
+ visit root_path
+ page.should have_content "Logout"
+ end
+
+ scenario "Switch language as registered user (from en to fi)" do
+ language = FactoryGirl.create(:language)
+ citizen = create_logged_in_citizen({ password: citizen_password, email: citizen_email })
+ citizen.profile.preferred_language = en_language
+ visit edit_profile_path
+ page.should have_content "Preferred language"
+ select "Finnish", :from => "profile_preferred_language"
+ click_button "Submit settings"
+ visit root_path
+ page.should have_content "Profiili"
+ end
+
+ scenario "Switch language as registered user (from fi to en)" do
+ language = FactoryGirl.create(:language, name: "en", full_name: "English")
+ citizen = create_logged_in_citizen({ password: citizen_password, email: citizen_email })
+ citizen.profile.preferred_language = fi_language
+ visit edit_profile_path
+ page.should have_content "Kieli"
+ select "English", :from => "profile_preferred_language"
+ click_button "Tallenna asetukset"
+ visit root_path
+ page.should have_content "Settings"
+ end
+end
View
13 spec/acceptance/pages/index_guest_spec.rb
@@ -0,0 +1,13 @@
+# -*- encoding: utf-8 -*-
+require "acceptance/acceptance_helper"
+
+feature "i18n" do
+ scenario "Visit home page as guest and switch between languages" do
+ visit root_path
+ page.should have_content "Kirjaudu"
+ click_link "Greatbritain"
+ page.should have_content "Login"
+ click_link "Finland"
+ page.should have_content "Kirjaudu"
+ end
+end
View
5 spec/factories.rb
@@ -85,4 +85,9 @@
accept_non_eu_server true
accept_publicity "Normal"
end
+
+ factory :language do
+ full_name "Finnish"
+ name "fi"
+ end
end

No commit comments for this range

Something went wrong with that request. Please try again.