From 4516cc0d654744d51b7e0b646b99bf83e7dfabb5 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Mon, 8 Jun 2020 21:57:52 +0200 Subject: [PATCH] Listen button only visible if user has read permissions Audioformat fix Table edit functions only available if user has edit rights --- cps/constants.py | 4 ++-- cps/templates/book_table.html | 20 +++++++++++--------- cps/templates/detail.html | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/cps/constants.py b/cps/constants.py index 63543c2b..ed127136 100644 --- a/cps/constants.py +++ b/cps/constants.py @@ -111,10 +111,10 @@ except ValueError: del env_CALIBRE_PORT -EXTENSIONS_AUDIO = {'mp3', 'mp4', 'ogg', 'opus', 'wav', 'flac'} +EXTENSIONS_AUDIO = {'mp3', 'mp4', 'ogg', 'opus', 'wav', 'flac', 'm4a', 'm4b'} EXTENSIONS_CONVERT = ['pdf', 'epub', 'mobi', 'azw3', 'docx', 'rtf', 'fb2', 'lit', 'lrf', 'txt', 'htmlz', 'rtf', 'odt'] EXTENSIONS_UPLOAD = {'txt', 'pdf', 'epub', 'kepub', 'mobi', 'azw', 'azw3', 'cbr', 'cbz', 'cbt', 'djvu', 'prc', 'doc', 'docx', - 'fb2', 'html', 'rtf', 'lit', 'odt', 'mp3', 'mp4', 'ogg', 'opus', 'wav', 'flac'} + 'fb2', 'html', 'rtf', 'lit', 'odt', 'mp3', 'mp4', 'ogg', 'opus', 'wav', 'flac', 'm4a', 'm4b'} def has_flag(value, bit_flag): diff --git a/cps/templates/book_table.html b/cps/templates/book_table.html index 4df92a97..4e19c39b 100644 --- a/cps/templates/book_table.html +++ b/cps/templates/book_table.html @@ -24,18 +24,20 @@ + {% if g.user.role_edit() %} + {% endif %} - Title - Sort - Authors Sort - Authors - Tags - Series - Series Index - Language + Title + Sort + Authors Sort + Authors + Tags + Series + Series Index + Language Publishing Date - Publishers + Publishers {% if g.user.role_edit() %} {% endif %} diff --git a/cps/templates/detail.html b/cps/templates/detail.html index 4a0fbe02..9014c8a5 100644 --- a/cps/templates/detail.html +++ b/cps/templates/detail.html @@ -66,7 +66,7 @@ {% endif %} - {% if audioentries|length > 0 %} + {% if audioentries|length > 0 and g.user.role_viewer() %}