Upload files to "/"

This commit is contained in:
agnes 2025-11-14 18:16:32 -05:00
parent 86fb48a95a
commit e43fa6597f
4 changed files with 216 additions and 0 deletions

147
_contents.html.erb Normal file
View file

@ -0,0 +1,147 @@
<!--main content-->
<!-- expects @fandoms, @works, @series, @bookmarks -->
<% if @status.present? %>
<hr><div class="userstatus">
<h3>Current Status...</h3>
<%= link_to t("All My Statuses"), user_statuses_path(@status.user) %><hr>
<%= image_tag @status.icon if @status.icon.attached? %> | <%= time_ago_in_words(@status.created_at) %> | <% if current_user == @status.user %>
<%= link_to 'Edit', edit_user_status_path(@status.user, @status) %> |
<%= link_to t("Delete"), user_status_path(@status.user, @status),
data: { confirm: t("Are you sure? All information in this status will be lost.") },
method: :delete %>
<% end %>
<br>
<p><%= raw sanitize_field(@status, :text) %></p>
<% if @status.mood.present? %>
<p>Mood: <%= @status.mood %>
<% end %>
<% if @status.music.present? %>
<p>Music: <%= @status.music %></p>
<% end %>
</div>
<% end %>
<p>
<% unless @fandoms.empty? %>
<div class="fandom listbox group" id="user-fandoms">
<h3 class="heading"><%= ts("Fandoms") %></h3>
<ol class="index group">
<% @fandoms.each_with_index do |fandom, i| %>
<% if i>= ArchiveConfig.NUMBER_OF_ITEMS_VISIBLE_IN_DASHBOARD && !params[:expand_fandoms] %>
<li class="more hidden">
<% else %>
<li>
<% end %>
<% if fandom.merger %>
<%= link_to fandom.name, {:controller => :works, :user_id => @user, :pseud_id => @pseud, :fandom_id => fandom.merger.id} %> (<%= fandom.work_count %>)
<% else %>
<%= link_to fandom.name, {:controller => :works, :user_id => @user, :pseud_id => @pseud, :fandom_id => fandom.id} %> (<%= fandom.work_count %>)
<% end %>
</li>
<% end %>
</ol>
<% if @fandoms.length > ArchiveConfig.NUMBER_OF_ITEMS_VISIBLE_IN_DASHBOARD %>
<p class="actions">
<noscript>
<% if params[:expand_fandoms] %>
<%= link_to ts("Collapse Fandoms List"), [@user, @pseud] %>
<% else %>
<%= link_to ts("Expand Fandoms List"), url_for(:expand_fandoms => true) %>
<% end %>
</noscript>
<a class="hidden" id="expand-fandoms" href="#"><%= ts("Expand Fandoms List") %></a>
<a class="hidden" id="collapse-fandoms" href="#"><%= ts("Collapse Fandoms List") %></a>
</p>
<% end %>
</div>
<% end %>
<% unless @works.blank? %>
<div class="work listbox group" id="user-works">
<h3 class="heading"><%= ts("Recent works") %></h3>
<ul class="index group">
<%= render partial: 'works/work_blurb', collection: @works, as: :work %>
</ul>
<% if @pseud %>
<% if @pseud.works.count > ArchiveConfig.NUMBER_OF_ITEMS_VISIBLE_IN_DASHBOARD %>
<ul class="actions" role="navigation"><li><%= pseud_works_link(@pseud) %></li>
<% end %>
<% else %>
<% if @user.works.size > ArchiveConfig.NUMBER_OF_ITEMS_VISIBLE_IN_DASHBOARD %>
<ul class="actions" role="navigation"><li><%= works_link(@user) %></li></ul>
<% end %>
<% end %>
</div>
<% end %>
<% unless @series.blank? %>
<div class="series listbox group" id="user-series">
<h3 class="heading"><%= ts("Recent series") %></h3>
<ol class="index group">
<%= render partial: 'series/series_blurb', collection: @series, as: :series %>
</ol>
<% if @pseud %>
<% if @pseud.series.count > ArchiveConfig.NUMBER_OF_ITEMS_VISIBLE_IN_DASHBOARD %>
<ul class="actions" role="navigation"><li><%= pseud_series_link(@pseud) %></li></ul>
<% end %>
<% else %>
<% if @user.series.size > ArchiveConfig.NUMBER_OF_ITEMS_VISIBLE_IN_DASHBOARD %>
<ul class="actions" role="navigation"><li><%= series_link(@user) %></li></ul>
<% end %>
<% end %>
</div>
<% end %>
<% unless @bookmarks.blank? %>
<div class="bookmark listbox group" id="user-bookmarks">
<h3 class="heading"><%= ts("Recent bookmarks") %></h3>
<ol class="index group">
<%= render partial: 'bookmarks/bookmark_blurb', collection: @bookmarks, as: :bookmark %>
</ol>
<% unless @user == User.orphan_account %>
<% if @pseud %>
<% if @pseud.bookmarks.visible.size > ArchiveConfig.NUMBER_OF_ITEMS_VISIBLE_IN_DASHBOARD %>
<ul class="actions" role="navigation"><li><%= pseud_bookmarks_link(@pseud) %></li></ul>
<% end %>
<% else %>
<% if @user.bookmarks.visible.size > ArchiveConfig.NUMBER_OF_ITEMS_VISIBLE_IN_DASHBOARD %>
<ul class="actions" role="navigation"><li><%= bookmarks_link(@user) %></li></ul>
<% end %>
<% end %>
<% end %>
</div>
<% end %>
<% if @works.blank? && @series.blank? && @bookmarks.blank? %>
<% if current_user == @user %>
<p class="alt message">
<%= ts("You don't have anything posted under this name yet. ") %>
<%= ts("Would you like to ")%>
<%= link_to ts("post a new work"), new_work_path %>
<%= ts("or maybe")%>
<%= link_to ts("a new bookmark"), new_external_work_path %>?
</p>
<% else %>
<p class="message"><%= ts("There are no works or bookmarks under this name yet.") %></p>
<% end %>
<% end %>
<!--/content-->
<%= content_for :footer_js do %>
<%= javascript_tag do %>
$j(document).ready(function() {
$j("#expand-fandoms").removeClass("hidden").click(function(e) {
e.preventDefault();
$j(".more").toggleClass("hidden");
$j("#collapse-fandoms").toggleClass("hidden");
$j(this).toggleClass("hidden");
});
$j("#collapse-fandoms").click(function(e) {
e.preventDefault();
$j(".more").toggleClass("hidden");
$j("#expand-fandoms").toggleClass("hidden");
$j(this).toggleClass("hidden");
});
});
<% end %>
<% end %>

59
_greeting.html.erb Normal file
View file

@ -0,0 +1,59 @@
<nav id="greeting" aria-label="<%= t(".nav.label") %>">
<% if logged_in? %>
<ul class="user navigation actions">
<li class="dropdown">
<%= link_to t(".nav.greeting", current_user: current_user.login), user_path(current_user) %>
<ul class="menu">
<li><%= link_to t(".nav.dashboard"), user_path(current_user) %></li>
<% if @current_user_subscriptions_count > 0 %>
<li><%= link_to t(".nav.subscriptions"), user_subscriptions_path(current_user) %></li>
<% end %>
<% if @current_user_visible_work_count > 0 %>
<li><%= link_to t(".nav.works"), user_works_path(@current_user) %></li>
<% end %>
<% if @current_user_bookmarks_count > 0 %>
<li><%= link_to t(".nav.bookmarks"), user_bookmarks_path(current_user) %></li>
<% end %>
<% if @current_user_owned_collections_count > 0 %>
<li><%= link_to t(".nav.collections"), user_collections_path(current_user) %></li>
<% end %>
<% if @current_user_challenge_signups_count > 0 %>
<li><%= link_to t(".nav.sign_ups"), user_signups_path(current_user) %></li>
<% end %>
<% if @current_user_offer_assignments > 0 %>
<li><%= link_to t(".nav.assignments"), user_assignments_path(current_user) %></li>
<% end %>
<% if @current_user.preference.try(:history_enabled?) %>
<li><%= link_to t(".nav.history"), user_readings_path(current_user) %></li>
<% end %>
<li><%= link_to t(".nav.preferences"), user_preferences_path(current_user) %></li>
<% if permit?("opendoors") %>
<li><%= link_to t(".nav.open_doors"), opendoors_tools_path %></li>
<% end %>
<% if current_user.is_tag_wrangler? %>
<li><%= link_to t(".nav.tag_wrangling"), tag_wrangler_path(current_user) %></li>
<% end %>
</ul>
</li>
<li class="dropdown">
<%= link_to t(".nav.post"), new_work_path %>
<ul class="menu">
<li><%= link_to t(".nav.new_work"), new_work_path %></li>
<li><%= link_to t(".nav.import"), new_work_path(import: "true") %></li>
<li><%= link_to t("New Status"), new_user_status_path(current_user) %></li>
<% if @current_user_unposted_works_size > 0 %>
<li><%= link_to t(".nav.post_draft"), drafts_user_works_path(@current_user) %></li>
<% end %>
</ul>
</li>
<li><%= link_to t(".nav.log_out"), destroy_user_session_path, method: :delete %></li>
</ul>
<% elsif logged_in_as_admin? %>
<ul class="user navigation actions">
<li><%= link_to t(".nav.greeting", current_user: current_admin.login), admins_path %></li>
<li><%= link_to t(".nav.log_out"), destroy_admin_session_path, method: :delete %></li>
</ul>
<% end %>
<p class="icon"><%= icon_display(current_user) %></p>
</nav>

6
_menu_browse.html.erb Normal file
View file

@ -0,0 +1,6 @@
<ul class="menu">
<li><%= link_to t(".works"), works_path %></li>
<li><%= link_to t(".bookmarks"), bookmarks_path %></li>
<li><%= link_to t(".tags"), tags_path %></li>
<li><%= link_to t(".collections"), collections_path %></li>
<li><a href="/timeline">Status Timeline</a></li></ul>

4
browse.html.erb Normal file
View file

@ -0,0 +1,4 @@
<h2 class="heading"><%= ts('Browse', key: 'header') %></h2>
<div class="userstuff">
<%= render 'menu/menu_browse' %>
</div>