Commit 0bb5a9c3 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Xiaowu Zhang

erp5_travel_expense: Add front page and custom css

erp5_travel_expense: Improve Front page and fix CSS on image modal

erp5_travel_expense: Router redirect to front page
parent b0f6e88c
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>OfficeJS Router Gadget</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_officejs_page_hr_front.js" type="text/javascript"></script>
</head>
<body>
<article class="ui-body-c document-access">
<section class="">
<h3 class="ui-body-c">
<span class="ui-icon ui-icon-custom ui-icon-plus">&nbsp;</span>
Add
</h3>
</section>
<section class="ui-body-c ui-content-section">
<div class="ui-controlgroup ui-controlgroup-horizontal">
<div class="ui-grid-b ui-responsive">
<div class="ui-block-a">
<a class="ui-btn" href="#page=add_document" data-i18n="Expense">Expense</a>
</div>
<div class="ui-block-b">
<a class="ui-btn" href="#page=add_leave_request_record" data-i18n="Leave">Leave</a>
</div>
<div class="ui-block-c">
<a class="ui-btn" href="#page=add_travel_request_record" data-i18n="Mission">Mission</a>
</div>
</div>
</div>
</section>
<section class="">
<h3 class="ui-body-c">
<span class="ui-icon ui-icon-custom ui-icon-exchange">&nbsp;</span>
Expenses to Answer
</h3>
</section>
<section class="ui-body-c ui-content-section">
<div data-gadget-url="gadget_officejs_widget_listbox.html" data-gadget-scope="listbox-suspended"></div>
</section>
<section class="">
<h3 class="ui-body-c">
<span class="ui-icon ui-icon-custom ui-icon-exchange">&nbsp;</span>
Expenses to Post
</h3>
</section>
<section class="ui-body-c ui-content-section">
<div data-gadget-url="gadget_officejs_widget_listbox.html" data-gadget-scope="listbox-draft"></div>
</section>
</article>
</body>
</html>
\ No newline at end of file
/*globals window, RSVP, rJS*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, RSVP, rJS) {
"use strict";
rJS(window)
.ready(function (g) {
g.props = {};
return g.getElement()
.push(function (element) {
g.props.element = element;
});
})
.ready(function (g) {
return new RSVP.Queue()
.push(function () {
return RSVP.all([
g.translate("validated"),
g.translate("invalidated"),
g.translate("Not synced!"),
g.translate("Waiting for approval")
]);
})
.push(function (result_list) {
g.props.translation_dict = {
"validated": result_list[0],
"invalidated": result_list[1],
"Not synced!": result_list[2],
"Waiting for approval": result_list[3]
};
});
})
.declareAcquiredMethod("translate", "translate")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod('getSetting', 'getSetting')
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
return this.jio_allDocs.apply(this, param_list)
.push(function (result) {
var i,
len;
for (i = 0, len = result.data.total_rows; i < len; i += 1) {
// XXX jIO does not create UUID with module inside
if (result.data.rows[i].id.indexOf("module") === -1) {
result.data.rows[i].value.state =
gadget.props.translation_dict["Not synced!"];
} else {
result.data.rows[i].value.state =
result.data.rows[i].value.state || gadget.props.translation_dict[
"Waiting for approval"];
}
}
return result;
});
})
.declareMethod("render", function (options) {
var gadget = this;
return new RSVP.Queue()
.push(function () {
gadget.props.portal_type = "Expense Record";
gadget.props.document_title_plural = "Expense Requests";
return RSVP.all([
gadget.getDeclaredGadget("listbox-suspended"),
gadget.getDeclaredGadget("listbox-draft")
]);
})
.push(function (listbox_gadget_list) {
return RSVP.all([
listbox_gadget_list[0].render({
column_list: [{
select: 'comment',
title: 'Description'
}, {
select: 'type_title',
title: 'Type'
}, {
select: 'quantity',
title: 'Total Price'
}, {
select: 'resource_title',
title: 'Currency'
}, {
select: 'date',
title: 'Input Date'
}, {
select: 'doc_id',
title: 'ID'
}, {
select: 'state',
title: 'State'
}],
query: {
query: 'portal_type:("' + gadget.props.portal_type + '") AND state:"Suspended"',
select_list: ['doc_id', 'quantity', 'resource_title',
'comment', 'date', 'type_title',
'state'],
sort_on: [["modification_date", "descending"]]
}
}),
listbox_gadget_list[1].render({
column_list: [{
select: 'comment',
title: 'Description'
}, {
select: 'type_title',
title: 'Type'
}, {
select: 'quantity',
title: 'Total Price'
}, {
select: 'resource_title',
title: 'Currency'
}, {
select: 'date',
title: 'Input Date'
}, {
select: 'doc_id',
title: 'ID'
}, {
select: 'state',
title: 'State'
}],
query: {
query: 'portal_type:("' + gadget.props.portal_type + '" OR "Expense Record Temp") AND sync_flag:"0"',
select_list: ['doc_id', 'quantity', 'resource_title',
'comment', 'date', 'type_title',
'state'],
sort_on: [["modification_date", "descending"]]
}
})
]);
});
});
}(window, RSVP, rJS));
\ No newline at end of file
......@@ -13,6 +13,8 @@
<script src="jquery.js" type="text/javascript"></script>
<script src="jquerymobile.js" type="text/javascript"></script>
<link rel="stylesheet" href="gadget_hr_style.css">
<script id="panel-template-header" type="text/x-handlebars-template">
<div data-role="header" class="ui-bar-inherit">
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
......@@ -25,7 +27,7 @@
<img class="ui-title" alt="ERP5" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJcAAAA/CAMAAADaDqrIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbi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mcyZmcxmmcwzmcwAmZn/mZnMmZmZmZlmmZkzmZkAmWb/mWbMmWaZmWZmmWYzmWYAmTP/mTPMmTOZmTNmmTMzmTMAmQD/mQDMmQCZmQBmmQAzmQAAZv//Zv/MZv+ZZv9mZv8zZv8AZsz/ZszMZsyZZsxmZswzZswAZpn/ZpnMZpmZZplmZpkzZpkAZmb/ZmbMZmaZZmZmZmYzZmYAZjP/ZjPMZjOZZjNmZjMzZjMAZgD/ZgDMZgCZZgBmZgAzZgAAM///M//MM/+ZM/9mM/8zM/8AM8z/M8zMM8yZM8xmM8wzM8wAM5n/M5nMM5mZM5lmM5kzM5kAM2b/M2bMM2aZM2ZmM2YzM2YAMzP/MzPMMzOZMzNmMzMzMzMAMwD/MwDMMwCZMwBmMwAzMwAAAP//AP/MAP+ZAP9mAP8zAP8AAMz/AMzMAMyZAMxmAMwzAMwAAJn/AJnMAJmZAJlmAJkzAJkAAGb/AGbMAGaZAGZmAGYzAGYAADP/ADPMADOZADNmADMzADMAAAD/AADMAACZAABmAAAzAAAAHHa7K3/AOojESZHJWZvNaKTSd63Whrbblb/fpMjks9Howtrt4e320uTx8Pb6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdfKHSQAAAOh0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ALItoLoAAAJkSURBVHja7NlZsqsgEABQ979C5kGGddxo4os0Q8BAynoFn0nUU23TNGRB9xzLdE3XdE3XdP2fLnIzF2VSrsYvC72HizAh9eZ5DVuOl15S4/jWwC+kDC8HPzCSJVHcRY8QXV2PwQuujUYTsYrvYlBv1yKLrsXHsPghnvR3Lazoip/JKuwpF8sm6/bY01Ow9CBlTXi53PNoRcUktEZT1NV1PIPnXAjtMJIMlzerFIzU1dVWF7aPj3Tetae4gjdxktG2et/qQjJ4kZFrv6ED4bK4eR1qduHzvEi4+PbGwD0EGu9CQQLFrv1F4jBc6BcuW3YhkPiPX1hOfxQvnHfh0HVMRqc4HuqiQf5k3mO6dq1s8Hx0H/Le5kq9YaNcxAcrZLpOvAv+ClcgNcZFtnrucd5Fwx4mXj0drnbBYXMuJmFDAV3Uhm4qlbHh3ddOrmholHNxFTVC+xTl2mf6pI4uVe4LwSp0DPGOmh/hAnM94bKZjkHlWuiLeV+cTab4luMKk82wy/Px2fLJskvKUk03hRf9RZ0wiYiZ4uVwVwTb9E71y0XboTYXGuTaa33Y47W5zBjXM3P11y7TfR2ycFdxyaW7uwSc5m0un9ix91m3TWJfW+1ijfW+wcVAfjS5dOP62LyvZZdcLHnA1MkFAtbgwq+Vm47po8OA1buwyy/a1ec5urzveAes2sV8kfW963mFaHNhlT0b6+Yi5+StchH1CtaK0ThXELDPLiyOPZHldzm/J1z9O/B14g7/K+DtkP7U8ivSeD4xaPCTSQvy+YIfubZWzRgtRe1iMP+3mq7pmq7p6jv+BBgAPrgi/TzwWzkAAAAASUVORK5CYII=">
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">
<div class="ui-controlgroup-controls">
<a href="#" class="ui-btn ui-btn-icon-notext ui-icon-home" data-i18n="Home">Home</a>
<a href="#page=hr_front" class="ui-btn ui-btn-icon-notext ui-icon-home" data-i18n="Home">Home</a>
</div>
</div>
</div>
......
......@@ -5,7 +5,7 @@
var gadget_klass = rJS(window),
MAIN_PAGE_PREFIX = "gadget_officejs_",
DEFAULT_PAGE = "expense_record_list",
DEFAULT_PAGE = "hr_front",
REDIRECT_TIMEOUT = 5000;
function listenHashChange(gadget) {
......@@ -95,7 +95,7 @@
args = options.args;
gadget.options = options;
if (args.jio_key === undefined || args.jio_key === '') {
if (args.page === undefined || args.page === '' || args.page === "document_list") {
if (args.page === undefined || args.page === '' || args.page === "hr_front") {
args.page = DEFAULT_PAGE;
}
return {
......
@media only screen and (max-width: 45em){
html div.ui-content {
padding: 1.3em 0.1em 0.1em 0.1em;
}
}
@media (max-width: 62em) {
html .ui-content .custom-grid thead {
display: none;
}
}
html article section.ui-content-section form {
display: none;
}
html .ui-content-section {
box-shadow: none;
border: none;
margin: 0.1em auto;
padding: 0.1em 0.1em 0.1em 0.1em;
}
html .ui-content .custom-grid-wrap .ui-shadow {
box-shadow: none;
}
html div[data-gadget-scope='header'] .ui-header {
position: fixed;
z-index: 1000;
text-align: center;
display: flex;
flex-flow: row wrap;
width: 100%;
}
html div[data-gadget-scope='header'] .ui-header h1 {
width: 100%;
}
html div.ui-content {
padding-top: 1.3em;
}
html .modal .close {
margin-top: 2em;
}
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