You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.2 KiB

  1. /**********************************************************************************
  2. *
  3. * Copyright (c) 2017-2019 MuK IT GmbH.
  4. *
  5. * This file is part of MuK Web Branding
  6. * (see https://mukit.at).
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. **********************************************************************************/
  22. odoo.define('muk_web_branding.dashboard', function (require) {
  23. "use strict";
  24. var core = require('web.core');
  25. var session = require('web.session');
  26. var dashboard = require('web_settings_dashboard');
  27. var _t = core._t;
  28. var QWeb = core.qweb;
  29. dashboard.DashboardApps.include({
  30. start: function() {
  31. this._super.apply(this, arguments);
  32. var $store = $('<a/>', {
  33. target: "_blank",
  34. href: this.data.store,
  35. html: '<i class="fa fa-lg fa-rocket text-muted"></i> App store',
  36. class: "flex-grow-1 w-25",
  37. });
  38. this.$('.o_web_settings_dashboard_pills').html($store);
  39. this.$('.o_web_settings_dashboard_enterprise').remove();
  40. },
  41. });
  42. dashboard.DashboardShare.include({
  43. init: function (parent, data) {
  44. this._super.apply(this, arguments);
  45. this.share_url = this.data.share;
  46. this.share_text = encodeURIComponent(_.str.sprintf(
  47. _t("I am using #%s - Awesome open source business apps."),
  48. this.data.system
  49. ));
  50. this.share_description = _.str.sprintf(
  51. _t("Mantained by %s"), this.data.publisher
  52. );
  53. },
  54. start: function() {
  55. this._super.apply(this, arguments);
  56. this.$('.o_web_settings_dashboard_compact_subtitle > small').text(this.share_description);
  57. },
  58. });
  59. });