* Allow user to have many orgs * Allow users to handle multi orgs in settings * Make rounded buttons inline * Add multi org function to dashboards * Fix merge conflicts * Fix mistake in merge conflict fix oops * Display the correct membership level * Fix accessibility issues * Display organizations for article editors * Handle submitting org id with preact editors * Make listings work with multiple organizations * Allow listings to have multiple orgs on create * Display the correct number of credits for each org * Move script tag to Webpack * Allow multi orgs for purchasing and viewing credits * Use OrganizationMembership as authorization check * Display multiple organizations for notifications * Allow dashboard to be viewable under multi-orgs * Remove unused method * Add multi-org functionality for article editors * Show pro dashboard buttons for member+ org levels * Leave the correct organization * Allow article API to change org id * Add left-out authorization method oops * Make nav buttons a bit more clear * Fix merge conflict * Fix adding org id for /api/articles and tests * Fix tests for org policy * Use proper logic for displaying org members * Update org actions with new authorization * Use correct org when creating a listing * Remove additional payment charge oops * Mark org notifications as read with authorization * Remove deprecated post_as_organization attribute * Use new org_admin syntax * Remove deprecated org logic for article create and update * Default all RSS posts to not belong to any org * Render org_member page for guest users * Update org policy spec to work with multi orgs * Use org_membership for org traits and move identity code * Use org_member trait * Update to work with multi-orgs * Validate article's org_id if param org_id is blank * Make a let variable * Remove unnecessary eager load for credits * Fix HTML structure and org logic for non-org users * Update credits spec for multi-org * Add test for failed payment when purchased by org * Lint listings_spec * Test that the listing was created under the user * Add tests for POST /listings multi-org * Use double quotes for classes * Fix /manage and a few other multi-org bugs * Fix test for multi org * Use correct method SQL exists? not Rails exist? * Fix reads spec for multi-org * Fix org_controller actions to work with multi org * Test only multi org and not old usage and fix leave_org * Fix org showing user profile img test for multi-org * Fix org logic for users with no orgs * Remove switch org functionality * Update tests and add hidden param for org id * Redirect to the specific organization * Test other org button actions * Use settings_notice instead of legacy notice and refactor * Fix weird extra end issue prob from merge conflicts * Test for with new flash key * Fix user_views_org tests for multi-org * Test for new flash message * Update snapshot with new a11y html * Move styling to stylesheet * Add site admins functionality * Move org_member? method in user model and refactor * Use unspent_credits_count for organizations * Add tests for /listings/new and minor bug fixes * Use .present? in case of empty array * Fix a lingering deprecated method * Use greater than 1 for random numbers * Add tests for counting spent and unspent credits
91 lines
4.2 KiB
Text
91 lines
4.2 KiB
Text
<div class="single-article <%= "single-article-unpublished" unless article.published %> <%= "single-article-archived hidden" if article.archived %>">
|
|
<div class="dashboard-collection-org-details">
|
|
<% if article.organization_id %>
|
|
<span class="dashboard-top-pill"><%= article.organization&.name %></span>
|
|
<% end %>
|
|
<% if article.collection_id %>
|
|
<span class="dashboard-top-pill"><strong>Series:</strong> <%= article.series %></span>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="ellipsis-menu">
|
|
<button class="ellipsis-menu-btn"><img src="<%= asset_path("three-dots.svg") %>" class="dropdown-icon" alt="dropdown menu icon"></button>
|
|
<ul class="ellipsis-menu hidden">
|
|
<li class="ellipsis-menu-item">
|
|
<%= form_for(article, url: "/article_mutes/#{article.id}", method: :patch, authenticity_token: true, html: { "data-type": "json" }) do |f| %>
|
|
<%= f.hidden_field :receive_notifications, value: !article.receive_notifications %>
|
|
<%= f.submit article.receive_notifications ? "Mute Notifications" : "Receive Notifications" %>
|
|
<% end %>
|
|
</li>
|
|
<hr />
|
|
<li class="ellipsis-menu-item">
|
|
<%= form_for(article, method: :patch, remote: true, authenticity_token: true, html: { "data-type": "json" }) do |f| %>
|
|
<%= f.hidden_field :archived, value: !article.archived %>
|
|
<%= f.submit article.archived ? "Unarchive Post" : "Archive Post" %>
|
|
<% end %>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<a href="<%= article.current_state_path %>"><h2><%= "[Archived] " if article.archived %><%= article.title %></h2></a>
|
|
<div class="dashboard-meta-details">
|
|
<% if article.published %>
|
|
<%= article.readable_publish_date %>
|
|
<% article.cached_tag_list_array.each do |tag| %>
|
|
<a href="/t/<%= tag %>"><span class="tag">#<%= tag %></span></a>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
<div class="dashboard-actions">
|
|
<% if !article.published %>
|
|
<a href="<%= article.current_state_path %>" class="pill cta yellow">DRAFT</a>
|
|
<% end %>
|
|
<a href="<%= article.path %>/edit" class="pill cta green">EDIT</a>
|
|
<% if manage_view %>
|
|
<%= form_for(article, url: "/article_mutes/#{article.id}", method: "patch", html: { class: "mute-form" }) do |f| %>
|
|
<%= f.hidden_field :receive_notifications, value: !article.receive_notifications %>
|
|
<%= f.submit article.receive_notifications ? "MUTE NOTIFICATIONS" : "NOTIFICATIONS MUTED", class: "cta pill #{article.receive_notifications ? 'mute' : 'unmute'}" %>
|
|
<% end %>
|
|
<a href="<%= article.path %>/delete_confirm" data-no-instant class="cta pill black">DELETE</a>
|
|
<% elsif article.published %>
|
|
<a href="<%= article.path %>/manage" class="cta pill black">MANAGE</a>
|
|
<% else %>
|
|
<a href="<%= article.path %>/delete_confirm" data-no-instant class="cta pill black">DELETE</a>
|
|
<% end %>
|
|
<% if article.published %>
|
|
<span id="pageviews-<%= article.id %>" class="cta pill dashboard-pageviews-indicator" data-analytics-pageviews data-article-id="<%= article.id %>">
|
|
<span class="page-views-count">
|
|
<span class="value">
|
|
<% if article.page_views_count > 100 %>
|
|
<span class="value"><%= article.page_views_count %></span>
|
|
<% else %>
|
|
under 100
|
|
<% end %>
|
|
</span>
|
|
views
|
|
</span>
|
|
//
|
|
<span class="reactions-count">
|
|
<span class="value">
|
|
<%= article.positive_reactions_count %>
|
|
</span>
|
|
<%= "reaction".pluralize(count: article.positive_reactions_count) %>
|
|
</span>
|
|
//
|
|
<span class="comments-count">
|
|
<span class="value">
|
|
<%= article.comments_count %>
|
|
</span>
|
|
<%= "comment".pluralize(count: article.comments_count) %>
|
|
</span>
|
|
</span>
|
|
<% end %>
|
|
</div>
|
|
<% if organization && org_admin %>
|
|
<%= form_for(article) do |f| %>
|
|
<input type="hidden" name="destination" value="/dashboard/organization/<%= organization.id %>" />
|
|
AUTHOR: <%= f.select(:user_id, options_for_select(organization.users.pluck(:name, :id), article.user_id)) %>
|
|
<%= f.submit "SUBMIT AUTHOR CHANGE", class: "cta pill black" %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|