-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds captions modal with visibility controlled by featureflag
- Loading branch information
Showing
13 changed files
with
120 additions
and
43 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...uration/contentcuration/frontend/channelEdit/components/CaptionsEditor/CaptionsEditor.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<template> | ||
<div> | ||
<h1>{{ message }}</h1> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
message: "Caption editor!", | ||
}; | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
/* styles */ | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from rest_framework import serializers, status | ||
from rest_framework.response import Response | ||
from rest_framework.viewsets import ModelViewSet | ||
from contentcuration.models import Caption | ||
|
||
|
||
class CaptionSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Caption | ||
fields = ["id", "caption", "language"] | ||
|
||
|
||
class CaptionViewSet(ModelViewSet): | ||
queryset = Caption.objects.all() | ||
serializer_class = CaptionSerializer | ||
|
||
def create(self, request): | ||
serializer = self.get_serializer(data=request.data) | ||
if not serializer.is_valid(): | ||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) | ||
else: | ||
self.perform_create(serializer=serializer) | ||
headers = self.get_success_headers(serializer.data) | ||
return Response( | ||
serializer.data, headers=headers, status=status.HTTP_201_CREATED | ||
) | ||
|
||
def update(self, request, pk=None): | ||
instance = self.get_object() | ||
serializer = self.get_serializer(instance, data=request.data, partial=True) | ||
if not serializer.is_valid(raise_exception=True): | ||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) | ||
else: | ||
serializer.save() | ||
return Response(serializer.data, status=status.HTTP_200_OK) | ||
|
||
def destroy(self, request): | ||
instance = self.get_object() | ||
self.perform_destroy(instance) | ||
return Response(status=status.HTTP_204_NO_CONTENT) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters