Skip to content

Commit

Permalink
Replaced newest authors carousel with random ones
Browse files Browse the repository at this point in the history
  • Loading branch information
abartov committed Nov 11, 2023
1 parent 7bd9893 commit 87c68d4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/controllers/welcome_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def index
@pop_authors = popular_authors
@pop_authors_this_month = @pop_authors # Temporary hack! TODO: stop cheating and actually count by month
@pop_works = popular_works
@newest_authors = cached_newest_authors
# @newest_authors = cached_newest_authors # deprecated because we stopped producing portraits
@random_authors = Person.published.has_image.order(Arel.sql('RAND()')).limit(10)
@newest_works = cached_newest_works
@surprise_author = Person.where(id: Person.has_toc.pluck(:id).sample(1))[0]
@surprise_work = randomize_works(1)[0]
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_authors.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- cache "homepage_authors", expires_in: 6.hours do
.by-card-content-v02
= render partial: 'shared/author_cards', locals: {title: t(:most_popular_authors), authors: popular_authors, surprise: false, id_frag: 'pop', skip_title: false, size: :large}
= render partial: 'shared/author_cards', locals: {title: t(:newest_authors), authors: newest_authors, surprise: true, id_frag: 'new', skip_title: false, size: :large}
= render partial: 'shared/author_cards', locals: {title: t(:random_authors), authors: random_authors, surprise: true, id_frag: 'new', skip_title: false, size: :large}
.link-to-all-v02
%a{style: 'font-weight:bold', href: authors_path}
%span= t(:to_all_authors)
Expand Down
2 changes: 1 addition & 1 deletion app/views/welcome/_homepage.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-#= t(:x_authors, x: @totals[:authors])
= "(#{@totals[:authors]})"
-# author carousels
= render partial: 'shared/authors', locals: {popular_authors: @pop_authors, random_authors: [], newest_authors: @newest_authors}
= render partial: 'shared/authors', locals: {popular_authors: @pop_authors, random_authors: @random_authors}

-# most read and new works
- cache "homepage_mostread", expires_in: 6.hours do
Expand Down
4 changes: 2 additions & 2 deletions config/locales/he.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ he:
whatsnew_subtitle: יצירות ויוצרים חדשים באתר, אירועים, סרטונים, וחדשות.
whats_new: מה חדש בפרויקט
project_ben_yehuda: פרויקט בן־יהודה
random_authors: יוצרים אקראיים
random_works: יצירות אקראיות
random_authors: יוצרים מן המאגר
random_works: יצירות מן המאגר
featured_item: זרקור על יצירה
edit_markdown: עריכת הטקסט
edit_markdown_in_new_window: עריכת הטקסט בלשונית חדשה
Expand Down

0 comments on commit 87c68d4

Please sign in to comment.