[IMP] web_settings_dashboard: Add a Translations and a Company settings block
Add blocks on settings dashboard to: - Load a translations - Set up company information
This commit is contained in:
committed by
Yannick Tivisse
parent
fffaf735f5
commit
e7b71a4b21
@@ -66,5 +66,9 @@ class WebSettingsDashboard(http.Controller):
|
||||
'server_version': release.version,
|
||||
'expiration_date': expiration_date,
|
||||
'debug': request.debug,
|
||||
},
|
||||
'company': {
|
||||
'company_id': request.env.user.company_id.id,
|
||||
'company_name': request.env.user.company_id.name
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ var Dashboard = Widget.extend({
|
||||
template: 'DashboardMain',
|
||||
|
||||
init: function(){
|
||||
this.all_dashboards = ['apps', 'invitations', 'planner', 'share'];
|
||||
this.all_dashboards = ['apps', 'invitations', 'planner', 'share', 'translations', 'company'];
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
|
||||
@@ -59,6 +59,14 @@ var Dashboard = Widget.extend({
|
||||
load_planner: function(data){
|
||||
return new DashboardPlanner(this, data.planner).replace(this.$('.o_web_settings_dashboard_planner'));
|
||||
},
|
||||
|
||||
load_translations: function (data) {
|
||||
return new DashboardTranslations(this, data.translations).replace(this.$('.o_web_settings_dashboard_translations'));
|
||||
},
|
||||
|
||||
load_company: function (data) {
|
||||
return new DashboardCompany(this, data.company).replace(this.$('.o_web_settings_dashboard_company'));
|
||||
}
|
||||
});
|
||||
|
||||
var DashboardInvitations = Widget.extend({
|
||||
@@ -287,6 +295,52 @@ var DashboardShare = Widget.extend({
|
||||
}
|
||||
});
|
||||
|
||||
var DashboardTranslations = Widget.extend({
|
||||
template: 'DashboardTranslations',
|
||||
|
||||
events: {
|
||||
'click .o_load_translations': 'on_load_translations'
|
||||
},
|
||||
|
||||
on_load_translations: function () {
|
||||
this.do_action('base.action_view_base_language_install');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var DashboardCompany = Widget.extend({
|
||||
template: 'DashboardCompany',
|
||||
|
||||
events: {
|
||||
'click .o_setup_company': 'on_setup_company'
|
||||
},
|
||||
|
||||
init: function (parent, data) {
|
||||
this.data = data;
|
||||
this.parent = parent;
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
|
||||
on_setup_company: function () {
|
||||
var self = this;
|
||||
var action = {
|
||||
type: 'ir.actions.act_window',
|
||||
res_model: 'res.company',
|
||||
view_mode: 'form',
|
||||
view_type: 'form',
|
||||
views: [[false, 'form']],
|
||||
res_id: this.data.company_id
|
||||
};
|
||||
this.do_action(action, {
|
||||
on_reverse_breadcrumb: function () { return self.reload(); }
|
||||
});
|
||||
},
|
||||
|
||||
reload: function () {
|
||||
return this.parent.load(['company']);
|
||||
}
|
||||
});
|
||||
|
||||
core.action_registry.add('web_settings_dashboard.main', Dashboard);
|
||||
|
||||
return {
|
||||
@@ -294,6 +348,8 @@ return {
|
||||
DashboardInvitations: DashboardInvitations,
|
||||
DashboardPlanner: DashboardPlanner,
|
||||
DashboardShare: DashboardShare,
|
||||
DashboardTranslations: DashboardTranslations,
|
||||
DashboardCompany: DashboardCompany
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
@@ -7,9 +7,11 @@
|
||||
<div class="o_web_settings_dashboard_enterprise"/>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 o_web_settings_dashboard_col">
|
||||
<div class="text-center o_web_settings_dashboard_apps"></div>
|
||||
<div class="text-center o_web_settings_dashboard_translations"></div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 o_web_settings_dashboard_col">
|
||||
<div class="text-center o_web_settings_dashboard_invitations"></div>
|
||||
<div class="text-center o_web_settings_dashboard_company"></div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 o_web_settings_dashboard_col">
|
||||
<div class="text-center o_web_settings_dashboard_planner"></div>
|
||||
@@ -187,4 +189,38 @@
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="DashboardTranslations">
|
||||
<div class="text-center o_web_settings_dashboard_translations mt8">
|
||||
<i class="fa fa-globe fa-4x text-muted"></i>
|
||||
<div class="o_web_settings_dashboard_header">
|
||||
Translations
|
||||
</div>
|
||||
<div>
|
||||
<small class="text-muted text-center o_web_settings_dashboard_compact_subtitle">
|
||||
Send your documents in your partner's language or set up a language for your users
|
||||
</small>
|
||||
</div>
|
||||
<div class="mt16">
|
||||
<a class="btn btn-primary btn-block o_load_translations"><strong>Load a Translation</strong></a>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="DashboardCompany">
|
||||
<div class="text-center o_web_settings_dashboard_company mt8">
|
||||
<i class="fa fa-suitcase fa-4x text-muted"></i>
|
||||
<div class="o_web_settings_dashboard_header">
|
||||
<t t-esc="widget.data.company_name"></t>
|
||||
</div>
|
||||
<div>
|
||||
<small class="text-muted text-center o_web_settings_dashboard_compact_subtitle">
|
||||
Set up your company information
|
||||
</small>
|
||||
</div>
|
||||
<div class="mt16">
|
||||
<a class="btn btn-primary btn-block o_setup_company"><strong>Set Up</strong></a>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
|
||||
Reference in New Issue
Block a user