{% load i18n %}

{% if user.is_authenticated and user.is_staff %}
    <script type="text/javascript"> 
        (function($){
            jQuery(document).ready(function () { 
                inplaceeditform_ready($);
        });
        })(jQuery);
    </script>
    <div id="view_{{ form_obj.prefix }}-{{field.name}}_save"  style="display:none" class="inplace-messages"> <ul class="save"> <li class="save"> {% trans "Changed successfully" %}</li></ul> </div>
    <span id="view_{{ form_obj.prefix }}-{{field.name}}" class="inplace-view-editable-field" style="display:block">
      <span id="view_{{ form_obj.prefix }}-{{field.name}}_id" class="inplace-view-editable-field-id">{% if empty_value %}{% trans "Double click here to edit" %}{% else %}{{ value2|default:value }}{% endif %}</span>
    </span>
    <div id="tools_{{ form_obj.prefix }}-{{field.name}}" style="display: none;" class="inplace-tools">
      <span id="tools_{{ form_obj.prefix }}-{{field.name}}_error" class="inplace-tools-error"> </span>
      <span class="field_id" style="display:none">{{ field.auto_id }}</span>
      <span class="field_name" style="display:none">{{ field.name }}</span>
      <span class="obj_id" style="display:none">{{ obj.id }}</span>
      <span class="content_type_id" style="display:none">{{ content_type_id }}</span>
      <span class="form" style="display:none">{{ form }}</span>
      <span class="filters" style="display:none">{{ filters }}</span>
     
      {{ field }}
      <button id="tools_{{ form_obj.prefix }}-{{field.name}}_apply_id" class="apply" title="Apply change" type="button"><span>{% trans "save" %}</span></button>
      <button id="tools_{{ form_obj.prefix }}-{{field.name}}_cancel_id" class="cancel" title="Revert change" type="button"><span>{% trans "Cancel" %}</span></button>
    </div>
{% else %}
    {{ value2|default:value|safe }}
{% endif %}
