Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
SMASCH
scheduling-system
Commits
8347cf91
Commit
8347cf91
authored
8 years ago
by
Piotr Matyjaszyk
Browse files
Options
Downloads
Patches
Plain Diff
Fixed the robust visit view
parent
a00d2afc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
smash/web/forms.py
+2
-2
2 additions, 2 deletions
smash/web/forms.py
smash/web/templates/visits/details.html
+22
-26
22 additions, 26 deletions
smash/web/templates/visits/details.html
smash/web/views.py
+3
-2
3 additions, 2 deletions
smash/web/views.py
with
27 additions
and
30 deletions
smash/web/forms.py
+
2
−
2
View file @
8347cf91
...
@@ -49,5 +49,5 @@ class AppointmentDetailForm(ModelForm):
...
@@ -49,5 +49,5 @@ class AppointmentDetailForm(ModelForm):
class
VisitDetailForm
(
ModelForm
):
class
VisitDetailForm
(
ModelForm
):
class
Meta
:
class
Meta
:
model
=
Subjec
t
model
=
Visi
t
fields
=
'
__all__
'
exclude
=
[
'
visitFinished
'
]
This diff is collapsed.
Click to expand it.
smash/web/templates/visits/details.html
+
22
−
26
View file @
8347cf91
...
@@ -26,9 +26,9 @@
...
@@ -26,9 +26,9 @@
<a
href=
"{% url 'web.views.visits' %}"
class=
"btn btn-block btn-default"
onclick=
"history.back()"
>
Back
</a>
<a
href=
"{% url 'web.views.visits' %}"
class=
"btn btn-block btn-default"
onclick=
"history.back()"
>
Back
</a>
</div>
</div>
{% comment %}
<div
class=
"box-header with-border"
>
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
Details of visit
</h3>
<h3
class=
"box-title"
>
Details of visit
</h3>
</div>
{% endcomment %}
</div>
<form
class=
"form-horizontal"
>
<form
class=
"form-horizontal"
>
<div
class=
"box-body"
>
<div
class=
"box-body"
>
...
@@ -49,15 +49,17 @@
...
@@ -49,15 +49,17 @@
{% endif %}
{% endif %}
</div>
</div>
{% endfor %}
{% endfor %}
<td>
Visit finished: {% if visFinished %}
<button
type=
"button"
class=
"btn btn-block btn-danger"
>
YES
</button>
{% else %}
<button
type=
"button"
class=
"btn btn-block btn-success"
>
NO
</button>
{% endif %}
</td>
</div>
<!-- /.box-body -->
</div>
<!-- /.box-body -->
<div
class=
"box-footer"
>
<a
href=
"{% url 'web.views.subjects' %}"
class=
"btn btn-block btn-default"
onclick=
"history.back()"
>
Back
</a>
</div>
<!-- /.box-footer -->
</form>
</form>
</div>
</form>
...
@@ -69,9 +71,11 @@
...
@@ -69,9 +71,11 @@
{% comment %}
<div
class=
"box-header with-border"
>
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
Visit's assignments
</h3>
<h3
class=
"box-title"
>
Visit's assignments
</h3>
</div>
{% endcomment %}
</div>
{% if loApp %}
{% if loApp %}
<table
id=
"table"
class=
"table table-bordered table-striped"
>
<table
id=
"table"
class=
"table table-bordered table-striped"
>
...
@@ -81,14 +85,16 @@
...
@@ -81,14 +85,16 @@
<th>
Type
</th>
<th>
Type
</th>
<th>
Date
</th>
<th>
Date
</th>
<th>
Time
</th>
<th>
Time
</th>
<th>
Length
</th>
<th>
Length
[min]
</th>
<th>
Responsible
</th>
<th>
Responsible
</th>
<th>
Plan/Modify
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
{% for app in loApp %}
{% for app in loApp %}
<tr>
<tr>
<td>
{{ forloop.counter }}
</td>
<td>
{{ forloop.counter }}
</td>
<td>
{{ app.appointmentType }}
</td>
<td>
{{ app.appDateTime | date:"d-M-Y" }}
</td>
<td>
{{ app.appDateTime | date:"d-M-Y" }}
</td>
<td>
{{ app.appDateTime | time:"H:i" }}
</td>
<td>
{{ app.appDateTime | time:"H:i" }}
</td>
<td>
{{ app.appLength }}
</td>
<td>
{{ app.appLength }}
</td>
...
@@ -97,6 +103,7 @@
...
@@ -97,6 +103,7 @@
{% else %} {{ app.flyingTeam }}
{% else %} {{ app.flyingTeam }}
{% endif %}
{% endif %}
</td>
</td>
<td>
<a
href=
""
type=
"button"
class=
"btn btn-block btn-default"
>
TODO
</a>
</td>
</tr>
</tr>
{% endfor %}
{% endfor %}
...
@@ -116,13 +123,13 @@
...
@@ -116,13 +123,13 @@
{% comment %}
<div
class=
"box-header with-border"
>
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
Subject's details
</h3>
<h3
class=
"box-title"
>
Subject's details
</h3>
</div>
{% endcomment %}
</div>
<form
class=
"form-horizontal"
>
<form
class=
"form-horizontal"
>
<div
class=
"box-body"
>
<div
class=
"box-body"
>
{% for field in
v
form %}
{% for field in
s
form %}
<div
class=
"col-md-6 form-group {% if field.errors %}has-error{% endif %}"
>
<div
class=
"col-md-6 form-group {% if field.errors %}has-error{% endif %}"
>
<label
for=
"{# TODO #}"
class=
"col-sm-4 control-label"
>
<label
for=
"{# TODO #}"
class=
"col-sm-4 control-label"
>
{{ field.label }}
{{ field.label }}
...
@@ -152,7 +159,7 @@
...
@@ -152,7 +159,7 @@
</div>
{% endblock maincontent %}
{% endblock maincontent %}
...
@@ -161,16 +168,5 @@
...
@@ -161,16 +168,5 @@
<script
src=
"{% static 'AdminLTE/plugins/datatables/jquery.dataTables.min.js' %}"
></script>
<script
src=
"{% static 'AdminLTE/plugins/datatables/jquery.dataTables.min.js' %}"
></script>
<script
src=
"{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.min.js' %}"
></script>
<script
src=
"{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.min.js' %}"
></script>
<script>
$
(
function
()
{
$
(
'
#table
'
).
DataTable
({
"
paging
"
:
true
,
"
lengthChange
"
:
false
,
"
searching
"
:
true
,
"
ordering
"
:
true
,
"
info
"
:
true
,
"
autoWidth
"
:
false
});
});
</script>
{% endblock scripts %}
{% endblock scripts %}
This diff is collapsed.
Click to expand it.
smash/web/views.py
+
3
−
2
View file @
8347cf91
...
@@ -64,12 +64,13 @@ def visits(request):
...
@@ -64,12 +64,13 @@ def visits(request):
def
visit_details
(
request
,
id
):
def
visit_details
(
request
,
id
):
displayedVisit
=
Visit
.
objects
.
get
(
id
=
id
)
displayedVisit
=
Visit
.
objects
.
get
(
id
=
id
)
visFinished
=
displayedVisit
.
visitFinished
displayedSubject
=
displayedVisit
.
subject
displayedSubject
=
displayedVisit
.
subject
listOfAppointments
=
displayedVisit
.
appointment_set
listOfAppointments
=
displayedVisit
.
appointment_set
.
all
()
vform
=
VisitDetailForm
(
instance
=
displayedVisit
)
vform
=
VisitDetailForm
(
instance
=
displayedVisit
)
sform
=
SubjectDetailForm
(
instance
=
displayedSubject
)
sform
=
SubjectDetailForm
(
instance
=
displayedSubject
)
return
wrap_response
(
request
,
'
visits/details.html
'
,
{
'
vform
'
:
vform
,
'
sform
'
:
sform
,
'
loApp
'
:
listOfAppointments
})
return
wrap_response
(
request
,
'
visits/details.html
'
,
{
'
vform
'
:
vform
,
'
sform
'
:
sform
,
'
loApp
'
:
listOfAppointments
,
'
visFinished
'
:
visFinished
})
def
subjects
(
request
):
def
subjects
(
request
):
...
...
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