SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
ca532d91
Commit
ca532d91
authored
6 years ago
by
Jorran de Wit
Browse files
Options
Downloads
Patches
Plain Diff
Fix counting query going wrong
parent
c582be86
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
colleges/templates/colleges/_potentialfellowship_voting_table.html
+3
-3
3 additions, 3 deletions
...templates/colleges/_potentialfellowship_voting_table.html
colleges/views.py
+2
-4
2 additions, 4 deletions
colleges/views.py
with
5 additions
and
7 deletions
colleges/templates/colleges/_potentialfellowship_voting_table.html
+
3
−
3
View file @
ca532d91
...
@@ -17,15 +17,15 @@
...
@@ -17,15 +17,15 @@
Click to vote:
Click to vote:
<form
action=
"{% url 'colleges:vote_on_potential_fellowship' potfel_id=potfel.id vote='A' %}"
method=
"post"
>
<form
action=
"{% url 'colleges:vote_on_potential_fellowship' potfel_id=potfel.id vote='A' %}"
method=
"post"
>
{% csrf_token %}
{% csrf_token %}
<input
type=
"submit"
class=
"agree"
value=
"Agree {{ potfel.
nr_A
}} "
/>
<input
type=
"submit"
class=
"agree"
value=
"Agree {{ potfel.
in_agreement.count
}} "
/>
</form>
</form>
<form
action=
"{% url 'colleges:vote_on_potential_fellowship' potfel_id=potfel.id vote='N' %}"
method=
"post"
>
<form
action=
"{% url 'colleges:vote_on_potential_fellowship' potfel_id=potfel.id vote='N' %}"
method=
"post"
>
{% csrf_token %}
{% csrf_token %}
<input
type=
"submit"
class=
"notsure"
value=
"Abstain {{ potfel.
nr_N
}}"
/>
<input
type=
"submit"
class=
"notsure"
value=
"Abstain {{ potfel.
in_abstain.count
}}"
/>
</form>
</form>
<form
action=
"{% url 'colleges:vote_on_potential_fellowship' potfel_id=potfel.id vote='D' %}"
method=
"post"
>
<form
action=
"{% url 'colleges:vote_on_potential_fellowship' potfel_id=potfel.id vote='D' %}"
method=
"post"
>
{% csrf_token %}
{% csrf_token %}
<input
type=
"submit"
class=
"disagree"
value=
"Disagree {{ potfel.
nr_D
}}"
/>
<input
type=
"submit"
class=
"disagree"
value=
"Disagree {{ potfel.
in_disagreement.count
}}"
/>
</form>
</form>
{% if request.user.contributor in potfel.in_agreement.all %}
{% if request.user.contributor in potfel.in_agreement.all %}
<strong>
(you have voted: Agreed)
</strong>
<strong>
(you have voted: Agreed)
</strong>
...
...
This diff is collapsed.
Click to expand it.
colleges/views.py
+
2
−
4
View file @
ca532d91
...
@@ -380,11 +380,9 @@ class PotentialFellowshipListView(PermissionsMixin, PaginationMixin, ListView):
...
@@ -380,11 +380,9 @@ class PotentialFellowshipListView(PermissionsMixin, PaginationMixin, ListView):
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
().
get_context_data
(
**
kwargs
)
context
=
super
().
get_context_data
(
**
kwargs
)
context
[
'
potfels_to_vote_on
'
]
=
PotentialFellowship
.
objects
.
to_vote_on
(
context
[
'
potfels_to_vote_on
'
]
=
PotentialFellowship
.
objects
.
to_vote_on
(
self
.
request
.
user
.
contributor
).
annotate
(
self
.
request
.
user
.
contributor
)
nr_A
=
Count
(
'
in_agreement
'
),
nr_N
=
Count
(
'
in_abstain
'
),
nr_D
=
Count
(
'
in_disagreement
'
))
context
[
'
potfels_voted_on
'
]
=
PotentialFellowship
.
objects
.
voted_on
(
context
[
'
potfels_voted_on
'
]
=
PotentialFellowship
.
objects
.
voted_on
(
self
.
request
.
user
.
contributor
).
annotate
(
self
.
request
.
user
.
contributor
)
nr_A
=
Count
(
'
in_agreement
'
),
nr_N
=
Count
(
'
in_abstain
'
),
nr_D
=
Count
(
'
in_disagreement
'
))
context
[
'
subject_areas
'
]
=
SCIPOST_SUBJECT_AREAS
context
[
'
subject_areas
'
]
=
SCIPOST_SUBJECT_AREAS
context
[
'
statuses
'
]
=
POTENTIAL_FELLOWSHIP_STATUSES
context
[
'
statuses
'
]
=
POTENTIAL_FELLOWSHIP_STATUSES
return
context
return
context
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment