Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Jan Maximilian Michal
grady
Commits
a265522c
Commit
a265522c
authored
7 years ago
by
Jan Maximilian Michal
Browse files
Options
Downloads
Patches
Plain Diff
Changed feedback view buttons so they auto accept before submitting
parent
e6c05d19
No related branches found
No related tags found
1 merge request
!3
Resolve "New input format"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/templates/core/feedback_form.html
+21
-15
21 additions, 15 deletions
core/templates/core/feedback_form.html
core/views/index.py
+1
-7
1 addition, 7 deletions
core/views/index.py
with
22 additions
and
22 deletions
core/templates/core/feedback_form.html
+
21
−
15
View file @
a265522c
...
...
@@ -73,7 +73,7 @@ RESULT: {{test.label}}
<div
class=
"form-inline"
>
{# Score field #}
<div
class=
"input-group col-5 nopadding mr-1 mb-
1
"
>
<div
class=
"input-group col-5 nopadding mr-1 mb-
2
"
>
<span
class=
"input-group-addon"
>
Score:
</span>
<input
class=
"form-control"
...
...
@@ -91,30 +91,32 @@ RESULT: {{test.label}}
{# status select #}
{% with form.fields.status as status %}
<div
class=
"form-group mr-
1
mb-
1
"
>
<div
class=
"form-group mr-
2
mb-
2
"
>
<select
class=
"custom-select"
id=
"id_status"
name=
"status"
>
{% for val, name in status.choices %}
<option
value=
"{{val}}"
{%
if
val =
=
feedback.status
%}
selected
{%
endif
%}
>
{{name}}
</option>
<option
value=
"{{val}}"
{%
if
val =
=
feedback.status
%}
selected
{%
endif
%}
>
{{name}}
</option>
{% endfor %}
</select>
</div>
{% endwith %}
<button
type=
"submit"
form=
"form1"
class=
"btn btn-secondary mr-1 mb-1"
name=
"update"
value=
"Submit"
>
Submit
</button>
<div>
{# Beware! compares status and origin #}
<button
type=
"submit"
form=
"form1"
class=
"btn btn-outline-success mb-2"
name=
"update"
value=
"Save"
>
Save
</button>
<button
type=
"submit"
form=
"form1"
class=
"btn btn-outline-success mb-2"
name=
"update"
value=
"Submit"
>
Save and return
</button>
{# Beware! compares status and origin #}
{% if feedback.status == feedback.NEEDS_REVIEW or feedback.status == feedback.EDITABLE %}
<button
type=
"submit"
form=
"form1"
class=
"btn btn-success mr-1 mb-1"
name=
"update"
value=
"Next"
>
Next
</button>
<button
type=
"submit"
form=
"form1"
class=
"btn btn-success mr-1 mb-1"
name=
"update"
value=
"Save"
>
Save
</button>
{% endif %}
{% if feedback.status == feedback.NEEDS_REVIEW or feedback.status == feedback.EDITABLE %}
<button
type=
"submit"
onclick=
"set_accepted();"
form=
"form1"
class=
"btn btn-outline-success mb-2"
name=
"update"
value=
"Next"
>
Accept, Save and Next
</button>
{% endif %}
{% if feedback.origin != feedback.MANUAL %}
<a
href=
"{% url 'FeedbackDelete' feedback.slug %}"
class=
"btn btn-outline-danger
mr-1
mb-
1
"
name=
"delete"
value=
"Delete"
>
Delete auto feedback
</a>
{% endif %}
{% if feedback.origin != feedback.MANUAL %}
<a
href=
"{% url 'FeedbackDelete' feedback.slug %}"
class=
"btn btn-outline-danger mb-
2
"
name=
"delete"
value=
"Delete"
>
Delete auto feedback
</a>
{% endif %}
{% if feedback.status == feedback.ACCEPTED %}
<button
class=
"btn btn-secondary mr-1 mb-1"
value=
"Submit"
disabled
>
View is read only
</button>
{% endif %}
{% if feedback.status == feedback.ACCEPTED %}
<button
class=
"btn btn-secondary mr-1 mb-2"
value=
"Submit"
disabled
>
View is read only
</button>
{% endif %}
</div>
</div>
</form>
</div>
...
...
@@ -130,6 +132,10 @@ RESULT: {{test.label}}
{% block script_block %}
<script>
function
set_accepted
()
{
$
(
'
#id_status
'
)[
0
].
value
=
{{
feedback
.
ACCEPTED
}};
}
$
(
'
#collapseAllOpen
'
).
click
(
function
(){
$
(
'
.collapse
'
).
collapse
(
'
show
'
);
});
...
...
This diff is collapsed.
Click to expand it.
core/views/index.py
+
1
−
7
View file @
a265522c
from
django.shortcuts
import
render
from
core.models
import
SubmissionType
def
index
(
request
):
context
=
{
'
boldmessage
'
:
'
Delbert Grady says hey there world!
'
,
'
submission_types
'
:
SubmissionType
.
objects
.
all
(),
}
return
render
(
request
,
'
core/index.html
'
,
context
)
return
render
(
request
,
'
core/index.html
'
)
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