Commit Graph

80 Commits

Author SHA1 Message Date
vkaracic
534b32c78c Xblock utilities tests
Tests for xblock_utils.py functions.
2015-12-29 18:46:10 +00:00
Nimisha Asthagiri
8e3f4e058d Update Course Catalog API to support filters 2015-12-23 12:31:31 -05:00
Robert Raposa
5e69224c32 Deprecate escaping in display_name_with_default
- Remove escaping in display_name_with_default
- Move escaped version to deprecated display_name_with_default_escaped
- Does not include any other changes to remove double-escaping

Thanks to agaylard who initiated this work:
https://github.com/edx/edx-platform/pull/10756

TNL-3425
2015-12-22 11:52:04 -05:00
Usman Khalid
5e972b2a66 Merge pull request #11022 from edx/bookmarking
Bookmarking
2015-12-22 18:25:48 +05:00
David Ormsbee
88c7d58313 Modify CourseOverviews to create course image thumbnails.
Course teams occasionally upload very large files as their course
image. Before this commit, those images would be used directly in
the student's dashboard, sometimes leading to MBs worth of image
data on that page. With this commit, we now auto-generate small
and large thumbnails of configurable size. The Student Dashboard
and Course About pages will make use of this new functionality
(CourseOverview.image_urls), but the behavior of
CourseOverview.course_image_url will not change.

Note that the thumbnails are still created in the contentstore,
and sit alongside their originals.

What's included:

1. Multiple sizes, currently starting with "raw", "small", and
   "large". This falls back to the current behavior automatically in
   the case where thumbnails don't exist or this feature has been
   disabled in configuration.

2. Django admin based configuration for image sizes and whether
   to enable the functionality at all. Note that to regenerate
   images, you'd need to wipe the CourseOverviewImageSet model
   rows -- it doesn't do that automatically. This is partly because
   it's a very rare operation, and partly because I'm not entirely
   sure what the longer term invalidation strategy should be in a
   world where we might potentially have multiple themes. The
   flexible configuration was intended to allow better customization
   and theming.

3. The Course About pages also use the new thumbnail functionality,
   as an example of "large". This is in addition to the "small"
   used on the student dashboard.

Things I'm punting on for now (followup PRs welcome!):

1. Bringing the thumbnails to course discovery. A quick attempt
   to do so showed that it wasn't getting properly invalidated
   and updated when publishes happen (so the old image still showed
   up). It probably has something to do with when we do the
   re-indexing because it stores this data in elasticsearch, but
   I'm not going to chase it down right now.

2. Center-cropping. While this is a nice-to-have feature, the
   behavior in this PR is no worse than what already exists in
   master in terms of image distortion (letting the browser handle
   it).

3. Automated invalidation of the images when a new config is
   created.
2015-12-18 20:03:09 -05:00
Matjaz Gregoric
585c64f282 Enable staff debug everywhere except on detached blocks.
Staff markup was enabled on all block types in
https://github.com/edx/edx-platform/pull/10903

This works well inside the courseware, but it breaks layout of the course about
page, which is also an XModule, see:
https://github.com/edx/edx-platform/pull/10903#issuecomment-164266342

This commit disables staff markup/staff debug on all blocks except
blocks tagged with 'detached'. Detached blocks include course about
and info pages, static tabs.
2015-12-18 08:19:57 +01:00
Usman Khalid
8bdc097293 Fixes after rebase to Django 1.8 2015-12-17 22:10:21 +05:00
wajeeha-khalid
588833ff43 MA-1051: DiscussionAPI - Removed http errors from api.py and refactored to more specific errors 2015-12-16 21:23:51 +05:00
Clinton Blackburn
2f131fafed Merge pull request #10961 from edx/release
Merging patch/2015-12-11
2015-12-11 15:16:52 -05:00
Clinton Blackburn
dfadb28343 Fixed Permissions Bug
The permissions class now supports non-GET requests.

ECOM-2893
2015-12-11 13:02:05 -05:00
muhammad-ammar
c0479fb79a use users anonymous id for subject field in JWT 2015-12-10 11:56:50 +05:00
Nimisha Asthagiri
7429a32ba8 Merge pull request #10799 from edx/mobile/course-api-fields-MA-1661
Update Course About API to include effort and video (MA-1661)
2015-12-04 17:17:21 -05:00
Nimisha Asthagiri
d170c92f3b Refactor course_image_url 2015-12-04 11:25:40 -05:00
Clinton Blackburn
c90880719f Corrected permission class and test
- The permission now checks the correct request attribute (GET instead of data).
- The Credit API view test has been updated to check for the positive access instead of just denial.

 ECOM-3096
2015-12-04 10:18:53 -05:00
J. Cliff Dyer
f53de2c04a Paginate results of Courses API list endpoint
* Catalog results are now paginated
* Implements the new namespaced pagination described at
  https://openedx.atlassian.net/wiki/pages/viewpage.action?pageId=47481813
* API level code returns pythonic business objects
* View layer performs serialize at the view layer
* Convert views to use DRF generic views
* Removes an unintentional authentication decorator that caused
  the detail endpoint to return a 401 for anonymous users

MA-1724
2015-12-01 08:13:18 -05:00
Jim Abramson
8f4c2264a1 Merge pull request #10701 from edx/renzo/studio-programs-tab
Add Programs tab to Studio
2015-11-25 16:37:34 -05:00
Renzo Lucioni
70d57327eb Add Programs tab to Studio
Extends the Programs ConfigurationModel, cleans up Programs-related utilities and corresponding tests, and corrects caching. Uses the Programs API to list programs within Studio. ECOM-2769.
2015-11-25 14:56:50 -05:00
Clinton Blackburn
92153752c0 Rewrote Credit API
- API built atop Django REST Framework
- Added support for OAuth 2.0 and session authentication
- Added permissions around eligibility data

ECOM-2609
2015-11-24 22:06:54 -05:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
Usman Khalid
6cb62f2697 Rebase upgrade Django to v1.8.5
Please note that this is a squshed commit and the work of:
Symbolist, macdiesel, nedbat, doctoryes, muzaffaryousaf and muhammad-ammar
2015-11-10 15:00:19 -05:00
Nimisha Asthagiri
00e9237153 Course Blocks API 2015-11-05 22:30:44 +00:00
Nimisha Asthagiri
a40d2b65d2 Course Blocks App MA-1556 2015-11-05 14:41:40 -05:00
Robert Raposa
3682fac832 Add json escaping to Studio
Make escaping for json simpler and more consistent in Mako templates
- add escape_json_dumps to escape and json.dumps
- add escape_js_str to escape javascript string
- refactor Studio to use escape_json_dumps in Mako templates

TNL-2646: Escape json.dumps
2015-11-04 13:34:42 -05:00
Renzo Lucioni
2f0e663581 Use ugettext_noop instead of lambdas assigned to the underscore
Replaces instances of an old hack with the more clear ugettext_noop.
2015-11-04 09:17:18 -05:00
Robert Raposa
44bd65293a Escape json for Studio advanced settings
- Resolve SEC-27 by escaping course name in advanced settings
- Add escape_json_dumps to simplify escaping json in Mako templates

SEC-27: XSS/JS Error in Advanced Settings with invalid course name
2015-11-03 10:38:39 -05:00
Nimisha Asthagiri
7f325aee73 Block Cache framework. 2015-10-30 14:24:57 -04:00
Nimisha Asthagiri
22c2e7e54c Reusable Graph Traversals 2015-10-27 10:54:28 -04:00
Ned Batchelder
322ca34b20 Remove pylint pragmas from "class Meta"
Also remove useless docstrings where they were added to keep pylint
quiet.
2015-10-21 07:37:00 -04:00
J. Cliff Dyer
257dcc54f2 Accept raw image data as Content-type: image/*
MA-1416

Created a TypedFileUploadParser that validates the mimetype and then
takes the content and puts it on request.FILES['file'].  Subclasses the
existing FileUploadParser.

Use namedtuple in IMAGE_TYPES as per style guide:
https://github.com/edx/edx-platform/wiki/Python-Guidelines#classes-vs-dictionaries
2015-10-20 13:23:28 -04:00
Matt Drayer
1eab25f292 mattdrayer/increment-edx-lint: Bump to v0.2.9 and address pylint/pep8 violations
* Fix paver violations to stablize edx-lint update
* Parens, Line2Long
* Fix missing docstrings
* Fix PEP8 issues
* Address PR feedback (thanks @nedbat!)
2015-10-19 10:11:59 -04:00
muzaffaryousaf
b2ebb680de DRF uses query_params instead of QUERY_PARAMS.
TNL-3442
2015-09-30 20:45:40 +05:00
Ned Batchelder
8ec2de9359 DRF 3.1 now uses request.data instead of request.DATA 2015-09-29 15:25:55 -04:00
Brian Beggs
144c347387 Fixes for rebasing of the release on 2015-09-23 2015-09-25 12:40:58 -04:00
Will Daly
8555630df7 Upgrade djangorestframework to v3.1
* Upgrade edx-submissions
* Upgrade edx-ora2
* Upgrade edx-val
* Upgrade edx-proctoring
* Update all edx-platform code that depends on DRF, including:
  - auth_exchange
  - cors_csrf
  - embargo
  - enrollment
  - util
  - commerce
  - course_structure
  - discussion_api
  - mobile_api
  - notifier_api
  - teams
  - credit
  - profile_images
  - user_api
  - lib/api (OAuth2 and pagination)
2015-09-25 12:40:57 -04:00
Peter Fogg
33f559b04a Remove membership field from teams when serializing memberships.
TNL-3281
2015-09-15 13:05:10 -04:00
Peter Fogg
48f72612c3 Prevent over-expansion of team memberships.
TNL-3202
2015-09-11 12:55:39 -04:00
Bill DeRusha
81ced1c964 Remove disable pylint for paginator error and fix syntax 2015-08-25 10:08:16 -04:00
Bill DeRusha
973314de7b Add basic elasticsearch search for teams
TNL-3014

Add tests for search

Add text_search to TeamsListView

Add reindex command line tool for course teams

Add Search Pagination and update comments

Move paginate_search_results to common library
2015-08-24 09:22:06 -04:00
Peter Fogg
2f7fa6fd8b Enforce discussions permissions in teams UI.
Adds a read-only mode to the discussion module which disables any
controls for updating the discussion (votes, follows, replies,
etc). This mode is enabled for users who are not a member of the team,
and are also not moderators, admins, or community TAs.
2015-08-06 11:15:56 -04:00
Ned Batchelder
f54fe787c6 Remove needless 'disable=no-member' pragmas 2015-08-03 17:47:44 -04:00
tlindaliu
3b483d14bc MA-851: Add access response information into view_course_access 2015-07-31 09:30:40 -04:00
Andy Armstrong
7b5f9b8009 Implement RequireJS Optimizer in the LMS
TNL-2487
2015-07-20 13:59:54 -04:00
Adam Palay
2c6264077d address quality violation 2015-07-13 15:09:53 -04:00
Adam Palay
213dc70d1e update to course import (TNL-2270) 2015-07-13 14:17:26 -04:00
Ben McMorran
351e491c82 Add generic paging framework
Authors:
  - Daniel Friedman
  - Ben McMorran
  - Peter Fogg

TNL-1892
2015-07-06 08:45:03 -04:00
Usman Khalid
fe54b085c6 Added ability to disable xblock types in LMS.
TNL-2305
2015-07-03 20:58:40 +05:00
Nickersoft
e184c78c0a XCOM-416: Embargo restrictions are now enforced during logistration 2015-06-23 14:17:43 -04:00
Greg Price
174b4d943a Handle whitespace-only content in discussion API
The comments service rejects whitespace-only content for certain
strings, so the discussion API should also reject such content.
2015-06-19 12:01:34 -04:00
Nimisha Asthagiri
65e330e8b5 Make RequestCache reusable 2015-06-12 09:27:16 -04:00
Clinton Blackburn
2da42d5efa Removed IsAuthenticatedOrDebug
IsAuthenticatedOrDebug hides potential issues with API client code that is run in local environments and later deployed to production where authentication fails.

XCOM-193
2015-06-10 18:55:27 -04:00