Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/assets/stylesheets/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ body {
}

.info-rows > * {
margin: 0.25em;
margin: 0.25em 0 0 0.5em;
}

.flex {
Expand All @@ -189,7 +189,7 @@ body {
h4 {
margin: 0 0 0.25em 0;
color: var(--color-brown-700);
font-size: var(--font-size-m);
font-size: var(--font-size-xl);
font-weight: 600;
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/helper/projects/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
<div class="pagination"><%== @pagy.series_nav %></div>
<% end %>

<%= link_to "← Back", helper_root_path, class: "btn-secondary" %>
<%= link_to "← Back", helper_root_path, class: "btn-secondary", style: "margin-top: 1rem;" %>
30 changes: 22 additions & 8 deletions app/views/helper/projects/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@
<div class="info-rows">
<div><b>Title:</b> <%= @project.title %></div>
<div><b>Description:</b> <%= @project.description.presence || "None" %></div>
<div><b>Has Banner:</b> <%= @project.banner.present? ? "Yes" : "No" %></div>
<div><b>Ship Status:</b> <%= @project.ship_status.titleize %></div>
<div><b>Devlog Count:</b> <%= @project.devlogs.count %></div>
<div><b>Time Spent: </b> <%= distance_of_time_in_words(@project.duration_seconds) %></div>
<div><b>Type:</b> <%= @project.project_type.presence || "Not set" %></div>
<div><b>Created:</b> <%= @project.created_at.strftime("%Y-%m-%d") %></div>
<div><b>Status:</b> <%= @project.deleted? ? "Deleted" : "Active" %></div>
<% if @project.repo_url.present? %>
<div><b>Repo:</b> <%= safe(@project.repo_url, "Repo") %></div>
<% end %>
<% if @project.demo_url.present? %>
<div><b>Demo:</b> <%= safe(@project.demo_url, "Demo") %></div>
<% end %>
<div><b>Deleted:</b> <%= @project.deleted? ? "Yes" : "No" %></div>
</div>
</div>

Expand All @@ -39,12 +36,29 @@
</div>
</div>

<div style="margin-top: 1rem; display: flex; gap: 0.5rem;">
<div style="display: flex; gap: 0.5rem;">
<%= link_to "← Back", helper_projects_path, class: "btn-secondary no-margin" %>
<% if @project.deleted? %>
<%= button_to "Restore Project", restore_helper_project_path(@project),
method: :post,
class: "btn-primary",
form: { onsubmit: "return confirm('Are you sure you want to restore this project?')" } %>
<% else %>
<%= button_to "View Project", project_path(@project),
method: :get,
class: "btn-primary",
form: { target: "_blank", rel: "noopener" } %>
<% end %>

<% if @project.repo_url.present? %>
<%= link_to "View Repo", @project.repo_url, class: "btn-primary", target: "_blank", rel: "noopener" %>
<% end %>

<% if @project.demo_url.present? %>
<%= link_to "View Demo", @project.demo_url, class: "btn-primary", target: "_blank", rel: "noopener" %>
<% end %>

<% if @project.readme_url.present? %>
<%= link_to "View Readme", @project.readme_url, class: "btn-primary", target: "_blank", rel: "noopener" %>
<% end %>
</div>
27 changes: 14 additions & 13 deletions app/views/helper/shop_orders/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,20 @@
<div class="pagination"><%== @pagy.series_nav %></div>
<% end %>

<%= link_to "← Back", helper_root_path, class: "btn-secondary" %>
<%= link_to "← Back", helper_root_path, class: "btn-secondary", style: "margin-top: 1rem;" %>

<style>
.badge {
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.875rem;
font-weight: 500;
display: inline-block;
}
.badge-pending { background-color: #fbbf24; color: #78350f; }
.badge-awaiting_periodical_fulfillment { background-color: #60a5fa; color: #1e3a8a; }
.badge-fulfilled { background-color: #10b981; color: white; }
.badge-rejected { background-color: #ef4444; color: white; }
.badge-on_hold { background-color: #6b7280; color: white; }
.badge {
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.875rem;
font-weight: 500;
display: inline-block;
}

.badge-pending { background-color: #fbbf24; color: #78350f; }
.badge-awaiting_periodical_fulfillment { background-color: #60a5fa; color: #1e3a8a; }
.badge-fulfilled { background-color: #10b981; color: white; }
.badge-rejected { background-color: #ef4444; color: white; }
.badge-on_hold { background-color: #6b7280; color: white; }
</style>
2 changes: 1 addition & 1 deletion app/views/helper/shop_orders/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>
</div>

<%= link_to "← Back", helper_shop_orders_path, class: "btn-secondary", style: "margin-top: 1rem;" %>
<%= link_to "← Back", helper_shop_orders_path, class: "btn-secondary" %>

<style>
.badge {
Expand Down
2 changes: 1 addition & 1 deletion app/views/helper/users/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
<div class="pagination"><%== @pagy.series_nav %></div>
<% end %>

<%= link_to "← Back", helper_root_path, class: "btn-secondary" %>
<%= link_to "← Back", helper_root_path, class: "btn-secondary", style: "margin-top: 1rem;" %>
32 changes: 27 additions & 5 deletions app/views/helper/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<% if @user.banned? %>
<div class="alert alert--danger" style="margin-bottom: 1rem;">
<strong>🚫 This user is banned</strong>
<% if @user.banned_reason.present? %>
<br>Reason: <%= @user.banned_reason %>
<% end %>
</div>
<% end %>

Expand All @@ -14,13 +11,31 @@
<h2>Basic Info</h2>
<div class="info-rows">
<div><b>Name:</b> <%= @user.display_name %></div>
<div><b>Slack ID:</b> <%= @user.slack_id || "N/A" %></div>
<div><b>Verification:</b> <%= @user.verification_status.titleize %></div>
<div><b>YSWS Eligible:</b> <%= @user.ysws_eligible? ? "Yes" : "No" %></div>
<div><b>Projects:</b> <%= @user.projects_count %></div>
<div><b>Vote Balance:</b> <%= @user.vote_balance %></div>
<div><b>Has Hackatime:</b> <%= @user.has_hackatime? ? "Yes" : "No" %></div>
<div><b>Joined:</b> <%= @user.created_at.strftime("%Y-%m-%d") %></div>
</div>
</div>

<div class="card">
<h2>Moderation</h2>
<div class="info-rows">
<div><b>⚠️ User Banned:</b> <%= @user.banned? ? "Yes" : "No" %></div>
<% if @user.banned? && @user.banned_reason.present? %>
<div><b>- Reason:</b> <%= @user.banned_reason %></div>
<div><b>- Since:</b> <%= @user.banned_at.strftime("%Y-%m-%d %H:%M") %></div>
<% end %>
<% if @user.shadow_banned? %>
<div><b>ℹ️ Visibility Restricted (do not tell user, contact an admin if needed)</b></div>
<div><b>- Reason:</b> <%= @user.shadow_banned_reason %></div>
<div><b>- Since:</b> <%= @user.shadow_banned_at.strftime("%Y-%m-%d %H:%M") %></div>
<% end %>
</div>
</div>

<div class="card">
<h2>Projects (<%= @user.projects.size %>)</h2>
<% if @user.projects.any? %>
Expand Down Expand Up @@ -76,4 +91,11 @@
</div>
</div>

<%= link_to "← Back", helper_users_path, class: "btn-secondary", style: "margin-top: 1rem;" %>
<div style="display: flex; gap: 0.5rem;">
<%= link_to "← Back", helper_users_path, class: "btn-secondary" %>

<%= button_to "View Profile", user_path(@user),
method: :get,
class: "btn-primary",
form: { target: "_blank", rel: "noopener" } %>
</div>
Loading