Skip to content

Commit 299a3af

Browse files
authored
Merge pull request #211 from hltcoe/dashboard-upgrade
inclusion of abandoned and bookmark tables to consolidate PR
2 parents 6a79ae1 + 6c96239 commit 299a3af

16 files changed

Lines changed: 328 additions & 147 deletions

File tree

turkle/admin.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ def has_delete_permission(self, request, obj=None):
11991199

12001200

12011201
class TaskAssignmentAdmin(admin.ModelAdmin):
1202-
"""View for assignments to expire abandoned ones"""
1202+
"""View for assignments to expire open ones"""
12031203

12041204
class Media:
12051205
css = {
@@ -1225,17 +1225,17 @@ def changelist_view(self, request, extra_context=None):
12251225
return super().changelist_view(request, extra_context)
12261226

12271227
@staticmethod
1228-
def expire_abandoned_assignments(request):
1229-
(total_deleted, _) = TaskAssignment.expire_all_abandoned()
1230-
messages.info(request, 'All {} abandoned Tasks have been expired'.format(total_deleted))
1228+
def expire_open_assignments(request):
1229+
(total_deleted, _) = TaskAssignment.expire_all_open()
1230+
messages.info(request, 'All {} open Tasks have been expired'.format(total_deleted))
12311231
return redirect(reverse('admin:turkle_taskassignment_changelist'))
12321232

12331233
def get_urls(self):
12341234
urls = super().get_urls()
12351235
my_urls = [
1236-
path('expire_abandoned_assignments/',
1237-
self.admin_site.admin_view(self.expire_abandoned_assignments),
1238-
name='turkle_expire_abandoned_assignments'),
1236+
path('expire_open_assignments/',
1237+
self.admin_site.admin_view(self.expire_open_assignments),
1238+
name='turkle_expire_open_assignments'),
12391239
]
12401240
return my_urls + urls
12411241

turkle/management/commands/expire_assignments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ class Command(BaseCommand):
1111

1212
def handle(self, *args, **options):
1313
t0 = datetime.now()
14-
(total_deleted, _) = TaskAssignment.expire_all_abandoned()
14+
(total_deleted, _) = TaskAssignment.expire_all_open()
1515
t = datetime.now()
1616
dt = (t - t0).total_seconds()
1717
logging.basicConfig(format="%(asctime)-15s %(message)s", level=logging.INFO)
18-
logging.info('TURKLE: Expired {0} abandoned Task Assignments in {1:.3f} seconds'.
18+
logging.info('TURKLE: Expired {0} open Task Assignments in {1:.3f} seconds'.
1919
format(total_deleted, dt))

turkle/migrations/0014_bookmark.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 4.2.6 on 2023-11-14 13:41
1+
# Generated by Django 4.2.6 on 2024-03-21 14:02
22

33
from django.conf import settings
44
from django.db import migrations, models
@@ -26,6 +26,7 @@ class Migration(migrations.Migration):
2626
),
2727
),
2828
("bookmarked", models.BooleanField(default=False)),
29+
("updated_at", models.DateTimeField(auto_now=True)),
2930
(
3031
"batch",
3132
models.ForeignKey(

turkle/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class Meta:
165165
updated_at = models.DateTimeField(auto_now=True, db_index=True)
166166

167167
@classmethod
168-
def expire_all_abandoned(cls):
168+
def expire_all_open(cls):
169169
result = cls.objects.\
170170
filter(completed=False).\
171171
filter(expires_at__lt=timezone.now()).\
@@ -944,3 +944,4 @@ class Bookmark(models.Model):
944944
user = models.ForeignKey(User, on_delete=models.CASCADE)
945945
batch = models.ForeignKey(Batch, on_delete=models.CASCADE)
946946
bookmarked = models.BooleanField(default=False)
947+
updated_at = models.DateTimeField(auto_now=True)

turkle/static/turkle/bootstrap-4.1.3/css/bootstrap.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

turkle/static/turkle/bootstrap-4.1.3/css/bootstrap.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

turkle/static/turkle/css/turkle.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,38 @@ div.task-preview {
6262
background: #fff;
6363
opacity: 0.8;
6464
}
65+
.table-alert{
66+
margin-bottom: 0;
67+
height: 100%;
68+
}
69+
.column-div {
70+
float: left;
71+
width: 50%;
72+
min-width:500pt;
73+
border-radius: 5px;
74+
padding: 5pt;
75+
position: relative;
76+
overflow: hidden;
77+
height: 100%;
78+
}
79+
.table-header, .table-body {
80+
width: 100%;
81+
table-layout: fixed;
82+
border-collapse: collapse;
83+
}
84+
85+
.table-body-container {
86+
min-height: 80pt;
87+
height: 12vh;
88+
overflow-y: auto;
89+
}
90+
.column-div th, td {
91+
text-align: left;
92+
padding: 8px;
93+
}
94+
.top-tables{
95+
height: 25vh;
96+
min-height: 175pt;
97+
display: block;
98+
99+
}

turkle/templates/admin/turkle/taskassignment/change_list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
</table>
1616
</div>
1717
<p class="mt-2">
18-
<a href="{% url 'admin:turkle_expire_abandoned_assignments' %}" class="button">
19-
Expire Abandoned Assignments
18+
<a href="{% url 'admin:turkle_expire_open_assignments' %}" class="button">
19+
Expire Open Assignments
2020
</a>
2121
</p>
2222
{% endblock %}

turkle/templates/turkle/base.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
{% load turkle_tags %}{% for tag in turkle_meta_tags %}{{ tag|meta_tag }}{% endfor %}
99
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'favicon-32x32.png' %}">
1010
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'favicon-16x16.png' %}">
11-
<link href="{% static "turkle/css/turkle.css" %}" rel="stylesheet" type="text/css"/>
12-
<link href="{% static "turkle/bootstrap-4.1.3/css/bootstrap.min.css" %}" rel="stylesheet" type="text/css"/>
11+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
12+
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.7/css/jquery.dataTables.css" />
13+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css">
1314
<link href="{% static "turkle/bootstrap4-glyphicons/css/bootstrap-glyphicons.min.css" %}" rel="stylesheet" type="text/css"/>
15+
<link href="{% static "turkle/css/turkle.css" %}" rel="stylesheet" type="text/css"/>
1416
{% block head %}
1517
{% endblock %}
1618
</head>

turkle/templates/turkle/help.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h5>Accept next Task</h5>
1111
<hr>
1212
<p>
1313
The task is assigned to you.
14-
If you do not finish it, you will be reminded on the main page that you have abandoned the task.
14+
If you do not finish it, you will be reminded on the main page that you have open the task.
1515
If you do not complete it by the deadline, it is returned to the task list.
1616
</p>
1717
</div>

0 commit comments

Comments
 (0)