|
Post by zikzak on May 12, 2019 12:03:31 GMT
That'd be awesome if you could find a good way to do that. I can probably manage to force things to display that way with an inelegant pile of spaghetti CSS, but doubt I have the skills to get under the hood and do it right.
|
|
|
Post by goofyballer on May 12, 2019 20:12:01 GMT
Early impressions of ember.js (or at least, how Discourse uses it): this thing sucks, everything is a reference to something else, I can't find code that actually implements any kind of real logic to save my fucking life
(I will persist!)
|
|
|
Post by goofyballer on May 12, 2019 21:33:26 GMT
Okay, I think I got it. idk if I'd want to submit this to our repo in this state, without making it more configurable, but in my test instance this got the "featured topic" sorting how you want.
In category-list.js.es6, find this code:
if (c.topics) { c.topics = c.topics.map(t => { const topic = Discourse.Topic.create(t); topic.set("category", c); return topic; }); } You want to change it to look like this (just the second to last line is different):
if (c.topics) { c.topics = c.topics.map(t => { const topic = Discourse.Topic.create(t); topic.set("category", c); return topic; }).sort((a, b) => b.get("bumpedAt") - a.get("bumpedAt")); }
|
|
|
Post by zikzak on May 12, 2019 22:33:06 GMT
You rock! I'll try this out later tonight.
|
|
|
Post by Marksman on May 12, 2019 23:17:30 GMT
I have a question about the uncategorized section. Is there a reason we need it? I have no idea and am genuinely asking. I know it is part of the config but wanted to know if there are uses for it I donβt see.
|
|
|
Post by goofyballer on May 12, 2019 23:25:06 GMT
In my screenshot? That's just the out-of-the-box setup, zz's server doesn't have it I think.
|
|
|
Post by zikzak on May 13, 2019 0:21:54 GMT
You have to have an Uncategorized section unless you toggle the switch which doesn't allow uncategorized topics, and then it goes away (it's still there, but hiding). This is what I did.
Then, because I like having a junk drawer category, I created a French BBV, but I hid that with CSS because nobody wants French BBV on the front page. You can get to it with the drop down categories menu.
|
|
|
Post by zikzak on May 13, 2019 1:03:33 GMT
Okay, I think I got it. idk if I'd want to submit this to our repo in this state, without making it more configurable, but in my test instance this got the "featured topic" sorting how you want. In category-list.js.es6, find this code: if (c.topics) { c.topics = c.topics.map(t => { const topic = Discourse.Topic.create(t); topic.set("category", c); return topic; }); } You want to change it to look like this (just the second to last line is different): if (c.topics) { c.topics = c.topics.map(t => { const topic = Discourse.Topic.create(t); topic.set("category", c); return topic; }).sort((a, b) => b.get("bumpedAt") - a.get("bumpedAt")); } no work for me
|
|
|
Post by zikzak on May 13, 2019 1:07:49 GMT
Oh wait, it did! Great success!
|
|
|
Post by zikzak on May 13, 2019 1:09:34 GMT
Wait, no. I'm so confused.
|
|
|
Post by zikzak on May 13, 2019 1:19:19 GMT
So... I think it works, but it takes a few minutes?
|
|
|
Post by zikzak on May 13, 2019 1:20:51 GMT
Ya'll are watching GoT aren't you, and I'm just in here talking to myself.
|
|
|
Post by goofyballer on May 13, 2019 1:29:39 GMT
I am watching NBA! Yeah, looks like it's working. It seems like in the case of the "Test blog" thread (which appears to violate the sorting rule in the main page list), it counts the most recent edit time as a "bump". Seems mostly good.
|
|
|
Post by zikzak on May 13, 2019 1:41:13 GMT
A bunch of things got bumped earlier today when I reorganized the categories, in ways I don't pretend to understand.
|
|
|
Post by Loden Pants on May 15, 2019 12:44:51 GMT
I pulled the latest master branch from our upstream, and rebased our master. Also created a branch `unstuck-dev` from the stable branch. I figure that's a good place for us to work.
|
|