Commit 49b71fba authored by Alain Takoudjou's avatar Alain Takoudjou

[slapos_jio] Display Unread Messages on SlapOS Home page

parent 2135490b
.box-gadget-left {
width: 49%;
float: left;
margin-bottom: 30px;
}
.box-gadget-right {
width: 49%;
float: right;
}
.box-gadget-bottom {
.box-gadget-top {
float: left;
width: 100%;
padding-top: 17px;
margin-bottom: 20px;
}
.ui-btn-white-front,
......
......@@ -74,6 +74,12 @@
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
......@@ -245,7 +251,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.40300.60783.54357</string> </value>
<value> <string>972.24386.22001.41932</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -263,7 +269,7 @@
</tuple>
<state>
<tuple>
<float>1522775894.53</float>
<float>1545068727.54</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -20,7 +20,7 @@
<script id="ticket-link-control-template" type="text/x-handlebars-template">
<div class="slapos-control-front">
<center>
<a class="ui-btn ui-first-child ui-btn-white-front ui-btn-icon-left ui-icon-sort-alpha-asc" href={{ show_all_url }} data-i18n="Show All Tickets" > Show All Tickets</a>
<a class="ui-btn ui-first-child ui-btn-white-front ui-btn-icon-left ui-icon-sort-alpha-asc" href={{ show_all_url }} data-i18n="Show Tickets" > Show Tickets</a>
<a class="ui-btn ui-first-child ui-btn-white-front ui-btn-icon-left ui-icon-rss" href={{ rss_all_url }} data-i18n="RSS (all)" > RSS </a>
<a class="ui-btn ui-first-child ui-btn-white-front ui-btn-icon-left ui-icon-rss" href={{ rss_critical_url }} data-i18n="RSS Critical" > Critical </a>
</center>
......@@ -30,6 +30,10 @@
</head>
<body>
<form>
<div class="box-gadget-top">
<div data-gadget-url="gadget_erp5_pt_form_view.html"
data-gadget-scope="last"></div>
</div>
<div class="box-gadget-left">
<div class="map-gadget"></div>
</div>
......@@ -37,10 +41,6 @@
<div data-gadget-url="gadget_erp5_pt_form_view.html"
data-gadget-scope="right"></div>
</div>
<div class="box-gadget-bottom">
<div data-gadget-url="gadget_erp5_pt_form_view.html"
data-gadget-scope="last"></div>
</div>
</form>
</body>
</html>
\ No newline at end of file
......@@ -74,6 +74,12 @@
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
......@@ -245,7 +251,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.40689.62566.35447</string> </value>
<value> <string>972.24383.44291.21572</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -263,7 +269,7 @@
</tuple>
<state>
<tuple>
<float>1522799337.96</float>
<float>1545068611.18</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -72,6 +72,13 @@
type: "DateTimeField"
};
}
if (result.data.rows[i].value.hasOwnProperty("text_content")) {
if (result.data.rows[i].value.text_content &&
result.data.rows[i].value.text_content.length > 80) {
result.data.rows[i].value.text_content =
result.data.rows[i].value.text_content.slice(0, 80) + " ...";
}
}
}
return result;
});
......@@ -169,8 +176,9 @@
var form_list = result[0],
column_list = [
['title', 'Title'],
['modification_date', 'Modification Date'],
['translated_simulation_state_title', 'State']
['modification_date', 'Date'],
['source_title', "From"],
['text_content', 'Message']
];
return form_list.render({
......@@ -200,13 +208,24 @@
"key": "slap_ticket_listbox",
"lines": lines_limit,
"list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=portal_type%3A%20%28%22Support%20Request%22%2C%20%22Upgrade%20Decision%22%2C%20%22Regularisation%20Request%22%29%20AND%20" +
"destination_decision_reference%3A" + gadget.me_dict.reference + "%20AND%20simulation_state%3A%20%28%22suspended%22%2C%20%22validated%22%2C%20%22confirmed%22%29",
"query": "urn:jio:allDocs?query=portal_type%3A%20%28%20" +
"%22" + "Web Message" + "%22%2C%20%22" + "Mail Message" +
"%22%29%20AND%20%28" + "default_destination_reference" +
"%3A" + gadget.me_dict.reference + "%29%20AND%20%28" +
"simulation_state" + "%3A%20%28%22" + "started" +
"%22%2C%22" + "stopped" + "%22%29%29%20AND%20%28" +
"follow_up_portal_type" + "%3A%20%28%22" + "Support Request" +
"%22%2C%22" + "Upgrade Decision" + "%22%2C%22" +
"Regularisation Request" + "%22%29%29%20AND%20%28" +
"follow_up_simulation_state" + "%3A%20%28%22" +
"validated" + "%22%2C%22" + "suspended" + "%22%2C%22" +
"confirmed" + "%22%2C%22" + "started" + "%22%2C%22" +
"stopped" + "%22%2C%22" + "%22%29%29",
"portal_type": [],
"search_column_list": column_list,
"sort_column_list": column_list,
"sort": [["modification_date", "Descending"]],
"title": "Pending Tickets to Process",
"title": "Unread Messages",
"type": "ListBox"
}
}},
......
......@@ -74,6 +74,12 @@
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
......@@ -241,7 +247,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.41526.6603.40089</string> </value>
<value> <string>972.24390.60760.64256</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -259,7 +265,7 @@
</tuple>
<state>
<tuple>
<float>1522849395.6</float>
<float>1545068588.17</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -29,7 +29,7 @@
<ul data-role="listview" class="ui-listview" data-enhanced="true">
<li class="ui-first-child"><a href="#?editable=true" class="ui-btn ui-btn-icon-left ui-icon-home" data-i18n="Home" accesskey="h">Home</a></li>
<li><a href="{{person_href}}" class="ui-btn ui-btn-icon-left ui-icon-user" data-i18n="Account" accesskey="p">Account</a></li>
<li><a href="{{message_href}}" class="ui-btn ui-btn-icon-left ui-icon-envelope" data-i18n="Messages" accesskey="m">Messages</a></li>
<li><a href="{{message_href}}" class="ui-btn ui-btn-icon-left ui-icon-envelope" data-i18n="Unread Messages" accesskey="m">Unread Messages</a></li>
<li><a href="{{support_request_href}}" class="ui-btn ui-btn-icon-left ui-icon-comments" data-i18n="Tickets" accesskey="t">Tickets</a></li>
<li><a href="{{organisation_href}}" class="ui-btn ui-btn-icon-left ui-icon-map-marker" data-i18n="Sites" accesskey="k">Sites</a></li>
<li><a href="{{project_href}}" class="ui-btn ui-btn-icon-left ui-icon-cubes" data-i18n="Projects" accesskey="w">Projects</a></li>
......
......@@ -63,6 +63,12 @@
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
......@@ -234,7 +240,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>972.18144.49149.35481</string> </value>
<value> <string>972.24319.2093.21845</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1545053930.08</float>
<float>1545068659.12</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment