[editable] [minor] made item, item_group pages editable

This commit is contained in:
Rushabh Mehta 2013-10-18 12:16:56 +05:30
parent 6294452435
commit 46eaa55f06
2 changed files with 17 additions and 1 deletions

View File

@ -8,7 +8,7 @@
{% include "lib/website/doctype/website_slideshow/templates/includes/slideshow.html" %} {% include "lib/website/doctype/website_slideshow/templates/includes/slideshow.html" %}
{% endif %} {% endif %}
{% if description %}<!-- description --> {% if description %}<!-- description -->
<div>{{ description or ""}}</div> <div itemprop="description">{{ description or ""}}</div>
{% else %} {% else %}
<h3>{{ name }}</h3> <h3>{{ name }}</h3>
{% endif %} {% endif %}
@ -38,5 +38,13 @@
<div class="alert alert-warning">No items listed.</div> <div class="alert alert-warning">No items listed.</div>
{% endif %} {% endif %}
</div> </div>
<script>
$(function() {
if(window.logged_in && getCookie("system_user")==="yes") {
wn.require("lib/js/wn/website/editable.js");
wn.make_editable($('[itemprop="description"]'), "Item Group", "{{ name }}", "description");
}
})
</script>
{% endblock %} {% endblock %}

View File

@ -3,6 +3,14 @@
{% block javascript %} {% block javascript %}
<script> <script>
{% include "app/stock/doctype/item/templates/includes/product_page.js" %} {% include "app/stock/doctype/item/templates/includes/product_page.js" %}
$(function() {
if(window.logged_in && getCookie("system_user")==="yes") {
wn.require("lib/js/wn/website/editable.js");
wn.make_editable($('[itemprop="description"]'), "Item", "{{ name }}", "web_long_description");
}
})
</script> </script>
{% endblock %} {% endblock %}