Skip to content

Commit

Permalink
Perspective videos for NME #1409
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 13, 2024
1 parent a8fb137 commit 19306b0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
13 changes: 13 additions & 0 deletions signbank/dictionary/templates/dictionary/gloss_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -1826,10 +1826,13 @@ <h2 id='modalDeleteNME'>{% trans "Delete NME Video" %}</h2>
</tr>
{% endfor %}
{% endwith %}
<tr>Perspective {{videonme.perspective}}</tr>
<tr class="editform">
<td>{% trans "Index" %}</td>
<td class='edit edit_int' id='nmevideo_offset_{{videonme.id}}'>{{videonme.offset}}</td>
</tr>
<tr>
</tr>
</table>
</td>
</tr>
Expand Down Expand Up @@ -1882,6 +1885,16 @@ <h4>{% trans "Upload New NME Video" %}</h4>
</td>
</tr>
{% endfor %}

<th>{% trans "Perspective" %}</th>
<td>
<select name="perspective" class="form-control" id="nmevideo_perspective">
<option value="left">Left</option>
<option value="center">Center</option>
<option value="right">Right</option>
</select>
</td>

</table>
<br><br>
</form>
Expand Down
18 changes: 18 additions & 0 deletions signbank/video/migrations/0014_glossvideonme_perspective.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.17 on 2024-12-13 14:34

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('video', '0013_annotatedvideo_url'),
]

operations = [
migrations.AddField(
model_name='glossvideonme',
name='perspective',
field=models.CharField(choices=[('left', 'Left'), ('right', 'Right')], default='center', max_length=20),
),
]
11 changes: 5 additions & 6 deletions signbank/video/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def get_two_letter_dir(idgloss):
return foldername


PERSPECTIVE_CHOICES = (('left', 'Left'),
('right', 'Right')
)

class GlossVideoStorage(FileSystemStorage):
"""Implement our shadowing video storage system"""

Expand Down Expand Up @@ -886,6 +890,7 @@ def __str__(self):

class GlossVideoNME(GlossVideo):
offset = models.IntegerField(default=1)
perspective = models.CharField(max_length=20, choices=PERSPECTIVE_CHOICES, default='center')

class Meta:
verbose_name = gettext("NME Gloss Video")
Expand Down Expand Up @@ -975,12 +980,6 @@ def reversion(self, revert=False):
self.delete_files()
self.delete()


PERSPECTIVE_CHOICES = (('left', 'Left'),
('right', 'Right')
)


class GlossVideoPerspective(GlossVideo):
perspective = models.CharField(max_length=20, choices=PERSPECTIVE_CHOICES)

Expand Down
1 change: 1 addition & 0 deletions signbank/video/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def addvideo(request):
form_value = form.cleaned_data[form_field]
descriptions[language.language_code_2char] = form_value.strip()
nmevideo.add_descriptions(descriptions)
nmevideo.perspective = form.cleaned_data['perspective'] #This is incorrect
elif object_type == 'morpheme_video':
morpheme = Morpheme.objects.filter(id=object_id).first()
if not morpheme:
Expand Down

0 comments on commit 19306b0

Please sign in to comment.