@@ -404,6 +404,11 @@ fieldset[disabled] .form-control { | |||||
.awesomplete > ul:before { | .awesomplete > ul:before { | ||||
display: none; | display: none; | ||||
} | } | ||||
.awesomplete > ul li[aria-selected="true"] mark, | |||||
.awesomplete > ul mark { | |||||
padding: 0px; | |||||
background-color: inherit; | |||||
} | |||||
.awesomplete > ul > li { | .awesomplete > ul > li { | ||||
font-size: 12px; | font-size: 12px; | ||||
padding: 9px 11.8px; | padding: 9px 11.8px; | ||||
@@ -15,7 +15,7 @@ frappe.views.CommunicationComposer = Class.extend({ | |||||
title: (this.subject || ""), | title: (this.subject || ""), | ||||
no_submit_on_enter: true, | no_submit_on_enter: true, | ||||
fields: this.get_fields(), | fields: this.get_fields(), | ||||
primary_action_label: "Send", | |||||
primary_action_label: __("Send"), | |||||
primary_action: function() { | primary_action: function() { | ||||
me.send_action(); | me.send_action(); | ||||
} | } | ||||
@@ -49,7 +49,7 @@ frappe.views.CommunicationComposer = Class.extend({ | |||||
get_fields: function() { | get_fields: function() { | ||||
return [ | return [ | ||||
{label:__("To"), fieldtype:"Data", reqd: 0, fieldname:"recipients"}, | {label:__("To"), fieldtype:"Data", reqd: 0, fieldname:"recipients"}, | ||||
{fieldtype: "Section Break", collapsible: 1, label: "CC & Standard Reply"}, | |||||
{fieldtype: "Section Break", collapsible: 1, label: __("CC & Standard Reply")}, | |||||
{label:__("CC"), fieldtype:"Data", fieldname:"cc"}, | {label:__("CC"), fieldtype:"Data", fieldname:"cc"}, | ||||
{label:__("Standard Reply"), fieldtype:"Link", options:"Standard Reply", | {label:__("Standard Reply"), fieldtype:"Link", options:"Standard Reply", | ||||
fieldname:"standard_reply"}, | fieldname:"standard_reply"}, | ||||
@@ -369,7 +369,7 @@ _f.Frm.prototype.show_web_link = function() { | |||||
} | } | ||||
_f.Frm.prototype.add_web_link = function(path) { | _f.Frm.prototype.add_web_link = function(path) { | ||||
this.web_link = this.sidebar.add_user_action("See on Website", | |||||
this.web_link = this.sidebar.add_user_action(__("See on Website"), | |||||
function() {}).attr("href", path || this.doc.route).attr("target", "_blank"); | function() {}).attr("href", path || this.doc.route).attr("target", "_blank"); | ||||
} | } | ||||
@@ -153,15 +153,15 @@ textarea.form-control { | |||||
&--cell { | &--cell { | ||||
&.-current- { | &.-current- { | ||||
color: @brand-primary; | color: @brand-primary; | ||||
&.-in-range- { | &.-in-range- { | ||||
color: @brand-primary; | color: @brand-primary; | ||||
} | } | ||||
} | } | ||||
&.-range-from-, &.-range-to- { | &.-range-from-, &.-range-to- { | ||||
border: 1px solid fade(@brand-primary, 30%); | |||||
background: fade(@brand-primary, 10%); | |||||
border: 1px solid fade(@brand-primary, 30%); | |||||
background: fade(@brand-primary, 10%); | |||||
} | } | ||||
&.-selected-, &.-current-.-selected- { | &.-selected-, &.-current-.-selected- { | ||||
@@ -205,6 +205,11 @@ textarea.form-control { | |||||
display: none; | display: none; | ||||
} | } | ||||
li[aria-selected="true"] mark, mark { | |||||
padding: 0px; | |||||
background-color: inherit; | |||||
} | |||||
&> li { | &> li { | ||||
font-size: 12px; | font-size: 12px; | ||||
padding: 9px 11.8px; | padding: 9px 11.8px; | ||||
@@ -30,7 +30,7 @@ | |||||
{%- endfor %} | {%- endfor %} | ||||
{% if frappe.user != 'Guest' %} | {% if frappe.user != 'Guest' %} | ||||
<li class="sidebar-item"> | <li class="sidebar-item"> | ||||
<a href="/me">My Account</a> | |||||
<a href="/me">{{ _("My Account") }}</a> | |||||
</li> | </li> | ||||
{% endif %} | {% endif %} | ||||
</ul> | </ul> | ||||
@@ -13,7 +13,7 @@ from dateutil import parser | |||||
from num2words import num2words | from num2words import num2words | ||||
import HTMLParser | import HTMLParser | ||||
from html2text import html2text | from html2text import html2text | ||||
from frappe import _ | |||||
DATE_FORMAT = "%Y-%m-%d" | DATE_FORMAT = "%Y-%m-%d" | ||||
TIME_FORMAT = "%H:%M:%S.%f" | TIME_FORMAT = "%H:%M:%S.%f" | ||||
@@ -510,25 +510,31 @@ def pretty_date(iso_datetime): | |||||
# differnt cases | # differnt cases | ||||
if dt_diff_seconds < 60.0: | if dt_diff_seconds < 60.0: | ||||
return 'just now' | |||||
return _('just now') | |||||
elif dt_diff_seconds < 120.0: | elif dt_diff_seconds < 120.0: | ||||
return '1 minute ago' | |||||
return _('1 minute ago') | |||||
elif dt_diff_seconds < 3600.0: | elif dt_diff_seconds < 3600.0: | ||||
return '%s minutes ago' % cint(math.floor(dt_diff_seconds / 60.0)) | |||||
return _('{0} minutes ago').format(cint(math.floor(dt_diff_seconds / 60.0))) | |||||
elif dt_diff_seconds < 7200.0: | elif dt_diff_seconds < 7200.0: | ||||
return '1 hour ago' | |||||
return _('1 hour ago') | |||||
elif dt_diff_seconds < 86400.0: | elif dt_diff_seconds < 86400.0: | ||||
return '%s hours ago' % cint(math.floor(dt_diff_seconds / 3600.0)) | |||||
return _('{0} hours ago').format(cint(math.floor(dt_diff_seconds / 3600.0))) | |||||
elif dt_diff_days == 1.0: | elif dt_diff_days == 1.0: | ||||
return 'Yesterday' | |||||
return _('Yesterday') | |||||
elif dt_diff_days < 7.0: | elif dt_diff_days < 7.0: | ||||
return '%s days ago' % cint(dt_diff_days) | |||||
return _('{0} days ago').format(cint(dt_diff_days)) | |||||
elif dt_diff_days < 12: | |||||
return _('1 weeks ago') | |||||
elif dt_diff_days < 31.0: | elif dt_diff_days < 31.0: | ||||
return '%s week(s) ago' % cint(math.ceil(dt_diff_days / 7.0)) | |||||
return _('{0} weeks ago').format(cint(math.ceil(dt_diff_days / 7.0))) | |||||
elif dt_diff_days < 46: | |||||
return _('1 month ago') | |||||
elif dt_diff_days < 365.0: | elif dt_diff_days < 365.0: | ||||
return '%s months ago' % cint(math.ceil(dt_diff_days / 30.0)) | |||||
return _('{0} months ago').format(cint(math.ceil(dt_diff_days / 30.0))) | |||||
elif dt_diff_days < 550.0: | |||||
return _('1 year ago') | |||||
else: | else: | ||||
return 'more than %s year(s) ago' % cint(math.floor(dt_diff_days / 365.0)) | |||||
return '{0} years ago'.format(cint(math.floor(dt_diff_days / 365.0))) | |||||
def comma_or(some_list): | def comma_or(some_list): | ||||
return comma_sep(some_list, frappe._("{0} or {1}")) | return comma_sep(some_list, frappe._("{0} or {1}")) | ||||
@@ -1,5 +1,5 @@ | |||||
frappe.ui.form.on("Contact Us Settings", { | frappe.ui.form.on("Contact Us Settings", { | ||||
"refresh": function(frm) { | "refresh": function(frm) { | ||||
frm.sidebar.add_user_action("See on Website").attr("href", "/contact").attr("target", "_blank"); | |||||
frm.sidebar.add_user_action(__("See on Website")).attr("href", "/contact").attr("target", "_blank"); | |||||
} | } | ||||
}); | }); |
@@ -74,9 +74,9 @@ def get_website_settings(): | |||||
'top_bar_items': get_items('top_bar_items'), | 'top_bar_items': get_items('top_bar_items'), | ||||
'footer_items': get_items('footer_items'), | 'footer_items': get_items('footer_items'), | ||||
"post_login": [ | "post_login": [ | ||||
{"label": "My Account", "url": "/me"}, | |||||
{"label": _("My Account"), "url": "/me"}, | |||||
# {"class": "divider"}, | # {"class": "divider"}, | ||||
{"label": "Logout", "url": "/?cmd=web_logout"} | |||||
{"label": _("Logout"), "url": "/?cmd=web_logout"} | |||||
] | ] | ||||
}) | }) | ||||
@@ -378,9 +378,10 @@ $(document).ready(function() { | |||||
// switch to app link | // switch to app link | ||||
if(getCookie("system_user")==="yes" && logged_in) { | if(getCookie("system_user")==="yes" && logged_in) { | ||||
$("#website-post-login .dropdown-menu").append('<li><a href="/desk">Switch To Desk</a></li>'); | |||||
$("#website-post-login .dropdown-menu").append('<li><a href="/desk">' | |||||
+__('Switch To Desk')+'</a></li>'); | |||||
$(".navbar-header .dropdown:not(.dropdown-submenu) > .dropdown-menu") | $(".navbar-header .dropdown:not(.dropdown-submenu) > .dropdown-menu") | ||||
.append('<li><a href="/desk">Switch To Desk</a></li>'); | |||||
.append('<li><a href="/desk">'+__('Switch To Desk')+'</a></li>'); | |||||
} | } | ||||
frappe.render_user(); | frappe.render_user(); | ||||
@@ -206,10 +206,10 @@ def set_content_type(response, data, path): | |||||
def clear_cache(path=None): | def clear_cache(path=None): | ||||
frappe.cache().delete_value("website_generator_routes") | frappe.cache().delete_value("website_generator_routes") | ||||
delete_page_cache(path) | delete_page_cache(path) | ||||
frappe.cache().delete_value("website_404") | |||||
if not path: | if not path: | ||||
clear_sitemap() | clear_sitemap() | ||||
frappe.clear_cache("Guest") | frappe.clear_cache("Guest") | ||||
frappe.cache().delete_value("website_404") | |||||
frappe.cache().delete_value("portal_menu_items") | frappe.cache().delete_value("portal_menu_items") | ||||
frappe.cache().delete_value("home_page") | frappe.cache().delete_value("home_page") | ||||