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

Initialize setting review / proposal stage page #782

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1497d90
Initialize setting review / proposal stage page
alice6373 May 21, 2020
f3095e6
Alice fixup with love
alice6373 Jul 18, 2020
8bb98fb
Merge branch 'master' into page-for-setting-review-stage
alice6373 Aug 30, 2020
57d036c
Clear gui
alice6373 Sep 27, 2020
e3fcda2
Merge branch 'master' into page-for-setting-review-stage
alice6373 Sep 27, 2020
2881ea9
Default timezone sring handling
alice6373 Oct 2, 2020
db4fea7
rename to Review Stages
alice6373 Oct 4, 2020
6ef2f5b
Generating timezone dynamically with pytz
alice6373 Oct 12, 2020
211bf3c
Delete comment in review_stages.html
alice6373 Oct 12, 2020
048c941
Delete print() in view.py
alice6373 Oct 12, 2020
76c39dc
Merge branch 'master' into page-for-setting-review-stage
alice6373 Oct 12, 2020
fdd09ab
Update GUI
alice6373 Oct 13, 2020
8ade9c1
return value add reviews_state()
alice6373 Oct 26, 2020
cfb5fa1
Rename First Round Review_2 to First Round Review
alice6373 Oct 26, 2020
afaf6d5
Change the typography to vertical
alice6373 Dec 10, 2020
88ee598
Rename First Round Review_1 to Locked (proposal editing and reviewing…
alice6373 Dec 10, 2020
9ef909e
Enhance user friendliness : accepting pycontw-2020.proposals.disable.…
alice6373 Dec 15, 2020
d579e69
Enhance user friendliness : Try more django date format (DATETIME_INP…
alice6373 Dec 15, 2020
2fb312d
Enhance user friendliness : display current review stage setting
alice6373 Dec 22, 2020
500b9db
Enhance user friendliness : automatically load the current settings t…
alice6373 Dec 27, 2020
ced5b07
Move url.py & view.py to more precise folder
alice6373 Dec 27, 2020
928e2d1
Fix problem that current settings will not be loaded after submitting…
alice6373 Dec 28, 2020
32f30a1
Merge branch 'master' into page-for-setting-review-stage
alice6373 Jan 16, 2021
c4ef31e
proposals.disabled.after not be required
alice6373 Jan 16, 2021
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
18 changes: 14 additions & 4 deletions src/static/js/reviews/review_stages.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ $('.hotkey').click(function () {
if ($(this).val() == "Call for Proposals") {
Call_for_Proposals();
}
else if ($(this).val() == "First Round Review") {
First_Round_Review()
else if ($(this).val() == "First Round Review_1") {
First_Round_Review_1()
}
else if ($(this).val() == "First Round Review_2") {
First_Round_Review_2()
}
else if ($(this).val() == "Modification Stage") {
Modification_Stage()
Expand All @@ -33,16 +36,23 @@ $('.hotkey').click(function () {
proposals_creatable.checked = true;
proposals_editable.checked = true;
proposals_withdrawable.checked = true;
reviews_stage.value = "0";
reviews_stage.value = 0;
reviews_visible_to_submitters.checked = false;
}
function First_Round_Review() {
function First_Round_Review_1() {
proposals_creatable.checked = false;
proposals_editable.checked = false;
proposals_withdrawable.checked = false;
reviews_stage.value = "0";
reviews_visible_to_submitters.checked = false;
}
function First_Round_Review_2() {
proposals_creatable.checked = false;
proposals_editable.checked = false;
proposals_withdrawable.checked = false;
reviews_stage.value = "1";
reviews_visible_to_submitters.checked = false;
}
function Modification_Stage() {
proposals_creatable.checked = false;
proposals_editable.checked = true;
Expand Down
39 changes: 9 additions & 30 deletions src/templates/default/reviews/review_stages.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,21 @@ <h3 class="dashboard-header">
<div class="dashboard-body">
<!--Hot Key Button-->
<div class="col-md-3">
<button class="btn btn-natural-noborder hotkey" value="Call for Proposals">
Call for Proposals
</button>
<button class="btn btn-natural-noborder hotkey" value="First Round Review">
First Round Review
</button>
<button class="btn btn-natural-noborder hotkey" value="Modification Stage">
Modification Stage
</button>
<button class="btn btn-natural-noborder hotkey" value="Second Round Review">
Second Round Review
</button>
<button class="btn btn-natural-noborder hotkey" value="Internal Decision">
Internal Decision
</button>
<button class="btn btn-natural-noborder hotkey" value="Announcement of Acceptance">
Announcement of Acceptance
</button>
{% for rs in review_stages_list %}
<button class="btn btn-natural-noborder hotkey" value="{{ rs }}">{{ rs }}</button>
{% endfor %}
</div>
<!--Review Change Setting-->
<div class="col-md-9">
<form action="{% url 'review_stages' %}" method="post">
{% csrf_token %}
<div class="panel panel-default">
<div class="panel-heading">{% trans 'Change Review' %}</div>
<div class="panel-heading">{% trans 'Review Stages' %}
<div class="material-switch pull-right">
<a href="https://github.com/pycontw/pycon.tw/blob/master/src/reviews/README.md">See Proposal Review System
Documentation</a>
</div>
</div>
<ul class="list-group">
<li class="panel-title list-group-item">
{{ ".proposals.creatable"|configuration_switch }}
Expand Down Expand Up @@ -102,12 +92,6 @@ <h3 class="dashboard-header">
</select>
</div>
</li>
<li class="panel-title list-group-item">
timezone comment (non-required)
<div class="input-customized-size pull-right">
<input name="timezone_comment" type="text" placeholder="AoE timezone: -1200">
</div>
</li>
</ul>
</div>

Expand All @@ -121,14 +105,9 @@ <h3 class="dashboard-header">
</div>
</div>

<script>
var default_tz = '{{default_tz}}'
</script>
{% endblock main-content %}

{% block extra_js %}
<!--{{ block.super }}
<script src="{% static 'js/vendors/simplemde.min.js' %}"></script>-->
{% compress js %}
<script src="{% static 'js/reviews/review_stages.js' %}"></script>
{% endcompress %}
Expand Down
21 changes: 17 additions & 4 deletions src/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ def get_context_data(self, **kwargs):
return context

def review_stages(request):

review_stages_list = [
'Call for Proposals', 'First Round Review_1',
'First Round Review_2', 'Modification Stage',
tomatoprinx marked this conversation as resolved.
Show resolved Hide resolved
'Second Round Review', 'Internal Decision',
'Announcement of Acceptance'
]

if request.method == 'POST':

Expand All @@ -209,26 +216,32 @@ def review_stages(request):
loc_dt = tz_selectd.localize(date_time_obj).strftime(fmt)

CONFERENCE_DEFAULT_SLUG = settings.CONFERENCE_DEFAULT_SLUG
review_stages_list = [
review_stages_var = [
'proposals.creatable', 'proposals.editable',
'proposals.withdrawable', 'reviews.visible.to.submitters',
'reviews.stage', 'proposals.disable.after'
]

for tag in review_stages_list:
for tag in review_stages_var:
key = CONFERENCE_DEFAULT_SLUG + '.' + tag
if(tag == 'proposals.disable.after'):
value = loc_dt
elif(tag == 'reviews.stage'):
value = int(request.POST[tag])
else:
value = request.POST[tag]
reg[key] = value

messages.info(
request,
'This setting has been changed successfully and the review stage will expire at '
+ str(loc_dt) + ' (' + request.POST.get('review_timezone') + ')')

return render(request, 'reviews/review_stages.html',{'timezones': pytz.common_timezones})
return render(
request, 'reviews/review_stages.html', {
'timezones': pytz.common_timezones,
'review_stages_list': review_stages_list
})


login = auth_views.LoginView.as_view(authentication_form=AuthenticationForm)
Expand Down