Hi all,
The team I'm working with is using the topic previews plugin, and we want to make the plugin text the same as the title's visited style if the topic has been visited. I quickly found out that that plugin caches all the topic previews, so putting the visited class directly on the preview is out of the question.
The general structure I see is
<div class="topic-details">
<div class="topic-title"><a class="title visited">LINK</a></div></div>
<div class="topic-excerpt" style="max-height: 80px;">EXCERPT</div>
</div>
So I want to put the visited class on the topic-details instead of the topic-title. Then I can use css on a parent .topic-details.visible to hit the .topic-except.
<div class="topic-details visited">
<div class="topic-title"><a class="title visited">LINK</a></div></div>
<div class="topic-excerpt" style="max-height: 80px;">EXCERPT</div>
</div>
When I tried to do this, I traced the code to discourse/routes/build-topic-route this.render('discovery/topics', { controller: 'discovery/topics', outlet: 'list-container' });
and then tojsapp/templates/discovery/topics.hbs
which has{{topic-list ... }}
.
Past that, I'm totally stuck figuring out where topic-list is rendered from. Can anyone help? And does this seem like a logical and useful addition? I think other plugins that add content in the topic list would also benefit.
On another note (and maybe this needs its own thread), coming from rails, I feel totally overwhelmed in trying to figure out which file defines which method/helper/controller/template. Add to that the fact that you can't step through templates in javascript like you can in rails, and it's really hard to track down where exactly things I see on the page are coming from. I've also tried the ember chrome plugin, but their view explorer stops drilling down far too early to be useful. The ember js tutorials/explanations are helpful but discourse truly seems order of magnitude more complex. Any suggestions on how to approach this would be very welcome. Thanks!