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
beb94c45
Commit
beb94c45
authored
8 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
visit can be marked as finished
parent
b8ea9072
No related branches found
No related tags found
1 merge request
!1
Appointments dev
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
smash/web/models.py
+10
-3
10 additions, 3 deletions
smash/web/models.py
smash/web/templates/appointments/edit.html
+3
-0
3 additions, 0 deletions
smash/web/templates/appointments/edit.html
smash/web/urls.py
+1
-0
1 addition, 0 deletions
smash/web/urls.py
smash/web/views.py
+7
-1
7 additions, 1 deletion
smash/web/views.py
with
21 additions
and
4 deletions
smash/web/models.py
+
10
−
3
View file @
beb94c45
...
...
@@ -67,11 +67,13 @@ class Subject(models.Model):
dead
=
models
.
BooleanField
(
verbose_name
=
'
Dead
'
,
default
=
False
default
=
False
,
editable
=
False
)
resigned
=
models
.
BooleanField
(
verbose_name
=
'
Resigned
'
,
default
=
False
default
=
False
,
editable
=
False
)
default_appointment_location
=
models
.
CharField
(
max_length
=
1
,
choices
=
LOCATION_CHOICES
,
...
...
@@ -467,9 +469,14 @@ class Appointment(models.Model):
)
#Potentially redundant; but can be used to manually adjust appointment's length
is_finished
=
models
.
BooleanField
(
verbose_name
=
'
Has the appointment ended?
'
,
default
=
False
default
=
False
,
editable
=
False
)
def
mark_as_finished
(
self
):
self
.
is_finished
=
True
self
.
save
()
def
datetime_until
(
self
):
if
self
.
datetime_when
is
None
:
return
None
...
...
This diff is collapsed.
Click to expand it.
smash/web/templates/appointments/edit.html
+
3
−
0
View file @
beb94c45
...
...
@@ -53,6 +53,9 @@
{% endif %}
</div>
{% endfor %}
<div
class=
"col-md-6"
>
<a
href=
"{% url 'web.views.appointment_mark' id 'finished' %}"
class=
"btn btn-warning btn-block"
>
Mark as finished
</a>
</div>
</div>
<!-- /.box-body -->
<div
class=
"box-footer"
>
...
...
This diff is collapsed.
Click to expand it.
smash/web/urls.py
+
1
−
0
View file @
beb94c45
...
...
@@ -22,6 +22,7 @@ urlpatterns = [
url
(
r
'
appointments/add/(?P<id>\d+)$
'
,
views
.
appointment_add
,
name
=
'
web.views.appointment_add
'
),
url
(
r
'
appointments/edit/(?P<id>\d+)$
'
,
views
.
appointment_edit
,
name
=
'
web.views.appointment_edit
'
),
url
(
r
'
appointments/edit_datetime/(?P<id>\d+)$
'
,
views
.
appointment_edit_datetime
,
name
=
'
web.views.appointment_edit_datetime
'
),
url
(
r
'
appointments/mark/(?P<id>\d+)/(?P<as_what>[A-z]+)$
'
,
views
.
appointment_mark
,
name
=
'
web.views.appointment_mark
'
),
url
(
r
'
visits$
'
,
views
.
visits
,
name
=
'
web.views.visits
'
),
url
(
r
'
visits/details/(?P<id>\d+)$
'
,
views
.
visit_details
,
name
=
'
web.views.visit_details
'
),
...
...
This diff is collapsed.
Click to expand it.
smash/web/views.py
+
7
−
1
View file @
beb94c45
...
...
@@ -173,6 +173,12 @@ def subject_mark(request, id, as_what):
who
.
mark_as_rejected
()
return
redirect
(
subject_edit
,
id
=
id
)
def
appointment_mark
(
request
,
id
,
as_what
):
appointment
=
get_object_or_404
(
Appointment
,
id
=
id
)
if
as_what
==
'
finished
'
:
appointment
.
mark_as_finished
()
return
redirect
(
visit_details
,
id
=
appointment
.
visit
.
id
)
def
subject_visit_details
(
request
,
id
):
locsubject
=
get_object_or_404
(
Subject
,
id
=
id
)
visits
=
locsubject
.
visit_set
.
all
()
...
...
@@ -350,7 +356,7 @@ def appointment_edit(request, id):
return
redirect
(
appointments
)
else
:
form
=
AppointmentEditForm
(
instance
=
the_appointment
)
return
wrap_response
(
request
,
'
appointments/edit.html
'
,
{
'
form
'
:
form
})
return
wrap_response
(
request
,
'
appointments/edit.html
'
,
{
'
form
'
:
form
,
'
id
'
:
id
})
def
appointment_edit_datetime
(
request
,
id
):
...
...
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