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
e4e3959c
Commit
e4e3959c
authored
8 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
appointments are spaned for duration time
parent
37170c76
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Appointments dev
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
smash/web/models.py
+18
-0
18 additions, 0 deletions
smash/web/models.py
smash/web/templates/appointments/index.html
+2
-1
2 additions, 1 deletion
smash/web/templates/appointments/index.html
with
20 additions
and
1 deletion
smash/web/models.py
+
18
−
0
View file @
e4e3959c
...
...
@@ -5,6 +5,7 @@ from django.utils import timezone
from
django.contrib.auth.models
import
User
,
AnonymousUser
import
datetime
from
datetime
import
timedelta
def
get_current_year
():
return
datetime
.
datetime
.
now
().
year
...
...
@@ -440,6 +441,11 @@ class Appointment(models.Model):
visit
=
models
.
ForeignKey
(
Visit
,
verbose_name
=
'
Visit ID
'
)
comment
=
models
.
CharField
(
max_length
=
1024
,
verbose_name
=
'
Comment
'
,
null
=
True
,
blank
=
True
)
datetime_when
=
models
.
DateTimeField
(
verbose_name
=
'
Appointment on
'
,
null
=
True
,
blank
=
True
...
...
@@ -451,3 +457,15 @@ class Appointment(models.Model):
verbose_name
=
'
Has the appointment ended?
'
,
default
=
False
)
def
datetime_until
(
self
):
if
self
.
datetime_when
is
None
:
return
None
else
:
return
self
.
datetime_when
+
timedelta
(
minutes
=
max
(
self
.
length
,
15
))
def
title
(
self
):
if
self
.
visit
.
subject
.
screening_number
==
"
---
"
:
return
self
.
comment
else
:
return
self
.
visit
.
subject
.
first_name
+
"
"
+
self
.
visit
.
subject
.
last_name
This diff is collapsed.
Click to expand it.
smash/web/templates/appointments/index.html
+
2
−
1
View file @
e4e3959c
...
...
@@ -137,8 +137,9 @@
events
:
[
{
%
for
approach
in
approaching_list
%
}
{
title
:
'
{{ approach.
visit.subject.first_name }} {{ approach.visit.subject.last_nam
e }}
'
,
title
:
'
{{ approach.
titl
e }}
'
,
start
:
'
{{ approach.datetime_when | date:"c" }}
'
,
end
:
'
{{ approach.datetime_until | date:"c" }}
'
,
color
:
'
#cfc600
'
,
subject_id
:
'
{{ approach.visit.subject.id }}
'
,
id
:
'
{{ approach.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