diff --git a/docs/codebase/installation/installation.rst b/docs/codebase/installation/installation.rst index 3cc3d467f0da3be9f5eba3728c1ccef6d90d9518..0a1b1e4253db36f89d1d61200120c6bace61cf9d 100644 --- a/docs/codebase/installation/installation.rst +++ b/docs/codebase/installation/installation.rst @@ -1,37 +1,72 @@ -************ -Dependencies -************ +##################### +Installing SciPost +##################### -SciPost runs on: +This guide will walk you through a basic installation of the +SciPost platform. -* Python 3.5 -* Django 1.11 -* PostgreSQL 9.4 or higher. +******** +Database +******** -Further Python dependencies are listed in ``requirements.txt``. +SciPost runs on the `Postgresql <https://www.postgresql.org/>`_ relational database. -Frontend dependencies are managed by `NPM <https://www.npmjs.com/>`__ in ``package.json``. +Make sure that PostgreSQL 9.4 (or higher) is installed (see `instructions <https://wiki.postgresql.org/wiki/Detailed_installation_guides>`_) and running on your system. +You will need to create a database user. You can find many guides online on how to do this. -******** -Database -******** +* Postgres creates a user `postgres` by default. Start a shell session for this user:: + + $ sudo su - postgres + +* Log into a postgres session:: + + $ psql + +* Create the database (let's assume from now on that you'll call your + database `scipost_database`):: + + CREATE DATABASE scipost_database; + +* Create the database user which SciPost will use to connect and interact + with the database:: + + CREATE USER scipost_db_user WITH PASSWORD [password]; + +* Give needed privileges to the user:: + + GRANT ALL PRIVILEGES ON DATABASE scipost_database TO scipost_db_user; + +* Quit postgres session:: + + \q + +* Go back to your regular user's shell session:: + + $ exit + +You will need the database username and password in your basic Django settings below. -Make sure that PostgreSQL is installed and running and that a database -with user is set up. A good guide how to do this can be found -`here <https://djangogirls.gitbooks.io/django-girls-tutorial-extensions/content/optional_postgresql_installation/>`__ -(NOTE: stop before the ‘Update settings’ part). ************** Python version ************** -Make sure you’re using Python 3.5. You are strongly encouraged to use a +Python comes in multiple versions, which in principle can lead to lots of +incompatibility problems on your system. Thankfully there exists a nifty +version management system, `pyenv <https://github.com/pyenv/pyenv>`_. +This allows you to hold multiple versions on your system, and determine +locally/globally which ones should be used. + +SciPost runs on Python 3.5. You are strongly encouraged to use a `virtual environment <https://docs.python.org/3.5/library/venv.html>`__:: $ pyvenv scipostenv $ source scipostenv/bin/activate +(N.B.: this is Python 3.5-specific; for 3.6 and above, pyvenv has been deprecated +in favour of using `python -m venv [path to new venv]`). + Now install dependencies:: (scipostenv) $ pip install -r requirements.txt @@ -55,14 +90,18 @@ In this project, many settings are not sensitive and are thus tracked using Git. Some settings are however secret. These settings may be saved into the ``secrets.json`` file in the root of the project (you should of course ensure that this file is excluded from the Git repository). The minimum -required structure is as follows (you'll have to generate your own ``SECRET_KEY``):: - - { - "SECRET_KEY": "<key>", - "DB_NAME": "", - "DB_USER": "", - "DB_PWD": "" - } +required structure is as follows +(you'll have to generate your own ``SECRET_KEY``; the database name, +user and password are the ones you set up in Database above; the +``CELERY_BROKER_URL`` can be left blank for now):: + + { + "SECRET_KEY": "<key>", + "DB_NAME": "", + "DB_USER": "", + "DB_PWD": "", + "CELERY_BROKER_URL": "" + } The settings file itself is saved into ``SciPost_v1/settings/local_<name>.py``. Be sure to *wildcard import* diff --git a/forums/templates/forums/post_card.html b/forums/templates/forums/post_card.html index da9085602e422ba7c6e1a63692d4015fcf3ac369..e1bd70a9147dc82b09f25249f2dfd4a82eecf189 100644 --- a/forums/templates/forums/post_card.html +++ b/forums/templates/forums/post_card.html @@ -46,22 +46,22 @@ </div> <div> <form action="{% url 'forums:motion_vote' slug=forum.slug motion_id=post.motion.id vote='Y' %}" method="post">{% csrf_token %} - <input type="submit" class="btn btn-success" data-toggle="tooltip" data-placement="top" title="Agree" value="{{ post.motion.in_agreement.all|length }}"> + <input type="submit" class="btn btn-success" data-toggle="tooltip" data-placement="top" data-html="true" title="Agree{% if perms.forums.can_change_forum %}<ul>{% for f in post.motion.in_agreement.all %}<li>{{ f.last_name }}, {{ f.first_name }}</li>{% endfor %}</ul>{% endif %}" value="{{ post.motion.in_agreement.all|length }}"> </form> </div> <div> <form action="{% url 'forums:motion_vote' slug=forum.slug motion_id=post.motion.id vote='M' %}" method="post">{% csrf_token %} - <input type="submit" class="btn btn-warning" data-toggle="tooltip" data-placement="top" title="Doubt" value="{{ post.motion.in_doubt.all|length }}"> + <input type="submit" class="btn btn-warning" data-toggle="tooltip" data-placement="top" data-html="true" title="Doubt{% if perms.forums.can_change_forum %}<ul>{% for f in post.motion.in_doubt.all %}<li>{{ f.last_name }}, {{ f.first_name }}</li>{% endfor %}</ul>{% endif %}" value="{{ post.motion.in_doubt.all|length }}"> </form> </div> <div> <form action="{% url 'forums:motion_vote' slug=forum.slug motion_id=post.motion.id vote='N' %}" method="post">{% csrf_token %} - <input type="submit" class="btn btn-danger" data-toggle="tooltip" data-placement="top" title="Disagree" value="{{ post.motion.in_disagreement.all|length }}"> + <input type="submit" class="btn btn-danger" data-toggle="tooltip" data-placement="top" data-html="true" title="Disagree{% if perms.forums.can_change_forum %}<ul>{% for f in post.motion.in_disagreement.all %}<li>{{ f.last_name }}, {{ f.first_name }}</li>{% endfor %}</ul>{% endif %}" value="{{ post.motion.in_disagreement.all|length }}"> </form> </div> <div> <form action="{% url 'forums:motion_vote' slug=forum.slug motion_id=post.motion.id vote='A' %}" method="post">{% csrf_token %} - <input type="submit" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Abstain" value="{{ post.motion.in_abstain.all|length }}"> + <input type="submit" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" data-html="true" title="Abstain{% if perms.forums.can_change_forum %}<ul>{% for f in post.motion.in_abstain.all %}<li>{{ f.last_name }}, {{ f.first_name }}</li>{% endfor %}</ul>{% endif %}" value="{{ post.motion.in_abstain.all|length }}"> </form> </div> <div class="align-self-center px-2"> diff --git a/journals/templates/journals/manage_report_metadata.html b/journals/templates/journals/manage_report_metadata.html index 170db85f214b106395d11c9c71943666735f9a2c..174c77245e582d3228bd8f84351c2cde173f8e96 100644 --- a/journals/templates/journals/manage_report_metadata.html +++ b/journals/templates/journals/manage_report_metadata.html @@ -31,9 +31,10 @@ Only Reports needing an update are shown below. <a href="{% url 'journals:manage_report_metadata' %}?needing_update=0" method="GET">View all Reports instead</a>. </p> {% else %} - <p> - <a href="{% url 'journals:manage_report_metadata' %}?needing_update=1" method="GET">Only view Reports needing an update</a>. - </p> + <ul> + <li><a href="{% url 'journals:manage_report_metadata' %}?ready_for_deposit=1" method="GET">Only view Reports ready for an initial deposit</a></li> + <li><a href="{% url 'journals:manage_report_metadata' %}?needing_update=1" method="GET">Only view Reports needing an update</a></li> + </ul> {% endif %} <table class="table table-hover"> diff --git a/journals/views.py b/journals/views.py index fec1e8652a00fc90e87b881cd2cfd302a9f0df9d..4128495f9e535113340d7c8d60d5555edbc7312d 100644 --- a/journals/views.py +++ b/journals/views.py @@ -982,6 +982,11 @@ def manage_report_metadata(request): the metadata of Reports. """ reports = Report.objects.all() + ready_for_deposit = request.GET.get('ready_for_deposit') == '1' + if ready_for_deposit: + report_ids = [r.id for r in reports.exclude( + needs_doi=False).filter(doi_label='') if r.associated_published_doi is not None] + reports = reports.filter(id__in=report_ids, doi_label='') needing_update = request.GET.get('needing_update') == '1' if needing_update: reports = reports.filter( diff --git a/scipost/management/commands/add_groups_and_permissions.py b/scipost/management/commands/add_groups_and_permissions.py index 3398db3a2f5c29486ece2cbeed757d8c83d913a0..051aeae28dd149873fa9cae7d46cc95a94dd4c7b 100644 --- a/scipost/management/commands/add_groups_and_permissions.py +++ b/scipost/management/commands/add_groups_and_permissions.py @@ -420,7 +420,6 @@ class Command(BaseCommand): RegisteredContributors.permissions.set([ can_submit_manuscript, can_submit_comments, - can_express_opinion_on_comments, can_request_commentary_pages, can_request_thesislinks, can_referee,