Rushabh Mehta před 11 roky
rodič
revize
bcc98188da
10 změnil soubory, kde provedl 22 přidání a 13 odebrání
  1. +1
    -1
      frappe/core/doctype/profile/profile.py
  2. +1
    -0
      frappe/model/db_query.py
  3. +7
    -2
      frappe/public/js/frappe/form/grid.js
  4. +5
    -3
      frappe/public/js/frappe/ui/appframe.js
  5. +1
    -0
      frappe/sessions.py
  6. +1
    -1
      frappe/templates/includes/login.css
  7. +2
    -1
      frappe/website/context.py
  8. +3
    -3
      frappe/website/doctype/website_settings/website_settings.py
  9. +0
    -1
      frappe/website/render.py
  10. +1
    -1
      frappe/website/sitemap.py

+ 1
- 1
frappe/core/doctype/profile/profile.py Zobrazit soubor

@@ -372,7 +372,7 @@ def profile_query(doctype, txt, searchfield, start, page_len, filters):
then 0 else 1 end, then 0 else 1 end,
name asc name asc
limit %(start)s, %(page_len)s""" % {'key': searchfield, 'txt': "%%%s%%" % txt, limit %(start)s, %(page_len)s""" % {'key': searchfield, 'txt': "%%%s%%" % txt,
'mcond':get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len})
'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len})


def get_total_users(): def get_total_users():
"""Returns total no. of system users""" """Returns total no. of system users"""


+ 1
- 0
frappe/model/db_query.py Zobrazit soubor

@@ -15,6 +15,7 @@ class DatabaseQuery(object):
self.doctype = doctype self.doctype = doctype
self.tables = [] self.tables = []
self.meta = [] self.meta = []
self.conditions = []
self.fields = ["name"] self.fields = ["name"]
def execute(self, query=None, filters=None, fields=None, docstatus=None, def execute(self, query=None, filters=None, fields=None, docstatus=None,


+ 7
- 2
frappe/public/js/frappe/form/grid.js Zobrazit soubor

@@ -398,6 +398,7 @@ frappe.ui.form.GridRow = Class.extend({
.toggle(this.grid.is_editable()); .toggle(this.grid.is_editable());
}, },
render_form: function() { render_form: function() {
var me = this;
this.make_form(); this.make_form();
this.form_area.empty(); this.form_area.empty();
@@ -408,11 +409,15 @@ frappe.ui.form.GridRow = Class.extend({
frm: this.frm, frm: this.frm,
}); });
this.layout.make(); this.layout.make();
this.layout.refresh(this.doc)
this.layout.refresh(this.doc);
this.fields = this.layout.fields; this.fields = this.layout.fields;
this.fields_dict = this.layout.fields_dict; this.fields_dict = this.layout.fields_dict;

// copy get_query to fields
$.each(this.grid.fieldinfo || {}, function(fieldname, fi) {
$.extend(me.fields_dict[fieldname], fi);
})
// var me = this, // var me = this,
// make_row = function(label) { // make_row = function(label) {


+ 5
- 3
frappe/public/js/frappe/ui/appframe.js Zobrazit soubor

@@ -125,7 +125,7 @@ frappe.ui.AppFrame = Class.extend({
if(module_info) { if(module_info) {
views.push({ views.push({
icon: module_info.icon, icon: module_info.icon,
route: module_info.link,
route: "Module/" + meta.module,
type: "module" type: "module"
}) })
} }
@@ -135,11 +135,13 @@ frappe.ui.AppFrame = Class.extend({
route: "", route: "",
type: "form", type: "form",
set_route: function() { set_route: function() {
console.log(me.doctype);
if(frappe.views.formview[me.doctype]) { if(frappe.views.formview[me.doctype]) {
frappe.set_route("Form", me.doctype, frappe.views.formview[me.doctype].frm.docname); frappe.set_route("Form", me.doctype, frappe.views.formview[me.doctype].frm.docname);
} else { } else {
new_doc(doctype);
new_doc(me.doctype);
} }
return false;
} }
}); });


@@ -182,7 +184,7 @@ frappe.ui.AppFrame = Class.extend({
set_views: function(views, active_view) { set_views: function(views, active_view) {
var me = this; var me = this;
$.each(views, function(i, e) { $.each(views, function(i, e) {
var btn = me.add_icon_btn("3", e.icon, frappe._(toTitle(e.type)), function() {
var btn = me.add_icon_btn("3", e.icon, frappe._(toTitle(e.type)), e.set_route || function() {
window.location.hash = "#" + $(this).attr("data-route"); window.location.hash = "#" + $(this).attr("data-route");
}).attr("data-route", e.route); }).attr("data-route", e.route);


+ 1
- 0
frappe/sessions.py Zobrazit soubor

@@ -75,6 +75,7 @@ def get():
bootinfo = frappe.cache().get_value('bootinfo:' + frappe.session.user) bootinfo = frappe.cache().get_value('bootinfo:' + frappe.session.user)
if bootinfo: if bootinfo:
bootinfo['from_cache'] = 1 bootinfo['from_cache'] = 1
bootinfo["profile"]["recent"] = json.dumps(frappe.cache().get_value("recent:" + frappe.session.user))
bootinfo["notification_info"].update(get_notifications()) bootinfo["notification_info"].update(get_notifications())
if not bootinfo: if not bootinfo:


+ 1
- 1
frappe/templates/includes/login.css Zobrazit soubor

@@ -3,7 +3,7 @@
} }


#wrap { #wrap {
background-color: #eee;
background-color: #f2f2f2;
} }
.page-content { .page-content {
right: 0%; right: 0%;


+ 2
- 1
frappe/website/context.py Zobrazit soubor

@@ -54,9 +54,10 @@ def build_context(sitemap_options):
if context.controller: if context.controller:
module = frappe.get_module(context.controller) module = frappe.get_module(context.controller)

if module and hasattr(module, "get_context"): if module and hasattr(module, "get_context"):
context.update(module.get_context(context) or {}) context.update(module.get_context(context) or {})
if context.get("base_template_path") != context.get("template_path") and not context.get("rendered"): if context.get("base_template_path") != context.get("template_path") and not context.get("rendered"):
context.data = render_blocks(context) context.data = render_blocks(context)


+ 3
- 3
frappe/website/doctype/website_settings/website_settings.py Zobrazit soubor

@@ -79,7 +79,7 @@ def get_website_settings():
{"label": "Logout", "url": "?cmd=web_logout", "icon": "icon-signout"} {"label": "Logout", "url": "?cmd=web_logout", "icon": "icon-signout"}
] ]
}) })
settings = frappe.doc("Website Settings", "Website Settings") settings = frappe.doc("Website Settings", "Website Settings")
for k in ["banner_html", "brand_html", "copyright", "twitter_share_via", for k in ["banner_html", "brand_html", "copyright", "twitter_share_via",
"favicon", "facebook_share", "google_plus_one", "twitter_share", "linked_in_share", "favicon", "facebook_share", "google_plus_one", "twitter_share", "linked_in_share",
@@ -99,10 +99,10 @@ def get_website_settings():
context.url = quote(str(get_request_site_address(full_address=True)), safe="/:") context.url = quote(str(get_request_site_address(full_address=True)), safe="/:")
context.encoded_title = quote(encode(context.title or ""), str("")) context.encoded_title = quote(encode(context.title or ""), str(""))
for update_website_context in hooks.update_website_context or []: for update_website_context in hooks.update_website_context or []:
frappe.get_attr(update_website_context)(context) frappe.get_attr(update_website_context)(context)
context.web_include_js = hooks.web_include_js or [] context.web_include_js = hooks.web_include_js or []
context.web_include_css = hooks.web_include_css or [] context.web_include_css = hooks.web_include_css or []


+ 0
- 1
frappe/website/render.py Zobrazit soubor

@@ -53,7 +53,6 @@ def build(path):
build_method = (build_json if is_ajax() else build_page) build_method = (build_json if is_ajax() else build_page)
try: try:
return build_method(path) return build_method(path)

except frappe.DoesNotExistError: except frappe.DoesNotExistError:
hooks = frappe.get_hooks() hooks = frappe.get_hooks()
if hooks.website_catch_all: if hooks.website_catch_all:


+ 1
- 1
frappe/website/sitemap.py Zobrazit soubor

@@ -26,7 +26,7 @@ def build_sitemap_options(path):
sitemap_config = frappe.doc("Website Template", sitemap_config = frappe.doc("Website Template",
sitemap_options.get("website_template")).fields sitemap_options.get("website_template")).fields
# get sitemap config fields too # get sitemap config fields too
for fieldname in ("base_template_path", "template_path", "controller", for fieldname in ("base_template_path", "template_path", "controller",
"no_cache", "no_sitemap", "page_name_field", "condition_field"): "no_cache", "no_sitemap", "page_name_field", "condition_field"):


Načítá se…
Zrušit
Uložit