Add links to diaries in preferred languages
This commit is contained in:
parent
d6827e6e96
commit
f4d84c4806
3 changed files with 19 additions and 0 deletions
|
@ -47,6 +47,8 @@ class DiaryEntriesController < ApplicationController
|
|||
@title = t ".in_language_title", :language => Language.find(params[:language]).english_name
|
||||
entries = entries.where(:language_code => params[:language])
|
||||
else
|
||||
candidate_codes = preferred_languages.flat_map(&:candidates).uniq.map(&:to_s)
|
||||
@languages = Language.where(:code => candidate_codes).in_order_of(:code, candidate_codes)
|
||||
@title = t ".title"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue