Skip to content

Commit

Permalink
New feature: Cut button.
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlFK committed Jun 13, 2024
1 parent 2bf060c commit a3896d9
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dj/main/templates/episode.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@

<input type="checkbox" id="ep-sm" class="ep-showmore" {{ep_sm|yesno:"checked=checked,"}}> <label class="ep-summary" for="ep-sm">show more...</label>

{%if episode.state == 1 %}
{% endif %}
<a href="{% url "episode_marks" episode.id %}">Marks</a><br>

<div class="ep-detail">
<table>
<tbody>
Expand Down
1 change: 1 addition & 0 deletions dj/main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

re_path(r'.*E/(?P<episode_id>\d+)/$', episode, name='episode'),
re_path(r'.*E/(?P<episode_id>\d+)/claim_lock/$', claim_episode_lock),
re_path(r'.*E/(?P<episode_id>\d+)/marks/$', episode_marks, name="episode_marks"),

re_path(r'meeting_announcement/(?P<show_id>\w+)/$',
meet_ann,
Expand Down
47 changes: 47 additions & 0 deletions dj/main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2835,6 +2835,53 @@ def episode(request, episode_id, episode_slug=None, edit_key=None):
},
)

def episode_marks(request, episode_id, edit_key=None):

"""
Add Episode Mrks and Cuts
WIP - meant to add Marks (like when you click cut) on the fly.
making this up as I go along.
MVP: log in, find an episode, "Cut" and now() is added to Mark.
TODO: add support for [x]ing the right cut. (typicaly the last)
problem: cutlist has a link to Raw_File,
and at the time the talk is happening
there isn't a Raw_File item in the DB.
"""

episode=get_object_or_404(Episode,id=episode_id)

cuts = Cut_List.objects.filter(
episode=episode).order_by('sequence','raw_file__start','start')

marks = Mark.objects.filter(
location=episode.location,
).order_by('click')

if request.user.is_authenticated:

if request.method == 'POST':

# grab server time (hope it is the right timezone)
# client side js time might be better.

mark = Mark.objects.create(
show=episode.show,
location=episode.location,
click=datetime.datetime.now()
)
mark.save()

return render(
request,
'episode_marks.html',
{'episode':episode,
'marks':marks,
'cuts':cuts,
'edit_key':edit_key,
},
)


def episode_logs(request, episode_id):

episode = get_object_or_404(Episode, id=episode_id)
Expand Down

0 comments on commit a3896d9

Please sign in to comment.