soustredeni +action skryti soustredeni
This commit is contained in:
parent
82cf4c6a64
commit
b5dda32fee
2 changed files with 8 additions and 2 deletions
|
@ -304,6 +304,12 @@ def zverejnit_soustredeni(modeladmin, request, queryset):
|
|||
soustredeni.save()
|
||||
zverejnit_soustredeni.short_description = 'Zveřejnit soustředění'
|
||||
|
||||
def skryt_soustredeni(modeladmin, request, queryset):
|
||||
for soustredeni in queryset:
|
||||
soustredeni.verejne_db = False
|
||||
soustredeni.save()
|
||||
skryt_soustredeni.short_description = 'Skrýt soustředění (Zneveřjnit)'
|
||||
|
||||
class SoustredeniAdminForm(forms.ModelForm):
|
||||
text = forms.CharField(widget=CKEditorWidget(), required=False, **field_labels(Soustredeni, 'text'))
|
||||
class Meta:
|
||||
|
@ -320,7 +326,7 @@ class SoustredeniAdmin(reversion.VersionAdmin):
|
|||
inlines = [Soustredeni_UcastniciInline]
|
||||
list_filter = ['rocnik']
|
||||
view_on_site = Soustredeni.verejne_url
|
||||
actions = [zverejnit_soustredeni,]
|
||||
actions = [zverejnit_soustredeni, skryt_soustredeni, ]
|
||||
|
||||
admin.site.register(Soustredeni, SoustredeniAdmin)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{% for soustredeni in object_list %}
|
||||
{# Kdyz je verejne -> zobraz #}
|
||||
{% if soustredeni.verejne_db or user.is_authenticated %}
|
||||
{% if user.is_authenticated %}
|
||||
{% if not soustredeni.verejne_db and user.is_authenticated %}
|
||||
Groups of user: {{user.groups.all}} <br>
|
||||
<!-- TODO pri prihlasovani ucastniku dodelat prava
|
||||
jen na group org ve view -->
|
||||
|
|
Loading…
Reference in a new issue