Revert "[IMP] web,web_settings_dashboard: Move 'About' menu to settings dashboard"

This reverts commit 328af5dc86.
This commit is contained in:
Yannick Tivisse
2016-08-17 10:07:51 +02:00
parent 328af5dc86
commit 2aaad4d256
5 changed files with 70 additions and 77 deletions
@@ -46,6 +46,28 @@ var UserMenu = Widget.extend({
on_menu_support: function () {
window.open('https://www.odoo.com/buy', '_blank');
},
on_menu_about: function () {
var self = this;
if (odoo.db_info) {
menu_help_about(odoo.db_info);
} else {
this.rpc("/web/webclient/version_info", {}).done(menu_help_about);
}
function menu_help_about(db_info) {
var $help = $(QWeb.render("UserMenu.about", {db_info: db_info, debug: core.debug}));
$help.find('a.oe_activate_debug_mode').click(function (e) {
e.preventDefault();
window.location = $.param.querystring(window.location.href, 'debug');
});
new Dialog(self, {
size: 'medium',
dialogClass: 'o_act_window',
title: _t("About"),
$content: $help
}).open();
}
},
on_menu_settings: function() {
var self = this;
this.trigger_up('clear_uncommitted_changes', {
+45
View File
@@ -1276,6 +1276,7 @@
<ul class="dropdown-menu" role="menu">
<li><a href="#" data-menu="documentation">Documentation</a></li>
<li><a href="#" data-menu="support">Support</a></li>
<li><a href="#" data-menu="about">About</a></li>
<li class="divider"/>
<li><a href="#" data-menu="settings">Preferences</a></li>
<li><a href="#" data-menu="account">My Odoo.com account</a></li>
@@ -1284,6 +1285,50 @@
</li>
</t>
<div t-name="UserMenu.about">
<div class="container-fluid">
<div class="row">
<div class="col-sm-offset-2 col-sm-8">
<div class="text-center">
<img src="/web/static/src/img/logo2.png" alt="Odoo (Formerly OpenERP)" title="Odoo (Formerly OpenERP)" class="img-circle"/>
</div>
<div class="text-center">
<div class="user-heading">
<h3>
Version <t t-esc="db_info.server_version"/>
(Community Edition)
</h3>
<t t-if="db_info.expiration_date">
<h5>Database expiration: <t t-esc="new moment(db_info.expiration_date).format('LL')"/></h5>
</t>
</div>
<div>
<div class="tab-content">
<div id="settings" class="tab-pane active">
<h4>Copyright © 2004-2015 Odoo S.A.</h4>
<p>Odoo is a trademark of <a target="_blank" href="https://www.odoo.com" style="text-decoration: underline;">Odoo S.A.</a></p>
<p>Licenced under the terms of <a target="_blank" href="http://www.gnu.org/licenses/lgpl.html" style="text-decoration: underline;">GNU Lesser General Public License</a></p>
<p>For more information visit <a target="_blank" href="https://www.odoo.com" style="text-decoration: underline;">Odoo.com</a></p>
<p>
<a href="https://www.odoo.com/web/about/facebook"><i class="fa fa-facebook-square fa-3x social-fb"></i></a>
<a href="https://www.odoo.com/web/about/twitter"><i class="fa fa-twitter-square fa-3x social-tw"></i></a>
<a href="https://www.odoo.com/web/about/googleplus"><i class="fa fa-google-plus-square fa-3x social-gp"></i></a>
<a href="https://www.odoo.com/web/about/linkedin"><i class="fa fa-linkedin-square fa-3x social-lk"></i></a>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" t-if="!debug">
<div class="col-md-12">
<a class="oe_activate_debug_mode pull-right" href="?debug" >Activate the developer mode</a>
</div>
</div>
</div>
</div>
<t t-name="EnterpriseUpgrade">
<div class="row">
<div class="col-xs-6">
@@ -6,7 +6,7 @@ from datetime import datetime, timedelta
from odoo import fields, http
from odoo.exceptions import AccessError
from odoo.http import request
from odoo import release
class WebSettingsDashboard(http.Controller):
@@ -50,8 +50,6 @@ class WebSettingsDashboard(http.Controller):
limit_date = datetime.now() - timedelta(15)
enterprise_users = request.env['res.users'].search_count([("login_date", ">=", fields.Datetime.to_string(limit_date)), ('share', '=', False)])
expiration_date = request.env['ir.config_parameter'].sudo().get_param('database.expiration_date')
return {
'apps': {
'installed_apps': installed_apps,
@@ -63,9 +61,4 @@ class WebSettingsDashboard(http.Controller):
'pending_users': pending_users,
'user_form_view_id': request.env['ir.model.data'].xmlid_to_res_id("base.view_users_form"),
},
'about': {
'server_version': release.version,
'expiration_date': expiration_date,
'debug': request.debug,
}
}
@@ -17,7 +17,7 @@ var Dashboard = Widget.extend({
template: 'DashboardMain',
init: function(parent, data){
this.all_dashboards = ['apps', 'invitations', 'planner', 'share', 'about'];
this.all_dashboards = ['apps', 'invitations', 'planner', 'share'];
return this._super.apply(this, arguments);
},
@@ -61,10 +61,6 @@ var Dashboard = Widget.extend({
load_planner: function(data){
return new DashboardPlanner(this, data.planner).replace(this.$('.o_web_settings_dashboard_planner'));
},
load_about: function(data){
return new DashboardAbout(this, data.about).replace(this.$('.o_web_settings_dashboard_about'));
},
});
var DashboardInvitations = Widget.extend({
@@ -302,17 +298,6 @@ var DashboardShare = Widget.extend({
}
});
var DashboardAbout = Widget.extend({
template: 'DashboardAbout',
init: function(parent, data){
this.data = data;
this.parent = parent;
return this._super.apply(this, arguments);
},
});
core.action_registry.add('web_settings_dashboard.main', Dashboard);
return {
@@ -320,7 +305,6 @@ return {
DashboardInvitations: DashboardInvitations,
DashboardPlanner: DashboardPlanner,
DashboardShare: DashboardShare,
DashboardAbout: DashboardAbout,
};
});
@@ -17,9 +17,6 @@
<div class="col-md-3 col-sm-6 col-xs-12 o_web_settings_dashboard_col">
<div class="text-center o_web_settings_dashboard_share"></div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12 o_web_settings_dashboard_col">
<div class="text-center o_web_settings_dashboard_about"></div>
</div>
</div>
</div>
</t>
@@ -88,7 +85,7 @@
</t>
<t t-name="DashboardPlanner">
<div class="text-center o_web_settings_dashboard_planner">
<i class="fa fa-check-square-o fa-4x text-muted"></i>
<i class="fa fa-info-circle fa-4x text-muted"></i>
<div class="o_web_settings_dashboard_header">
<span class="o_web_settings_dashboard_planner_overall_progress"><t t-esc="widget.overall_progress"></t></span>%
Implementation
@@ -160,52 +157,4 @@
</div>
</t>
<t t-name="DashboardAbout">
<div class="container-fluid text-center o_web_settings_dashboard_about">
<t t-set="server_version" t-value="widget.data.server_version"/>
<t t-set="expiration_date" t-value="new moment(widget.data.expiration_date).format('LL')"/>
<t t-set="debug" t-value="widget.data.debug"/>
<div class="row">
<div class="col-sm-offset-2 col-sm-8">
<i class="fa fa-info-circle fa-4x text-muted"></i>
<div class="o_web_settings_dashboard_header">
About Us
</div>
<div class="text-center">
<div class="user-heading">
<h3>
Version <t t-esc="server_version"/>
(Community Edition)
</h3>
<t t-if="expiration_date">
<h5>Database expiration: <t t-esc="expiration_date"/></h5>
</t>
</div>
<div>
<div class="tab-content">
<div id="settings" class="tab-pane active">
<h4>Copyright © 2004-2015 Odoo S.A.</h4>
<p>Odoo is a trademark of <a target="_blank" href="https://www.odoo.com" style="text-decoration: underline;">Odoo S.A.</a></p>
<p>Licenced under the terms of <a target="_blank" href="http://www.gnu.org/licenses/lgpl.html" style="text-decoration: underline;">GNU Lesser General Public License</a></p>
<p>For more information visit <a target="_blank" href="https://www.odoo.com" style="text-decoration: underline;">Odoo.com</a></p>
<p>
<a href="https://www.odoo.com/web/about/facebook"><i class="fa fa-facebook-square fa-3x social-fb"></i></a>
<a href="https://www.odoo.com/web/about/twitter"><i class="fa fa-twitter-square fa-3x social-tw"></i></a>
<a href="https://www.odoo.com/web/about/googleplus"><i class="fa fa-google-plus-square fa-3x social-gp"></i></a>
<a href="https://www.odoo.com/web/about/linkedin"><i class="fa fa-linkedin-square fa-3x social-lk"></i></a>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" t-if="!debug">
<div class="col-md-12">
<a class="oe_activate_debug_mode pull-right" href="?debug" >Activate the developer mode</a>
</div>
</div>
</div>
</t>
</templates>