diff --git a/README.md b/README.md
index 3d33814..a83dc62 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Hackatime!
+# Hackatime
[](https://status.hackatime.hackclub.com/status/hackatime)
[](https://status.hackatime.hackclub.com/status/hackatime)
@@ -48,9 +48,9 @@ app# bin/rails c # start an interactive irb!
app# bin/rails db:migrate # migrate the database
```
-You can now access the app at http://localhost:3000/
+You can now access the app at
-Use email authentication from the homepage with `test@example.com` or create a new user (you can view outgoing emails at http://localhost:3000/letter_opener)!
+Use email authentication from the homepage with `test@example.com` or create a new user (you can view outgoing emails at [http://localhost:3000/letter_opener](http://localhost:3000/letter_opener))!
Ever need to setup a new database?
diff --git a/app/assets/stylesheets/admin_timeline.css b/app/assets/stylesheets/admin_timeline.css
deleted file mode 100644
index 1d5ddf0..0000000
--- a/app/assets/stylesheets/admin_timeline.css
+++ /dev/null
@@ -1,248 +0,0 @@
-.admin-timeline-view-wrapper {
- overflow-x: auto; /* Enables horizontal scrolling */
- width: 100%; /* Takes full width of its parent in the main layout */
- -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
- flex-grow: 1; /* Allow it to take available vertical space in flex layouts */
- display: flex; /* Needed for flex-grow to work properly with its child */
- flex-direction: column;
-}
-
-.admin-timeline-content-sizer {
- /* min-width is set inline dynamically via ERB based on number of users and min_column_width_px */
- display: block; /* Or inline-block; block should be fine to ensure it respects min-width */
- /* This element will be wider than its parent if content requires it, triggering scroll on admin-timeline-view-wrapper */
-}
-
-.admin-timeline-sticky-header {
- /* Changed structure to use simple absolute positioning, no more flex layout */
- position: sticky; /* Sticky to the top of admin-timeline-view-wrapper */
- top: 0;
- z-index: 20; /* Above other content */
- background-color: #1F2937; /* Match page background to avoid transparency issues */
- padding-bottom: 0.5rem;
- padding-top: 0.25rem;
- box-sizing: border-box;
- /* No padding left/right as we use absolute positioning for the headers */
-}
-
-/* Removed header spacer and container styles as they're no longer used */
-
-.admin-timeline-user-header-cell {
- position: absolute; /* Positioned absolutely within the sticky header container */
- /* left is set inline per instance - using the EXACT same calculation as activity spans */
- top: 0; /* All headers start at the top of the container */
- min-width: 186px; /* Minimum width for each header cell */
- width: 186px; /* Fixed width set inline to match span columns exactly */
- box-sizing: border-box; /* Include padding and border in width/height */
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- text-align: center;
- font-weight: 500;
- color: #E5E7EB;
- font-size: 0.875rem;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- padding: 0.1rem 0.25rem; /* Padding for content */
-}
-
-#timeline-grid-scroll-container { /* Original ID, holds hour rows and activity spans */
- overflow-y: auto; /* Retains vertical scroll for hours */
- position: relative; /* For absolute positioning of spans and current time line */
- flex-grow: 1; /* Takes remaining vertical space within admin-timeline-content-sizer */
- /* Width is implicitly 100% of admin-timeline-content-sizer, which can be very wide */
-}
-
-/* Span items representing user activity */
-.admin-timeline-span-item {
- position: absolute;
- /* background-color is set by --span-color CSS variable, applied inline */
- color: #FFFFFF;
- border-radius: 0.25rem;
- font-size: 0.75rem;
- line-height: 1.1;
- padding: 2px 4px;
- box-shadow: 0 1px 3px rgba(0,0,0,0.2);
- z-index: 10; /* Above grid lines */
- overflow: hidden; /* Clip content that overflows */
- box-sizing: border-box;
- min-width: 186px; /* Minimum width for each span "column" */
- width: 186px; /* Fixed width set inline to match exactly with headers */
-}
-
-.admin-timeline-span-item a { /* Ensure links inside spans are visible and styled */
- color: inherit; /* Inherit color from parent span */
- text-decoration: underline;
-}
-.admin-timeline-span-item a:hover {
- color: #FACC15; /* Example: yellow hover for links */
-}
-
-/* Styling for the hour rows that form the timeline background grid */
-.admin-timeline-hour-row {
- display: flex; /* To layout hour label container and gridline container */
- align-items: center;
- border-top: 1px solid #374151; /* Horizontal line for the hour */
- position: relative; /* For the absolutely positioned detailed grid line */
- box-sizing: border-box;
- /* height for each hour row is set inline via ERB (pixels_per_hour) */
-}
-
-.admin-timeline-hour-label-container { /* Container for the hour text, e.g., "9:00 AM" */
- /* width for this container is set inline via ERB (line_left_rem) */
- flex-shrink: 0; /* Prevent shrinking */
- font-size: 0.75rem;
- line-height: 1rem;
- color: #6B7280;
- padding-right: 0.5rem;
- text-align: right;
- box-sizing: border-box;
- height: 100%; /* Match parent row height */
- display: flex; /* To vertically center text if needed, though align-items on parent might suffice */
- align-items: flex-start; /* Vertically center text */
-}
-
-.admin-timeline-hour-gridline-container { /* Container that stretches across for the faint mid-hour line */
- flex-grow: 1; /* Take remaining width */
- height: 100%; /* Fill the row height */
- position: relative; /* For the absolutely positioned line itself */
-}
-
-.admin-timeline-hour-gridline { /* The faint horizontal line in the middle of an hour block */
- position: absolute;
- /* left: 0; right: (calculated from line_right_rem) are applied inline */
- top: 50%;
- border-bottom: 1px solid #374151; /* Color of the grid line */
- transform: translateY(-50%);
- z-index: 1; /* Behind activity spans */
-}
-
-/* Current time indicator line */
-.admin-timeline-now-marker {
- position: absolute;
- /* left, right, top positions are set inline via ERB */
- height: 2px;
- background-color: #F87171; /* Prominent color for "now" line */
- z-index: 15; /* Above grid lines, potentially above spans if desired (adjust z-index accordingly) */
-}
-.admin-timeline-now-marker-text { /* For the "NOW" text label */
- position: absolute;
- left: -2.5rem; /* Adjust to position text to the left of the line_left_rem area */
- top: -0.4rem; /* Adjust to vertically center with the line */
- font-size: 0.65rem;
- color: #F87171; /* Match line color */
- background-color: #1F2937; /* Match page background to make it appear to "cut through" */
- padding: 0 0.2rem;
- white-space: nowrap;
-}
-
-.user-trust-red {
- background-color: rgba(239, 68, 68, 0.15) !important;
- border-left: 3px solid rgb(239, 68, 68) !important;
-}
-
-.user-trust-green {
- background-color: rgba(16, 185, 129, 0.15) !important;
- border-left: 3px solid rgb(16, 185, 129) !important;
-}
-
-.user-trust-yellow {
- background-color: rgba(245, 158, 11, 0.15) !important;
- border-left: 3px solid rgb(245, 158, 11) !important;
-}
-
-.user-trust-blue {
- background-color: rgba(59, 130, 246, 0.1) !important;
- border-left: 3px solid rgb(59, 130, 246) !important;
-}
-
-.user-trust-indicator {
- display: inline-block;
- margin-left: 4px;
- font-size: 0.875rem;
-}
-
-.conviction-hammer {
- cursor: pointer;
- margin-left: 6px;
- padding: 2px 4px;
- border-radius: 4px;
- transition: background-color 0.2s;
-}
-
-.conviction-hammer:hover {
- background-color: rgba(255, 255, 255, 0.1);
-}
-
-.cm {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.5);
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 1000;
-}
-
-.cm-content {
- background-color: #1F2937;
- border-radius: 8px;
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
- width: 90%;
- max-width: 500px;
-}
-
-.cm-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 16px;
- border-bottom: 1px solid #374151;
-}
-
-.cm-header h3 {
- margin: 0;
- color: #F3F4F6;
- font-size: 1.25rem;
-}
-
-.cm-close {
- background: none;
- border: none;
- color: #9CA3AF;
- font-size: 1.5rem;
- cursor: pointer;
-}
-
-.cm-body {
- padding: 16px;
- color: #D1D5DB;
-}
-
-.cos {
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- gap: 12px;
- margin-top: 16px;
-}
-
-.co {
- background-color: #2D3748;
- border: 1px solid #4B5563;
- border-radius: 6px;
- padding: 12px;
- color: #E5E7EB;
- font-size: 0.875rem;
- cursor: pointer;
- transition: background-color 0.2s;
- text-align: center;
-}
-
-.co:hover {
- background-color: #374151;
-}
\ No newline at end of file
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index 06871fa..7471403 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -10,7 +10,6 @@
*/
@import "https://uchu.style/color.css";
-@import "https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css";
@import "settings.css";
/* Force dark mode for all elements */
diff --git a/app/assets/stylesheets/settings.css b/app/assets/stylesheets/settings.css
deleted file mode 100644
index 387971a..0000000
--- a/app/assets/stylesheets/settings.css
+++ /dev/null
@@ -1,160 +0,0 @@
-.settings-page .grid {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
- gap: 1rem;
- margin-top: 2rem;
-}
-
-.settings-page article {
- background: var(--pico-card-background-color);
- border: var(--pico-border-width) solid var(--pico-card-border-color);
- border-radius: var(--pico-border-radius);
- box-shadow: var(--pico-card-box-shadow);
- transition: box-shadow var(--pico-transition);
- margin: 0;
-}
-
-.settings-page article header {
- padding: 0.5rem;
- border-bottom: 1px solid var(--pico-muted-border-color);
-}
-
-.settings-page article header h2 {
- margin-bottom: 0;
- font-size: 1.25rem;
- font-weight: 600;
- color: var(--pico-color);
-}
-
-.settings-page article header p {
- margin-bottom: 0;
- color: var(--pico-muted-color);
- font-size: 0.875rem;
-}
-
-.settings-page article section {
- margin-top: 1.5rem;
- padding-top: 1rem;
- border-top: 1px solid var(--pico-muted-border-color);
-}
-
-.settings-page article section:first-of-type {
- margin-top: 0;
- padding-top: 0;
- border-top: none;
-}
-
-.settings-page article section h3 {
- margin-bottom: 0.75rem;
- font-size: 1rem;
- font-weight: 500;
- color: var(--pico-color);
-}
-
-.settings-page article .form-group {
- margin-bottom: 1rem;
-}
-
-.settings-page article .form-group:last-child {
- margin-bottom: 0;
-}
-
-.settings-page article button[role="button"],
-.settings-page article input[type="submit"][role="button"] {
- margin-top: 1rem;
-}
-
-.settings-page article .secondary {
- background-color: var(--pico-secondary-background);
- border-color: var(--pico-secondary-border);
- color: var(--pico-secondary-color);
-}
-
-.settings-page article .secondary:hover {
- background-color: var(--pico-secondary-hover-background);
- border-color: var(--pico-secondary-hover-border);
-}
-
-.settings-page article .code-example {
- margin: 1rem 0;
- background: var(--pico-code-background-color);
- border-radius: var(--pico-border-radius);
-}
-
-.settings-page article .code-example pre {
- margin: 0;
- background: transparent;
- padding: 0;
-}
-
-.settings-page article img {
- max-width: 100%;
- height: auto;
- margin: 1rem 0;
- border-radius: var(--pico-border-radius);
-}
-
-.settings-page article pre:not(.code-example pre) {
- background: var(--pico-code-background-color);
- padding: 0.75rem;
- border-radius: var(--pico-border-radius);
- font-size: 0.875rem;
- overflow-x: auto;
-}
-
-.settings-page .mirror {
- padding: 1rem;
- background: var(--pico-card-sectioning-background-color);
- border-radius: var(--pico-border-radius);
- margin-bottom: 1rem;
-}
-
-.settings-page .mirror:last-child {
- margin-bottom: 0;
-}
-
-.settings-page .email-form {
- margin-top: 1rem;
- padding-top: 1rem;
- border-top: 1px solid var(--pico-muted-border-color);
-}
-
-.settings-page .email-form .field {
- display: flex;
- gap: 0.5rem;
- align-items: end;
-}
-
-.settings-page .email-form input[type="email"] {
- flex: 1;
- margin-bottom: 0;
-}
-
-@media (max-width: 768px) {
- .settings-page .grid {
- grid-template-columns: 1fr;
- gap: 1.5rem;
- }
-
- .settings-page article {
- padding: 1rem;
- }
-
- .settings-page .email-form .field {
- flex-direction: column;
- align-items: stretch;
- }
-}
-
-/* Dark mode styles (now default) */
-.settings-page article {
- background: var(--pico-card-background-color, #1e293b);
- border-color: var(--pico-card-border-color, #334155);
-}
-
-.settings-page article:hover {
- box-shadow: var(
- --pico-card-box-shadow-hover,
- 0 0.125rem 1rem rgba(0, 0, 0, 0.3)
- );
-}
diff --git a/app/assets/tailwind/application.css b/app/assets/tailwind/application.css
index 471a079..e298fad 100644
--- a/app/assets/tailwind/application.css
+++ b/app/assets/tailwind/application.css
@@ -52,6 +52,9 @@
.bg-dark {
background-color: var(--color-dark);
}
+ .bg-darkless {
+ background-color: var(--color-darkless);
+ }
.bg-sheet {
background-color: var(--color-sheet);
}
diff --git a/app/javascript/controllers/trust_level_controller.js b/app/javascript/controllers/trust_level_controller.js
index 91615c2..5231fa6 100644
--- a/app/javascript/controllers/trust_level_controller.js
+++ b/app/javascript/controllers/trust_level_controller.js
@@ -28,8 +28,7 @@ export default class extends Controller {
method: "PATCH",
headers: {
"Content-Type": "application/json",
- "X-CSRF-Token": document.querySelector('meta[name="csrf-token"]')
- .content,
+ "X-CSRF-Token": document.querySelector('meta[name="csrf-token"]').content,
},
body: JSON.stringify({ trust_level: trustLevel }),
});
@@ -40,10 +39,7 @@ export default class extends Controller {
);
}
- // Update the current trust level in the dataset
event.target.dataset.currentTrustLevel = trustLevel;
-
- // Update the leaderboard entry's omitted class
const leaderboardEntry = event.target.closest(".leaderboard-entry");
if (leaderboardEntry) {
if (trustLevel === "red") {
diff --git a/app/views/admin/timeline/show.html.erb b/app/views/admin/timeline/show.html.erb
index 32b16e4..8de83ae 100644
--- a/app/views/admin/timeline/show.html.erb
+++ b/app/views/admin/timeline/show.html.erb
@@ -13,35 +13,10 @@
num_users = users_data_array.count
num_users = 1 if num_users == 0 # Ensure num_users is at least 1 for calculations
- # Fixed REM values for layout (assuming 1rem = 16px for px calculations)
- line_left_rem = 4.0
- line_right_rem = 0.5
- activity_col_area_start_rem = line_left_rem # Header spacer aligns with hour labels
- activity_col_area_end_rem = line_right_rem # Header spacer aligns with right padding of grid
-
- gutter_rem = 0.25
pixels_per_hour = 128 # Controls vertical scale
pixels_per_minute = pixels_per_hour / 60.0
-
min_column_width_px = 186 # Minimum width for each user column
- gutter_px = gutter_rem * 16 # Gutter in pixels
-
- # Calculate the total minimum width required for all user columns + gutters + fixed label/padding areas
- # This width will be applied to the admin-timeline-content-sizer div
- user_columns_total_min_width_px = (num_users * min_column_width_px)
- gutters_total_width_px = (num_users > 1 ? (num_users - 1) * gutter_px : 0)
-
- # Total min width for the content that scrolls (headers part)
- min_header_content_width_px = user_columns_total_min_width_px + gutters_total_width_px
-
- # Total min width for the grid content part (timeline-grid-scroll-container's content)
- # This area includes the hour labels on the left, then the user activity columns, then right padding
- min_grid_content_width_px = (line_left_rem * 16) + min_header_content_width_px + (line_right_rem * 16)
-
- # The sizer div needs to be at least as wide as the widest of its direct children (header row or grid row)
- # The header row's actual content part (user headers) spans min_header_content_width_px.
- # Add fixed spacers for the header:
- total_min_scroll_width_px = (activity_col_area_start_rem * 16) + min_header_content_width_px + (activity_col_area_end_rem * 16)
+ gutter_px = 4
# Current admin user and selected users for Stimulus
current_admin_user = {
@@ -55,189 +30,179 @@
current_date_for_form = @date.to_s
%>
-