Commit Graph

201 Commits

Author SHA1 Message Date
Robin Ward 74d9293ca9 FIX: Allow duplicate slugs when the parent category is not the same 2014-08-13 14:45:25 -04:00
Neil Lalonde e40e9351f6 FIX: don't allow same category name with different case 2014-08-12 11:40:33 -04:00
Robin Ward 6ba5f715f3 FIX: There was an error renaming the Uncategorized topic 2014-07-25 16:36:34 -04:00
Robin Ward ffa84d9bb4 If you rename a category, also rename the category definition topic. 2014-07-18 13:59:54 -04:00
Neil Lalonde 01a68f8cc7 Emails are case insensitive 2014-07-16 10:22:01 -04:00
Robin Ward c6df00a5cc FIX: You shouldn't be able to add a parent to `Uncategorized` 2014-07-15 15:19:39 -04:00
Sam 45ca83328d Annotate 2014-07-15 11:29:44 +10:00
Sam 9a9ad9bda8 FEATURE: Badge progress
- Refactor model so it stores backfill query
- Implement autobiographer
- Remove sample badge
- Correct featured badges to only include a badge once
2014-07-03 17:29:44 +10:00
Robin Ward 952426d358 FEATURE: Uploaded images to categories are shown when browsing 2014-06-30 14:14:00 -04:00
Catrin 772a304fc2 dropdown on categorypage 2014-05-29 18:18:27 -04:00
Sam b1d5f4440b Annotate models 2014-05-28 12:30:57 +10:00
Robin Ward 7900c7bd2f Allow multiple subcategories with the same name 2014-05-26 15:33:51 -04:00
Louis Rose 1574485443 Perform the where(...).first to find_by(...) refactoring.
This refactoring was automated using the command: bundle exec "ruby refactorings/where_dot_first_to_find_by/app.rb"
2014-05-06 14:41:59 +01:00
Benjamin Kampmann 0cf07d41ae Move Concern from lib into app/models. refs #2279 2014-04-29 19:26:43 +02:00
Benjamin Kampmann 2450088c03 Add CustomFields to Post, Category and Group 2014-04-29 19:26:42 +02:00
Erick Guan 6d45f71254 move concerns to the model/concerns 2014-04-19 12:00:40 +08:00
Sam 862a6696c0 Correct annotations
allow longer usernames (up to 60)
2014-04-15 15:53:48 +10:00
Régis Hanol 6373de550f update annotations 2014-04-08 17:35:44 +02:00
Thomas Cioppettini 38882eb1a7 Remove threequals from ruby files 2014-03-26 12:20:41 -07:00
Neil Lalonde ea86cfd4ef FIX: categories with non-ascii names will have broken next page urls 2014-03-24 13:36:23 -04:00
Sam 5c148faeb9 annotations were out of date 2014-03-20 15:35:51 +11:00
Neil Lalonde a9a8e649ba Oops, and these methods too 2014-03-19 10:36:24 -04:00
Neil Lalonde 986f6e9c2a Oops I meant to delete the old method 2014-03-19 10:35:35 -04:00
Neil Lalonde 3ea477b17d FIX: performance of CategoryDetailedSerializer and Category.update_stats on large databases 2014-03-19 10:14:15 -04:00
Neil Lalonde 5f34a621b5 Revert "Merge pull request #1896 from nickborromeo/category-list" 2014-03-12 16:41:15 -04:00
Régis Hanol bbde2aaa97 Merge pull request #1896 from nickborromeo/category-list
Refactor find_relevant_topics and find_categories
2014-03-12 09:44:41 +01:00
Nick Borromeo 5104c7365f Refactor find_relevant_topics and find_categories
This breaks down two private methods into smaller methods for
readability. This also moves logic into the Category model class.
2014-03-11 22:16:13 -07:00
Benjamin Kampmann 37cea49459 Add Email-In-Per-Category
- allow the configuration of an inbox-email-address per category
 - post emails to that email into that category instead of global

 - Adds UI for configuration
 - Adds Documentation for configuration
 - Adds Tests for new feature
2014-02-28 16:53:58 +01:00
Robin Ward 3151f59bc9 REFACTOR: We don't cache the json for the Site model anymore, so let's
rename and remove the methods leftover from that.
2014-02-24 14:25:37 -05:00
Stephan Kaag f12925887c Drop Rails3 support 2014-02-17 19:42:08 +01:00
Sam 23af46a66c Merge pull request #1960 from verg/subcategory-search-links
Fix subcategories links from search
2014-02-17 10:33:35 +11:00
verg f723f11443 Fix subcategories links from search 2014-02-16 12:49:20 -05:00
Robin Ward f73a3f252a FIX: Don't allow parent categories to be deleted. Also, remove
duplicated logic and rely on the server response for `can_delete`
status.
2014-02-12 17:24:25 -05:00
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
Sam be560d4eb6 Update annotations 2014-02-07 11:07:52 +11:00
Neil Lalonde 14018ec07c FIX: topic and post counts on /categories page should include sub-categories 2014-02-05 18:39:49 -05:00
Robin Ward 2892153712 REMOVE: Get rid of the `hotness` control for good. 2014-01-29 11:54:34 -05:00
Neil Lalonde 89908cdb47 Admins don't see uncategorized on /categories if it has no topics and allow_uncategorized_topics is false 2014-01-15 14:11:36 -05:00
verg 8a830fb8e3 Prevent deleting 'uncategorized' category 2013-12-31 11:22:44 -06:00
Neil Lalonde 341adc93a4 Allow categories with null position, which means sort them based on activity. Mix absolutely positioned (position is not null) categories with null position categories. 2013-12-16 15:13:57 -05:00
Neil Lalonde 1145e4bfd9 Fix topics_year, topics_month, topics_week for uncategorized category 2013-12-13 16:17:06 -05:00
Neil Lalonde 49c3482464 Show topic and post counts by day/week/month/year on categories page 2013-12-13 15:37:45 -05:00
Neil Lalonde 9a24d2651d Allow category to auto-close topics in X hours instead of days. FIX: the system message that says a topic was automatically closed was only counting in days. 2013-12-06 16:39:35 -05:00
Sam 2db3cfb16b annotate models 2013-12-05 17:40:35 +11:00
Neil Lalonde abed146cc7 FIX: Category description topics shouldn't auto-close 2013-12-04 10:31:25 -05:00
Robin Ward 01b768392a Remove `default_scope` 2013-11-06 16:56:49 -05:00
Robin Ward 914b723b97 Category dropdown should be in the `position` order 2013-11-06 15:50:47 -05:00
Robin Ward b93ca1089e List subcategories on categories page 2013-10-31 18:02:24 -04:00
Robin Ward 61468f6f27 Can assign a parent category to a category. 2013-10-24 17:03:28 -04:00
Sam 24d732b12a regressions post merge 2013-10-24 12:25:20 +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 c814fc16a3 Database structure to support sub categories 2013-10-23 15:22:49 -04:00
Sam 614f45d003 correct topic and category counting query
revive old styling that was stripped
2013-10-21 10:20:16 +11:00
Sam 5f74cb6bf9 category is not "positionable" 2013-10-18 18:09:30 +11:00
Sam 1ee49798b2 work in progress wide category list 2013-10-18 11:10:10 +11:00
Sam 7bf96ee690 naive implementation of post_count on categories 2013-10-18 11:10:10 +11:00
Sam 7df4e4afb9 security fix, anon should not be treated as though they can create anything 2013-10-13 09:54:48 +11:00
Navin Keswani d87389b38e No more rails 4 deprecation warnings 2013-08-25 23:18:11 +02:00
Navin 9ab2471a92 Fix rails4 deprecation warnings
That appear when running topic_spec.rb
2013-08-15 17:52:18 +02:00
Neil Lalonde 882c1524f7 Strip trailing and leading spaces from category names 2013-07-30 16:48:45 -04:00
Stephan Kaag 0e3b8fbb24 Remove some calls to `all`. They are not required, and Rails4 raises warnings about them. 2013-07-22 20:44:11 +02:00
Sam 352ac9e60c Finalize read only and post only categories, finished off UI work 2013-07-16 15:46:11 +10:00
Sam ecf17cfebb work in progress, add fidelity to category group permissions (full, create posts, readonly) 2013-07-16 15:46:11 +10:00
Ian Christian Myers 0d01c33482 Enabled strong_parameters across all models/controllers.
All models are now using ActiveModel::ForbiddenAttributesProtection, which shifts the responsibility for parameter whitelisting for mass-assignments from the model to the controller. attr_accessible has been disabled and removed as this functionality replaces that.

The require_parameters method in the ApplicationController has been removed in favor of strong_parameters' #require method.

It is important to note that there is still some refactoring required to get all parameters to pass through #require and #permit so that we can guarantee that parameter values are scalar. Currently strong_parameters, in most cases, is only being utilized to require parameters and to whitelist the few places that do mass-assignments.
2013-06-06 00:30:59 -07:00
Ian Christian Myers 130d837952 Implemented strong_parameters for Category/CategoriesController.
Category now requires parameters to be permitted by strong_parameters using #require or #permit for mass-assignment. Missing required parameters now throw a ActionController::ParameterMissing execption instead of the Discourse::InvalidParameters execption.
2013-06-04 23:45:25 -07:00
Sam 870e59883b secure the links on the topic pages, eliminated deleted topics as well. 2013-06-05 16:10:26 +10:00
Sam d2c1eb090e Merge pull request #921 from nirnanaaa/postgres-truefalse
removed t's and f's from models
2013-05-30 21:38:26 -07:00
Neil Lalonde b82a5dfd56 Move logic to reject slugs that are just numbers into the slug module 2013-05-30 11:54:02 -04:00
Neil Lalonde 7d5c313456 Don't allow category slugs that are numbers 2013-05-30 11:09:09 -04:00
Sam e93b7a3b20 more progress towards live unread and new counts, unread message implemented, still to implement delete messages 2013-05-30 16:49:57 +10:00
nirnanaaa 364113a4d5 removed t and f 's from group model
removed t and f 's from user model as mentioned in #919

removed t's and f's from category model
2013-05-29 22:10:43 +02:00
Robin Ward 560fb15d8a Include pinned topics in category list.
- removes an (n+1) query for user data
- supports the preload store for the data to avoid a second request
- fix a bug where uncategorizes was reporting (0, 0, 0) for topics by week, month, year
2013-05-28 15:36:16 -04:00
Victor Cruz Dueñas bca006feca removed unnecesary method 2013-05-24 18:03:02 +02:00
Sam ca2dee52db moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
Sam 2cd95bc649 lets try out annotations 2013-05-24 12:35:14 +10:00
Robin Ward 7a31630837 Search Refactor: Remove some manual SQL, make search data tables more idomatic Rails/AR 2013-05-22 16:31:13 -04:00
Robin Ward 27828c5ec2 Merge pull request #871 from avdi/refactoring-with-josh-and-avdi
Various refactorings towards Ruby/Rails idiom from Josh Susser and Avdi Grimm
2013-05-21 07:18:50 -07:00
Josh Susser and Avdi Grimm 5659b66729 Refactor select().map() to use pluck.
Remove a method already provided by ActiveRecord.
2013-05-17 15:11:37 -04:00
Lee Machin dadb7eaa23 fix crash caused by incorrect query in scope
setting all categories to be secured led to a blank screen on all pages

use stabby lambda for consistency in class

make the test a little more concise

- move the local assignments into let blocks for
reusability

- remove calls to `to_a`, which aren't needed

- use 'be_empty' instead of '[]' to be consistent
with the other matchers in the test

add a test for the `secured` scope with multiple
secured categories
2013-05-15 22:26:52 +01:00
Sam b6bf95e741 speed up startup (avoid loading some gems on startup)
correct group permission leaks
add Discourse.cache for richer caching support
2013-05-13 18:04:03 +10:00
Sam 942f168ab6 UI still a tad rough, but we have a first pass of secure categories 2013-05-10 16:47:47 +10:00
Sam 4f328e3e45 +x on files makes no sense unless they really are executable
rails in the script dir makes no sense, use binstubs or bundler instead
2013-05-09 17:35:15 +10:00
Sam 5cfcdc7ef0 backend for secure categories mostly done (todo pm groups) 2013-04-29 16:33:43 +10:00
Sam 4d9dc82be0 bug fix 2013-04-24 14:39:31 +10:00
Neil Lalonde c0f3c47196 Use message bus to broadcast addition and removal of categories 2013-04-10 15:53:36 -04:00
Robin Ward 79c986dd92 Fix issue with duplicate slugs 2013-04-01 12:26:51 -04:00
Kuba Brecka d50b5e1fd8 make sure Category.topic_count is consistent with week/year stats 2013-03-31 13:22:05 +02:00
Robin Ward 36269cfbaa Rename 'popular' to 'latest'. First stab at 'Hot' tab. 2013-03-27 16:21:23 -04:00
Régis Hanol 3bf6625aa4 displays a message when a failure happen while creating a new category 2013-03-14 22:25:55 +01:00
Robin Ward 8c02d2f48d Robin sucks at merging! This fixes a n+1 query. 2013-03-08 16:48:56 -05:00
Robin Ward b8fd734d0e Merge branch 'refactor-category' of git://github.com/goshakkk/discourse
Conflicts:
	app/models/category.rb
2013-03-08 10:49:25 -05:00
Sam d6ca23a75b remove N+1 queries 2013-03-08 05:34:19 -08:00
Robin Ward 052887c296 Category Topics are no longer invisible, they are pinned. 2013-03-07 12:46:23 -05:00
Gosha Arinich a1825fece9 refactor Category
* move callback bodies to separate methods (easier to test)
2013-03-05 21:09:13 +03:00
Gosha Arinich 6e5399d544 minor cleanup, using AR querying DSL over raw SQL in some places 2013-02-28 21:54:12 +03:00
Gosha Arinich cafc75b238 remove trailing whitespaces ❤️ 2013-02-26 07:31:35 +03:00
Robin Ward 532b1f5450 Can edit category descriptions, they show up in a `title` attribute 2013-02-22 13:43:47 -05:00
Dan Neumann 37ca391f50 validate category user_id. 2013-02-19 21:24:38 -06:00
Dan Neumann fac75401ef category stats shouldn't include deleted topics. 2013-02-16 21:10:18 -06:00
Jakub Arnold 61654ab8f0 Fix all the trailing whitespace 2013-02-07 16:45:24 +01:00
Robin Ward 21b5628528 Initial release of Discourse 2013-02-05 14:16:51 -05:00