Commit c9afdccb authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Include Free Trial Section to SlapOS Master website.

parent 3726970d
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Site List</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_page_slap_request_trial.js" type="text/javascript"></script>
</head>
<body>
<form class="save_form ui-body-c" novalidate>
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
.offer {
}
.offer ul {
margin: 0;
padding: 31px 0 0 0;
list-style-type: none;
text-align: center;
}
.offer ul li {
display: inline;
width: 278px;
padding: 0;
margin: 0;
}
.offer ul li .theoffer {
display: inline-block;
width: 277px;
color: #fff;
margin: 0 auto 45px auto;
text-decoration: none;
}
.offer ul li .theoffer a:visited,
.offer ul li .theoffer a {
color: #fff;
text-decoration: none;
}
.offer ul li .theoffer span {
display: block;
}
.offer .top {
background: rgb(107,139,155);
-webkit-box-shadow: inset 0 0px 70px rgba(0,0,0,0.1);
-moz-box-shadow: inset 0 0px 70px rgba(0,0,0,0.1);
box-shadow: inset 0 0px 70px rgba(0,0,0,0.1);
}
.offer .conditions {
width: 100%;
margin-top: 1px;
background: rgb(119,158,177);
-webkit-box-shadow: inset 0 0px 70px rgba(0,0,0,0.1);
-moz-box-shadow: inset 0 0px 70px rgba(0,0,0,0.1);
box-shadow: inset 0 0px 70px rgba(0,0,0,0.1);
}
.offer a.conditions {
text-decoration: none;
text-transform: uppercase;
display: inline-block;
color: #fff;
}
.offer a.conditions:hover {
background: rgb(62,102,122);
}
.offer .system,
.offer .terms {
font-size: 0.9em;
text-transform: uppercase;
padding: 17px 0;
}
.offer .offername {
font-size: 3.7em;
font-weight: 700;
padding: 12px 0 14px 0;
}
.offer .conditions strong {
display: inline-block;
padding: 12px 0 8px 0;
margin: 0;
font-size: 1.5em;
font-weight: 600;
text-transform: uppercase;
}
.offer .desc {
padding: 0 0 10px 0;
font-size: 0.9em;
}
.offer ul li .theoffer {
margin: 0 20px 45px 20px;
}
li {
margin-left: 20px;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>SlapOS Page</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="handlebars.js"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_page_trial.js" type="text/javascript"></script>
<link href="gadget_erp5_page_trial.css" rel="stylesheet" type="text/css"/>
<script id="offer-template" type="text/x-handlebars-template">
<li>
<span class="theoffer">
<span class="top">
<a class="explanation" href="{{url}}">
<span class="system">
{{header}}
</span>
<span class="offername">
{{name}}
</span>
<span class="terms">
{{footer}}
</span>
</a>
</span>
<a class="conditions" href="{{url}}">
<strong>
{{ price }}
</strong>
<span class="desc">
Order now
</span>
</a>
</span>
</li>
</script>
</head>
<body>
<form>
<div class="offer">
<ul>
</ul>
<div class="clear"></div>
</div>
</form>
</body>
</html>
\ No newline at end of file
/*global document, window, Option, rJS, RSVP, Chart, UriTemplate, Handlebars*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window),
offer_source = gadget_klass.__template_element
.getElementById("offer-template")
.innerHTML,
offer_template = Handlebars.compile(offer_source);
gadget_klass
.ready(function (gadget) {
gadget.property_dict = {};
return gadget.getElement()
.push(function (element) {
gadget.property_dict.element = element;
gadget.property_dict.deferred = RSVP.defer();
});
})
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updateConfiguration", "updateConfiguration")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function () {
var gadget = this, offer_list = [];
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("hateoas_url");
})
.push(function (hateoas_url) {
return gadget.jio_getAttachment("/",
hateoas_url + "/ERP5Site_getTrialConfigurationAsJSON");
})
.push(function (queue_list) {
var i, url_queue = [];
gadget.queue_list = queue_list;
for (i in gadget.queue_list) {
if (gadget.queue_list.hasOwnProperty(i)) {
url_queue.push(
gadget.getUrlFor({command: 'change', options: {jio_key: gadget.queue_list[i].url, page: "slap_request_trial"}})
);
}
}
return RSVP.all(url_queue);
})
.push(function (url_list) {
var i;
for (i in gadget.queue_list) {
if (gadget.queue_list.hasOwnProperty(i)) {
offer_list.push(offer_template({
url: url_list[i],
header: gadget.queue_list[i].header,
name: gadget.queue_list[i].name,
footer: gadget.queue_list[i].footer,
price: gadget.queue_list[i].price
}));
}
}
return gadget.getElement()
.push(function (element) {
var ul = element.querySelector("ul");
ul.innerHTML = offer_list.join(" ");
return element;
});
})
.push(function () {
return gadget.updateHeader({
page_title: "Welcome to Free Trial Program"
});
});
});
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, document, rJS, Handlebars, RSVP, Node, loopEventListener */
(function (window, document, rJS, Handlebars, RSVP, Node, loopEventListener) {
"use strict";
/////////////////////////////////////////////////////////////////
// temlates
/////////////////////////////////////////////////////////////////
// Precompile templates while loading the first gadget instance
var gadget_klass = rJS(window);
gadget_klass
.setState({
visible: false,
desktop: false
})
//////////////////////////////////////////////
// acquired method
//////////////////////////////////////////////
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("redirect", "redirect")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('toggle', function () {
return this.changeState({
visible: false
});
})
.declareMethod('close', function () {
return this.changeState({
visible: false
});
})
.declareMethod('render', function (options) {
var erp5_document = options.erp5_document,
workflow_list,
view_list;
if (erp5_document !== undefined) {
workflow_list = erp5_document._links.action_workflow || [];
view_list = erp5_document._links.action_object_view || [];
if (workflow_list.constructor !== Array) {
workflow_list = [workflow_list];
}
if (view_list.constructor !== Array) {
view_list = [view_list];
}
// Prevent has much as possible to modify the DOM panel
// stateChange prefer to compare strings
workflow_list = JSON.stringify(workflow_list);
view_list = JSON.stringify(view_list);
}
return this.changeState({
workflow_list: workflow_list,
view_list: view_list,
global: true,
editable: options.editable
});
})
.onStateChange(function (modification_dict) {
var context = this,
gadget = this,
queue = new RSVP.Queue(),
tmp_element;
return queue;
})
/////////////////////////////////////////////////////////////////
// declared services
/////////////////////////////////////////////////////////////////
.onEvent('click', function (evt) {
if ((evt.target.nodeType === Node.ELEMENT_NODE) &&
(evt.target.tagName === 'BUTTON')) {
return this.toggle();
}
}, false, false)
.declareJob('listenResize', function () {
// resize should be only trigger after the render method
// as displaying the panel rely on external gadget (for translation for example)
var result,
event,
context = this;
function extractSizeAndDispatch() {
if (window.matchMedia("(min-width: 90em)").matches) {
return context.changeState({
desktop: true
});
}
return context.changeState({
desktop: false
});
}
result = loopEventListener(window, 'resize', false,
extractSizeAndDispatch);
event = document.createEvent("Event");
event.initEvent('resize', true, true);
window.dispatchEvent(event);
return result;
})
.allowPublicAcquisition('notifyChange', function () {
// Typing a search query should not modify the header status
return;
})
.onEvent('submit', function () {
var gadget = this;
return gadget.getDeclaredGadget("erp5_searchfield")
.push(function (search_gadget) {
return search_gadget.getContent();
})
.push(function (data) {
var options = {
page: "search"
};
if (data.search) {
options.extended_search = data.search;
}
// Remove focus from the search field
document.activeElement.blur();
return gadget.redirect({command: 'display', options: options});
});
}, false, true)
.onEvent('blur', function (evt) {
// XXX Horrible hack to clear the search when focus is lost
// This does not follow renderJS design, as a gadget should not touch
// another gadget content
if (evt.target.type === 'search') {
evt.target.value = "";
}
}, true, false);
}(window, document, rJS, Handlebars, RSVP, Node, loopEventListener));
......@@ -602,9 +602,7 @@
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
<value> <string>Deleted objects: []</string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
......@@ -612,7 +610,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.9903.31192.42530</string> </value>
<value> <string>966.8632.57005.9079</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -630,7 +628,7 @@
</tuple>
<state>
<tuple>
<float>1513346940.52</float>
<float>1520876084.55</float>
<string>UTC</string>
</tuple>
</state>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_title</string>
<string>my_aggregate_title</string>
<string>my_short_title</string>
<string>my_description</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TrialCondition_viewAsHateoas</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>TrialCondition_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Trial Condition</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>editable</string>
<string>portal_type</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_aggregate_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<tuple>
<string>Web Page</string>
<string>Web Page</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Terms of Service</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
web_page_module/rjs_gadget_erp5_page_slap_request_trial_html
web_page_module/rjs_gadget_erp5_page_trial_js
web_page_module/rjs_gadget_trial_panel_html
web_page_module/rjs_gadget_trial_panel_js
web_page_module/rjs_gadget_erp5_page_trial_html
web_page_module/rjs_gadget_erp5_page_trial_css
web_page_module/rjs_gadget_erp5_page_map_css
web_page_module/rjs_gadget_erp5_panel_shortcut_html
web_page_module/rjs_gadget_erp5_panel_shortcut_js
......
......@@ -74,6 +74,7 @@ web_page_module/rjs_gadget_erp5_page_slap_project_view_html
web_page_module/rjs_gadget_erp5_page_slap_project_view_js
web_page_module/rjs_gadget_erp5_page_slap_regularisation_request_view_html
web_page_module/rjs_gadget_erp5_page_slap_regularisation_request_view_js
web_page_module/rjs_gadget_erp5_page_slap_request_trial_html
web_page_module/rjs_gadget_erp5_page_slap_rss_ticket_html
web_page_module/rjs_gadget_erp5_page_slap_rss_ticket_js
web_page_module/rjs_gadget_erp5_page_slap_sale_invoice_transaction_view_html
......@@ -108,6 +109,9 @@ web_page_module/rjs_gadget_erp5_page_slapos_html
web_page_module/rjs_gadget_erp5_page_slapos_html
web_page_module/rjs_gadget_erp5_page_slapos_js
web_page_module/rjs_gadget_erp5_page_slapos_request_form_html
web_page_module/rjs_gadget_erp5_page_trial_css
web_page_module/rjs_gadget_erp5_page_trial_html
web_page_module/rjs_gadget_erp5_page_trial_js
web_page_module/rjs_gadget_erp5_panel_shortcut_html
web_page_module/rjs_gadget_erp5_panel_shortcut_js
web_page_module/rjs_gadget_erp5_pt_form_slapos_index_html
......@@ -146,6 +150,8 @@ web_page_module/rjs_gadget_slapos_site_status_html
web_page_module/rjs_gadget_slapos_site_status_js
web_page_module/rjs_gadget_slapos_software_release_info_html
web_page_module/rjs_gadget_slapos_software_release_info_js
web_page_module/rjs_gadget_trial_panel_html
web_page_module/rjs_gadget_trial_panel_js
web_page_module/rjs_leaflet_css
web_page_module/rjs_leaflet_js
web_page_module/rjs_tv4_min_js
......
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