mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
@@ -90,7 +90,7 @@ class SQLconnector(object):
|
||||
|
||||
Filters: rs, rid, content
|
||||
"""
|
||||
flt = Q(rs__in=[' ', 'V', 'R', 'p']) \
|
||||
flt = Q(rs__in=[' ', 'V', 'R', 'p', 'S', 'H']) \
|
||||
if self.navparams.get('viewrequests', '0') != '1' else Q(rs='p')
|
||||
flt = self._apply_msgrcpt_filters(flt)
|
||||
pattern = self.navparams.get("pattern", "")
|
||||
@@ -168,6 +168,10 @@ class SQLconnector(object):
|
||||
m["class"] = "unseen"
|
||||
elif rs == 'R':
|
||||
m["img_rstatus"] = static_url("pics/release.png")
|
||||
elif rs == 'H':
|
||||
m["img_rstatus"] = "icon-thumbs-up"
|
||||
elif rs == 'S':
|
||||
m["img_rstatus"] = "icon-thumbs-down"
|
||||
elif rs == 'p':
|
||||
m["class"] = "pending"
|
||||
emails.append(m)
|
||||
|
||||
@@ -23,7 +23,7 @@ class Qtable(tables.Table):
|
||||
"type", align="center", width="30px", sort_order="type", safe=True
|
||||
)
|
||||
rstatus = tables.ImgColumn(
|
||||
"rstatus", width='25px', sortable=False
|
||||
"rstatus", width='25px', sortable=False, bootstrap=True
|
||||
)
|
||||
score = tables.Column(
|
||||
"score", label=ugettext_lazy("Score"), limit=6,
|
||||
|
||||
@@ -407,6 +407,9 @@ Quarantine.prototype = {
|
||||
},
|
||||
|
||||
action_cb: function(data) {
|
||||
if (data.reload) {
|
||||
this.navobj.update(true);
|
||||
}
|
||||
if (data.url) {
|
||||
this.navobj.parse_string(data.url, true).update(true);
|
||||
}
|
||||
|
||||
@@ -304,6 +304,7 @@ def mark_messages(request, selection, mtype, recipient_db=None):
|
||||
else saclient.learn_ham(rcpt, content)
|
||||
if not result:
|
||||
break
|
||||
connector.set_msgrcpt_status(rcpt, mail_id, mtype[0].upper())
|
||||
if saclient.error is None:
|
||||
saclient.done()
|
||||
message = ungettext("%(count)d message processed successfully",
|
||||
@@ -312,7 +313,9 @@ def mark_messages(request, selection, mtype, recipient_db=None):
|
||||
else:
|
||||
message = saclient.error
|
||||
status = 400 if saclient.error else 200
|
||||
return render_to_json_response({"message": message}, status=status)
|
||||
return render_to_json_response({
|
||||
"message": message, "reload": True
|
||||
}, status=status)
|
||||
|
||||
|
||||
@login_required
|
||||
|
||||
@@ -89,6 +89,8 @@ class ImgColumn(Column):
|
||||
return ""
|
||||
|
||||
def render(self, value):
|
||||
if getattr(self, "bootstrap", False) and value.startswith("icon"):
|
||||
return "<i class='%s'></i>" % value
|
||||
if type(value) in [list, tuple]:
|
||||
return "".join(["<img src='%s' />" % i for i in value])
|
||||
return "<img src='%s' />" % value
|
||||
|
||||
Reference in New Issue
Block a user