Guest User

Untitled

a guest
May 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.45 KB | None | 0 0
  1. {% extends "admin/base_site.html" %}
  2. {% load i18n admin_urls static admin_modify %}
  3.  
  4. {% block extrahead %}{{ block.super }}
  5. <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
  6. {{ media }}
  7. {% endblock %}
  8.  
  9. {% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
  10.  
  11. {% block coltype %}colM{% endblock %}
  12.  
  13. {% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %}
  14.  
  15. {% if not is_popup %}
  16. {% block breadcrumbs %}
  17. <div class="breadcrumbs">
  18. <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
  19. &rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
  20. &rsaquo; {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
  21. &rsaquo; {% if add %}{% blocktrans with name=opts.verbose_name %}Add {{ name }}{% endblocktrans %}{% else %}{{ original|truncatewords:"18" }}{% endif %}
  22. </div>
  23. {% endblock %}
  24. {% endif %}
  25.  
  26. {% block content %}<div id="content-main">
  27. {% block object-tools %}
  28. {% if change %}{% if not is_popup %}
  29. <ul class="object-tools">
  30. {% block object-tools-items %}
  31. <li>
  32. {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
  33. <a href="{% add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a>
  34. </li>
  35. {% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif %}
  36. {% endblock %}
  37. </ul>
  38. {% endif %}{% endif %}
  39. {% endblock %}
  40. <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
  41. <div>
  42. {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
  43. {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
  44. {% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %}
  45. {% if errors %}
  46. <p class="errornote">
  47. {% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
  48. </p>
  49. {{ adminform.form.non_field_errors }}
  50. {% endif %}
  51.  
  52. {% block field_sets %}
  53.  
  54. {% for fieldset in adminform %}
  55.  
  56. {% include "admin/includes/fieldset.html" %}
  57.  
  58. {% endfor %}
  59. {% endblock %}
  60.  
  61. {% block after_field_sets %}{% endblock %}
  62.  
  63. {% block inline_field_sets %}
  64. {% for inline_admin_formset in inline_admin_formsets %}
  65. {% include inline_admin_formset.opts.template %}
  66. {% endfor %}
  67. {% endblock %}
  68.  
  69. {% block after_related_objects %}{% endblock %}
  70.  
  71. {% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
  72.  
  73. {% block admin_change_form_document_ready %}
  74. <script type="text/javascript"
  75. id="django-admin-form-add-constants"
  76. src="{% static 'admin/js/change_form.js' %}"
  77. {% if adminform and add %}
  78. data-model-name="{{ opts.model_name }}"
  79. {% endif %}>
  80. </script>
  81. {% endblock %}
  82.  
  83. {# JavaScript for prepopulated fields #}
  84. {% prepopulated_fields_js %}
  85.  
  86. </div>
  87. </form></div>
  88. {% endblock %}
  89.  
  90. INSTALLED_APPS = [
  91. ...
  92. 'tinymce',
  93. ...
  94. ]
  95.  
  96. urlpatterns = [
  97. ...
  98. url(r'^tinymce/', include('tinymce.urls')),
  99. ...
  100. ]
  101.  
  102. 'height': 360,
  103. 'width': 1120,
  104. 'cleanup_on_startup': True,
  105. 'custom_undo_redo_levels': 20,
  106. 'selector': 'textarea',
  107. 'theme': 'modern',
  108. 'plugins': '''
  109. textcolor save link image media preview codesample contextmenu
  110. table code lists fullscreen insertdatetime nonbreaking
  111. contextmenu directionality searchreplace wordcount visualblocks
  112. visualchars code fullscreen autolink lists charmap print hr
  113. anchor pagebreak
  114. ''',
  115. 'toolbar1': '''
  116. fullscreen preview bold italic underline | fontselect,
  117. fontsizeselect | forecolor backcolor | alignleft alignright |
  118. aligncenter alignjustify | indent outdent | bullist numlist table |
  119. | link image media | codesample |
  120. ''',
  121. 'toolbar2': '''
  122. visualblocks visualchars |
  123. charmap hr pagebreak nonbreaking anchor | code |
  124. ''',
  125. 'contextmenu': 'formats | link image',
  126. 'menubar': True,
  127. 'statusbar': True,
Add Comment
Please, Sign In to add comment