% content_for(:sidebar) do %> <%# Deliberately NOT keyed on current_user, unlike the fresh_when etag on this same action: the 5 most recent post titles/links are identical for every viewer, and the signed-in-as banner + new-post form that DO vary per viewer render outside this block, never inside the cached fragment. See prism-postep.md session 62/64. %> <% cache(:recent_posts_sidebar, expires_in: 60) do %>
<%= notice %>
<% end %> <% unless errors.empty? %><%== f.label(:title, t('posts.title_label')) %> <%== f.text_field(:title) %> <%== f.error_messages(:title) %>
<%== f.label(:body, t('posts.body_label')) %> <%== f.text_area(:body) %> <%== f.error_messages(:body) %>
<%== f.label(:cover, t('posts.cover_label')) %> <%== f.tag(:input, type: 'file', name: 'post[cover]', id: 'post_cover') %>
<%== f.check_box(:featured) %> <%== f.label(:featured, t('posts.featured_label')) %>
<%== f.label(:giveaway_slots, t('claims.giveaway_slots_label')) %> <%== f.text_field(:giveaway_slots) %> <%== f.error_messages(:giveaway_slots) %>
<%== f.submit(t('posts.submit')) %> <% end %><%== f.label(:file, t('posts.import_label')) %> <%== f.tag(:input, type: 'file', name: 'file', id: 'post_file', accept: '.csv,text/csv') %>
<%== f.submit(t('posts.import_submit')) %> <% end %> <% end %><%== link_to(t('posts.filter_all'), url_for(:posts)) %> | <%== link_to(t('posts.filter_recent', days: 7), "#{url_for(:posts)}?days=7") %> | <%== link_to(t('posts.filter_recent', days: 30), "#{url_for(:posts)}?days=30") %> | <%== link_to(t('posts.filter_featured'), "#{url_for(:posts)}?featured=1") %>