Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.core
Commits
355e8c31
Commit
355e8c31
authored
Aug 31, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add simple notification system based on acknowledgement tool.
parent
fdf0454f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
249 additions
and
3 deletions
+249
-3
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting_theme/AcknowledgementTool_getUserUnreadAcknowledgementJSON.xml
.../AcknowledgementTool_getUserUnreadAcknowledgementJSON.xml
+73
-0
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting_theme/ERP5Site_getJavaScriptRelativeUrlList.xml
...b_hosting_theme/ERP5Site_getJavaScriptRelativeUrlList.xml
+1
-0
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting_theme/vifib_hosting_js/erp5_acknowledgement.js.xml
...osting_theme/vifib_hosting_js/erp5_acknowledgement.js.xml
+172
-0
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_jauks_widget_library/WebSite_viewTopBarWidget.xml
...s/vifib_jauks_widget_library/WebSite_viewTopBarWidget.xml
+2
-2
master/bt5/vifib_web/bt/revision
master/bt5/vifib_web/bt/revision
+1
-1
No files found.
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting_theme/AcknowledgementTool_getUserUnreadAcknowledgementJSON.xml
0 → 100644
View file @
355e8c31
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
result_list = context.AcknowledgementTool_getUserUnreadAcknowledgementList()\n
if len(result_list):\n
result_list = [result_list[0]]\n
result_list = [\'{"text_content": "%s", "acknowledge_url": "%s"}\' % (x[\'text_content\'], x[\'acknowledge_url\']) for x in result_list]\n
\n
context.REQUEST.RESPONSE.setHeader(\'Content-Type\', \'application/json\')\n
return \'{"result": [%s]}\' % \', \'.join(result_list)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
AcknowledgementTool_getUserUnreadAcknowledgementJSON
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting_theme/ERP5Site_getJavaScriptRelativeUrlList.xml
View file @
355e8c31
...
...
@@ -53,6 +53,7 @@
<value>
<string>
# This script returns an iterable of the paths to standard JavaScript objects.\n
\n
return (\'jquery/core/jquery.js\',\n
\'vifib_hosting_js/erp5_acknowledgement.js\',\n
\'vifib_hosting_js/vifib_hosting.js\',)\n
</string>
</value>
</item>
...
...
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting_theme/vifib_hosting_js/erp5_acknowledgement.js.xml
0 → 100644
View file @
355e8c31
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"DTMLMethod"
module=
"OFS.DTMLMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Cacheable__manager_id
</string>
</key>
<value>
<string>
http_cache
</string>
</value>
</item>
<item>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
erp5_acknowledgement.js
</string>
</value>
</item>
<item>
<key>
<string>
_vars
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
globals
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
raw
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
/*\n
Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved.\n
\n
This program is Free Software; you can redistribute it and/or\n
modify it under the terms of the GNU General Public License\n
as published by the Free Software Foundation; either version 2\n
of the License, or (at your option) any later version.\n
\n
This program is distributed in the hope that it will be useful,\n
but WITHOUT ANY WARRANTY; without even the implied warranty of\n
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
GNU General Public License for more details.\n
\n
You should have received a copy of the GNU General Public License\n
along with this program; if not, write to the Free Software\n
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
*/\n
"use strict";\n
(function (window, $) {\n
\n
var notificationload,\n
notificationdisplay,\n
notificationsettimeout,\n
notificationhide,\n
notificationdismiss,\n
methods;\n
\n
notificationload = function (context) {\n
$.ajax({\n
url: \'AcknowledgementTool_getUserUnreadAcknowledgementJSON\',\n
dataType: \'json\',\n
context: context,\n
success: function (data) {\n
notificationhide($(this));\n
var result = data.result;\n
if (result.length === 0) {\n
notificationsettimeout($(this));\n
} else {\n
notificationdisplay($(this), data.result[0]);\n
}\n
},\n
error: function () {\n
notificationsettimeout($(this));\n
},\n
});\n
};\n
\n
notificationdisplay = function (context, acknowledgement_json) {\n
context\n
.css({\n
"width": "300px",\n
"min-height": "5em",\n
"z-index": "9999",\n
"position": "fixed",\n
"top": "1em",\n
"left": "1em",\n
"text-align": "center",\n
"color": "#eee",\n
"font-weight": "bold",\n
"font-size": "14px",\n
"text-shadow": "1px 1px 0 #000",\n
"background-color": "#59bae2",\n
"padding": "2px 11px 8px 11px",\n
"border-radius": "15px",\n
})\n
.show()\n
.html(acknowledgement_json.text_content)\n
.append("<br/>
<br/><button
id=
\'acknowledgement_button\'
>
Mark as read
</button>
")\n
.find("#acknowledgement_button")\n
.attr("data-acknowledgement-url", encodeURIComponent(acknowledgement_json.acknowledge_url))\n
.click(function () {\n
var url = decodeURIComponent($(this).attr("data-acknowledgement-url"));\n
notificationdismiss($(this).parent(), url);\n
return false;\n
\n
})\n
;\n
};\n
\n
notificationhide = function (context) {\n
context.hide();\n
};\n
\n
notificationdismiss = function (context, url) {\n
notificationhide(context);\n
$.ajax({\n
type: \'POST\',\n
url: url,\n
context: context,\n
async: true,\n
complete: function () {\n
notificationload($(this));\n
},\n
});\n
};\n
\n
notificationsettimeout = function (context) {\n
setTimeout(function () {\n
notificationload(context);\n
}, 600000);\n
};\n
\n
methods = {\n
init: function () {\n
notificationload($(this));\n
return $(this);\n
},\n
};\n
\n
$.fn.slaposnotification = function (method) {\n
var result;\n
if (methods.hasOwnProperty(method)) {\n
result = methods[method].apply(\n
this,\n
Array.prototype.slice.call(arguments, 1)\n
);\n
} else {\n
$.error(\'Method \' + method +\n
\' does not exist on jQuery.slaposnotification\');\n
}\n
return result;\n
};\n
}(window, jQuery));\n
\n
$(document).ready(function () {\n
$("#acknowledgement_zone").slaposnotification("init");\n
});\n
\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_jauks_widget_library/WebSite_viewTopBarWidget.xml
View file @
355e8c31
...
...
@@ -51,6 +51,7 @@
logout_form_id python:current_web_site.getLayoutProperty(\'layout_logout_form_id\',\'WebSite_logout\');\n
login_form_id python:current_web_site.getLayoutProperty(\'layout_login_form_id\',\'login_form\')"
>
\n
\n
<div
id=
"acknowledgement_zone"
></div>
\n
<a
tal:attributes=
"href current_web_site_url"
><div
id=
"vifib_logo"
></div></a>
\n
\n
<div
id=
"login_menu"
>
\n
...
...
@@ -86,8 +87,7 @@
</ul>
\n
</div>
\n
\n
</tal:block>
\n
</tal:block>
]]>
</unicode>
</value>
</item>
...
...
master/bt5/vifib_web/bt/revision
View file @
355e8c31
423
\ No newline at end of file
424
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment