aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-08-29 10:37:19 +0530
committerBobby <[email protected]>2025-08-29 10:37:19 +0530
commit8201431f6314baeb42e2ddc4d8ea909a577c814f (patch)
treeb611c8564772bee9c7c572d1e04bf76ef76d15b5 /static
parentdbcf50e9fa2143a97ec4992eb5e691204ac92cbc (diff)
downloadthatcomputerscientist-8201431f6314baeb42e2ddc4d8ea909a577c814f.tar.xz
thatcomputerscientist-8201431f6314baeb42e2ddc4d8ea909a577c814f.zip
admin announcement management
Diffstat (limited to 'static')
-rw-r--r--static/css/administration/admin.css121
-rw-r--r--static/css/administration/forms.css10
-rw-r--r--static/js/miku_editor/miku.js8
3 files changed, 132 insertions, 7 deletions
diff --git a/static/css/administration/admin.css b/static/css/administration/admin.css
new file mode 100644
index 00000000..9ccf23e1
--- /dev/null
+++ b/static/css/administration/admin.css
@@ -0,0 +1,121 @@
+.content-title {
+ margin: 4px 0px;
+}
+
+.collapsable p {
+ color: #8d8dff;
+ margin: 20px 0 15px 0;
+ padding-bottom: 5px;
+ border-bottom: 1px dashed rgba(141, 141, 255, 0.5);
+ font-weight: 700;
+ text-shadow: 0 0 3px #000;
+}
+
+.error-message {
+ color: #ff6b6b;
+ font-size: 11px;
+ font-weight: bold;
+}
+
+.success-message {
+ color: #6bff9e;
+ font-size: 11px;
+ font-weight: bold;
+}
+
+.crispy-table {
+ width: 100%;
+ border-collapse: separate;
+ border-spacing: 0;
+ border-radius: 8px;
+ overflow: hidden;
+ margin-top: 12px;
+ background: rgba(49, 27, 79, 0.4);
+}
+
+.crispy-table th,
+.crispy-table td {
+ padding: 12px;
+ text-align: left;
+ border-bottom: 1px solid rgba(141, 141, 255, 0.3);
+}
+
+.crispy-table th {
+ background: linear-gradient(to bottom, #6b3fa0 0%, #311b4f 100%);
+ font-weight: bold;
+}
+
+.crispy-table tr {
+ transition: all 0.3s ease;
+}
+
+.crispy-table tr:hover {
+ background-color: rgba(68, 68, 177, 0.15);
+}
+
+.crispy-table tr:nth-child(even) {
+ background-color: rgba(49, 27, 79, 0.6);
+}
+
+.table-image {
+ width: 64px;
+ height: 64px;
+ border-radius: 4px;
+}
+
+.table-metadata p {
+ margin: 5px 0;
+ color: #dddddd;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ max-width: 500px;
+}
+
+.table-metadata strong {
+ color: #8d8dff;
+}
+
+.table-actions {
+ display: flex;
+ gap: 8px;
+}
+
+.table-actions a,
+.table-actions>form>input[type="submit"] {
+ padding: 5px 10px;
+ border-radius: 4px;
+ font-weight: bold;
+ text-decoration: none;
+ text-align: center;
+ color: #ffffff;
+ cursor: pointer;
+}
+
+.edit-button {
+ background: rgba(141, 141, 255, 0.3);
+ border: 1px solid #8d8dff;
+}
+
+.edit-button:hover {
+ background: rgba(141, 141, 255, 0.6);
+}
+
+.delete-button {
+ background: rgba(255, 107, 107, 0.3);
+ border: 1px solid #ff6b6b;
+}
+
+.delete-button:hover {
+ background: rgba(255, 107, 107, 0.6);
+}
+
+.crispy-table tfoot {
+ background: linear-gradient(to top, rgba(107, 63, 160, 0.6), rgba(49, 27, 79, 0.6));
+}
+
+.crispy-table tfoot p {
+ font-weight: bold;
+ color: #ffffff;
+ text-align: center;
+} \ No newline at end of file
diff --git a/static/css/administration/forms.css b/static/css/administration/forms.css
index dca366e5..1a026b7d 100644
--- a/static/css/administration/forms.css
+++ b/static/css/administration/forms.css
@@ -57,7 +57,7 @@ form.crispy-forms {
margin-bottom: 15px;
display: flex;
gap: 10px;
- align-items: center;
+ align-items: flex-start;
}
.crispy-forms .form-group>*:not(label) {
@@ -78,8 +78,7 @@ form.crispy-forms {
.crispy-forms .form-group input[type="number"],
.crispy-forms .form-group input[type="url"],
.crispy-forms .form-group input[type="date"],
-.crispy-forms .form-group select,
-.crispy-forms .form-group textarea {
+.crispy-forms .form-group select {
width: 100%;
padding: 8px 10px;
border: 1px solid rgba(141, 141, 255, 0.5);
@@ -100,8 +99,7 @@ form.crispy-forms {
}
.crispy-forms .form-group input:focus,
-.crispy-forms .form-group select:focus,
-.crispy-forms .form-group textarea:focus {
+.crispy-forms .form-group select:focus {
outline: none;
border-color: #df23c4;
box-shadow: 0 0 8px rgba(223, 35, 196, 0.4);
@@ -154,7 +152,7 @@ form.crispy-forms {
content: '✓';
position: absolute;
top: -2px;
- left: 3.5px;
+ left: 2.5px;
}
/* Submit Button Styles */
diff --git a/static/js/miku_editor/miku.js b/static/js/miku_editor/miku.js
index e72cc1c2..e955e4a9 100644
--- a/static/js/miku_editor/miku.js
+++ b/static/js/miku_editor/miku.js
@@ -526,6 +526,8 @@
}
createEditor() {
+ const existingContent = this.container.innerHTML || ``;
+
this.container.className = `miku-editor-container`;
this.container.innerHTML = `
<div class="miku-editor-wrapper">
@@ -537,7 +539,7 @@
id="mikuEditor"
placeholder="${this.options.placeholder}"
spellcheck="false"
- ></textarea>
+ >${existingContent}</textarea>
</div>
</div>
<div class="miku-editor-autocomplete-dropdown" id="mikuAutocompleteDropdown"></div>
@@ -1020,6 +1022,10 @@
this.selectedIndex = -1;
this.suggestions = [];
}
+
+ getContent() {
+ return this.editor.value;
+ }
}
window.Miku = Miku;