{% load i18n %}

{% if can_edit_this_object %}
    <script type="text/javascript"> 
        (function($){
            $(document).ready(function () { 
                inplaceeditform_ready('{{ form_obj.prefix }}', '{{ field.name }}', '{{ obj.id }}', {{ content_type_id }}, '{{ form }}', $.evalJSON( '[]') );
        });
        })(jQuery);
    </script>
    <div id="view_{{ form_obj.prefix }}-{{field.name}}_save"  style="display:none" > <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">
      <span id="view_{{ form_obj.prefix }}-{{field.name}}_id" >{% if empty_value %} {% if obj.text_empty_value %}{{ obj.text_empty_value }}{% else %}{% trans "Double click here to edit" %}{% endif %} {% else %}{{ value2|default:value }}{% endif %}</span>
    </span>
    <div id="tools_{{ form_obj.prefix }}-{{field.name}}" style="display: none; ">
      <span id="tools_{{ form_obj.prefix }}-{{field.name}}_error"> </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 %}
