Commit Graph

214 Commits

Author SHA1 Message Date
Nick Borromeo b51bebb200 Extract queries to keep logic in the Categories Model
This creates two methods in the Category model. This moves the model
logic to the model and just calls the Category class methods in
ListController.

This also adds tests for the two methods created in the Category
model. The motivation for this refactor is the code climate score of the
this class and readability of the code.

 Please enter the commit message for your changes. Lines starting
2014-02-08 14:10:48 -08:00
Régis Hanol 58202baa62 BUGFIX: show the draft on top page 2014-02-06 11:39:43 +01:00
Robin Ward aff16f372b FIX: Show a nicer error when a user tries to access a category they
can't see.
2014-02-05 15:33:52 -05:00
Régis Hanol d2974c2a15 BUGFIX: proper handling of top_menu_items 2014-02-03 16:08:00 +01:00
Vikhyat Korrapati daa14cda40 ignore exclude_category from the menu if we are trying to view the category. 2014-01-31 22:35:19 +05:30
Régis Hanol ae401f0dc7 BUGFIX: JSON requests don't exclude categories from filters 2014-01-31 14:36:00 +01:00
Régis Hanol 8d2e5041bc BUGFIX: proper handling of /none subcategory 2014-01-18 19:27:25 +01:00
Régis Hanol e31789327e fix the specs 2014-01-18 19:27:25 +01:00
Régis Hanol 129617b415 Lots of bugfixes
BUGFIX: navigation bar should always activate the right tab (even when diging into a top period)
BUGFIX: /top pages titles
BUGFIX: no "edit category" button on /top page after visiting a category
BUGFIX: properly hide category columns when there is no children category (on both filter + top pages)
BUGFIX: promises not caught when scrolling down a topic list to load more of them
BUGFIX: CSS on category dropdowns
Updated `top_menu` i18n with available filters
2014-01-18 19:27:25 +01:00
Régis Hanol c1a66b70bb BUGFIX: use previous_visit_at instead of last_seen_at to determine the best period to display in the top summary 2014-01-16 01:36:32 +01:00
Régis Hanol 462c6d81f5 BUGFIX: exclude categories from the top view 2014-01-16 00:49:58 +01:00
Régis Hanol a177732d28 FEATURE: top page should not be infinite. Limite them to 200 topics by default 2014-01-15 22:12:53 +01:00
Régis Hanol 0b2ead2248 rename topics_per_period_in_summary settings to topics_per_period_in_top_summary 2014-01-15 22:12:47 +01:00
Régis Hanol ed87a589ca BUGFIX: only show the best period for logged-in users 2014-01-15 21:45:28 +01:00
Régis Hanol 3a6bffa05d FEATURE: better top pages 2014-01-14 01:09:12 +01:00
Sam 2c75e15049 FEATURE: query param for closed / archived / open
?status=closed for closed topics
?status=open for open topics
?status=archived for archived topics
2014-01-13 14:40:21 +11:00
Régis Hanol 9c8e50351d first stab at calculating the score of a topic for the top tab 2013-12-27 18:10:35 +01:00
Sam cbaa0a3a49 BUG: drafts broken for new topics 2013-12-27 10:35:53 +11:00
Régis Hanol 567d2bd23c add top page 2013-12-24 00:50:36 +01:00
Robin Ward acf262b631 Support for "no subcategories" 2013-12-16 13:06:35 -05:00
Robin Ward 309904ef8f Revert "Merge pull request #1673 from aperrault/patch-04"
This reverts commit c9ea89bdd3, reversing
changes made to 9ed49888fc.
2013-11-19 14:08:45 -05:00
Autumn Perrault d9c026bec5 Fixing neglect to determine whether a user has the permission to create a topic on a category (besides being able to create a post) in ListController, TopicList, and TopicListSerializer causing the "Create Topic" button to appear even if a user cannot actually create a topic in that category but can reply to a topic therein. 2013-11-19 05:09:58 -07:00
Robin Ward 639394e38a FIX: Pinned topics within a category weren't working without a refresh 2013-11-18 10:52:01 -05:00
Robin Ward 41dfcd2774 FIX: Pagination while sorting on column headers 2013-11-14 12:35:18 -05:00
Robin Ward bda5a72c6a Server side support for custom ordering of topics 2013-11-13 14:17:06 -05:00
Robin Ward df568df9dc Controls for sorting topic columns 2013-11-13 11:48:38 -05:00
Sam b7d3b52e4f basic implementation of per-category new/latest etc filters 2013-10-24 21:05:06 +11:00
Sam 666264879c change it so all topics MUST include a category, we store a special uncategorized category to compensate
this cleans up a bunch of internals and removes some settings
2013-10-24 12:08:02 +11:00
Robin Ward 541620c115 Routes and support for sub-categories 2013-10-23 15:22:49 -04:00
Régis Hanol 26218ce11f RSS feeds should contain only publicly-available posts 2013-10-22 16:30:25 +02:00
Manoj 7dfa99998f Remove duplication of action defintion, add missing spec for topics_by, extract out URL construction logic 2013-10-21 08:34:18 +05:30
Sam 3d647a4b41 remove rack cache, it has been causing trouble
instead implement an aggressive anonymous cache that is stored in redis
this cache is sitting in the front of the middleware stack enabled only in production
TODO: expire it more intelligently when stuff is created
2013-10-16 16:39:18 +11:00
Régis Hanol c38ba8acdd add rss links to anonymous homepages 2013-10-11 18:43:29 +02:00
Robin Ward 3f0c03a20c FIX: Prevent unauthorized list of private message titles. Also remove some unused code. 2013-09-30 14:35:11 -04:00
Neil Lalonde 4fa11f159f Add site setting site_description. If filled, it will be used in meta description tag for teh white hat SEO 2013-09-11 15:33:27 -04:00
Neil Lalonde b73f4e9864 Put category description in meta description tag 2013-09-09 11:38:09 -04:00
Robin Ward 46efbac40e Add "Unread" filter to messages tab. Rename the other two views. 2013-08-30 12:32:05 -04:00
Robin Ward e1efde6707 Merge pull request #1376 from gcapizzi/lists_controller_refactoring
ListController refactoring
2013-08-25 07:29:35 -07:00
Robin Ward c0b051c9f6 Show Private Messages pill as a topic list rather than individual messages. 2013-08-24 16:58:16 -04:00
Giuseppe Capizzi 6f19cb7252 Extract ListController#list_target_user 2013-08-24 19:38:02 +02:00
Neil Lalonde 86012ac579 Fix a case when the wrong topic is loaded because the slug starts with a number 2013-08-22 16:23:46 -04:00
Sam d7596840e5 only staff should be able to see bookmarks and favs of other users
ensure that when they click on them they see the correct topics (topics for user they are looking at, not current user)
2013-08-22 09:18:54 +10:00
Robin Ward 0317cf9608 Show topics as a list of topics on the User Stream. 2013-07-25 15:56:20 -04:00
Sam 085e094497 404 if a category does not exist .... 2013-07-08 15:56:13 +10:00
Neil Lalonde 1c0e0da683 Add rss feed for latest and hot 2013-07-05 16:49:06 -04:00
Sam c3f64f99b3 fix up messed up routes 2013-07-02 15:21:26 +10:00
Neil Lalonde 1355c1e3b0 Fix links to uncategorized when SiteSetting.uncategorized_name is set 2013-06-27 16:16:06 -04:00
Jesse House 2e12eb2b62 refactor list_controller
- minor refactoring of actions 'category' and 'category_feed'
- fix defect in 'category' where check was for literal
  string 'uncategorized' instead of SiteSetting.uncategorized_name
- major refactoring on defined topic actions
2013-06-25 08:29:00 -07:00
Jesse House 06be760257 adds TopMenuItem model which encapsulates top_menu parsing logic 2013-06-24 10:04:18 -07:00
Sam 73834370a5 work in progress, live unread and new counts 2013-05-30 16:49:57 +10:00
Neil Lalonde b1bdebd611 url for uncategorized category topic list is always /category/uncategorized 2013-05-29 12:06:33 -04:00
Neil Lalonde f76d6c0f3f Fix for loading uncategorized topics when slug for uncategorized_name is blank 2013-04-18 16:28:47 -04:00
Robin Ward ee76f1926d Debugging Tool for Hot Topics 2013-04-02 18:00:53 -04:00
Régis Hanol 1668b5eab2 FIX: allows the selection of the default landing tab 2013-03-28 14:01:13 +01:00
Robin Ward 36269cfbaa Rename 'popular' to 'latest'. First stab at 'Hot' tab. 2013-03-27 16:21:23 -04:00
Robin Ward 0c5ca30188 Merge pull request #361 from ZogStriP/enforce-coding-convention
enforce coding convention
2013-03-05 07:25:19 -08:00
Régis Hanol 239cbd2d58 enforce coding convention
replaced every `and` by `&&` and every `or` by `||`
2013-03-05 01:42:44 +01:00
Alexander d6e665f888 Caching for topic/category RSS feeds
Using anonymous_etag() now
2013-03-04 11:21:01 -08:00
Alexander fd240c1967 RSS for topics in a category
Creates a new route for category RSS
2013-03-01 09:52:59 -08:00
Robin Ward 5d4efa9100 Support for non-english categories 2013-02-14 16:51:48 -05:00
Robin Ward 69c7b5aeed Support category names with spaces 2013-02-12 17:54:56 -05:00
Jakub Arnold 61654ab8f0 Fix all the trailing whitespace 2013-02-07 16:45:24 +01:00
Robin Ward 8d568b05c4 Don't enable Cache-Control if the site has restricted access. 2013-02-06 11:55:54 -05:00
Robin Ward 21b5628528 Initial release of Discourse 2013-02-05 14:16:51 -05:00