Commit Graph

550 Commits

Author SHA1 Message Date
David Celis e751b8d58f Default values for posts/topics fields on Category
When creating categories (or, at least, subcategories), certain integer
values are set to a default of NULL: topics_week, topics_month,
topics_year, posts_week, posts_month, and posts_year. This causes
consistent exceptions when trying to visit `/categories`, with the
offending line being in
`CategoryDetailedSerializer#count_with_subcategories`. This attempts to
coerce nil into Fixnum.

A fix could be to convert to 0 in the code, but these attributes should
really never be NULL. If there are no posts or topics, they should be 0
to maintain data integrity.

Signed-off-by: David Celis <me@davidcel.is>
2014-02-06 12:04:03 -08:00
Régis Hanol 4fb274fb9d BUGFIX: history link doesn't work on deleted posts 2014-02-04 20:05:50 +01:00
Sam 6c3c9345df use consistent style 2014-02-04 12:57:52 +11:00
Sam 5267e5bea6 BUGFIX: emails sent from "2 replies" as opposed to correct user 2014-02-04 12:56:28 +11:00
Régis Hanol d2974c2a15 BUGFIX: proper handling of top_menu_items 2014-02-03 16:08:00 +01:00
Sam 6205240a56 minor style fix 2014-02-03 14:50:19 +11:00
Régis Hanol ae401f0dc7 BUGFIX: JSON requests don't exclude categories from filters 2014-01-31 14:36:00 +01:00
Robin Ward 2892153712 REMOVE: Get rid of the `hotness` control for good. 2014-01-29 11:54:34 -05:00
Neil Lalonde 7cc5da08fe Track how many posts a user reads each day in user_visits 2014-01-27 11:20:19 -05:00
Sam 7e5a17f277 FEATURE: mute/watch/track buttons for private conversations 2014-01-22 17:46:52 +11:00
Neil Lalonde da825451d0 Invite link can't be used to log in after you set a password or sign in with 3rd party 2014-01-21 16:56:41 -05:00
Neil Lalonde 1dbc1c56b4 FIX: inviting a user again after the first invite expires will create a new invite 2014-01-21 16:56:40 -05:00
Sam b85e5dc191 FEATURE: collapse PM notifications 2014-01-20 16:18:43 +11:00
Robin Ward 4981525047 REFACTOR: Fixes poor class hierarchy for listing topics
- Upgrades Ember to latest
- Fixes a bunch of bugs with page titles and missing "active" states
2014-01-18 19:26:24 +01:00
Neil Lalonde 1806a7d4b3 Trust Level 3: invited users start at default_invitee_trust_level + 1, unless default_invitee_trust_level is 2 or higher 2014-01-17 11:12:00 -05:00
Neil Lalonde 4f6b208e8d Posts by trust level 3 users do not have nofollow on their external links. 2014-01-15 11:40:51 -05:00
Robin Ward 4f6283ba56 FIX: Accept HTTPS or HTTP urls on redirect 2014-01-14 15:02:05 -05:00
Neil Lalonde 52580f09af Rename favorite to starred everywhere 2014-01-10 14:54:19 -05:00
Sam 1533a1163c use_ssl is just confusing, it means use_https , fix name of setting 2014-01-09 10:51:38 +11:00
Régis Hanol e732aa8a86 BUGFIX: we should not store absolute urls for locally uploaded avatar templates
Highly recommended to run: `RAILS_ENV=production bundle exec rake avatars:regenerate` to fix the avatar templates stored in the database.
2014-01-07 17:45:06 +01:00
Sam 6e2797112d Attempt to fix spec under vagrant 2014-01-07 09:26:30 +11:00
Sam 6befdceabf BUGFIX: UserStat spec was over ambitious with its mocking 2014-01-06 16:50:55 +11:00
Robin Ward f145060315 Don't employ the "too many replies" if the user is staff, or if they created the topic.
See: http://meta.discourse.org/t/what-is-the-point-of-limiting-new-users-to-three-replies-per-topic/11696
2014-01-02 12:57:40 -05:00
Sam 2da5d2311b FEATURE: Added UI for adding and removing watched and muted categories 2014-01-02 17:59:08 +11:00
Sam b482b280d6 FEATURE: Basic backend support for muted and watched categories 2014-01-02 12:00:29 +11:00
Sam 2ad190b9f6 FEATURE: allow for additional plugin defined global settings 2014-01-02 10:46:09 +11:00
Robin Ward 4f8aed295a FEATURE: Embeddable Discourse comments, now with simple-rss instead of feedzirra 2013-12-31 15:01:22 -05:00
Robin Ward 62db063e1e Revert "Support for Embeddable Comments via IFRAME" - it depends on Curl
which not every server has. Have to rethink this.

This reverts commit e3e4c62887.
2013-12-31 12:52:31 -05:00
Robin Ward e3e4c62887 Support for Embeddable Comments via IFRAME 2013-12-31 12:26:24 -05:00
Godfrey Chan c6577fb98e Added a reload to fix a test broken on master
I am not sure why this is wokring on Rails 4, but the problem is that `post3`
here is holding on to an old reference of some associations so `PostDestroyer`
is not doing the right thing.
2013-12-30 14:36:51 -08:00
Sam 1915f292ad BUGFIX: invalid referer would cause 500 errors 2013-12-30 14:05:44 +11:00
Sam db1d01d1a2 Discourse as a Mailing List improvements
FEATURE: context is not emailed if we previously emailed you the post
FEATURE: site setting to enable_watch_new_topics , false by default.
  When enables users can elect to watch everything by default
FIX: Custom email subjects (x quoted you in [title], x replied to [title])
  was removed, this broke email grouping. TBD, include info in footer somehow
FIX: topic user specs were messy, reduce side effects
2013-12-30 13:02:12 +11:00
Sam 293b7e5857 add spec to demo blanking props 2013-12-30 08:42:55 +11:00
Régis Hanol 567d2bd23c add top page 2013-12-24 00:50:36 +01:00
Sam 7b8d2547d0 globals now implemented and documented 2013-12-20 16:17:21 +11:00
Neil Lalonde 1f0a59584b Revert "Re-apply with fixes: Stop using user agent to detect mobile devices. Use a media query and yepnope to load the appropriate css and customizations." 2013-12-18 14:47:22 -05:00
Régis Hanol c6fb60e0a0 FIX: S3 upload when using dots in bucket name 2013-12-16 11:44:59 +01:00
Alexander d93e4fc65d add more info to rss feeds 2013-12-15 01:17:39 -08: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
Régis Hanol 1457a3792d that fix should have been in the emoji plugin 2013-12-12 16:42:27 +01:00
Régis Hanol be835785f8 FIX: allow new user to post emojis 2013-12-12 15:05:18 +01:00
Régis Hanol 06dd7ffe3c better revision history 2013-12-12 03:41:34 +01:00
Neil Lalonde 5171a23a9c Re-apply with fixes: Stop using user agent to detect mobile devices. Use a media query and yepnope to load the appropriate css and customizations. 2013-12-11 11:19:22 -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
Neil Lalonde abed146cc7 FIX: Category description topics shouldn't auto-close 2013-12-04 10:31:25 -05:00
Neil Lalonde a9ab98ef9e Auto-close time can be entered in 3 ways, so a topic can close at any time 2013-11-27 09:52:35 -05:00
Régis Hanol 82b78ec6ba schemaless avatar urls 2013-11-22 19:18:45 +01:00
Régis Hanol 3cf5a363f7 do not destroy uploads when destroying a user 2013-11-22 18:29:07 +01:00
Sam 49b48e1eb6 ensure we have a bigint id 2013-11-22 17:51:36 +11:00
Neil Lalonde ae58a7db95 Add a warning on dashboard if enforce_global_nicknames is checked, but access key is blank. 2013-11-18 13:45:10 -05:00
Robin Ward 4ce81e1b01 Rename "Best Of" to "Summary" 2013-11-18 12:48:26 -05:00
Robin Ward ad3e276b4b Rename TopicSummary -> TopicMap 2013-11-18 12:08:21 -05:00
Robin Ward 639394e38a FIX: Pinned topics within a category weren't working without a refresh 2013-11-18 10:52:01 -05:00
railsaholic 34bba737ff Refactor SessionController#create, reduce complexity.
Don't compromise readablity
2013-11-15 22:09:03 +05:30
Scott Albertson 77b59b54ce Refactor UsersController#invited
* Add test coverage
* Simplify controller action
* Move finder code to Invite class
2013-11-11 13:23:49 -08:00
Sam d1d661f6e1 add logic that auto closes any topics that missed the queued job (due to redis flush or whatever) 2013-11-11 10:52:44 +11:00
sirMackk af67284995 User ctrl refactor - breaks up large methods, moves some logic into model
Includes missing methods from backup for travis to pass

fix missing code, failing specs

keep params handling in the controller.
2013-11-09 18:44:13 +05:30
Robin Ward 948a545cb1 Category descriptions should not appear in digests 2013-11-06 15:05:06 -05:00
Robin Ward 25ef66c60b User invites page now has search, displays first `invites_shown` records 2013-11-05 17:53:26 -05:00
Régis Hanol 37fd7ab574 pull hotlinked images 2013-11-05 19:07:29 +01:00
Neil Lalonde bd9b85f076 Screened Urls page shows results for each domain instead of each url 2013-11-04 16:24:48 -05:00
Robin Ward 3d6d7c8abe SiteSetting to hide regular names from users 2013-10-30 15:45:34 -04:00
Robin Ward 6063b52d6a Support for choosing a destination category when splitting topics. 2013-10-29 15:30:06 -04:00
Manoj 9650dbb97c Refactor topics controller
Refactor: 1) TopicsController to reduce code climate complexity.
2) Topic model, addressed comments

fix typo
2013-10-28 11:42:07 +05:30
Sam 95e936c299 cleanup API for looking up a user by email or username, add specs, fix invalid auto association in open id provider 2013-10-28 16:29:07 +11:00
Robin Ward f4d9bf9181 Merge pull request #1573 from railsaholic/use_existing_find_by_username_or_email
Utilize already existing method 'find_by_username_or_email'
2013-10-25 12:57:18 -07:00
Sam 4929c5db71 FIX: when allow_uncategorized_topics was false, PMs can not be created 2013-10-25 09:33:39 +11:00
Manoj 96ae3cdacc Utilize already existing method 'find_by_username_or_email'
check presence of email using include, dont use =~
2013-10-24 19:26:06 +05:30
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
Neil Lalonde 8aab2253d0 Whitelisted ip addresses will not be flagged as spam by flag_sockpuppets 2013-10-23 17:11:35 -04:00
Robin Ward c814fc16a3 Database structure to support sub categories 2013-10-23 15:22:49 -04:00
Robin Ward 348e2e3ef2 Support for per-user API keys 2013-10-22 17:34:39 -04:00
Neil Lalonde 7d582fbee3 Screened ip address can be edited, deleted, and changed to allow or block. 2013-10-22 16:30:46 -04:00
Robin Ward 2308784713 Merge pull request #1543 from railsaholic/small_users_controller_refactoring
refactor UsersController to reduce complexity
2013-10-21 12:21:03 -07:00
Neil Lalonde 648b11a0eb Add screening by IP address. When deleting a user as a spammer, block all signups from the same IP address. 2013-10-21 14:50:18 -04:00
Manoj 868e4ffe6d refactor UsersController to reduce complexity
Refactored: UsersController#create
2013-10-19 15:18:11 +05:30
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
Robin Ward 0a4f5af4a8 Merge pull request #1531 from railsaholic/topics_model_refactoring
Refactored Topic#limit_topics_per_day to improve Code Climate Complexity
2013-10-17 06:56:41 -07:00
Neil Lalonde cabe8f0d2d Clean up ScreenUrl normalization and matching 2013-10-16 16:39:29 -04:00
Robin Ward f27413219e Support for MDTest 2013-10-16 10:28:42 -04:00
Manoj 7c03076c2a Refactored Topic#limit_topics_per_day to reduce code climate complexity
Extracted  1) #apply_per_day_rate_limit_for, method as generic
RateLimiter , 2) #limit_first_day_topics_per_day as a separate method,
3) Added User#added_a_day_ago?, 4) Fixed private methods indentation.
2013-10-16 14:58:18 +05:30
James Edward Gray II 1aa9fc982d Adding post details in preparation for the API importer code. 2013-10-15 09:21:30 -05:00
Sam 7df4e4afb9 security fix, anon should not be treated as though they can create anything 2013-10-13 09:54:48 +11:00
Sam ad2ed5fe51 rate limits for topics and posts on first day
max_topics_in_first_day and max_replies_in_first_day
2013-10-10 10:32:03 +11:00
Neil Lalonde bccb37b6f3 When creating a topic, don't select a category by default when allow_uncategorized_topics is false. Also, added category validation on the server to enforce allow_uncategorized_topics. 2013-10-08 14:41:20 -04:00
Sam 5bf26ec34e large refactor, ship a few columns from the user table into user_stats 2013-10-07 15:04:59 +11: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
Régis Hanol cd4cda5b4c allow users to specify thumbnail size 2013-09-27 10:57:31 +02:00
Robin Ward 2baf5fda8e Merge pull request #1438 from Elegios/composer_use_category_id
Make the composer and TopicCreator use category id instead of category name
2013-09-17 08:03:48 -07:00
Neil Lalonde b15e629f46 Strip trailing slashes from ScreeningUrl records 2013-09-17 10:26:05 -04:00
Viktor Palmkvist 37673e3412 Make the composer and TopicCreator use category id instead of category name
Also fixes #1171
Includes backwards compatibility for topic creation
2013-09-17 12:13:19 +02:00
Neil Lalonde c845071066 Fix an error with mobile custom header 2013-09-16 12:55:44 -04:00
Neil Lalonde 13f17b2a5c Add ability to customize css and header for mobile 2013-09-16 12:28:02 -04:00
Robin Ward 7d9a84b496 New User Education goes through a server side ComposerMessages check. Composer message for users
who don't have avatars.
2013-09-13 12:23:53 -04:00
Robin Ward fcff4e80d1 New `user_stats` table to keep track of queried information on a user.
This is information that is not usually needed when representing a user
and is in a separate table with a has one relationship to avoid querying
it all the time.
2013-09-11 14:50:26 -04:00
Neil Lalonde e8ef55c446 Rename StaffActionLog to UserHistory 2013-09-10 22:01:20 -04:00
Robin Ward c8ad977c8a Revert "Merge pull request #1215 from Elegios/composer_use_category_id"
This reverts commit 763859d439, reversing
changes made to b62caf80fb.
2013-09-06 18:00:57 -04:00
Robin Ward 763859d439 Merge pull request #1215 from Elegios/composer_use_category_id
Make the composer and TopicCreator use category id instead of category name
2013-09-06 11:55:27 -07:00
Sam 641c51367a fix broken build
hack to allow for PMs with no users for flagging needs
2013-09-06 18:03:30 +10:00
Sam 2ce4468aa5 rename system_username to site_contact_username , system_user is a special user with -1 id that is only used for certain admin tasks
for example system_user will autoclose stuff if needed, it will delete stubs and be the target for flag pms
2013-09-06 17:28:37 +10:00
Sam 41a1b6942d notify moderators now goes to the "community" user, that saves our poor mods from a flood of pms
if any staff respond to a pm they are automatically added to the list of recipients and will start
getting email notifications
2013-09-06 14:07:23 +10:00
Sam 61281a3c81 invite only forums had very wonky logic, invited users were not being activated, invite_only forums were still registering users 2013-08-28 17:18:31 +10:00
Sam 83d8bcdc27 revert non queuing of emails 2013-08-27 11:52:28 +10:00
Sam 322b5c236c queue emails right away if a user is not online, no point waiting. 2013-08-26 14:55:35 +10:00
Sam 818bf1355d PluginStore for plugin specific bits of storage
Amended plugin interfaces so they work with the vk sample
2013-08-26 12:59:17 +10:00
Navin Keswani d87389b38e No more rails 4 deprecation warnings 2013-08-25 23:18:11 +02:00
Robin Ward e9663e5338 Merge pull request #1332 from locks/user_email_observer
User email observer (Code Climate improvements)
2013-08-24 08:34:11 -07:00
Ricardo Mendes 37f4022f73 Refactors UserEmailObserver to improve Code Climate score
- Extracts certain logic to private methods and remove unnecessary
comments
- Extracts email enqueueing methods into a separate class
- Fix specs involving UserEmailObserver to call #after_commit instead
of the specific methods
2013-08-24 12:21:39 +01:00
Neil Lalonde 6e79197519 Enum site settings can have translatable names in dropdown. Add setting for how often users get digest emails by default: default_digest_email_frequency. 2013-08-23 17:36:25 -04:00
Scott Albertson 1dbe1fb1bc Refactor User.find_by_username_or_email
* Improve test coverage
2013-08-22 09:40:07 -07:00
Robin Ward 7f69a58439 Replace Markdown parser. 2013-08-21 10:10:57 -04:00
Régis Hanol 3922c9b6b5 FIX: specs for ruby 2.0.0-p247 2013-08-20 21:45:58 +02:00
Sam 31dac4b197 unseen users get no updates 2013-08-20 17:48:04 +10:00
Sam a9393e4a7a paging for flag list
corrected reload behavior on flag list
refactored post actions ... extracted flag queries
2013-08-19 21:14:26 +10:00
Viktor Palmkvist f8129c4e43 Make the composer and TopicCreator use category id instead of category name
Also fixes #1171
2013-08-19 11:57:35 +02:00
Sam c2653b2915 Merge pull request #1309 from stephankaag/sidetiq
Replace Clockwork with Sidetiq
2013-08-14 16:51:04 -07:00
Neil Lalonde 86647f0a54 Add ScreenedUrl. Rename BlockedEmail to ScreenedEmail. 2013-08-14 16:08:23 -04:00
Stephan Kaag a6b4b5dbf2 Replace Clockwork with Sidetiq 2013-08-14 21:39:40 +02:00
Régis Hanol c867b67a0b custom avatar support 2013-08-13 22:08:29 +02:00
Robin Ward fe3a69c271 Private message emails now include the history 2013-08-07 13:03:45 -04:00
Robin Ward 1c3804934e Show the entire history of replies above a post when you expend "in reply to" 2013-08-06 17:43:10 -04:00
Neil Lalonde 1552c4b69e Remove users column from Top Traffic Sources table on dashboard. It's not useful and very expensive to calculate. 2013-08-02 18:32:33 -04:00
Sam d343d512b9 favorite user action consistency 2013-08-02 11:07:18 +10:00
Sam 5e23a0681d work in progress, will finalize soon 2013-08-02 09:59:25 +10:00
Régis Hanol faeb4a9ebd enhance upload selector
- Change the icon on the button to a file when attachments are enabled
- Display the list of allowed extensions in the upload selector
- FIX : regexps for validating uploads weren't escaping the dots
2013-08-02 01:30:18 +02:00
Régis Hanol ed9417fa3b enable thumbnailing on S3
- added url to optimized image model
- refactored s3_store & local_store
2013-07-31 23:26:34 +02:00
Ryan Boland 553a671fdb fix mentions in code blocks 2013-07-30 18:01:42 -04:00
Neil Lalonde 882c1524f7 Strip trailing and leading spaces from category names 2013-07-30 16:48:45 -04:00
Neil Lalonde 8cee3a9fcd Add a way to add email to block list when nuking a user 2013-07-29 15:29:43 -04:00
Neil Lalonde 5f8a130277 Add BlockedEmail, to block signups based on email. Track stats of how many times each email address is blocked, and last time it was blocked. Move email validation out of User model and into EmailValidator. Signup form remembers which email addresses have failed and shows validation error on email field. 2013-07-29 15:29:43 -04:00
Neil Lalonde a8df9778b5 Rename AdminLog to StaffActionLog 2013-07-29 15:29:43 -04:00
Robin Ward c28b377494 Don't redirect to arbitrary URLs via link tracker 2013-07-26 12:14:11 -04:00
Stephan Kaag f99acebdaa Rails 4 updates 2013-07-24 21:09:18 +02:00
Sam 38b8e9b1b4 get rake autospec working in rails 4 2013-07-24 11:49:26 +10:00
Régis Hanol be9217d4c8 add server-side filesize check on uploads 2013-07-24 00:54:41 +02:00
Sam 060c79ecc0 remove dupes before correcting topic_ids in user action consistency check job 2013-07-23 12:44:20 +10:00
Sam 4b269de724 correct: http://meta.discourse.org/t/cant-save-adding-a-group-permission-to-a-category/8537
can not save category after adding a new custom group
2013-07-23 10:10:36 +10:00
Sam 0acc96c94e work around for http://meta.discourse.org/t/activerecord-statementinvalid-exception-raised-in-models-user-action-rb/7275/4 2013-07-23 09:48:18 +10: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
Robin Ward ed745c3fdd Merge pull request #1222 from ZogStriP/fix-s3-related-issues
Fix s3 related issues
2013-07-22 07:30:41 -07:00
Robin Ward 80a0943f54 Merge pull request #1228 from ZogStriP/fix-thumbnailing-with-cdn-enabled
FIX: thumbnailing isn't working with CDN enabled
2013-07-22 07:22:59 -07:00
Robin Ward 8b181e0803 Merge pull request #1230 from ZogStriP/add-newuser-max-attachments-setting
add newuser-max-attachments setting
2013-07-22 07:22:23 -07:00
Sam 58e7c3e1f3 push some work out of AR callbacks into PostCreator, add a couple of helpers for post and topic creation in test
fix it so the auto_track false marks topics as new
2013-07-22 15:07:20 +10:00
Sam 31bb08bcdd added an option to bypass auto tracking of topics on post creation 2013-07-22 15:07:20 +10:00
Régis Hanol 2986798ba7 add newuser-max-attachments setting 2013-07-22 02:39:17 +02:00
Régis Hanol 649ab85740 FIX: thumbnailing wasn't working with CDN enabled 2013-07-22 00:37:23 +02:00
Régis Hanol 33977252c9 rollback to previous s3 syntax (ie. subdomains) 2013-07-20 11:30:36 +02:00
Régis Hanol 8406a4230c FIX: click tracking on attachments wasn't working 2013-07-19 01:27:09 +02:00
Sam 81616a46ba db consistency check for mismatching topic_ids in user_actions
fix up post mover so it remaps user actions as well
move specs for post mover into post_mover_spec
2013-07-17 16:40:56 +10:00