Skip to content

Commit

Permalink
Merge pull request #593 from EsupPortail/dev
Browse files Browse the repository at this point in the history
[DONE] Fix some bug to 2.9
  • Loading branch information
ptitloup authored Feb 28, 2022
2 parents f8d0d17 + dedf887 commit be3d08a
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 16 deletions.
9 changes: 7 additions & 2 deletions pod/enrichment/static/css/videojs-slides.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,17 @@
}
.video-slides>li>div {
height: 100%;
background-color: #fff;
color: #000;
background-color: var(--light); /*#fff;*/
color: var(--font-color);
padding: 1em;
}
.video-slides>li>.slide_embed {
overflow: auto;
background-color: #000; /*var(--light);*/
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.video-slides>li>img {
max-width: 100%;
Expand Down
11 changes: 6 additions & 5 deletions pod/enrichment/static/js/videojs-slides.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,14 @@ var VideoSlides = function (items) {
slide.alt = this.slidesItems[i].title;
slide.width = player.currentDimensions().width / 2;
slide.height = player.currentDimensions().height / 2;
} else*/ if (type == "document") {
} else*/
if (type == "document") {
slide = document.createElement("embed");
slide.src = this.slidesItems[i].url;
slide.alt = this.slidesItems[i].title;
slides.type = "application/pdf";
slide.width = player.currentDimensions().width / 2;
slide.height = player.currentDimensions().height / 2;
slide.width = "100%"; //player.currentDimensions().width / 2;
slide.height = "100%"; //player.currentDimensions().height / 2;
} else if (type == "richtext") {
slide = document.createElement("div");
slide.innerHTML = this.slidesItems[i].url;
Expand All @@ -179,8 +180,8 @@ var VideoSlides = function (items) {
slide.src = this.slidesItems[i].url;
slide.alt = this.slidesItems[i].title;
slides.type = "text/html";
slide.width = player.currentDimensions().width / 2;
slide.height = player.currentDimensions().height / 2;
slide.width = "100%"; //player.currentDimensions().width / 2;
slide.height = "100%"; //player.currentDimensions().height / 2;
} else if (type == "embed") {
slide = document.createElement("div");
slide.classList.add("slide_embed");
Expand Down
Binary file modified pod/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
4 changes: 0 additions & 4 deletions pod/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -4382,8 +4382,6 @@ msgid "Same size for screen and camera"
msgstr "La vidéo de l'écran et de la caméra seront côte à côte"

#: pod/recorder/templates/recorder/opencast-studio.html:60
#, fuzzy
#| msgid "Please enter a document."
msgid "Please select the render you want"
msgstr "Veuillez sélectionner le rendu souhaité"

Expand Down Expand Up @@ -4477,8 +4475,6 @@ msgid "The record has been deleted."
msgstr "L’enregistrement a été supprimé."

#: pod/recorder/views.py:838
#, fuzzy
#| msgid "Recorder not found."
msgid "Recorder for Studio not found."
msgstr "Enregistreur Studio non trouvé."

Expand Down
2 changes: 1 addition & 1 deletion pod/main/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def context_navbar(request):
.annotate(video_count=Count("video", distinct=True))
)

linkFooter = LinkFooter.objects.all().filter(page__sites=get_current_site(request))
linkFooter = LinkFooter.objects.all().filter(sites=get_current_site(request))

list_videos = Video.objects.filter(
encoding_in_progress=False,
Expand Down
10 changes: 10 additions & 0 deletions pod/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.template.defaultfilters import slugify
from django.dispatch import receiver
from django.db.models.signals import post_save
from django.db import connection
import os
import mimetypes
Expand Down Expand Up @@ -133,6 +136,7 @@ class LinkFooter(models.Model):
null=True,
help_text=_("Select the page of Pod you want to link with."),
)
sites = models.ManyToManyField(Site)

class Meta:
ordering = ["order", "title"]
Expand All @@ -152,6 +156,12 @@ def clean(self):
raise ValidationError(_("You must give an URL or a page to link the link"))


@receiver(post_save, sender=LinkFooter)
def default_site_link_footer(sender, instance, created, **kwargs):
if len(instance.sites.all()) == 0:
instance.sites.add(Site.objects.get_current())


class Configuration(models.Model):
key = models.SlugField(
_("Key"),
Expand Down
33 changes: 30 additions & 3 deletions pod/recorder/templates/recorder/opencast-studio.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
{% extends 'base.html' %}
{% load i18n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %}

{% block page_extra_head %}
<style>
:root {
--theme-ui-colors-background: var(--background-color);
--theme-ui-colors-text: var(--font-color);
--theme-ui-colors-primary: var(--primary);
--theme-ui-colors-error: var(--color-formfields);
}
[data-theme="dark"] {
/*--theme-ui-colors-gray-0: var(--font-color);*/
/* secondary-button::hover */
--theme-ui-colors-gray-3: #797676;
/*--theme-ui-colors-gray-4: #737373;*/
}
#root header {display:none;}
/* Studio height */
#root > div {
min-height: 600px;
}
</style>

#root code {
color: var(--font-color);
}

button>.fa-layers {
color: var(--font-color);
}
</style>
<script>
// put local storage default value for default presenter
{% if default_presenter %}
localStorage.setItem('ocStudioLastPresenter', "{{default_presenter}}");
{% endif %}
// put local storage default value for language
localStorage.setItem('i18nextLng', "{{LANGUAGE_CODE|lower}}");
</script>
{% endblock page_extra_head %}

{% block breadcrumbs %}{{ block.super }}
Expand Down Expand Up @@ -41,8 +69,7 @@
{% else %}
const list_value = [["mid", "50/50 - {% trans "Same size for screen and camera" %}"], ["piph", "Pip - {% trans "Camera inside the screen video to top right" %}"], ["pipb", "Pip - {% trans "Camera inside the screen video to bottom right" %}"]];
{% endif %}
// put local storage default value
localStorage.setItem('ocStudioLastPresenter', "{{default_presenter}}");

//Create and append select list
let selectList = document.createElement("select");
selectList.id = "input_presenter";
Expand Down
2 changes: 1 addition & 1 deletion pod/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
##
# Version of the project
#
VERSION = "2.9.0"
VERSION = "2.9.1"

##
# Installed applications list
Expand Down
6 changes: 6 additions & 0 deletions pod/video/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,12 @@ class Meta:
verbose_name_plural = _("Types")


@receiver(post_save, sender=Type)
def default_site_type(sender, instance, created, **kwargs):
if len(instance.sites.all()) == 0:
instance.sites.add(Site.objects.get_current())


class Discipline(models.Model):
title = models.CharField(_("title"), max_length=100, unique=True)
slug = models.SlugField(
Expand Down

0 comments on commit be3d08a

Please sign in to comment.