Fixed sidebar, fixtures and delete doc

This commit is contained in:
Anand Doshi 2014-07-09 18:47:57 +05:30
parent 4b3fbc3265
commit 65be3f65a5
4 changed files with 18 additions and 7 deletions

View file

@ -90,9 +90,9 @@ def delete_from_table(doctype, name, ignore_doctypes, doc):
tables = get_table_fields("DocField") + get_table_fields("Custom Field")
# delete from child tables
for t in tables:
for t in list(set(tables)):
if t not in ignore_doctypes:
frappe.db.sql("delete from `tab%s` where parent = %s" % (t, '%s'), (name,))
frappe.db.sql("delete from `tab%s` where parenttype=%s and parent = %s" % (t, '%s', '%s'), (doctype, name))
def check_permission_and_not_submitted(doc, ignore_permissions=False):
# permission

View file

@ -3,9 +3,11 @@
{%- for child in children -%}
<div class="sidebar-item">
{% set is_parent = parents and child.name == parents[-1].name or (loop.first and child.name==pathname) %}
<i class="icon-fixed-width
{% if (child.lft != None) and (child.rgt - child.lft != 1) and (not loop.first) %}icon-chevron-right{% endif %}"
style="margin-left: -15px; color: #ddd; {% if is_parent %}margin-left: -30px;{% endif %}"></i>
{% set has_children = (child.lft != None) and (child.rgt - child.lft != 1) and (not loop.first) %}
<i class="{% if has_children %} icon-chevron-right {% endif %} icon-fixed-width"
style="color: #ddd; {% if is_parent %} margin-left: -30px;
{% else %} margin-left: -18px;
{% endif %}"></i>
<a href="{{ child.name }}" class="no-decoration {% if child.name == pathname %}active{% endif %}">
{{ child.page_title or child.name.replace("_", " ").title() }}
{% if not child.public_read %}

View file

@ -17,6 +17,7 @@ def sync_fixtures(app=None):
if fname.endswith(".json") or fname.endswith(".csv"):
import_doc(frappe.get_app_path(app, "fixtures", fname), ignore_links=True, overwrite=True)
frappe.db.commit()
def export_fixtures():
for app in frappe.get_installed_apps():

View file

@ -249,12 +249,20 @@ fieldset {
.sidebar-item a {
color: #999;
text-decoration: none;
}
.sidebar-item a:hover {
.sidebar-item a:hover,
.sidebar-item a:focus,
.sidebar-item a:active {
color: #333;
text-decoration: none;
border-bottom: 2px solid #999;
/* thanks medium: https://medium.com/designing-medium/crafting-link-underlines-on-medium-7c03a9274f9 */
background-image: linear-gradient(to bottom, transparent 50%, rgba(153,153,153, 0.5) 50%);
background-repeat: repeat-x;
background-size: 5% 20%;
background-position: 0 100%;
}
.sidebar-item a.active {