+
{{ __("You have {0} days left in your trial", [days_to_expiry]) }}
+
+ {% if limits.upgrade_url %}
+
Upgrade to a premium plan with more users, storage and priority support.
+
+ {% endif %}
+
{% endif %}
{% if limits.users %}
{% var users_percent = ((enabled_users / limits.users) * 100); %}
-
+
{{ __("Emails") }}
{% var email_percent = (( emails_sent / limits.emails ) * 100); %}
{% var emails_remaining = (limits.emails - emails_sent) %}
-
+
-
-
-
- {{ __("Emails Sent") }} |
- {{ __("Max Emails") }} |
- {{ __("Remaining") }} |
-
-
-
-
- {%= emails_sent %} |
- {%= limits.emails %} |
- {%= emails_remaining %} |
-
-
-
-
+
{%= emails_sent %} out of {%= limits.emails %} sent this month
+
{% endif %}
{% if limits.space %}
-
{{ __("Space usage") }}
+
+
{{ __("Space") }}
{% var database_percent = ((limits.space_usage.database_size / limits.space) * 100); %}
{% var files_percent = ((limits.space_usage.files_size / limits.space) * 100); %}
{% var backup_percent = ((limits.space_usage.backup_size / limits.space) * 100); %}
-
-
-
-
-
-
-
+
-
-
-
- {{ __("Type") }} |
- {{ __("Size (MB)") }} |
-
-
-
-
- {{ __("Database Size") }} |
- {%= limits.space_usage.database_size %} MB |
-
-
- {{ __("Files Size") }} |
- {%= limits.space_usage.files_size %} MB |
-
-
- {{ __("Backup Size") }} |
- {%= limits.space_usage.backup_size %} MB |
-
-
- {{ __("Total") }} |
- {%= limits.space_usage.total %} MB |
-
-
- {{ __("Remaining") }} |
-
- {%= flt(limits.space - limits.space_usage.total, 2) %} MB |
-
-
-
+
+ {{ __("Database Size:") }} {%= limits.space_usage.files_size %} MB
+
+
+ {{ __("Files Size:") }} {%= limits.space_usage.files_size %} MB
+
+
+ {{ __("Backup Size:") }} {%= limits.space_usage.backup_size %} MB
+
+
+
+
+ {%= flt(limits.space - limits.space_usage.total, 2) %} MB
+ available out of
+ {%= limits.space %} MB
+
+
{% endif %}
diff --git a/frappe/core/page/usage_info/usage_info.js b/frappe/core/page/usage_info/usage_info.js
index 1f2409980e..5137eeac6a 100644
--- a/frappe/core/page/usage_info/usage_info.js
+++ b/frappe/core/page/usage_info/usage_info.js
@@ -18,12 +18,9 @@ frappe.pages['usage-info'].on_page_load = function(wrapper) {
$(frappe.render_template("usage_info", usage_info)).appendTo(page.main);
var btn_text = usage_info.limits.users == 1 ? __("Upgrade") : __("Renew / Upgrade");
-
- if(usage_info.upgrade_url) {
- page.set_primary_action(btn_text, function() {
- window.open(usage_info.upgrade_url);
- });
- }
+ $(page.main).find('.btn-primary').html(btn_text).on('click', () => {
+ window.open(usage_info.upgrade_url);
+ });
}
});
diff --git a/frappe/public/js/frappe/list/list_sidebar.js b/frappe/public/js/frappe/list/list_sidebar.js
index 4a9a5753c2..99daa6c2da 100644
--- a/frappe/public/js/frappe/list/list_sidebar.js
+++ b/frappe/public/js/frappe/list/list_sidebar.js
@@ -28,6 +28,12 @@ frappe.views.ListSidebar = Class.extend({
this.setup_views();
this.setup_kanban_boards();
this.setup_email_inbox();
+
+ let limits = frappe.boot.limits;
+
+ if(limits.upgrade_url && limits.expiry && !frappe.flags.upgrade_dismissed) {
+ this.setup_upgrade_box();
+ }
},
setup_views: function() {
var show_list_link = false;
@@ -66,7 +72,7 @@ frappe.views.ListSidebar = Class.extend({
//enable link for Kanban view
this.sidebar.find('.list-link[data-view="Kanban"] a, .list-link[data-view="Inbox"] a')
- .attr('disabled', null).removeClass('disabled')
+ .attr('disabled', null).removeClass('disabled');
// show image link if image_view
if(this.list_view.meta.image_field) {
@@ -97,7 +103,7 @@ frappe.views.ListSidebar = Class.extend({
added.push(route);
if(!divider) {
- $('
').appendTo(dropdown);
+ me.get_divider().appendTo(dropdown);
divider = true;
}
@@ -129,7 +135,7 @@ frappe.views.ListSidebar = Class.extend({
boards.forEach(function(board) {
var route = ["List", board.reference_doctype, "Kanban", board.name].join('/');
if(!divider) {
- $('
').appendTo($dropdown);
+ me.get_divider().appendTo($dropdown);
divider = true;
}
$(`
@@ -284,7 +290,7 @@ frappe.views.ListSidebar = Class.extend({
var email_account = (account.email_id == "All Accounts")? "All Accounts": account.email_account;
var route = ["List", "Communication", "Inbox", email_account].join('/');
if(!divider) {
- $('').appendTo($dropdown);
+ this.get_divider().appendTo($dropdown);
divider = true;
}
$(''+account.email_id+'').appendTo($dropdown);
@@ -293,7 +299,7 @@ frappe.views.ListSidebar = Class.extend({
});
$dropdown.find('.new-email-account').click(function() {
- frappe.new_doc("Email Account")
+ frappe.new_doc("Email Account");
});
},
setup_assigned_to_me: function() {
@@ -302,11 +308,32 @@ frappe.views.ListSidebar = Class.extend({
me.list_view.assigned_to_me();
});
},
+ setup_upgrade_box: function() {
+ let upgrade_list = $(``).appendTo(this.sidebar);
+ let upgrade_box = $(`
+
+
Go Premium
+
Upgrade to a premium plan with more users, storage and priority support.
+
+
`).appendTo(upgrade_list);
+
+ upgrade_box.find('.btn-primary').on('click', () => {
+ window.open(frappe.boot.limits.upgrade_url);
+ });
+
+ upgrade_box.find('.close').on('click', () => {
+ upgrade_list.remove();
+ frappe.flags.upgrade_dismissed = 1;
+ });
+ },
get_cat_tags:function(){
return this.cat_tags;
},
get_stats: function() {
- var me = this
+ var me = this;
frappe.call({
method: 'frappe.desk.reportview.get_sidebar_stats',
args: {
@@ -421,4 +448,7 @@ frappe.views.ListSidebar = Class.extend({
this.sidebar.find(".sidebar-stat").remove();
this.get_stats();
},
+ get_divider: function() {
+ return $('');
+ }
});
diff --git a/frappe/public/js/frappe/toolbar.js b/frappe/public/js/frappe/toolbar.js
index a6a8931001..a466e038bd 100755
--- a/frappe/public/js/frappe/toolbar.js
+++ b/frappe/public/js/frappe/toolbar.js
@@ -17,15 +17,10 @@ $(document).on("toolbar_setup", function() {
}
}
- if(limits.support_email || limits.support_chat) {
+ if(limits.support_chat) {
help_links.push('');
}
- if(limits.support_email) {
- var support_link = 'mailto:'+frappe.boot.limits.support_email;
- help_links.push('' + frappe._('Email Support') + '');
- }
-
if(limits.support_chat) {
help_links.push('' + frappe._('Chat Support') + '');
}