Add app/views/home/index.html.erb

This commit is contained in:
agnes 2025-12-28 12:35:52 +00:00
commit d9a97f9e1a

View file

@ -0,0 +1,61 @@
<div class="splash">
<% if !logged_in? %>
<%= render 'intro_module' %>
<% end %>
<% if logged_in? && @homepage.favorite_tags.present? %>
<div class="favorite module">
<h3 class="heading"><%= t(".find_your_favorites") %></h3>
<ul>
<% @homepage.favorite_tags.each do |favorite_tag| %>
<li>
<%= link_to_tag_works(favorite_tag.tag) %>
</li>
<% end %>
</ul>
</div>
<% else %>
<div role="navigation" aria-label="<%= t(".media_navigation_label") %>" class="browse module">
<h3 class="heading"><%= t(".find_your_favorites") %></h3>
<% if logged_in? %>
<p class="note"><%= t(".browse_or_favorite", count: ArchiveConfig.MAX_FAVORITE_TAGS) %></p>
<% end %>
# new code begins here
Or, try a new author...
<% if @random_user %>
<%= link_to @random_user.login, user_path(@random_user) %>
<% else %>
<span>No authors available</span>
<% end %><br>
# ends here
<%= render 'fandoms' %>
</div>
<% end %>
<% if @homepage.admin_posts.present? %>
<%= render 'news_module', admin_posts: @homepage.admin_posts %>
<% end %>
<% if logged_in? && @homepage.readings.present? %>
<div class="random readings module">
<h3 class="heading">
<span class="title"><%= t(".readings.heading.title") %></span>
<span class="link"><%= link_to t(".readings.heading.history_link"), user_readings_path(current_user) %></span>
</h3>
<div class="flash"></div>
<p class="note"><%= t(".readings.note") %></p>
<ol class="reading work index group">
<% @homepage.readings.each do |reading| %>
<%= render "readings/reading_blurb", work: reading.work, reading: reading %>
<% end %>
</ol>
</div>
<% end %>
<% if logged_in? && @homepage.inbox_comments.present? %>
<%= render 'inbox_module', inbox_comments: @homepage.inbox_comments %>
<% end %>