Commit Graph

280 Commits

Author SHA1 Message Date
riking 1833b43ae2 FEATURE: Badge query validation, preview results, and EXPLAIN
Upon saving a badge or requesting a badge result preview,
BadgeGranter.contract_checks! will examine the provided badge SQL for
some contractual obligations - namely, the returned columns and use of
trigger parameters.

Saving the badge is wrapped in a transaction to make this easier, by
raising ActiveRecord::Rollback on a detected violation.

On the client, a modal view is added for the badge query sample run
results, named admin-badge-preview.
The preview action is moved up to the route.
The save action, on failure, triggers a 'saveError' action (also in the
route).

The preview action gains a new parameter, 'explain', which will give the
output of an EXPLAIN query for the badge sql, which can be used by forum
admins to estimate the cost of their badge queries.
The preview link is replaced by two links, one which omits (false) and
includes (true) the EXPLAIN query.

The Badge.save() method is amended to propogate errors.

Badge::Trigger gets some utility methods for use in the
BadgeGranter.contract_checks! method.

Additionally, extra checks outside of BadgeGranter.contract_checks! are
added in the preview() method, to cover cases of null granted_at
columns.

An uninitialized variable path is removed in the backfill() method.

TODO - it would be nice to be able to get the actual names of all
columns the provided query returns, so we could give more errors
2014-08-31 11:25:44 -07:00
Régis Hanol fd6dd88afb FIX: dual modal when deleting spammer in the flag modal 2014-08-29 13:05:51 +02:00
Régis Hanol 521cb6bd0d FIX: dual modal when selecting 'delete spammer' in flags section 2014-08-29 12:54:24 +02:00
Robin Ward 9e2c72e277 Allow restoring from backups in development mode even if the setting is
off.
2014-08-28 17:02:48 -04:00
Régis Hanol 5b1785157d TRIVIAL: fix deprecations due to momentjs upgrade 2014-08-20 22:22:58 +02:00
Régis Hanol 8a20d05ba5 FEATURE: backup without uploads 2014-08-20 18:53:58 +02:00
Arpit Jalan d0736a06b6 FEATURE: export user list 2014-08-15 01:46:57 +05:30
Régis Hanol ec30086dea FEATURE: agree all the flags 2014-08-04 22:48:04 +02:00
Régis Hanol bddffa7f9a FEATURE: flag dispositions normalization
All flags should end up in one of the three dispositions
  - Agree
  - Disagree
  - Defer

In the administration area, the *active* flags section displays 4 buttons
  - Agree (hide post + send PM)
  - Disagree
  - Defer
  - Delete

Clicking "Delete" will open a modal that offer to
  - Delete Post & Defer Flags
  - Delete Post & Agree with Flags
  - Delete Spammer (if available)

When the flag has a list associated, the list will now display 1
response and 1 reply and a "show more..." link if there are more in the
conversation. Replying to the conversation will NOT give a disposition.
Moderators must click the buttons that does that.

If someone clicks one buttons, this will add a default moderator message
from that moderator saying what happened.

The *old* flags section now displays the proper dispositions and is
super duper fast (no more N+9999 queries).

FIX: the old list includes deleted topics
FIX: the lists now properly display the topic states (deleted, closed,
archived, hidden, PM)
FIX: flagging a topic that you've already flagged the first post
2014-07-28 19:28:07 +02:00
Sam f9162d6add FIX: moderators had no access to admin user page 2014-07-28 11:59:46 +10:00
Sam 1a6aa07611 FEATURE: editable badge groups 2014-07-27 18:22:01 +10:00
Robin Ward 15a51c6316 ES6: Patch up a few issues with the admin controllers conversion 2014-07-25 14:17:58 -04:00
Joshua Gorner e242368266 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
Sam ec03d135fa FEATURE: allow advanced badge options in admin screen
clean up serializer, allow simplistic preview
2014-07-24 18:28:23 +10:00
Robin Ward c8a0bf35c5 FIX: Navigating to a user's admin page would not populate
`availableGroups`
2014-07-23 16:54:04 -04:00
Sam b9a7d945c3 Improve badge grouping UI
Start work on triggers
2014-07-23 11:43:17 +10:00
Benjamin Kampmann 5025e97712 move available groups loader into router 2014-07-15 15:48:02 +02:00
Robin Ward 85747137ef FIX: Put in admin title when browsing admin section 2014-06-27 11:58:46 -04:00
Robin Ward 580a1bf8b0 ES6: Migrated and deprecated a bunch of views 2014-06-10 11:54:38 -04:00
Robin Ward 06965a999e Use `replaceWith` in order to not break the back button. 2014-06-05 10:18:31 -04:00
Vikhyat Korrapati 6225b83f4a Show system badges in the admin interface but don't allow editing them. 2014-05-19 10:27:04 +05:30
Vikhyat Korrapati 8fe8e66280 Don't display system badges in the admin badges interface. 2014-05-18 12:28:14 +05:30
Neil Lalonde c4d3aa3d47 Theming: a UI to choose some base colors that are applied to all the site css. CSS compiled outside of asset pipeline. 2014-05-14 10:18:12 -04:00
Neil Lalonde feaaf55a0c Theming: color scheme editing. Unfinished! Doesn't have any effect on css files yet. 2014-04-24 16:49:12 -04:00
Robin Ward e48cf06fc9 REFACTOR: Add urls for admin groups, make it more idiomatic ember 2014-04-23 15:15:46 -04:00
Régis Hanol ff1823beca BUGFIX: backups logs page was busted since last Ember update 2014-04-23 11:20:22 +02:00
Robin Ward c9c95a9ac2 FIX: Ember doesn't allow one route name, `basic`, and Discourse used it! 2014-04-17 10:45:06 -04:00
Vikhyat Korrapati 61ec2b390e Don't display granted badges in the badge grant combobox. 2014-03-25 15:45:34 +05:30
Vikhyat Korrapati 0f9ea25010 Interface for granting/revoking badges from admin user page. 2014-03-21 11:09:19 +05:30
Robin Ward 51e3d72461 Merge pull request #2141 from riking/correctness
Lots of JS correctness fixes
2014-03-19 11:20:15 -04:00
Régis Hanol 80bfdeee82 Merge pull request #2147 from vikhyat/serialize-params
Route `serialize` hook argument is the model, not params
2014-03-19 09:30:26 +01:00
Vikhyat Korrapati 28731ea633 Route `serialize` hook argument is the model, not params. 2014-03-19 12:02:27 +05:30
riking 3f35d1062e Remove trailing commas, add trailing semicolons 2014-03-18 18:21:10 -07:00
riking 593f5df503 Corrections to JSDoc 2014-03-18 18:19:20 -07:00
Vikhyat Korrapati 9b26c8584e Initial badge system implementation. 2014-03-14 21:49:26 +05:30
Régis Hanol 68a935c36b FEATURE: upload backups 2014-02-22 01:41:01 +01:00
Régis Hanol 30ccdf3fb7 BUGFIX: calling _super() won't actually set the model to the controller
cf.
351719f7c1 (commitcomment-5410366)
for more information
2014-02-18 18:21:35 +01:00
Régis Hanol 351719f7c1 BUGFIX: do not forget Ember's default behavior 2014-02-17 21:58:28 +01:00
Régis Hanol 683bf8c0a4 FEATURE: add all email logs tab 2014-02-15 01:17:13 +01:00
Régis Hanol 3f3c9ca7cb FEATURE: add filters on email logs 2014-02-15 00:50:08 +01:00
Neil Lalonde 35dae76bbd Log when and why an email was not sent in email_logs 2014-02-14 13:06:39 -05:00
Régis Hanol 41d16a3657 forgot the AdminBackupsLogsRoute 2014-02-13 13:31:14 -08:00
Régis Hanol 38e365ea45 do not show the read-only alert to the admin 2014-02-13 13:31:13 -08:00
Régis Hanol babcc3fc50 backup & restore client-side code 2014-02-13 13:31:13 -08:00
Régis Hanol 310a439f3d update client-side admin routes 2014-02-13 13:31:13 -08:00
Robin Ward b61df08d1b FEATURE: Admin selector to choose a primary group for a user, display it
and apply a CSS class to their posts.
2014-02-10 17:00:15 -05:00
Robin Ward 003eb06807 Move `Discourse.Group` into public models 2014-02-07 10:44:51 -05:00
Neil Lalonde ae3b53bb76 Add a page in admin to view trust level 3 requirements for a user. Only shows for users who are currently at trust level 2. 2014-01-22 18:17:45 -05:00
Robin Ward 3bba75b052 FIX: Email preview with no date caused a server error 2014-01-06 10:18:37 -05:00
Robin Ward a502266c42 Enable JSHINT's `unused` option. It caught a bunch of suspicious stuff which is fixed in this commit. 2013-12-30 13:30:22 -05:00
Régis Hanol 567d2bd23c add top page 2013-12-24 00:50:36 +01:00
Neil Lalonde d3c84b60c8 Add an All Results tab when filtering the site settings 2013-11-15 16:43:56 -05:00
Neil Lalonde 726b985ece FIX: a js error when reloading /admin/site_settings/category/:id 2013-11-14 16:50:34 -05:00
Neil Lalonde df213d7b23 Filter on site settings across all categories 2013-11-14 16:02:14 -05:00
Neil Lalonde 1e37abc310 Add site setting category support 2013-11-14 16:02:13 -05:00
Neil Lalonde 0c6f794eb0 Used the term suspended instead of banned. 2013-11-07 13:53:49 -05:00
Neil Lalonde 92a0729937 When banning a user, a reason can be provided. The user will see this reason when trying to log in. Also log bans and unbans in the staff action logs. 2013-11-01 10:47:26 -04:00
Robin Ward 348e2e3ef2 Support for per-user API keys 2013-10-22 17:34:39 -04: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
Robin Ward be0ce08cc2 Ember Upgrade: 1.0 2013-10-01 11:16:27 -04:00
Neil Lalonde e5464a4bed Show staff action log details in a modal 2013-08-21 12:33:24 -04:00
Neil Lalonde a95303fcd8 Log site customization changes. Use a modal to show staff action log details for site customizations. 2013-08-21 12:33:24 -04: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
Neil Lalonde 293361dcd3 Screened URLs list in admin 2013-08-15 10:52:26 -04:00
Neil Lalonde 9170166e93 Finish renaming blocked emails to screen emails 2013-08-14 16:45:30 -04:00
Neil Lalonde bb492eb8bf Add filtering to staff logs page 2013-08-09 16:59:05 -04:00
Neil Lalonde 5c8c52482a Add a way to view staff action logs in admin 2013-08-07 16:27:34 -04:00
Neil Lalonde d2fb6ec53f Blocked Emails list in admin 2013-08-07 16:27:34 -04:00
Neil Lalonde 98b58150bb Dashboard calculations are done with an async job now 2013-08-02 18:32:33 -04:00
Robin Ward 6237a155e7 FIX: Linking to users on admin dashboard was broken 2013-07-23 13:35:32 -04:00
Robin Ward d8978cb4a0 FIX: Redirect on some URLs to wrong path 2013-07-23 12:15:44 -04:00
Ryan Boland f6963a05c4 fix graphical error 2013-07-18 23:26:04 -04:00
Sam 625204c8bd work in progress category UI
refactor hack from earlier
2013-07-17 14:54:21 +10:00
Sam 63cbe8dd17 fix links to site contents, fix it so the site contents page is refreshable 2013-07-17 14:15:09 +10:00
Robin Ward 4bfb546942 Removed `modelReady` hack now that the async router exists 2013-07-16 13:24:59 -04:00
Robin Ward 5eaae063f0 Discourse Macro Helpers + Minor Fix to Admin User View 2013-07-11 19:35:52 -04:00
Neil Lalonde 9b0f63627b Add blocked users count to dashboard 2013-07-08 12:44:13 -04:00
Navin c065fad546 Refactor setting originalTrustLevel to model. 2013-07-04 13:01:01 +02:00
Navin b90a79d40a Move setting originalTrustLevel from a CP to setupController 2013-07-04 09:32:12 +02:00
Robin Ward 82c21868f3 Moved JSHint into Qunit suite. It's much harder to forget about now! 2013-06-21 14:07:11 -04:00
Robin Ward cb6774a895 FIX: Impersonate was hidden when navigating to user details page in admin from list. 2013-06-13 13:47:31 -04:00
Chris Hunt d5c7e6b5f4 Add missing parentheses to moment() 2013-06-11 08:46:14 -07:00
Sam 4e01b84695 fix digest 2013-06-11 15:27:26 +10:00
Sam fa8a84f20c removed sugar.js, port functionality to moment and underscore.js
bring in latest ace from local so we don't mess up with https
2013-06-11 15:27:26 +10:00
Robin Ward 0b97ea6345 Better HTML emails, smarter email digests, new email section in admin with digest preview 2013-06-05 17:47:25 -04:00
Robin Ward 07cd87f941 FIX: Couldn't navigate to Categories list via link 2013-06-05 12:40:06 -04:00
Robin Ward a0bd51862e Upgrade Ember to RC5. Disabled a deprecation warning that I believe is in error. 2013-06-05 12:07:18 -04:00
Neil Lalonde 2259e97d42 Add a count of blocked users on the dashboard 2013-06-04 11:53:19 -04:00
Robin Ward 42248a7164 Removed many unnecessary paths that included `content.x` when just `x` would do. 2013-05-20 15:27:58 -04:00
Neil Lalonde 18634ad00d Don't cache the problems list with the rest of the dashboard data 2013-05-15 11:09:12 -04:00
Robin Ward 008b308939 Fix: comma 2013-05-14 12:49:53 -04:00
Robin Ward df2a718446 FIX: Load more user admin details, even when passed from a list 2013-05-14 12:03:46 -04:00
Sam 6b536dcde5 work in progress ... groups 2013-05-08 15:20:38 +10:00
Robin Ward bd99d5a40c Calls to Discourse.ajax no longer need `getURL` -- will be done automatically. 2013-05-07 15:16:27 -04:00
Neil Lalonde 38ed86d0c5 Add reports for IncomingLinks on admin dashboard 2013-05-01 18:12:02 -04:00
Sam 8a04cc05aa render :json appears to have changed ... this is odd ... better add some tests 2013-04-30 14:01:34 +10:00
Sam 855ba562ac api was not showing api key cause model in ember is just partial advice that is sometimes followed up 2013-04-30 13:49:01 +10:00
Neil Lalonde 06e5083950 Dashboard links to list of admins and moderators; Move a bunch of ember routes into one file: admin_users_list_routes.js 2013-04-23 12:07:58 -04:00
Neil Lalonde fe1b979c65 Admin Dashboard: click numbers in Users per Trust Level table to see a list of the users 2013-04-23 10:41:40 -04:00
Sam 4cea92c4e9 work in progress add support for groups 2013-04-19 10:34:39 +10:00
Neil Lalonde 2b5a2b5fce Add a refresh button to problems on dashboard, so you can check for problems again 2013-04-16 12:09:37 -04:00
Sam a2cca2540e some minimal site settings diags
fix issue where days_visited was totally out of sync
2013-04-05 17:47:54 +11:00
Robin Ward fa1ba6791b Work in Progress: Content Editing in Admin Section 2013-04-04 17:26:22 -04:00
Neil Lalonde d0f810dee5 Don't request list of problems from server as often if there weren't any problems 2013-03-29 16:05:29 -04:00
Neil Lalonde 25073e873f Fetch the list of problems more frequently on the admin dashboard 2013-03-29 15:48:26 -04:00
Sam c57ec611e1 basic api support 2013-03-25 18:04:46 -07:00
Neil Lalonde 158cda7628 Add moderator and admin count to dashboard 2013-03-22 17:50:34 -04:00
Neil Lalonde 1e4dd3ea0c Start detecting install problems and report them on the admin dashboard. This commit adds check for Rails.env 2013-03-20 12:00:52 -04:00
Neil Lalonde 8983df9856 Show current user count for now, not at different points in time 2013-03-15 18:09:01 -04:00
Neil Lalonde 6c4d9ecfdc Use one request to fetch dashboard report data and check version 2013-03-14 18:26:26 -04:00
Kuba Brecka 8003c63fa6 fixing admin dashboard english date parsing in other locales 2013-03-13 13:04:10 +01:00
Neil Lalonde 40c27ff3cf Add flag counts to admin dashboard 2013-03-12 14:40:59 -04:00
Neil Lalonde 4eda422cdf Add total users report; restructure dashboard reports js 2013-03-12 14:40:59 -04:00
Neil Lalonde bf37e1b995 Convert github commits widget to ember 2013-03-11 15:27:06 -04:00
Neil Lalonde 8927432a93 Add stats to the admin dashboard 2013-03-09 15:34:27 -05:00
Robin Ward dc8e1196fd Code to support EmberJS + Discourse Tutorial feature: Admin Reports 2013-02-27 22:40:36 -05:00
Robin Ward 1caf1e6b45 Clean up discourse.js 2013-02-26 15:20:06 -05:00
Gosha Arinich cafc75b238 remove trailing whitespaces ❤️ 2013-02-26 07:31:35 +03:00
Robin Ward e461c84253 Clean up JS, add YUIDoc support, automatically create IIFE via asset pipeline 2013-02-25 17:16:57 -05:00
Neil Lalonde 0321643636 Dashboard JS checks version every 12 hours 2013-02-25 16:21:52 -05:00
Robin Ward 45ab3ab892 JS refactoring that fixes presence errors in earlier reverted commit. 2013-02-22 11:00:47 -05:00
Sam Saffron 2b5be29d3c Revert "Remove old unused code."
This reverts commit 6a617348e5.
2013-02-22 10:57:11 +11:00
Robin Ward 6a617348e5 Remove old unused code. 2013-02-21 16:17:56 -05:00
Robin Ward c8a908e81a Remove some useless views 2013-02-21 15:55:58 -05:00
Robin Ward c1b5803486 Cleaned up admin JS, added YUIDoc headers to all admin classes. 2013-02-21 14:12:09 -05:00
Neil Lalonde 560411eece Add site_setting to disable version checks 2013-02-21 10:19:17 -05:00
Robin Ward f661fa609e Convert all CoffeeScript to Javascript. See:
http://meta.discourse.org/t/is-it-better-for-discourse-to-use-javascript-or-coffeescript/3153
2013-02-20 19:01:13 -05:00
Neil Lalonde c0371ff427 Add version checking that shows on the admin dashboard 2013-02-19 15:20:49 -05: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