Skip to content

Commit

Permalink
Merge pull request #154 from EsupPortail/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ptitloup authored Aug 23, 2019
2 parents 2912368 + 4420ae9 commit 0e55c2c
Show file tree
Hide file tree
Showing 46 changed files with 3,316 additions and 1,109 deletions.
12 changes: 12 additions & 0 deletions pod/authentication/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
Expand All @@ -12,6 +13,11 @@
# Define an inline admin descriptor for Owner model
# which acts a bit like a singleton

USE_ESTABLISHMENT_FIELD = getattr(
settings,
'USE_ESTABLISHMENT_FIELD',
False)


class OwnerInline(admin.StackedInline):
model = Owner
Expand Down Expand Up @@ -64,10 +70,16 @@ def clickable_email(self, obj):
'is_superuser',
'owner_hashkey'
)
if USE_ESTABLISHMENT_FIELD:
list_display = list_display + ('owner_establishment',)

def owner_hashkey(self, obj):
return "%s" % Owner.objects.get(user=obj).hashkey

def owner_establishment(self, obj):
return "%s" % Owner.objects.get(user=obj).establishment
owner_establishment.short_description = _('Establishment')

ordering = ('-is_superuser', 'username', )
inlines = (OwnerInline, )

Expand Down
6 changes: 6 additions & 0 deletions pod/authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
else:
from pod.main.models import CustomImageModel

USE_RGPD = getattr(settings, 'USE_RGPD', False)

AUTH_TYPE = getattr(
settings, 'AUTH_TYPE', (('local', _('local')), ('CAS', 'CAS')))
AFFILIATION = getattr(
Expand Down Expand Up @@ -48,6 +50,8 @@


def get_name(self):
if USE_RGPD:
return '%s %s' % (self.first_name, self.last_name)
return '%s %s (%s)' % (self.first_name, self.last_name, self.username)


Expand All @@ -71,6 +75,8 @@ class Owner(models.Model):
default=ESTABLISHMENTS[0][0])

def __str__(self):
if USE_RGPD:
return "%s %s" % (self.user.first_name, self.user.last_name)
return "%s %s (%s)" % (self.user.first_name, self.user.last_name,
self.user.username)

Expand Down
2 changes: 2 additions & 0 deletions pod/completion/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
from django.conf import settings
from django.forms.widgets import HiddenInput
from django.utils.safestring import mark_safe
# from django.utils.translation import ugettext_lazy as _
from pod.completion.models import Contributor
from pod.completion.models import Document
from pod.completion.models import Track
from pod.completion.models import Overlay

FILEPICKER = False
if getattr(settings, 'USE_PODFILE', False):
FILEPICKER = True
Expand Down
87 changes: 87 additions & 0 deletions pod/completion/static/css/caption_maker.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#videoElm {
display: block;
border: solid 1px #999;
width: 100%;
min-height: 297px;
}
.videoError {
display: block;
background-color: #999;
width: 100%;
min-height: 297px;
color: white;
text-align: center;
padding: 12px;
}

#videoError {
display: none;
}
#captionTitle {
padding-top: 4px;
padding-bottom: 4px;
}

#textCaptionEntry {
width: 100%;
height: auto;
line-height: 19px;
border: 1px solid #999;
padding: 3px 8px 5px;
text-align: center;
min-height: 50px;
overflow: hidden;
}

#textCaptionEntry.playing {
border-color: #666;
background-color: #666;
color: white;
}

textarea {
line-height: 16px;
font-size: 14px;
}

/* the list of captions */

#display {
border: solid 1px #999;
height: 374px;
overflow: auto;
}

#display div {
cursor: pointer;
padding: 2px 0 3px 0;
white-space: nowrap;
overflow: hidden;
}

#display div:nth-child(odd) {
background-color: #5BC2EC;
}

#display div:nth-child(even) {
background-color: #bef;
}

#display div:hover {
background-color: #ECA809;
}

#display div span {
margin-left: 1em;
display: inline-block;
vertical-align: top;
}

#display div span:nth-child(3) {
font-style: italic;
}


#captionmakerModal.save > .modal-dialog {
max-width: 1000px;
}
Loading

0 comments on commit 0e55c2c

Please sign in to comment.