From 026b899db3e43059214376a18080502ed524a38e Mon Sep 17 00:00:00 2001 From: Kobe Date: Mon, 26 May 2025 08:52:04 +0200 Subject: [PATCH] dynamic colours in website settings --- __pycache__/models.cpython-313.pyc | Bin 11100 -> 12303 bytes .../9faab7ef6036_add_site_settings_table.py | 42 +++ ...36_add_site_settings_table.cpython-313.pyc | Bin 0 -> 2356 bytes models.py | 17 +- routes/__pycache__/main.cpython-313.pyc | Bin 21425 -> 29236 bytes routes/main.py | 130 +++++++- static/css/room_members.css | 6 +- static/css/starred.css | 12 +- static/js/file-grid.js | 44 +-- templates/common/base.html | 2 + templates/components/header.html | 6 +- templates/components/storage_usage.html | 2 +- templates/components/trash_type.html | 2 +- templates/contacts/list.html | 12 +- templates/dashboard/dashboard.html | 1 + templates/rooms/room.html | 141 ++++---- templates/rooms/rooms.html | 6 +- templates/settings/settings.html | 312 +++++++++++++++++- templates/trash/trash.html | 1 + 19 files changed, 617 insertions(+), 119 deletions(-) create mode 100644 migrations/versions/9faab7ef6036_add_site_settings_table.py create mode 100644 migrations/versions/__pycache__/9faab7ef6036_add_site_settings_table.cpython-313.pyc diff --git a/__pycache__/models.cpython-313.pyc b/__pycache__/models.cpython-313.pyc index 3c7a3b2bb1ac1e079dde9036fb5c2e01fc1820d8..ba276ec90d0fab9f020893a1dbf9ecd55171b981 100644 GIT binary patch delta 909 zcmZuvNlX(_7=AOg(}iiLrKO#=pjA;iBuYS88VpE+#x}76r5?0NE$y_7c7Zq31DZhf zBAjS>F@+<3?KvPf;&B+Fimg%4%@j+ga zgiKQ0xs9FUkjA*9!EjS^w6mwTr*{H6s#@>q&WY{>M?yQ+WoVbON7*%Kc-!a`jud@)*O;ouX)UuWK z{+EtMRo1zBEjI`etpFawu^c6fq|ixTiqt)_0juUk95lheQ1-h&ol4@{tFz%5a1fo zcXtyiF|1!UOhF+Xg)@;@HkE}kBl59qCjQ3&@!|ngjttLXkoDC|#v@TlZiuC#qL}8T z$!r`xM`jPpJXHb}P+o{Qi$+Y%b5>i)SM)7UJQP-hRpNeX%~$Z1tpoXsn>My26op6R zGu>m|>ftB!notnRwzK(5n`TSNQFJVKJ?vlUU(>#1)|t1S4;}A13XZb*O5VS%HvJ$e zHM^?-03pv4k^lez diff --git a/migrations/versions/9faab7ef6036_add_site_settings_table.py b/migrations/versions/9faab7ef6036_add_site_settings_table.py new file mode 100644 index 0000000..3e18a7c --- /dev/null +++ b/migrations/versions/9faab7ef6036_add_site_settings_table.py @@ -0,0 +1,42 @@ +"""Add site_settings table + +Revision ID: 9faab7ef6036 +Revises: ca9026520dad +Create Date: 2025-05-25 21:16:39.683736 + +""" +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = '9faab7ef6036' +down_revision = 'ca9026520dad' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('site_settings', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('primary_color', sa.String(length=7), nullable=True), + sa.Column('secondary_color', sa.String(length=7), nullable=True), + sa.Column('updated_at', sa.DateTime(), nullable=True), + sa.PrimaryKeyConstraint('id') + ) + op.drop_table('color_settings') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('color_settings', + sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), + sa.Column('primary_color', sa.VARCHAR(length=7), autoincrement=False, nullable=True), + sa.Column('secondary_color', sa.VARCHAR(length=7), autoincrement=False, nullable=True), + sa.Column('updated_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), + sa.PrimaryKeyConstraint('id', name=op.f('color_settings_pkey')) + ) + op.drop_table('site_settings') + # ### end Alembic commands ### diff --git a/migrations/versions/__pycache__/9faab7ef6036_add_site_settings_table.cpython-313.pyc b/migrations/versions/__pycache__/9faab7ef6036_add_site_settings_table.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c51223a5b1e6062c62388698c6d72a1a52475c04 GIT binary patch literal 2356 zcmc&$&2Jk;6yLSiYkOn6`I1ULAWkSCBbqu6PO*iMk~oFLs>Ru zE^!9jD_z*l)tVfqVDb$kGMEur(UoQwT-X(+b9dT}IT*RLXMx8& z@I2Tn^4KT3u^+l1dIuTYCHjB{3hs!13r{Ob*eIGvGLUH&wSo~g<#iPaLI&L^8bw_T z&!>{%#D*-dUq%~K(aEW%1R2S2UQR?~Q}I|-kriPUBiTgZ6p&;%7LCO(M&lP_@o;P+ zIWd)-OpH&xGkF=Tg=h2{5tg|0@)8U}SvSlAM#iTq2{`v50jK|b>++2u0Mrfr_(zsT zVy!L9*fDBz7-kG2v&Pws3~$d)M$m9MG<+u#dp5?zTT{_3atXIX`)q$6heqQ?ZBNY+ zcH~8Gf)#x)+xtyqMeFVfwVIVsq5**0OO zz(fK|B-oLJ#8p(TKyvuBimK9lB*8K+mSkL&^17*2oKO`53D=nr?>}V(ORx)eKs>aBdw`GqK(bdNE)tY0 zre4$lgC(Sym_{3SQ9^HsX|mvRl+a_7zD@*7W45l9f;?K@6&WYLS#TEP#U9%f_fZ7aFLK7DcQ?_5xKhv5x zdmYwc=*E2@ZJgEnFWC5K1FgpGS1fMM=2NI`?QYe2tdYrscwM|^aUZp0O|%W(9jr}Q zqw#~)`s&9P_la$&?kzkSjy@WW9uCJ2UaM!WTHG~|*|58ZADDN|`dib7Z_HTSY$pV7 zU3$!oH7*hf60amFdR~%T`EcuB zfCOnoq?6@3mbLt*1SJ}&22?>*Mw((sy4EO6m`3e%P<`)~bfu!A_wXf<(l3WWllI8X zvh43Jp5^`wG3@!DnDf6dZyxbXU~t>_wELCq;M4AYAi' \ No newline at end of file + return f'' + +class SiteSettings(db.Model): + id = db.Column(db.Integer, primary_key=True) + primary_color = db.Column(db.String(7), default='#16767b') # Default from colors.css + secondary_color = db.Column(db.String(7), default='#741b5f') # Default from colors.css + updated_at = db.Column(db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow) + + @classmethod + def get_settings(cls): + settings = cls.query.first() + if not settings: + settings = cls() + db.session.add(settings) + db.session.commit() + return settings \ No newline at end of file diff --git a/routes/__pycache__/main.cpython-313.pyc b/routes/__pycache__/main.cpython-313.pyc index 56299eef9b448a86e066533ee7dcf8a9a1dbcf33..0b8cc23132900752cadb82233727f7fbba8777ab 100644 GIT binary patch delta 8474 zcmb_heQaCTb-#~~U!q8TQI=>*6rV&{7G+akmMmMACCjocnX)BEv|@WoqR`Zn%!DH4 z`>5Df7SKVl&P|%8>035u%TRY1S`}yqWoa`v8y2_8Q16>8z0rO!76dB>cqleH4$>t1 zqdVt5e##P(0KJgTJNMjk&%Ni~^SfVs<9pnXe#w!_=rz4ZuFMW60eDxSe_p*^_r>KYoQiz87=dc({gVGt?*XTN>;8NucB2@Pd9G$ zR?})G(~ocQ*3cSnEv@z1sLi{TZe?=AxZP`~c5fZ6%hau>^-xzk?r>1YWA#%5*t6o) zL>{Y`KPcbgFhco(;xf!Zxnt^}?A&4B-@*Ax_VNN$m^!qfqN|rv<+RynvJ<*(LF+EP zha$H@Uf_mIig8MmmLg$El)uY0a(ekD*IA~ReZi>c6Qj{!ctMgs;odUnc|x8ry(<5P zx5_zut@15xt-H!s0v$B%)y!zJo%31k zq&Jhve!~V-uHHa-%Ld9uP_C=Vy5+0QtAtAyh}$NcbuV(C$yap_=*U~TA977^&gp;M z!nM8mnCB&q+b92b`}3Sx4s{G3?uU+03=PE?lxF>Ni@`80Ls>Zz3lOm9TDAom~a3remAu&ul zP+*dxeoC2|qW3Q?iQzd~jRo3J@M#f>mqNkl?2?~G=@vQAIUK0PLj7_y5RP1+Hq00n z#l^ECl@#6|zNGNM@GPxh@?}Y+v%xuqUl5}d2bjXV5qASUfc!9$gGfe@V93zJNcPEw zF2U{wR;ikg&_#bV3jOm3qQPf^(Mz;b9`0&$9YM`eBx9&(j)dk!DLNaae(4-NigK^~ zjjlHRII_p&zwJ8Bx!$bp4%BeJCqFwj!@clkYHX65!vUvXM+=&Wq-dA?(R1`M%<9F9 zK`A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odM+R?qGQN1s+#ST9pHt9=TLv1t`puNSV6Z2Q+jB|+Yyi;J(3{r1hp z64}FA!h5)a$FiB&RGm7!f>TL*L$@89NuZh5mgd$LUUn@N%QSTdWDNBoBt!$Tj|d`` z5X*=f0yoZl`~)r$F7lydazmy(_EKcD&K{9cR)UKRe9gjnW&X7b1A)O~r%T|Or>A6PAZ$?%T=A0dtq zCl%$lpt4$7-5QH*Yp}7awQ8d+N9W#H7v3J5hH6ymnz`e4AYki2 zHzJO}`; files.forEach((file, idx) => { let icon = file.type === 'folder' - ? `` - : ``; + ? `` + : ``; let size = file.size !== '-' ? (file.size > 0 ? (file.size < 1024*1024 ? (file.size/1024).toFixed(1)+' KB' : (file.size/1024/1024).toFixed(2)+' MB') : '0 KB') : '-'; let actionsArr = []; let dblClickAction = ''; @@ -138,16 +138,16 @@ function renderFiles(files) { } if (isTrashPage) { - actionsArr.push(``); - actionsArr.push(``); + actionsArr.push(``); + actionsArr.push(``); } else { - actionsArr.push(``); + actionsArr.push(``); } - actionsArr.push(``); + actionsArr.push(``); const actions = actionsArr.join(''); table += ` ${icon} - + ${file.name} ${formatDate(file.modified)} ${file.type} @@ -161,8 +161,8 @@ function renderFiles(files) { } else { files.forEach((file, idx) => { let icon = file.type === 'folder' - ? `` - : ``; + ? `` + : ``; let size = file.size !== '-' ? (file.size > 0 ? (file.size < 1024*1024 ? (file.size/1024).toFixed(1)+' KB' : (file.size/1024/1024).toFixed(2)+' MB') : '0 KB') : '-'; let actionsArr = []; let dblClickAction = ''; @@ -173,12 +173,12 @@ function renderFiles(files) { } if (isTrashPage) { - actionsArr.push(``); - actionsArr.push(``); + actionsArr.push(``); + actionsArr.push(``); } else { - actionsArr.push(``); + actionsArr.push(``); } - actionsArr.push(``); + actionsArr.push(``); const actions = actionsArr.join(''); grid.innerHTML += `
@@ -189,7 +189,7 @@ function renderFiles(files) {
${formatDate(file.modified)}
${size}
${isTrashPage ? `
Auto Delete: ${file.auto_delete ? formatDate(file.auto_delete) : 'Never'}
` : ''} -
+
@@ -428,8 +428,8 @@ function emptyTrash() { function showDetailsModal(idx) { const item = currentFiles[idx]; const icon = item.type === 'folder' - ? `` - : ``; + ? `` + : ``; const uploaderPic = item.uploader_profile_pic ? `/uploads/profile_pics/${item.uploader_profile_pic}` : '/static/default-avatar.png'; @@ -446,12 +446,12 @@ function showDetailsModal(idx) { ${item.uploaded_by || '-'}
${formatDate(item.modified)}
-
-
Room:
-
Path: ${(item.path ? item.path + '/' : '') + item.name}
-
Size: ${item.size === '-' ? '-' : (item.size > 0 ? (item.size < 1024*1024 ? (item.size/1024).toFixed(1)+' KB' : (item.size/1024/1024).toFixed(2)+' MB') : '0 KB')}
-
Uploaded at: ${item.uploaded_at ? new Date(item.uploaded_at).toLocaleString() : '-'}
- ${isTrashPage ? `
Auto Delete: ${item.auto_delete ? formatDate(item.auto_delete) : 'Never'}
` : ''} +
+
Room:
+
Path: ${(item.path ? item.path + '/' : '') + item.name}
+
Size: ${item.size === '-' ? '-' : (item.size > 0 ? (item.size < 1024*1024 ? (item.size/1024).toFixed(1)+' KB' : (item.size/1024/1024).toFixed(2)+' MB') : '0 KB')}
+
Uploaded at: ${item.uploaded_at ? new Date(item.uploaded_at).toLocaleString() : '-'}
+ ${isTrashPage ? `
Auto Delete: ${item.auto_delete ? formatDate(item.auto_delete) : 'Never'}
` : ''} `; document.getElementById('detailsModalBody').innerHTML = detailsHtml; var modal = new bootstrap.Modal(document.getElementById('detailsModal')); diff --git a/templates/common/base.html b/templates/common/base.html index 9b8281e..c0f00bd 100644 --- a/templates/common/base.html +++ b/templates/common/base.html @@ -10,6 +10,8 @@ + + {% block extra_css %}{% endblock %} diff --git a/templates/components/header.html b/templates/components/header.html index f17118e..884cf01 100644 --- a/templates/components/header.html +++ b/templates/components/header.html @@ -4,7 +4,7 @@

- + {{ title }}

{% if description %} @@ -16,7 +16,7 @@ {% if button_url == "#" %}
@@ -132,14 +132,14 @@
+ style="background-color: var(--primary-opacity-8); color: var(--primary-color);"> {{ user.email }} {% if user.phone %} + style="background-color: var(--primary-opacity-8); color: var(--primary-color);"> {{ user.phone }} @@ -182,7 +182,7 @@
+ style="background-color: var(--primary-opacity-8); color: var(--primary-color);"> Edit diff --git a/templates/dashboard/dashboard.html b/templates/dashboard/dashboard.html index f965cc0..c351d95 100644 --- a/templates/dashboard/dashboard.html +++ b/templates/dashboard/dashboard.html @@ -5,6 +5,7 @@ {% block extra_css %} + {% endblock %} {% block content %} diff --git a/templates/rooms/room.html b/templates/rooms/room.html index c31dfcc..1c97700 100644 --- a/templates/rooms/room.html +++ b/templates/rooms/room.html @@ -31,28 +31,28 @@
{% if current_user.is_admin %} - + Manage Members {% endif %} {% if current_user.is_admin or can_upload %} -
-
{% endif %} {% if current_user.is_admin or can_download %} - {% endif %} {% if current_user.is_admin or can_delete %} - {% endif %} @@ -60,8 +60,8 @@
@@ -191,8 +191,8 @@
@@ -217,7 +217,7 @@ @@ -270,22 +270,22 @@ #fileGrid.list-view table { width: 100%; border-collapse: collapse; - background: #fff; + background: var(--white); } #fileGrid.list-view th, #fileGrid.list-view td { padding: 0.5rem 1rem; - border-bottom: 1px solid #e9ecef; + border-bottom: 1px solid var(--border-light); text-align: left; font-size: 0.95rem; vertical-align: middle; } #fileGrid.list-view th { - background: #f8f9fa; - color: #6c757d; + background: var(--bg-color); + color: var(--text-muted); font-weight: 500; } #fileGrid.list-view tr:hover td { - background-color: rgba(22, 118, 123, 0.08); + background-color: var(--primary-opacity-8); transition: background 0.15s; } #fileGrid.list-view .file-icon { @@ -308,31 +308,31 @@ display: grid; grid-template-columns: 40px 2fr 1fr 1fr 1fr; padding: 0.5rem 1rem; - background-color: #f8f9fa; - border-bottom: 1px solid #e9ecef; - color: #6c757d; + background-color: var(--bg-color); + border-bottom: 1px solid var(--border-light); + color: var(--text-muted); font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; } .btn-group.btn-group-sm .btn { - background-color: #fff; - border-color: #e9ecef; - color: #6c757d; + background-color: var(--white); + border-color: var(--border-light); + color: var(--text-muted); transition: background-color 0.15s, color 0.15s; } .btn-group.btn-group-sm .btn.active, .btn-group.btn-group-sm .btn:active { - background-color: #e6f3f4 !important; - color: #16767b !important; - border-color: #16767b !important; + background-color: var(--primary-bg-light) !important; + color: var(--primary-color) !important; + border-color: var(--primary-color) !important; box-shadow: none; } .btn-group.btn-group-sm .btn:focus { - box-shadow: 0 0 0 0.1rem #16767b33; + box-shadow: 0 0 0 0.1rem var(--primary-opacity-20); } .btn-group.btn-group-sm .btn:hover:not(.active) { - background-color: #f8f9fa; - color: #16767b; + background-color: var(--bg-color); + color: var(--primary-color); } #fileGrid.table-mode { padding: 0; @@ -340,22 +340,22 @@ #fileGrid.table-mode table { width: 100%; border-collapse: collapse; - background: #fff; + background: var(--white); } #fileGrid.table-mode th, #fileGrid.table-mode td { padding: 0.5rem 1rem; - border-bottom: 1px solid #e9ecef; + border-bottom: 1px solid var(--border-light); text-align: left; font-size: 0.95rem; vertical-align: middle; } #fileGrid.table-mode th { - background: #f8f9fa; - color: #6c757d; + background: var(--bg-color); + color: var(--text-muted); font-weight: 500; } #fileGrid.table-mode tr:hover td { - background-color: rgba(22, 118, 123, 0.08); + background-color: var(--primary-opacity-8); transition: background 0.15s; } #fileGrid.table-mode .file-icon { @@ -374,6 +374,9 @@ font-size: 0.875rem; margin-left: 0.25rem; } +#fileGrid.table-mode tr.selected { + background-color: var(--primary-bg-light) !important; +} /* Disable text selection for file grid and table rows/cards */ #fileGrid, #fileGrid * { user-select: none; @@ -490,8 +493,8 @@ function showDetailsModal(idx) { } const icon = item.type === 'folder' - ? `` - : ``; + ? `` + : ``; const uploaderPic = item.uploader_profile_pic ? `/uploads/profile_pics/${item.uploader_profile_pic}` : '/static/default-avatar.png'; @@ -513,11 +516,11 @@ function showDetailsModal(idx) { ${item.uploaded_by || '-'}
${formatDate(item.modified)}
-
-
Room:
-
Path: ${(item.path ? item.path + '/' : '') + item.name}
-
Size: ${item.size === '-' ? '-' : (item.size > 0 ? (item.size < 1024*1024 ? (item.size/1024).toFixed(1)+' KB' : (item.size/1024/1024).toFixed(2)+' MB') : '0 KB')}
-
Uploaded at: ${item.uploaded_at ? new Date(item.uploaded_at).toLocaleString() : '-'}
+
+
Room:
+
Path: ${(item.path ? item.path + '/' : '') + item.name}
+
Size: ${item.size === '-' ? '-' : (item.size > 0 ? (item.size < 1024*1024 ? (item.size/1024).toFixed(1)+' KB' : (item.size/1024/1024).toFixed(2)+' MB') : '0 KB')}
+
Uploaded at: ${item.uploaded_at ? new Date(item.uploaded_at).toLocaleString() : '-'}
`; document.getElementById('detailsModalBody').innerHTML = detailsHtml; var modal = new bootstrap.Modal(document.getElementById('detailsModal')); @@ -589,10 +592,10 @@ function renderBreadcrumb() { bc.innerHTML = ''; const parts = currentPath ? currentPath.split('/') : []; let pathSoFar = ''; - bc.innerHTML += `Root`; + bc.innerHTML += `Root`; parts.forEach((part, idx) => { pathSoFar += (pathSoFar ? '/' : '') + part; - bc.innerHTML += ` / ${part}`; + bc.innerHTML += ` / ${part}`; }); // Show/hide up button const upBtn = document.getElementById('upBtn'); @@ -723,8 +726,8 @@ function renderFiles(files) { `; filesToRender.forEach((file, idx) => { let icon = file.type === 'folder' - ? `` - : ``; + ? `` + : ``; let size = file.size !== '-' ? (file.size > 0 ? (file.size < 1024*1024 ? (file.size/1024).toFixed(1)+' KB' : (file.size/1024/1024).toFixed(2)+' MB') : '0 KB') : '-'; let actionsArr = []; const canRenameAction = (canRename === 'true'); @@ -737,28 +740,28 @@ function renderFiles(files) { } if (file.type === 'file') { if (canDownload === 'true') { - actionsArr.push(``); + actionsArr.push(``); } if (canRenameAction) { - actionsArr.push(``); + actionsArr.push(``); } - actionsArr.push(``); + actionsArr.push(``); if (canMove === 'true') { - actionsArr.push(``); + actionsArr.push(``); } - actionsArr.push(``); + actionsArr.push(``); if (canDelete === true || canDelete === 'true') { - actionsArr.push(``); + actionsArr.push(``); } } else { - actionsArr.push(``); + actionsArr.push(``); if (canRenameAction) { - actionsArr.push(``); + actionsArr.push(``); } - actionsArr.push(``); - actionsArr.push(``); + actionsArr.push(``); + actionsArr.push(``); if (canDelete === true || canDelete === 'true') { - actionsArr.push(``); + actionsArr.push(``); } } // Move Delete to the end if present @@ -806,28 +809,28 @@ function renderFiles(files) { } if (file.type === 'file') { if (canDownload === 'true') { - actionsArr.push(``); + actionsArr.push(``); } if (canRenameAction) { - actionsArr.push(``); + actionsArr.push(``); } - actionsArr.push(``); + actionsArr.push(``); if (canMove === 'true') { - actionsArr.push(``); + actionsArr.push(``); } - actionsArr.push(``); + actionsArr.push(``); if (canDelete === true || canDelete === 'true') { - actionsArr.push(``); + actionsArr.push(``); } } else { - actionsArr.push(``); + actionsArr.push(``); if (canRenameAction) { - actionsArr.push(``); + actionsArr.push(``); } - actionsArr.push(``); - actionsArr.push(``); + actionsArr.push(``); + actionsArr.push(``); if (canDelete === true || canDelete === 'true') { - actionsArr.push(``); + actionsArr.push(``); } } // Move Delete to the end if present diff --git a/templates/rooms/rooms.html b/templates/rooms/rooms.html index 327736f..13f7425 100644 --- a/templates/rooms/rooms.html +++ b/templates/rooms/rooms.html @@ -25,9 +25,9 @@
diff --git a/templates/settings/settings.html b/templates/settings/settings.html index af50361..942463f 100644 --- a/templates/settings/settings.html +++ b/templates/settings/settings.html @@ -13,6 +13,316 @@ ) }}
- +
+
+
+
+
Theme Colors
+
+
+
+ + + +
+
Primary Color
+
+
+
+
+ +
+ + +
+ Used for primary buttons, links, and accents +
+
+
+
+
+
+ +
+
+
+
+ Base +
+
+
+
+ Light +
+
+
+
+ Background +
+
+
+
+ Opacity 15% +
+
+
+
+
+
+
+ + +
+
Secondary Color
+
+
+
+
+ +
+ + + +
+ Used for secondary elements and highlights +
+
+
+
+
+
+ +
+
+
+
+ Base +
+
+
+
+ Light +
+
+
+
+ Opacity 15% +
+
+
+
+
+
+
+ +
+ + +
+
+
+
+
+
+ + + + + {% endblock %} \ No newline at end of file diff --git a/templates/trash/trash.html b/templates/trash/trash.html index 7a96f8e..b7e0b34 100644 --- a/templates/trash/trash.html +++ b/templates/trash/trash.html @@ -5,6 +5,7 @@ {% block extra_css %} + {% endblock %} {% block content %}