Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ What changed for forums running Jtech Tools. Newest first.

**New**

- JTech theme: logos on @handles. A mention of @claude, @chatgpt, @microsoft, @jtechforums, @groupme, @24six, @zing, @naki and the rest of the list (22 in all) is a chip with that brand's logo after the name, like a mention of an account, in posts and the composer's preview, whether or not the account exists. Setting: `handle_logos`.
- Dumbcourse: what staff can do on the full site. A topic's Options has everything in Discourse's topic admin menu (pin in its category or globally until a date, banner, private message or public topic, topic timers, change timestamp, reset bump date, topic slow mode, delete permanently, alongside close, archive, unlist and delete), changing the category and tags, publishing a shared draft, nested or flat replies, and Moderator tools' footer message, reply approval, staff note and reply checklist. Select posts moves them to a new or existing topic or message, merges, changes owner or deletes. A post's actions have Discourse's post admin menu (staff colour, notice, unhide, change owner, grant badge, lock, wiki, rebuild HTML, delete permanently, publish as a page, pin in nested replies), whispers (staff only, or to a member, group or badge's holders), pin to the bottom, and its edit history for anyone, with revert and hiding an edit for staff. A Moderate button on a member's profile has the admin user page's actions: suspend, silence, slow mode, warning, trust level, roles, title, username, email, approval, activation, staff notes, badges, groups and primary group, IP lookup and deleting the other accounts on it, logs, penalty history, bounce score, sign-in accounts, impersonation, merge, anonymize and delete. The review queue gets every filter the full site has, claiming, flag details, reviewer notes, history, DSA classification, editing a queued post, the post's fate with a suspension, and flag reason priorities for admins, and shows each item's actions again. Each shows where Discourse shows it, with times picked from a short list or typed as a date.
- Moderator tools: slow mode for one user. From a user's admin page, staff can let them post one reply or new topic every so often (1 minute to a week apart), for a day, a week, a month, until a date or until lifted, with a reason. The user gets a message saying so, and their composer says how often they can post and how long until the next one; a post that's too soon is turned away with how long to wait, on the full site and in Dumbcourse. Personal messages and edits aren't limited, and a post waiting for approval holds them until it's reviewed. Staff can't be put in slow mode. Settings: `mod_user_slow_mode_enabled`, `mod_user_slow_mode_moderators`.
- Mod elections: the results post shows the whole count, so anyone can see it was honest: everyone's first-choice votes and share as a bar chart, what each stage did, where everyone finished, how ties were settled, and every stage in numbers. Never who ranked whom. Elections already published get it too: their results post is updated in place without bumping the topic, or added if there's none.
Expand Down
1 change: 1 addition & 0 deletions docs/development/jtech-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ Paths are inside `themes/jtech/`; the TypeScript is under `javascripts/discourse
| `stylesheets/jt-gate.scss` (right-to-left) | the browse arrow's hover nudge is a `translate` (core mirrors the arrow with a transform in right-to-left), with an `html.rtl` override since the right-to-left stylesheet doesn't flip `translate` |
| `stylesheets/jt-tabs.scss` | the selected tab everywhere core's nav style is used: core's underline at 1px (`--d-nav-underline-height` in jt-tokens) with a glow, and a faint radial light behind the label, both mixed from the text colour; jtech-tools' REQ-PM tabs (`.reqpm-tabs`) take the same nav colours, weight and line, and their strip scrolls without a scrollbar, fading at whichever edge is cut off (jt-topic-list's `jt-tabs-fade` scroll-driven animation, its duration held at `auto` against blanket `animation-duration: 0s !important` rules such as the test suite's); a tab's focus ring is drawn inside it, since the scrolling strip clips. The strips' fades (this and the list's tabs) take their direction from `--jt-tabs-fade-to`, `to left` under `html.rtl`: core's right-to-left stylesheet doesn't turn gradients round |
| `stylesheets/jt-topic-list.scss` + `api-initializers/jt-compact-nav.ts` | desktop list controls: the tabs are one dropdown (core's `navigation-bar-dropdown-mode`, as Discourse's Compact Nav component sets), sharing a line with New Topic; when the row doesn't fit the filters move up a line; New Topic icon-only below 66rem |
| `lib/jt-handle-logos.ts` + `api-initializers/jt-handle-logos.ts` + `stylesheets/jt-handles.scss` + `assets/handles/` | a logo after mentions of the listed handles (setting `handle_logos`, `decorateCookedElement`): core's `a.mention` (an account; the name from its `/u/` path, as core can put a status emoji in its text) and `span.mention` (no account) get a `.jt-handle-logo` with `data-jt-handle` after the name, where core puts a status emoji, and the span gets core's `a.mention` chip; the stylesheet gives each its asset (`$handle-<name>`, registered in `about.json`). Each logo is a 24 by 24 SVG: the brand's colour and mark (Simple Icons, LobeHub's icons for ChatGPT, the brands' own icons for JTech, GroupMe, 24six, Zing and Naki), drawn round. A new handle goes in all four |
| `api-initializers/jt-external-links.ts` | ↗ on outbound links in posts (`decorateCookedElement`) |
| `stylesheets/jt-topic-list.scss` (tabs) | every `.nav-pills` tab, link or button (the search page's Posts / Categories & tags / Users are buttons), at weight 500 with its focus ring drawn inside, since tab rows scroll and clip |
| `stylesheets/jt-leaderboard.scss`, `jt-components.scss` | restyles for gamification, Gated Topics, Category Boxes, admin |
Expand Down
1 change: 1 addition & 0 deletions docs/features/jtech-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ What it adds on top of a restyle:
- The **tags page** as chips with their counts, instead of columns of "name x 190".
- **Reactions in a row** (with the Reactions plugin, setting `reaction_rollout`): the heart likes a post when clicked, and pointing at it rolls the reactions out sideways in the post's menu, pushing what's beside it along, instead of a box over the post. It slides open to as many whole reactions as there's room for, and slides shut again when the pointer leaves. A row that doesn't fit scrolls (the mouse wheel glides along it, and while pointing at the row never scrolls the page, even at its ends) and fades at an edge with more to scroll to. On phones a button beside the heart opens it with a tap; while it's open the menu's other buttons but Reply step aside. Under a Discourse palette the plugin's own picker shows, as in stock Discourse.
- **A post's buttons on one line on phones**: what doesn't fit beside the reactions goes into ⋯, which opens a list of them, named, from the bottom of the screen.
- **Logos on @handles** (setting `handle_logos`): a mention of @claude, @chatgpt, @anthropic, @microsoft, @apple, @meta, @samsung, @nvidia, @intel, @tesla, @spacex, @jtechforums, @groupme, @github, @discourse, @linux, @android, @24six, @zing, @naki, @cloudflare, @python is a chip with that brand's logo after the name, in posts and the preview, like a mention of an account. The account doesn't have to exist; make one with that username if the mention should link somewhere.
- An overlay page scrollbar, a back-to-top button, reading progress, language labels on code blocks, category icons on the categories page.

Each of those has its own switch in the theme's settings.
Expand Down
22 changes: 22 additions & 0 deletions spec/system/jtech_theme_part3_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,28 @@ def header_glyphs(skip: ".current-user")
expect(page).to have_no_css(".post-action-menu__jt-print")
end

it "puts a brand's logo before a mention of its handle" do
Fabricate(:user, username: "claude")
post =
Fabricate(:post, topic: topic, user: member, raw: "Asked @claude, @groupme and @somebody.")
visit("#{topic.relative_url}/#{post.post_number}")
at = "#post_#{post.post_number} .cooked"
expect(page).to have_css("#{at} a.mention.jt-handle .jt-handle-logo[data-jt-handle='claude']")
expect(page).to have_css(
"#{at} span.mention.jt-handle .jt-handle-logo[data-jt-handle='groupme']",
)
expect(page).to have_css("#{at} .mention:not(.jt-handle)", text: "@somebody")
image = page.evaluate_script(<<~JS)
getComputedStyle(document.querySelector("#{at} .jt-handle-logo")).backgroundImage
JS
expect(image).to start_with("url(")
chip = page.evaluate_script(<<~JS)
getComputedStyle(document.querySelector("#{at} span.mention.jt-handle")).display
JS
expect(chip).to eq("inline-block")
expect_no_theme_errors
end

it "shows the listed badges after a poster's name" do
badge = Fabricate(:badge, name: "Phone Distributor", icon: "certificate")
BadgeGranter.grant(badge, member)
Expand Down
24 changes: 23 additions & 1 deletion themes/jtech/about.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,29 @@
"assets": {
"geist": "assets/Geist-Variable.woff2",
"geist-mono": "assets/GeistMono-Variable.woff2",
"icons-sprite": "assets/icons-sprite.svg"
"icons-sprite": "assets/icons-sprite.svg",
"handle-claude": "assets/handles/claude.svg",
"handle-chatgpt": "assets/handles/chatgpt.svg",
"handle-anthropic": "assets/handles/anthropic.svg",
"handle-microsoft": "assets/handles/microsoft.svg",
"handle-apple": "assets/handles/apple.svg",
"handle-meta": "assets/handles/meta.svg",
"handle-samsung": "assets/handles/samsung.svg",
"handle-nvidia": "assets/handles/nvidia.svg",
"handle-intel": "assets/handles/intel.svg",
"handle-tesla": "assets/handles/tesla.svg",
"handle-spacex": "assets/handles/spacex.svg",
"handle-jtechforums": "assets/handles/jtechforums.svg",
"handle-groupme": "assets/handles/groupme.svg",
"handle-github": "assets/handles/github.svg",
"handle-discourse": "assets/handles/discourse.svg",
"handle-linux": "assets/handles/linux.svg",
"handle-android": "assets/handles/android.svg",
"handle-24six": "assets/handles/24six.svg",
"handle-zing": "assets/handles/zing.svg",
"handle-naki": "assets/handles/naki.svg",
"handle-cloudflare": "assets/handles/cloudflare.svg",
"handle-python": "assets/handles/python.svg"
},
"color_schemes": {
"JTech Light": {
Expand Down
1 change: 1 addition & 0 deletions themes/jtech/assets/handles/24six.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions themes/jtech/assets/handles/android.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions themes/jtech/assets/handles/anthropic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions themes/jtech/assets/handles/apple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions themes/jtech/assets/handles/chatgpt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions themes/jtech/assets/handles/claude.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions themes/jtech/assets/handles/cloudflare.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading