summaryrefslogtreecommitdiffstats
path: root/hyperkitty/static
diff options
context:
space:
mode:
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) {