summaryrefslogtreecommitdiffstats
path: root/hyperkitty
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-07-11 20:17:17 +0200
committerAurélien Bompard <aurelien@bompard.org>2013-07-11 20:17:17 +0200
commit9fb58fd8fecc7c1d86ff3693eb528d9ad19e703d (patch)
treea5a2e86b1cc5918393b64bda15b6b7ed93a4bfba /hyperkitty
parentce57f4cbe44d2594ff11aba8501a1d8f2727fd70 (diff)
downloadhyperkitty-9fb58fd8fecc7c1d86ff3693eb528d9ad19e703d.tar.gz
hyperkitty-9fb58fd8fecc7c1d86ff3693eb528d9ad19e703d.tar.xz
hyperkitty-9fb58fd8fecc7c1d86ff3693eb528d9ad19e703d.zip
Only allow category edition when logged-in
Diffstat (limited to 'hyperkitty')
-rw-r--r--hyperkitty/static/hyperkitty/css/hyperkitty-common.css3
-rw-r--r--hyperkitty/static/hyperkitty/css/hyperkitty-message.css5
-rw-r--r--hyperkitty/static/hyperkitty/js/hyperkitty-thread.js3
-rw-r--r--hyperkitty/templates/threads/category.html10
4 files changed, 17 insertions, 4 deletions
diff --git a/hyperkitty/static/hyperkitty/css/hyperkitty-common.css b/hyperkitty/static/hyperkitty/css/hyperkitty-common.css
index fa8b6d4..a6f47ca 100644
--- a/hyperkitty/static/hyperkitty/css/hyperkitty-common.css
+++ b/hyperkitty/static/hyperkitty/css/hyperkitty-common.css
@@ -304,6 +304,9 @@ a.thread-new strong {
.thread-category {
padding: 0;
}
+.thread-category a.label.disabled {
+ cursor: default;
+}
.thread-category form {
margin: 0;
display: none;
diff --git a/hyperkitty/static/hyperkitty/css/hyperkitty-message.css b/hyperkitty/static/hyperkitty/css/hyperkitty-message.css
index 0f7ca20..d2be237 100644
--- a/hyperkitty/static/hyperkitty/css/hyperkitty-message.css
+++ b/hyperkitty/static/hyperkitty/css/hyperkitty-message.css
@@ -154,8 +154,9 @@
text-align: center;
}
.thread-header .thread-category a.label {
- font-size: 120%;
- line-height: 120%;
+ padding: 0.2em 0.4em;
+ font-size: 110%;
+ line-height: 110%;
}
/* Participants */
diff --git a/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js b/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js
index 2ce664d..069c4e9 100644
--- a/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js
+++ b/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js
@@ -45,6 +45,9 @@ function setup_category() {
});
$(".thread-category a.label").click(function(e) {
e.preventDefault();
+ if ($(this).hasClass("disabled")) {
+ return;
+ }
$(this).hide()
.parents(".thread-category").first()
.find("form").show();
diff --git a/hyperkitty/templates/threads/category.html b/hyperkitty/templates/threads/category.html
index c315a2e..71c279c 100644
--- a/hyperkitty/templates/threads/category.html
+++ b/hyperkitty/templates/threads/category.html
@@ -1,8 +1,14 @@
{% load url from future %}
{{ category_form.errors.category }}
- <a class="label" title="Click to edit"
- {% if category %}style="background-color:{{category.color}}"{% endif %}>
+ <a class="label {% if not user.is_authenticated %} disabled {% endif %}"
+ {% if category %}style="background-color:{{category.color}}"{% endif %}
+ {% if user.is_authenticated %}
+ title="Click to edit"
+ {% else %}
+ title="You must be logged-in to edit."
+ {% endif %}
+ >
{% if category %}
{{ category.name|upper }}
{% else %}