Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.2.0 #112

Merged
merged 4 commits into from
Aug 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Performing a systematic literature review is a labor-intensive task that require
The project is currently running on the following versions:

* Python 3.9
* Django 3.2
* Django 4.1
* PostgreSQL 12
* Bootstrap 3.4
* jQuery 3.6
Expand Down
2 changes: 1 addition & 1 deletion parsifal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from parsifal.utils.version import get_version

VERSION = (2, 1, 1, "final", 0)
VERSION = (2, 2, 0, "final", 0)

__version__ = get_version(VERSION)
8 changes: 3 additions & 5 deletions parsifal/apps/invites/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_context_data(self, **kwargs):
return super().get_context_data(**kwargs)


class InviteDeleteView(LoginRequiredMixin, MainAuthorRequiredMixin, ReviewMixin, DeleteView):
class InviteDeleteView(LoginRequiredMixin, MainAuthorRequiredMixin, ReviewMixin, SuccessMessageMixin, DeleteView):
model = Invite
pk_url_kwarg = "invite_id"
context_object_name = "invite"
Expand All @@ -47,10 +47,8 @@ def get_queryset(self):
def get_success_url(self):
return reverse("invites:manage_access", args=(self.review.author.username, self.review.name))

def delete(self, request, *args, **kwargs):
response = super().delete(request, *args, **kwargs)
messages.success(request, _("The invitation was removed with success."))
return response
def get_success_message(self, cleaned_data):
return _("The invitation was removed with success.")


class InviteDetailView(DetailView):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,13 @@ $(function () {
$(this).closest("tr").remove();
});
break;
case "unclassify":
$(".source-articles table tbody input[type=checkbox]:checked").each(function () {
var row = $(this).closest("tr");
$(row).attr("article-status", "U");
$("span", row).replaceWith("<span class='label label-default'>Unclassified</span>");
});
break;
case "accept":
$(".source-articles table tbody input[type=checkbox]:checked").each(function () {
var row = $(this).closest("tr");
Expand All @@ -330,7 +337,7 @@ $(function () {
case "duplicated":
$(".source-articles table tbody input[type=checkbox]:checked").each(function () {
var row = $(this).closest("tr");
$(row).attr("article-status", "R");
$(row).attr("article-status", "D");
$("span", row).replaceWith("<span class='label label-warning'>Duplicated</span>");
});
break;
Expand Down Expand Up @@ -360,6 +367,9 @@ $(function () {
case "remove":
multiple_articles_actions(article_ids, action);
break;
case "unclassify":
multiple_articles_actions(article_ids, action);
break;
case "accept":
multiple_articles_actions(article_ids, action);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<select class="select-action form-control" style="width: 200px; display: inline-block;">
<option value="">Select...</option>
<option value="remove">Remove selected</option>
<option value="unclassify">Mark as unclassified</option>
<option value="accept">Mark as accepted</option>
<option value="reject">Mark as rejected</option>
<option value="duplicated">Mark as duplicated</option>
Expand Down
5 changes: 5 additions & 0 deletions parsifal/apps/reviews/conducting/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
views.multiple_articles_action_remove,
name="multiple_articles_action_remove",
),
path(
"multiple_articles_action/unclassify/",
views.multiple_articles_action_unclassify,
name="multiple_articles_action_unclassify",
),
path(
"multiple_articles_action/accept/",
views.multiple_articles_action_accept,
Expand Down
31 changes: 27 additions & 4 deletions parsifal/apps/reviews/conducting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,24 @@ def multiple_articles_action_remove(request):
article_ids = request.POST["article_ids"]
article_ids_list = article_ids.split("|")
if article_ids_list:
Article.objects.filter(pk__in=article_ids_list).delete()
review_id = request.POST["review-id"]
review = get_object_or_404(Review, pk=review_id)
review.article_set.filter(pk__in=article_ids_list).delete()
return HttpResponse()
except Exception:
return HttpResponseBadRequest()


@author_required
@login_required
def multiple_articles_action_unclassify(request):
try:
article_ids = request.POST["article_ids"]
article_ids_list = article_ids.split("|")
if article_ids_list:
review_id = request.POST["review-id"]
review = get_object_or_404(Review, pk=review_id)
review.article_set.filter(pk__in=article_ids_list).update(status=Article.UNCLASSIFIED)
return HttpResponse()
except Exception:
return HttpResponseBadRequest()
Expand All @@ -937,7 +954,9 @@ def multiple_articles_action_accept(request):
article_ids = request.POST["article_ids"]
article_ids_list = article_ids.split("|")
if article_ids_list:
Article.objects.filter(pk__in=article_ids_list).update(status=Article.ACCEPTED)
review_id = request.POST["review-id"]
review = get_object_or_404(Review, pk=review_id)
review.article_set.filter(pk__in=article_ids_list).update(status=Article.ACCEPTED)
return HttpResponse()
except Exception:
return HttpResponseBadRequest()
Expand All @@ -950,7 +969,9 @@ def multiple_articles_action_reject(request):
article_ids = request.POST["article_ids"]
article_ids_list = article_ids.split("|")
if article_ids_list:
Article.objects.filter(pk__in=article_ids_list).update(status=Article.REJECTED)
review_id = request.POST["review-id"]
review = get_object_or_404(Review, pk=review_id)
review.article_set.filter(pk__in=article_ids_list).update(status=Article.REJECTED)
return HttpResponse()
except Exception:
return HttpResponseBadRequest()
Expand All @@ -963,7 +984,9 @@ def multiple_articles_action_duplicated(request):
article_ids = request.POST["article_ids"]
article_ids_list = article_ids.split("|")
if article_ids_list:
Article.objects.filter(pk__in=article_ids_list).update(status=Article.DUPLICATED)
review_id = request.POST["review-id"]
review = get_object_or_404(Review, pk=review_id)
review.article_set.filter(pk__in=article_ids_list).update(status=Article.DUPLICATED)
return HttpResponse()
except Exception:
return HttpResponseBadRequest()
Expand Down
22 changes: 11 additions & 11 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
bibtexparser==1.2.0
Django==3.2.7
django-compressor==2.4.1
django-crispy-forms==1.13.0
dj-database-url==0.5.0
requests==2.26.0
Pillow==8.3.2
psycopg2-binary==2.9.1
python-decouple==3.4
bibtexparser==1.3.0
Django==4.1
django-compressor==4.1
django-crispy-forms==1.14.0
dj-database-url==1.0.0
requests==2.28.1
Pillow==9.2.0
psycopg2-binary==2.9.3
python-decouple==3.6
python-docx==0.8.11
pytz==2021.1
beautifulsoup4==4.10.0
pytz==2022.2.1
beautifulsoup4==4.11.1
xlwt==1.3.0
6 changes: 3 additions & 3 deletions requirements/local.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-r tests.txt

django-debug-toolbar==3.2.2
django-debug-toolbar==3.5.0
git+git://github.com/jazzband/django-silk.git#egg=django-silk
ipython==7.28.0
towncrier==21.3.0
ipython==8.4.0
towncrier==21.9.0
2 changes: 1 addition & 1 deletion requirements/production.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r base.txt

gunicorn==20.1.0
sentry-sdk==1.4.2
sentry-sdk==1.9.4
12 changes: 6 additions & 6 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-r base.txt

coverage==5.5
factory-boy==3.2.0
flake8==3.9.2
isort==5.9.3
black==21.7b0
tox==3.24.4
coverage==6.4.3
factory-boy==3.2.1
flake8==5.0.4
isort==5.10.1
black==22.6.0
tox==3.25.1
Loading