Skip to content

Commit

Permalink
Merge pull request #2 from open-craft/fox/BB-7351-admin-views
Browse files Browse the repository at this point in the history
[BB-7351] feat: admin views.
  • Loading branch information
Kelketek authored May 10, 2023
2 parents f977c05 + d26bf0e commit 1007357
Show file tree
Hide file tree
Showing 37 changed files with 1,815 additions and 106 deletions.
8 changes: 8 additions & 0 deletions .annotation_safe_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ auth.User:
".. pii_retirement": "consumer_api"
contenttypes.ContentType:
".. no_pii:": "This model has no PII"
organizations.HistoricalOrganization:
".. no_pii:": "This model has no PII"
organizations.HistoricalOrganizationCourse:
".. no_pii:": "This model has no PII"
organizations.Organization:
".. no_pii:": "This model has no PII"
organizations.OrganizationCourse:
".. no_pii:": "This model has no PII"
sessions.Session:
".. no_pii:": "This model has no PII"
social_django.Association:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [quality, pii_check, django32, django40]
toxenv: [quality, pii_check, package]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pip-log.txt
.tox
coverage.xml
htmlcov/

pii_report/


# The Silver Searcher
Expand Down
15 changes: 12 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,21 @@ Change Log
Unreleased
**********

* Initial copy-paste circuit code.
*

[0.1.0] - 2023-04-03
************************************************
[0.2.0] - 2023-05-10
********************

Added
=====

* Admin views for creating new section-based courses.
* First release on PyPI.

[0.1.0] - 2023-04-03
********************

Added
=====

* Initial section-derived course creation code.
111 changes: 73 additions & 38 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,63 +1,32 @@
section-to-course
#############################
#################

|pypi-badge| |ci-badge| |codecov-badge| |pyversions-badge|
|license-badge| |status-badge|

Purpose
*******

Allows course authors to factor sections from Open edX courses into their own new course.


License
*******

The code in this repository is licensed under the AGPL 3.0.

Please see `LICENSE.txt <LICENSE.txt>`_ for details.

Contributing
************

Contributions are very welcome.

This project is currently accepting all types of contributions, bug fixes,
security fixes, maintenance work, or new features. However, please make sure
to have a discussion about your new feature idea with the maintainers prior to
beginning development to maximize the chances of your change being accepted.
You can start a conversation by creating a new issue on this repo summarizing
your idea.

Reporting Security Issues
*************************

Please do not report security issues in public. Please email [email protected].

.. |license-badge| image:: https://img.shields.io/github/license/open-craft/section-to-course.svg
:target: https://github.com/open-craft/section-to-course/blob/main/LICENSE.txt
:alt: License

.. |status-badge| image:: https://img.shields.io/badge/Status-Experimental-yellow


Installation
************

This application is not yet available on PyPI, so you will need to install it from source. You can install it from source on the current master branch by adding:
This application is not yet available on PyPI, so you will need to install it from source. You can install it from source on the current ``main`` branch by adding:

.. code-block:: bash
git+https://github.com/open-craft/section-to-course.git
...to the ``requirements/private.txt`` file of your Open edX installation, and then run ``pip install -r requirements/private.txt``. ``section_to_course`` is currently only known to work with OpenCraft's Nutmeg fork of Open edX, so you will need to use that fork. We expect it will work with newer upstream versions within a few weeks.
...to the ``requirements/private.txt`` file of your Open edX installation, and then run ``pip install -r requirements/private.txt``. If you're developing locally without the platform, create a virtualenv using the latest Python 3.8 release, and then run ``pip install -e .`` from the root of this repository.

Development
-----------
===========

If developing on this application, you will need to install it as an editable package. To do so, follow these steps:

1. Set up the Open edX `devstack <https://github.com/openedx/devstack>`_ using the `nutmeg.master` version as explained in `this guide <https://edx.readthedocs.io/projects/open-edx-devstack/en/latest/developing_on_named_release_branches.html>`_.
1. Set up the Open edX `devstack <https://github.com/openedx/devstack>`_ using the ``nutmeg.master`` version as explained in `this guide <https://edx.readthedocs.io/projects/open-edx-devstack/en/latest/developing_on_named_release_branches.html>`_.

Then, in the ``edx-platform`` repository root, run:

Expand All @@ -73,10 +42,76 @@ Then, in the ``edx-platform`` repository root, run:
git clone [email protected]:open-craft/section-to-course.git
Then, in your `devstack` directory, run:
Then, in your ``devstack`` directory, run:

.. code-block:: bash
make dev.shell.studio
cd /edx/src/section-to-course
pip install -e .
Usage
*****

Once installed, the plugin should automatically register itself within Django. Be sure to run database migrations.

The admin views are in the Django admin, under the "Section to Course" section. From there, you can create a new section to course link, which will create a new course with the same content as the section you selected. You can also view the list of existing section to course links, refresh them, and delete them.

Refreshing a Course
===================

There are two ways to refresh a course:

1. Use the admin action from the changelist view. This will allow you to refresh several courses at once.
2. Use the refresh button on the detail view for a single course, shown here:

.. image:: assets/admin_screenshot.png
:alt: A screenshot of the admin page showing the refresh button in the upper left

License
*******

The code in this repository is licensed under the AGPL 3.0.

Please see `LICENSE.txt <LICENSE.txt>`_ for details.

Contributing
************

Contributions are very welcome.

This project is currently accepting all types of contributions, bug fixes,
security fixes, maintenance work, or new features. However, please make sure
to have a discussion about your new feature idea with the maintainers prior to
beginning development to maximize the chances of your change being accepted.
You can start a conversation by creating a new issue on this repo summarizing
your idea.

Reporting Security Issues
*************************

Please do not report security issues in public. Please email [email protected].

.. |pypi-badge| image:: https://img.shields.io/pypi/v/section-to-course.svg
:target: https://pypi.python.org/pypi/section-to-course/
:alt: PyPI

.. |ci-badge| image:: https://github.com/open-craft/section-to-course/workflows/Python%20CI/badge.svg?branch=main
:target: https://github.com/open-craft/section-to-course/actions
:alt: CI

.. |codecov-badge| image:: https://codecov.io/github/open-craft/section-to-course/coverage.svg?branch=main
:target: https://codecov.io/github/open-craft/section-to-course?branch=main
:alt: Codecov

.. |pyversions-badge| image:: https://img.shields.io/pypi/pyversions/section-to-course.svg
:target: https://pypi.python.org/pypi/section-to-course/
:alt: Supported Python versions

.. |license-badge| image:: https://img.shields.io/github/license/open-craft/section-to-course.svg
:target: https://github.com/open-craft/section-to-course/blob/main/LICENSE.txt
:alt: License

.. |status-badge| image:: https://img.shields.io/badge/Status-Experimental-yellow
:alt: Project status
Binary file added assets/admin_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Core requirements for using this application
-c constraints.txt
edx-opaque-keys>=2.3.0
django>=3.2.15
django-model-utils>=4.2.0
djangorestframework
django
django-model-utils
django-object-actions
edx-django-utils
edx-opaque-keys
edx-organizations
98 changes: 95 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,114 @@
#
asgiref==3.6.0
# via django
django==3.2.18
certifi==2023.5.7
# via requests
cffi==1.15.1
# via
# cryptography
# pynacl
charset-normalizer==3.1.0
# via requests
click==8.1.3
# via edx-django-utils
cryptography==40.0.2
# via pyjwt
django==3.2.19
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
# django-crum
# django-model-utils
# djangorestframework
# drf-jwt
# edx-django-utils
# edx-drf-extensions
# edx-organizations
django-crum==0.7.9
# via edx-django-utils
django-model-utils==4.3.1
# via
# -r requirements/base.in
# edx-organizations
django-object-actions==4.1.0
# via -r requirements/base.in
django-simple-history==3.0.0
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# edx-organizations
django-waffle==3.0.0
# via
# edx-django-utils
# edx-drf-extensions
djangorestframework==3.14.0
# via
# -r requirements/base.in
# drf-jwt
# edx-drf-extensions
# edx-organizations
drf-jwt==1.19.2
# via edx-drf-extensions
edx-django-utils==5.4.0
# via
# -r requirements/base.in
# edx-drf-extensions
edx-drf-extensions==8.7.0
# via edx-organizations
edx-opaque-keys==2.3.0
# via
# -r requirements/base.in
# edx-drf-extensions
# edx-organizations
edx-organizations==6.11.1
# via -r requirements/base.in
future==0.18.3
# via pyjwkest
idna==3.4
# via requests
newrelic==8.8.0
# via edx-django-utils
pbr==5.11.1
# via stevedore
pillow==9.5.0
# via edx-organizations
psutil==5.9.5
# via edx-django-utils
pycparser==2.21
# via cffi
pycryptodomex==3.17
# via pyjwkest
pyjwkest==1.4.2
# via edx-drf-extensions
pyjwt[crypto]==2.7.0
# via
# drf-jwt
# edx-drf-extensions
pymongo==3.13.0
# via edx-opaque-keys
pynacl==1.5.0
# via edx-django-utils
python-dateutil==2.8.2
# via edx-drf-extensions
pytz==2023.3
# via django
# via
# django
# djangorestframework
requests==2.30.0
# via
# edx-drf-extensions
# pyjwkest
semantic-version==2.10.0
# via edx-drf-extensions
six==1.16.0
# via
# edx-drf-extensions
# pyjwkest
# python-dateutil
sqlparse==0.4.4
# via django
stevedore==5.0.0
# via edx-opaque-keys
# via
# edx-django-utils
# edx-opaque-keys
urllib3==2.0.2
# via requests
1 change: 1 addition & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@

# Common constraints for edx repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt

Loading

0 comments on commit 1007357

Please sign in to comment.