summaryrefslogtreecommitdiffstats
path: root/hyperkitty/static
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-07-10 19:02:39 +0200
committerAurélien Bompard <aurelien@bompard.org>2013-07-10 19:02:39 +0200
commit5b18d42d67afc08f469ec216b1d55adeb19feda8 (patch)
treef159cfb488b7f1c25c0a78cd882daaafb794f0a4 /hyperkitty/static
parentf2950f4b226b5a7d388c4eb2fb6c383e72ac6d54 (diff)
downloadhyperkitty-5b18d42d67afc08f469ec216b1d55adeb19feda8.tar.gz
hyperkitty-5b18d42d67afc08f469ec216b1d55adeb19feda8.tar.xz
hyperkitty-5b18d42d67afc08f469ec216b1d55adeb19feda8.zip
Add categories to threads
Diffstat (limited to 'hyperkitty/static')
-rw-r--r--hyperkitty/static/css/hyperkitty-message.css27
-rw-r--r--hyperkitty/static/js/hyperkitty-thread.js34
2 files changed, 60 insertions, 1 deletions
diff --git a/hyperkitty/static/css/hyperkitty-message.css b/hyperkitty/static/css/hyperkitty-message.css
index 2dfb9df..f7af9b2 100644
--- a/hyperkitty/static/css/hyperkitty-message.css
+++ b/hyperkitty/static/css/hyperkitty-message.css
@@ -148,6 +148,33 @@
}
+/* Categories */
+
+#thread-overview-info #thread-category {
+ padding: 10px 0;
+ text-align: center;
+}
+#thread-overview-info #thread-category form {
+ margin: 0;
+ display: none;
+}
+#thread-overview-info #thread-category form select {
+ font-size: 90%;
+ width: 12em;
+}
+#thread-overview-info #thread-category a.label {
+ font-size: 120%;
+ line-height: 120%;
+}
+
+#thread-category .question {
+ background-color: #f89406;
+}
+#thread-category .announce {
+ background-color: #3a87ad;
+}
+
+
/* Participants */
#participants {
diff --git a/hyperkitty/static/js/hyperkitty-thread.js b/hyperkitty/static/js/hyperkitty-thread.js
index 5b7765d..f2c3cd0 100644
--- a/hyperkitty/static/js/hyperkitty-thread.js
+++ b/hyperkitty/static/js/hyperkitty-thread.js
@@ -21,6 +21,39 @@
/*
+ * Categories
+ */
+
+function setup_category() {
+ $("#thread-category form").submit(function (e) {
+ e.preventDefault();
+ $.ajax({
+ type: "POST",
+ //dataType: "json",
+ data : $(this).serialize(),
+ url: $(this).attr("action"),
+ success: function(data) {
+ $("#thread-category").html(data);
+ setup_category();
+ },
+ error: function(jqXHR, textStatus, errorThrown) {
+ // authentication and invalid data
+ alert(jqXHR.responseText);
+ }
+ });
+ });
+ $("#thread-category a.label").click(function(e) {
+ e.preventDefault();
+ $(this).hide();
+ $("#thread-category form").show();
+ });
+ $("#thread-category form select").change(function() {
+ $(this).parents("form").first().submit();
+ });
+}
+
+
+/*
* Tagging
*/
@@ -39,7 +72,6 @@ function setup_tags() {
e.preventDefault();
$(this).parents("form").first().submit();
});
- console.log($(this));
$(this).find("#id_tag").value("");
},
error: function(jqXHR, textStatus, errorThrown) {