django-transcribe 0.5.17__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {django_transcribe-0.5.17.dist-info → django_transcribe-0.7.0.dist-info}/AUTHORS +6 -2
  2. django_transcribe-0.7.0.dist-info/METADATA +27 -0
  3. {django_transcribe-0.5.17.dist-info → django_transcribe-0.7.0.dist-info}/RECORD +34 -32
  4. {django_transcribe-0.5.17.dist-info → django_transcribe-0.7.0.dist-info}/WHEEL +1 -1
  5. transcribe/__init__.py +1 -1
  6. transcribe/admin.py +56 -11
  7. transcribe/apps.py +1 -2
  8. transcribe/filters.py +1 -2
  9. transcribe/forms.py +21 -4
  10. transcribe/migrations/0001_initial_squashed_0021_point_fks_to_transcribe_user.py +555 -0
  11. transcribe/migrations/0002_initial_data.py +3 -1
  12. transcribe/migrations/0007_reviewer_group_addition.py +2 -2
  13. transcribe/migrations/0018_point_fks_to_user.py +40 -0
  14. transcribe/migrations/0019_create_transcribeuser.py +43 -0
  15. transcribe/migrations/0020_populate_transcribe_users.py +18 -0
  16. transcribe/migrations/0021_point_fks_to_transcribe_user.py +57 -0
  17. transcribe/models.py +37 -21
  18. transcribe/signals.py +10 -1
  19. transcribe/templates/admin/base_site.html +1 -10
  20. transcribe/templates/transcribe/reports/list.html +1 -1
  21. transcribe/templates/transcribe/reports/projects.html +0 -19
  22. transcribe/templates/transcribe/reports/users.html +8 -8
  23. transcribe/templates/transcribe/web/dashboard.html +0 -5
  24. transcribe/templates/transcribe/web/project.html +1 -3
  25. transcribe/templates/transcribe/web/project_edit.html +0 -3
  26. transcribe/templates/transcribe/web/task_edit.html +22 -21
  27. transcribe/templates/transcribe/web/user.html +2 -57
  28. transcribe/templates/transcribe/web/users_list.html +11 -37
  29. transcribe/urls.py +27 -33
  30. transcribe/views/mixins.py +1 -1
  31. transcribe/views/reports.py +40 -28
  32. transcribe/views/web.py +15 -4
  33. django_transcribe-0.5.17.dist-info/METADATA +0 -24
  34. transcribe/templates/.DS_Store +0 -0
  35. transcribe/templates/admin/.DS_Store +0 -0
  36. transcribe/templates/transcribe/.DS_Store +0 -0
  37. {django_transcribe-0.5.17.dist-info → django_transcribe-0.7.0.dist-info}/LICENSE +0 -0
  38. {django_transcribe-0.5.17.dist-info → django_transcribe-0.7.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,57 @@
1
+ # Generated by Django 2.2.6 on 2024-08-20 22:20
2
+
3
+ import django.db.models.deletion
4
+ from django.db import migrations, models
5
+
6
+
7
+ class Migration(migrations.Migration):
8
+
9
+ dependencies = [('transcribe', '0020_populate_transcribe_users')]
10
+
11
+ operations = [
12
+ migrations.AlterField(
13
+ model_name='project',
14
+ name='reviewers',
15
+ field=models.ManyToManyField(
16
+ blank=True,
17
+ related_name='review_projects',
18
+ to='transcribe.TranscribeUser',
19
+ ),
20
+ ),
21
+ migrations.AlterField(
22
+ model_name='project',
23
+ name='transcribers',
24
+ field=models.ManyToManyField(
25
+ blank=True,
26
+ related_name='transcription_projects',
27
+ to='transcribe.TranscribeUser',
28
+ ),
29
+ ),
30
+ migrations.AlterField(
31
+ model_name='userpreferences',
32
+ name='user',
33
+ field=models.OneToOneField(
34
+ on_delete=django.db.models.deletion.CASCADE,
35
+ related_name='preferences',
36
+ to='transcribe.TranscribeUser',
37
+ ),
38
+ ),
39
+ migrations.AlterField(
40
+ model_name='userprojectpreferences',
41
+ name='user',
42
+ field=models.ForeignKey(
43
+ on_delete=django.db.models.deletion.CASCADE,
44
+ related_name='projects',
45
+ to='transcribe.TranscribeUser',
46
+ ),
47
+ ),
48
+ migrations.AlterField(
49
+ model_name='usertask',
50
+ name='user',
51
+ field=models.ForeignKey(
52
+ on_delete=django.db.models.deletion.CASCADE,
53
+ related_name='tasks',
54
+ to='transcribe.TranscribeUser',
55
+ ),
56
+ ),
57
+ ]
transcribe/models.py CHANGED
@@ -38,7 +38,7 @@ TASK = Choices(TRANSCRIPTION, REVIEW)
38
38
 
39
39
  def get_transcribe_user(user):
40
40
  if not isinstance(user, TranscribeUser):
41
- user = TranscribeUser.objects.get(pk=user.pk)
41
+ user = TranscribeUser.objects.get(user=user)
42
42
  return user
43
43
 
44
44
 
@@ -64,8 +64,19 @@ def make_task_count_property(task_type, status):
64
64
  return task_counter
65
65
 
66
66
 
67
- class TranscribeUser(User):
68
- """Proxy user model to extend the default User model."""
67
+ class TranscribeUserManager(models.Manager):
68
+ """Custom manager for TranscribeUser."""
69
+
70
+ def get_queryset(self):
71
+ return super().get_queryset().select_related('user')
72
+
73
+
74
+ class TranscribeUser(models.Model):
75
+ user = models.OneToOneField(
76
+ User, related_name='transcribe_user', on_delete=models.CASCADE
77
+ )
78
+
79
+ objects = TranscribeUserManager()
69
80
 
70
81
  num_finished_transcriptions = make_task_count_property(
71
82
  TRANSCRIPTION, FINISHED
@@ -83,12 +94,12 @@ class TranscribeUser(User):
83
94
  @cached_property
84
95
  def name(self):
85
96
  """Returns the user's name."""
86
- return '{u.first_name} {u.last_name}'.format(u=self)
97
+ return '{u.first_name} {u.last_name}'.format(u=self.user)
87
98
 
88
99
  @cached_property
89
100
  def sort_name(self):
90
101
  """Returns the user's sortable name."""
91
- return '{u.last_name}, {u.first_name}'.format(u=self)
102
+ return '{u.last_name}, {u.first_name}'.format(u=self.user)
92
103
 
93
104
  @cached_property
94
105
  def is_new(self):
@@ -99,12 +110,15 @@ class TranscribeUser(User):
99
110
  @cached_property
100
111
  def is_admin(self):
101
112
  """Returns if the user is part of the Admin group or a superuser."""
102
- return self.groups.filter(name='Admin').exists() or self.is_superuser
113
+ return (
114
+ self.user.groups.filter(name='Admin').exists()
115
+ or self.user.is_superuser
116
+ )
103
117
 
104
118
  @cached_property
105
119
  def is_reviewer(self):
106
120
  """Returns if the user is part of the Reviewer group."""
107
- return self.groups.filter(name='Reviewer').exists()
121
+ return self.user.groups.filter(name='Reviewer').exists()
108
122
 
109
123
  @cached_property
110
124
  def num_tasks(self):
@@ -194,7 +208,7 @@ class TranscribeUser(User):
194
208
  )
195
209
 
196
210
  def _get_report_stats(self, datetime_start, datetime_end):
197
- counts = UserTask.objects.filter(user_id=self.pk).aggregate(
211
+ counts = UserTask.objects.filter(user=self).aggregate(
198
212
  num_finished_transcriptions=Count(
199
213
  'id',
200
214
  filter=Q(
@@ -264,12 +278,13 @@ class TranscribeUser(User):
264
278
  def roles(self):
265
279
  pass
266
280
 
281
+ def __str__(self):
282
+ return self.user.username
283
+
267
284
  class Meta:
268
- proxy = True
269
- app_label = 'transcribe'
270
285
  verbose_name = 'Transcribe user'
271
286
  verbose_name_plural = 'Transcribe users'
272
- ordering = ['last_name', 'first_name']
287
+ ordering = ['user__last_name', 'user__first_name']
273
288
 
274
289
 
275
290
  class UserPreferences(models.Model):
@@ -373,10 +388,10 @@ class Project(TimeStampedModel):
373
388
  archived = models.BooleanField(default=False)
374
389
  finding_aid_url = models.CharField(blank=True, max_length=2083)
375
390
  transcribers = models.ManyToManyField(
376
- User, blank=True, related_name='transcription_projects'
391
+ TranscribeUser, blank=True, related_name='transcription_projects'
377
392
  )
378
393
  reviewers = models.ManyToManyField(
379
- User, blank=True, related_name='review_projects'
394
+ TranscribeUser, blank=True, related_name='review_projects'
380
395
  )
381
396
  allow_global_transcriptions = models.BooleanField(default=False)
382
397
 
@@ -420,7 +435,7 @@ class Project(TimeStampedModel):
420
435
  task__project=self,
421
436
  status='in progress',
422
437
  task_type=task_type,
423
- user__id=user.id,
438
+ user=user,
424
439
  ).first()
425
440
 
426
441
  def pending_transcription_task(self, user):
@@ -891,7 +906,7 @@ class Task(TimeStampedModel):
891
906
  # an instance of the TranscribeUser proxy model, and it needs to be.
892
907
  # The ids should be the same though.
893
908
  users_usertasks_for_task = (
894
- self.usertasks.filter(user__id=user.id)
909
+ self.usertasks.filter(user=user)
895
910
  .filter(task_type=TRANSCRIPTION)
896
911
  .exclude(status=FINISHED)
897
912
  )
@@ -899,7 +914,7 @@ class Task(TimeStampedModel):
899
914
  # are transcription tasks and are not finished.
900
915
  if users_usertasks_for_task.count() < 1:
901
916
  ut = UserTask()
902
- ut.user_id = user.id
917
+ ut.user = user
903
918
  ut.transcription = self.transcription
904
919
  ut.task = self
905
920
  ut.save()
@@ -912,7 +927,7 @@ class Task(TimeStampedModel):
912
927
  # See first comment in claim_transcription about working with the user
913
928
  # instance in these methods.
914
929
  users_usertasks_for_task = (
915
- self.usertasks.filter(user__id=user.id)
930
+ self.usertasks.filter(user=user)
916
931
  .filter(task_type=REVIEW)
917
932
  .exclude(status=FINISHED)
918
933
  )
@@ -927,7 +942,7 @@ class Task(TimeStampedModel):
927
942
  num_tasks = self.project.transcribers_per_task
928
943
  transcriptions = transcriptions[:num_tasks]
929
944
  ut = UserTask()
930
- ut.user_id = user.id
945
+ ut.user = user
931
946
  if len(transcriptions):
932
947
  ut.transcription = self.diff_transcriptions(transcriptions)
933
948
  ut.task = self
@@ -1066,10 +1081,11 @@ class UserTask(TimeStampedModel):
1066
1081
 
1067
1082
  def user_admin_display_name(self):
1068
1083
  params = {
1069
- 'name': self.user.get_full_name(),
1070
- 'netid': self.user.username,
1084
+ 'name': self.user.user.get_full_name(),
1085
+ 'netid': self.user.user.username,
1071
1086
  'url': reverse(
1072
- 'admin:transcribe_transcribeuser_change', args=(self.user.pk,)
1087
+ 'admin:transcribe_transcribeuser_change',
1088
+ args=(self.user.user.pk,),
1073
1089
  ),
1074
1090
  }
1075
1091
  return format_html('<a href="{url}">{name} ({netid})</a>', **params)
transcribe/signals.py CHANGED
@@ -1,14 +1,23 @@
1
1
  """Application Signals"""
2
2
  import logging
3
- from datetime import datetime, timedelta, timezone
4
3
 
5
4
  from django.contrib.auth import get_user_model
6
5
  from django.contrib.auth.signals import user_logged_in
6
+ from django.db.models.signals import post_save
7
+ from django.dispatch import receiver
8
+
9
+ from .models import TranscribeUser
7
10
 
8
11
  logger = logging.getLogger(__file__)
9
12
  User = get_user_model()
10
13
 
11
14
 
15
+ @receiver(post_save, sender=User)
16
+ def manage_user_profile(sender, instance, created, **kwargs):
17
+ if created:
18
+ TranscribeUser.objects.create(user=instance)
19
+
20
+
12
21
  def update_staff_membership(user):
13
22
  """
14
23
  Makes sure the is_staff attribute is set on the user if they are a
@@ -1,13 +1,4 @@
1
- {% extends "admin/base.html" %}
2
- {% load admin_static %}
3
-
4
- {% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
5
-
6
- {% block branding %}
7
- <h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a></h1>
8
- {% endblock %}
9
-
10
- {% block nav-global %}{% endblock %}
1
+ {% extends "admin/base_site.html" %}
11
2
 
12
3
  {% block userlinks %}
13
4
  <a href="{% url 'reports:list' %}">Reports</a>
@@ -33,7 +33,7 @@
33
33
  <h3>User Reports</h3>
34
34
 
35
35
  <a href="{% url 'reports:users_report' %}?datetime_start={{ previous_week.datetime_start }}&datetime_end={{ previous_week.datetime_end }}">Previous Week, {{ previous_week.week_name }}</a>
36
- <a href="{% url 'reports:projects_report' %}?datetime_start={{ previous_week.datetime_start }}&datetime_end={{ previous_week.datetime_end }}&download=True">(download)</a>
36
+ <a href="{% url 'reports:users_report' %}?datetime_start={{ previous_week.datetime_start }}&datetime_end={{ previous_week.datetime_end }}&download=True">(download)</a>
37
37
  <br>
38
38
  <a href="{% url 'reports:users_report' %}?datetime_start={{ current_month.datetime_start }}&datetime_end={{ current_month.datetime_end }}">{{ current_month.month_name }}</a>
39
39
  <a href="{% url 'reports:users_report' %}?datetime_start={{ current_month.datetime_start }}&datetime_end={{ current_month.datetime_end }}&download=True">(download)</a>
@@ -29,35 +29,16 @@
29
29
  <b>{{ project.title }}</b>
30
30
  <br>
31
31
  Current Status:
32
- <!-- Total Tasks: {{ project.stats.total_tasks }}
33
- <br>
34
- Transcriptions: {{ project.stats.transcriptions_percent_done }}% complete ({{ project.stats.transcriptions_remaining }} tasks remaining)
35
- <br>
36
- Reviews: {{ project.stats.reviews_percent_done }}% complete ({{ project.stats.reviews_remaining }} tasks remaining) -->
37
32
 
38
33
  {{ project.stats.percent_done }}% complete
39
34
  ({{ project.stats.total_finished_transcriptions }} / {{ project.stats.total_tasks }} Transcriptions, {{ project.stats.total_finished_reviews }} / {{ project.stats.total_tasks }} Reviews)
40
35
 
41
- <!-- <br>
42
- <b>
43
- {% if datetime_start|date:'Y' == datetime_end|date:'Y' and datetime_start|date:'M' == datetime_end|date:'M' %}
44
- {{ datetime_start|date:'F j' }} - {{ datetime_end|date:'j, Y' }}
45
- {% elif datetime_start|date:'Y' == datetime_end|date:'Y' %}
46
- {{ datetime_start|date:'F j' }} - {{ datetime_end|date:'F j, Y' }}
47
- {% else %}
48
- {{ datetime_start|date:'M j, Y' }} - {{ datetime_end|date:'M j, Y' }}
49
- {% endif %}:
50
- </b> -->
51
-
52
36
  <br>
53
37
  Finished Transcription{{ project.stats.finished_transcriptions|pluralize }}:
54
38
  {{ project.stats.finished_transcriptions }}
55
- <!-- ({{ project.stats.total_finished_transcriptions }}/{{ project.stats.total_tasks }}) -->
56
39
  <br>
57
40
  Finished Review{{ project.stats.finished_reviews|pluralize }}:
58
41
  {{ project.stats.finished_reviews }}
59
- <!-- ({{ project.stats.total_finished_reviews }}/{{ project.stats.total_tasks }}) -->
60
- <!-- <p>{{ project.stats }}</p> -->
61
42
  </div>
62
43
  {% endfor %}
63
44
 
@@ -16,18 +16,18 @@
16
16
  <a href="{% url 'reports:users_report' %}?datetime_start={{ datetime_start|date:'Y-m-d H:i:s' }}&datetime_end={{ datetime_end|date:'Y-m-d H:i:s' }}&download=True">(download)</a>
17
17
  </h3>
18
18
 
19
- {% for user in users %}
19
+ {% for transcribe_user in transcribe_users %}
20
20
  <p>
21
- <b>{{ user.last_name }}, {{ user.first_name }}</b>
22
- ({{ user }})
21
+ <b>{{ transcribe_user.user.last_name }}, {{ transcribe_user.user.first_name }}</b>
22
+ ({{ transcribe_user }})
23
23
  <br>
24
- Last Login: {{ user.last_login|date:'F j, Y, g:i A' }}
24
+ Last Login: {{ transcribe_user.user.last_login|date:'F j, Y, g:i A' }}
25
25
  <br>
26
- {{ user.num_finished_transcriptions }} finished transcriptions
27
- ({{ user.num_skipped_transcriptions }} skipped, {{ user.num_in_progress_transcriptions }} in progress)
26
+ {{ transcribe_user.num_finished_transcriptions }} finished transcriptions
27
+ ({{ transcribe_user.num_skipped_transcriptions }} skipped, {{ transcribe_user.num_in_progress_transcriptions }} in progress)
28
28
  <br>
29
- {{ user.num_finished_reviews }} finished reviews
30
- ({{ user.num_skipped_reviews }} skipped, {{ user.num_in_progress_reviews }} in progress)
29
+ {{ transcribe_user.num_finished_reviews }} finished reviews
30
+ ({{ transcribe_user.num_skipped_reviews }} skipped, {{ transcribe_user.num_in_progress_reviews }} in progress)
31
31
  </p>
32
32
  {% endfor %}
33
33
 
@@ -6,11 +6,6 @@
6
6
  {% block content %}
7
7
  <h1><span class="icon-user-4"></span> Dashboard</h1>
8
8
 
9
- {% if transcribe_user.is_new %}
10
- <!-- message for new users of Transcribe -->
11
- <!-- <div class='alert'>Welcome to Transcribe.</div> -->
12
- {% endif %}
13
-
14
9
  <section id="available">
15
10
  <header>
16
11
  <h2><span class="icon-checkmark"></span> Available Tasks</h2>
@@ -72,13 +72,11 @@
72
72
  <p>Have a specific question the basic guidelines don't answer? Check the <a href='/faq/'>FAQ page</a>!</p>
73
73
  </div>
74
74
 
75
- <!-- ADMIN STUFF -->
75
+ <!-- ADMIN ITEMS -->
76
76
  {% if transcribe_user.is_admin %}
77
77
  <div class="toolbar">
78
78
  <ul>
79
79
  <li><a href="{% url 'admin:transcribe_project_change' project.id %}" title="Edit this project"><span class="icon-pencil"></span> Edit</a></li>
80
- <!-- <li><a href="/Project/editRoles/{{ project.id }}" title="Mangage user roles for this project (i.e. who is allowed to transcribe it)"><span class="icon-users-2"></span> Roles</a></li> -->
81
-
82
80
  {% if project.tasks %}
83
81
  <li class="message"><span class="icon-download-2"></span> Download:
84
82
  <a href="{% url 'project_download' pk=project.id type='xml' %}">XML</a>
@@ -10,9 +10,6 @@
10
10
  <input class="button" type="submit" value="Save Project">
11
11
 
12
12
  {% if project %}
13
- <!-- <a href="{% url 'project_delete' project.id %}" title="Delete the project" class="button delete" -->
14
- <!-- onClick="if(confirm('Are you sure you want to delete this project?\nThe entire project, transcriptions, and media will be permanently deleted.')) return true; else return false"> -->
15
- <!-- <span class="icon-remove"></span> delete project</a> -->
16
13
  <a href="{% url 'project_delete' project.id %}" title="Delete the project" class="button delete"><span class="icon-remove"></span> delete project</a>
17
14
  {% endif %}
18
15
 
@@ -70,30 +70,31 @@
70
70
  <script src="{% static 'transcribe/js/lib/openseadragon/openseadragon.min.js' %}"></script>
71
71
  <script src="{% static 'transcribe/js/lib/openseadragon/openseadragon-filtering.js' %}"></script>
72
72
  <script type="text/javascript">
73
- var viewer = OpenSeadragon({
73
+ var viewer = OpenSeadragon({
74
74
  id: "openseadragon",
75
75
  prefixUrl: '/static/transcribe/js/lib/openseadragon/images/',
76
76
  tileSources: {
77
77
  type: 'image',
78
- url: '{{ usertask.task.file.url }}',
78
+ url: '{{ usertask.task.file.url }}',
79
+ crossOriginPolicy: 'Anonymous',
79
80
  },
80
81
  // It was decided to load the images full length instead
81
- // of width. This is to allow people to see the whole page
82
- // before beginning transcribing.
82
+ // of width. This is to allow people to see the whole page
83
+ // before beginning transcribing.
83
84
  //visibilityRatio: 1.0, // don't pan beyond image
84
85
  //defaultZoomLevel: 1, // fixed width
85
86
  //minZoomLevel: 1, // can't zoom out more than the full width
86
87
  maxZoomLevel: 5, // can't zoom out more than the full width
87
- showRotationControl: true, // allow image rotation
88
+ showRotationControl: true, // allow image rotation
89
+ });
90
+ viewer.setFilterOptions({
91
+ filters: {
92
+ processors: [
93
+ OpenSeadragon.Filters.BRIGHTNESS(0),
94
+ OpenSeadragon.Filters.CONTRAST(1)
95
+ ]
96
+ }
88
97
  });
89
- viewer.setFilterOptions({
90
- filters: {
91
- processors: [
92
- OpenSeadragon.Filters.BRIGHTNESS(0),
93
- OpenSeadragon.Filters.CONTRAST(1)
94
- ]
95
- }
96
- });
97
98
  function go_to_top(immediately) {
98
99
  var oldBounds = viewer.viewport.getBounds();
99
100
  //var newBounds = new OpenSeadragon.Rect(0, 0, 1, oldBounds.height / oldBounds.width);
@@ -181,20 +182,20 @@
181
182
 
182
183
  <input type="hidden" name="id" value="{{ usertask.id }}" id="id">
183
184
  <input type="hidden" name="task" value="{{ usertask.task.id }}">
184
- <input type="hidden" name="task_type" value="{{ usertask.task_type }}">
185
+ <input type="hidden" name="task_type" value="{{ usertask.task_type }}">
185
186
  <input type="hidden" name="user" value="{{ request.user.id }}">
186
187
  </div>
187
188
 
188
189
  <ul class="toolbar">
189
190
  <li><a id="toggleLayout" href="#"><span class="icon-screen"></span> Toggle Layout</a></li>
190
191
  <li><a class="saveTranscription" href="{{ usertask.task.project.get_absolute_url }}"><span class="icon-info"></span> Project Info</a></li>
191
- <li><span><span class="icon-image"></span> {{ usertask.task.filename }}</span></li>
192
- <li><span id="pagesNav">
193
- <button onclick="return false;" id="previousPageButton" class="icon-arrow-left" title="view the previous page">
194
- <button onclick="return false;" id="currentPageButton" class="icon-home" title="view the page you are currently transcribing">
195
- <button onclick="return false;" id="nextPageButton" class="icon-arrow-right" title="view the next page">
196
- </span></li>
197
- <li><span id="serifToggle" class="serif"><button onclick="return false;" id="serifToggleButton" title="toggle serif font">F</button></span></li>
192
+ <li><span><span class="icon-image"></span> {{ usertask.task.filename }}</span></li>
193
+ <li><span id="pagesNav">
194
+ <button onclick="return false;" id="previousPageButton" class="icon-arrow-left" title="view the previous page">
195
+ <button onclick="return false;" id="currentPageButton" class="icon-home" title="view the page you are currently transcribing">
196
+ <button onclick="return false;" id="nextPageButton" class="icon-arrow-right" title="view the next page">
197
+ </span></li>
198
+ <li><span id="serifToggle" class="serif"><button onclick="return false;" id="serifToggleButton" title="toggle serif font">F</button></span></li>
198
199
  <li class="right finishButton"><button id="finishButton" class="submit" name="status" value="finished" type="submit"><span class="icon-checkmark"></span> Submit</button></li>
199
200
  <li class="right skipButton"><button id="skipButton" class="skip" name="status" value="skipped" type="submit" onClick="if(confirm('Are you sure you want to skip this task?\n')) return true; else return false"><span class="icon-close"></span> Skip</button></li>
200
201
  <li class="right saveButton"><button id="saveButton" class="save" name="status" value="in progress" type="submit"><span class="icon-disk icon"></span><span class="icon-spinner-5 spinner"></span> Save</button></li>
@@ -6,71 +6,16 @@
6
6
  <h1><a href="/users"><span class="icon-users-2"></span> Users</a> &gt; User</h1>
7
7
  </header>
8
8
 
9
- <h2 class='user'>{{ object.name }} ({{ object.username }})</h2>
9
+ <h2 class='user'>{{ transcribe_user.name }} ({{ transcribe_user.user.username }})</h2>
10
10
 
11
11
  <div class='roles'>
12
12
  <h3>Roles</h3>
13
- <!-- $userRoles = $user->getRoles(); -->
14
- <!-- // check for global roles -->
15
- <!-- $globalRoles = array(); -->
16
- <!-- if(isset($userRoles[0])) { -->
17
- <!-- $globalRoles = $userRoles[0]; -->
18
- <!-- // remove global roles, everything else is project-specific -->
19
- <!-- unset($userRoles[0]); -->
20
- <!-- } -->
21
-
22
- <!-- // roles for a specific project or projects -->
23
- <!-- foreach ($userRoles AS $scope => $roles) { -->
24
- <!-- $project = Project::get($scope); -->
25
- <!-- $projectTitle = $project->getTitle(); -->
26
- <!-- echo "<b><a href='/Project/editRoles/" . $project->getId() . "'>$projectTitle</a>: </b>"; -->
27
- <!-- $x = 0; -->
28
- <!-- foreach($roles AS $role) { -->
29
- <!-- $x++; -->
30
- <!-- if($x > 1) echo ", "; -->
31
- <!-- echo "$role"; -->
32
- <!-- } -->
33
- <!-- echo "<br>"; -->
34
- <!-- } -->
35
-
36
- <!-- // global roles, ie roles for All projects -->
37
- <!-- echo "<b class='globalRoles'>Global Roles (All Projects): </b>"; -->
38
- <!-- $x = 0; -->
39
- <!-- foreach($globalRoles AS $role) { -->
40
- <!-- $x++; -->
41
- <!-- if($x > 1) echo ", "; -->
42
- <!-- echo "<a href='/ProjectRole/deleteRole/0/$role/" . $user->getId() . "' class='deleteUser'>"; -->
43
- <!-- echo "$role"; -->
44
- <!-- echo "</a>"; -->
45
- <!-- $global[$role] = true; -->
46
- <!-- } -->
47
- <!-- if(empty($globalRoles)) echo "none"; -->
48
-
49
- <!-- // show options to add global roles for this user? -->
50
- <!-- if(!isset($global['transcriber']) || !isset($global['reviewer']) || !isset($global['admin'])) { -->
51
- <!-- echo "<br>"; -->
52
- <!-- echo "(Add Global Roles: "; -->
53
- <!-- if(!isset($global['transcriber'])) { -->
54
- <!-- echo "<a href='/ProjectRole/addRole/0/transcriber/" . $user->getId() . "' class='addUser'>transcriber</a> "; -->
55
- <!-- } -->
56
- <!-- if(!isset($global['reviewer'])) { -->
57
- <!-- echo "<a href='/ProjectRole/addRole/0/reviewer/" . $user->getId() . "' class='addUser'>reviewer</a> "; -->
58
- <!-- } -->
59
- <!-- if(!isset($global['admin'])) { -->
60
- <!-- echo "<a href='/ProjectRole/addRole/0/admin/" . $user->getId() . "' class='addUser'>admin</a>"; -->
61
- <!-- } -->
62
- <!-- echo ")"; -->
63
- <!-- } -->
64
-
65
- <!-- echo "</div>"; -->
66
13
  </div>
67
-
68
- <!-- $userTasks = $user->getUserTasks('all', 'updatedAt DESC', '100'); -->
69
14
  <br><br>
70
15
  <div class='recentActivity'>
71
16
  <h3>Recent Activity</h3>
72
17
  <ul class='usertasks'>
73
- {% for task in object.recent_transcription_tasks %}
18
+ {% for task in transcribe_user.recent_transcription_tasks %}
74
19
  <li class='{{ task.status }}'>
75
20
  <span class='datetime'>{{ task.modified|date:"M j, Y g:i a" }}</span>
76
21
  <span class='status'>{{ task.status }}</span> task from
@@ -8,28 +8,6 @@
8
8
  <h1><span class="icon-users-2"></span> Users ({{ users.count }})</h1>
9
9
  </header>
10
10
  <span class='recentActivity'>Show statistics for the past: </span>
11
-
12
- <!-- echo " <a href='/users/recentTime:24_hours'"; -->
13
- <!-- if($recentTime == '24 hours') echo " class='current'"; -->
14
- <!-- echo ">24 hours</a>"; -->
15
-
16
- <!-- echo " <a href='/users/recentTime:7_days'"; -->
17
- <!-- if($recentTime == '7 days') echo " class='current'"; -->
18
- <!-- echo ">7 days</a>"; -->
19
-
20
- <!-- echo " <a href='/users/recentTime:1_month'"; -->
21
- <!-- if($recentTime == '1 month') echo " class='current'"; -->
22
- <!-- echo ">1 month</a>"; -->
23
-
24
- <!-- echo " <a href='/users/recentTime:6_months'"; -->
25
- <!-- if($recentTime == '6 months') echo " class='current'"; -->
26
- <!-- echo ">6 months</a>"; -->
27
-
28
- <!-- echo " <a href='/users/recentTime:1_year'"; -->
29
- <!-- if($recentTime == '1 year') echo " class='current'"; -->
30
- <!-- echo ">1 year</a>"; -->
31
- <!-- echo "</span>"; -->
32
-
33
11
  <br/>
34
12
  <br/>
35
13
  <table class="users">
@@ -38,24 +16,20 @@
38
16
  <th>finished</th>
39
17
  <th>skipped</th>
40
18
  <th>in progress</th>
41
- <!-- <th><a href='/users/orderBy:lastName' {% if order_by == 'last_name' %}class='current'{% endif %}>User</a></th> -->
42
- <!-- <th><a href='/users/orderBy:finishedTasks_DESC' {%if order_by == 'finished_tasks desc' %}class='current'{% endif %}>finished</a></th> -->
43
- <!-- <th><a href='/users/orderBy:skippedTasks_DESC'<?php if($orderBy == 'skippedTasks DESC') echo " class='current'"; ?>>skipped</a></th> -->
44
- <!-- <th><a href='/users/orderBy:inProgressTasks_DESC'<?php if($orderBy == 'inProgressTasks DESC') echo " class='current'"; ?>>in progress</a></th> -->
45
19
  </tr>
46
- {% for user in users %}
20
+ {% for transcribe_user in transcribe_users %}
47
21
  <tr>
48
22
  <td>
49
- <a href="/user/{{ user.pk }}">{{ user.sort_name }} ({{ user.username }})</a>
23
+ <a href="/user/{{ transcribe_user.pk }}">{{ transcribe_user.sort_name }} ({{ transcribe_user.user.username }})</a>
50
24
  </td>
51
25
  <td align="center">
52
- {{ user.num_finished_transcriptions }}
26
+ {{ transcribe_user.num_finished_transcriptions }}
53
27
  </td>
54
28
  <td align="center">
55
- {{ user.num_skipped_transcriptions }}
29
+ {{ transcribe_user.num_skipped_transcriptions }}
56
30
  </td>
57
31
  <td align="center">
58
- {{ user.num_in_progress_transcriptions }}
32
+ {{ transcribe_user.num_in_progress_transcriptions }}
59
33
  </td>
60
34
  </tr>
61
35
  {% endfor %}
@@ -74,18 +48,18 @@
74
48
  </tr>
75
49
  <tr>
76
50
  <td>
77
- {% for user in global_transcribers %}
78
- <a href='/user/{{ user.pk }}/'>{{ user.name }} ({{ user.username }})</a><br>
51
+ {% for transcribe_user in global_transcribers %}
52
+ <a href='/user/{{ transcribe_user.pk }}/'>{{ transcribe_user.name }} ({{ transcribe_user.user.username }})</a><br>
79
53
  {% endfor %}
80
54
  </td>
81
55
  <td>
82
- {% for user in global_reviewers %}
83
- <a href='/user/{{ user.pk }}/'>{{ user.name }} ({{ user.username }})</a><br>
56
+ {% for transcribe_user in global_reviewers %}
57
+ <a href='/user/{{ transcribe_user.pk }}/'>{{ transcribe_user.name }} ({{ transcribe_user.user.username }})</a><br>
84
58
  {% endfor %}
85
59
  </td>
86
60
  <td>
87
- {% for user in global_admins %}
88
- <a href='/user/{{ user.pk }}/'>{{ user.name }} ({{ user.username }})</a><br>
61
+ {% for transcribe_user in global_admins %}
62
+ <a href='/user/{{ transcribe_user.pk }}/'>{{ transcribe_user.name }} ({{ transcribe_user.user.username }})</a><br>
89
63
  {% endfor %}
90
64
  </td>
91
65
  </tr>