First, a little context…

Channels are public forums that live on Disqus Home. They’re pretty great because they take an age-old internet concpet, forums, and simplify the heck out of ‘em, making them accessible and friendly to all. To name a few of my favorites:

Discuss Disqus is a meta channel where people can talk about Disqus, report bugs, ask questions, get developer help, or convey their love/hate for various features. It’s run by a stellar crew of community moderators and Disqus staff and has become an important part of the Disqus’ development since it’s channel birthday on August 29, 2014.

Recent Discussions Component

Recent discussions compent displaying table with several discussions

I wanted a way to highlight the most recent discussions happening in Discuss Disqus directly on help.disqus.com inside a table and play with Bootstrap, jQuery, moment.js.

Why?

  • pull people into the community with a call-to-action
  • show the high level of activity in the community
  • show that there are real humans ready to help and discuss!

I looked at other companies’ help pages and found a great one by Olark, so I did my best to copy the design (:raised_hands:).

It is a table with the .table-striped class. The table has 4 columns for inserting the discussion title, author, number of comments, and date. The code to populate this table does this:

drawTable() takes all the data from the ajax() call to Disqus’ /timelines/activities/ endpoint (currently a private) and plops different strings into variables that correspond with the columns we want to populate. truncateString() shortens those strings so they fit nicely into the table data cells every time. moment() turns the unix timestamp into a pretty relative time that’s more appropriate for saying “yo, look at all this recent activity”.

This was a good mini-project to learn a bit about ajax and using libraries like moment.js.

Check it out at help.disqus.com.