KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
8.2KB

  1. <form id="post_edit_form_$post.id" class="inline_edit post_edit" action="{% admin "update_post" %}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
  2. <fieldset>
  3. ${ trigger.call("before_ajax_edit_post_fields", feather) }
  4. {% for field in feather.fields %}
  5. <p>
  6. <label for="$field.attr">
  7. $field.label
  8. {% if field.optional %}
  9. <span class="sub">${ "(optional)" | translate }</span>
  10. {% endif %}
  11. </label>
  12. {% if field.type == "text" or field.type == "file" %}
  13. <input class="$field.type{% if field.classes %} ${ field.classes | join(" ") }{% endif %}" type="$field.type" name="$field.attr" value="{% if not field.no_value %}${ field.value | fallback(post[field.attr] | escape(true, false)) }{% endif %}" id="$field.attr" />
  14. {% elseif field.type == "text_block" %}
  15. <textarea class="wide{% if field.classes %} ${ field.classes | join(" ") }{% endif %}" rows="${ field.rows | fallback(12) }" name="$field.attr" id="$field.attr" cols="50">{% if not field.no_value %}${ field.value | fallback(post[field.attr] | escape(false, false)) }{% endif %}</textarea>
  16. {% elseif field.type == "checkbox" %}
  17. <input class="$field.type{% if field.classes %} ${ field.classes | join(" ") }{% endif %}" type="$field.type" name="$field.attr"{% if field.checked %}checked="checked"{% endif %} id="$field.attr">
  18. {% elseif field.type == "select" %}
  19. <select name="$field.attr" id="$field.attr"{% if field.classes %} class="${ field.classes | join(" ") }"{% endif %}>
  20. {% for value, name in field.options | items %}
  21. <option value="${ value | escape }"{% if not field.no_value %}${ value | option_selected(post[field.attr]) }{% endif %}>${ name | escape }</option>
  22. {% endfor %}
  23. </select>
  24. {% endif %}
  25. </p>
  26. {% endfor %}
  27. <a id="more_options_link_$post.id" href="javascript:void(0)" class="more_options_link">${ "More Options &darr;" | translate("chyrp") }</a>
  28. <div id="more_options_$post.id" class="more_options" style="display: none">
  29. {% if visitor.group.can("add_post") %}
  30. <p>
  31. <label for="status">${ "Status" | translate }</label>
  32. <select name="status" id="status">
  33. <option value="draft"{% if post.status == "draft" %} selected="selected"{% endif %}>${ "Draft" | translate }</option>
  34. <option value="public"{% if post.status == "public" %} selected="selected"{% endif %}>${ "Public" | translate }</option>
  35. <option value="private"{% if post.status == "private" %} selected="selected"{% endif %}>${ "Private" | translate }</option>
  36. <option value="registered_only"{% if post.status == "registered_only" %} selected="selected"{% endif %}>${ "Registered Only" | translate }</option>
  37. {% if groups %}
  38. <optgroup label="${ "Group" | translate }">
  39. {% for group in groups %}
  40. <option value="{$group.id}"${ post.status | option_selected("{"~ group.id ~"}") }>${ group.name | escape }</option>
  41. {% endfor %}
  42. </optgroup>
  43. {% endif %}
  44. </select>
  45. </p>
  46. {% endif %}
  47. <p>
  48. <label for="pinned">${ "Pinned?" | translate }</label>
  49. <input type="checkbox" name="pinned" id="pinned"{% if post.pinned %} checked="checked"{% endif %}/>&nbsp;
  50. <small>${ "(shows this post above all others)" | translate }</small>
  51. </p>
  52. <p>
  53. <label for="slug">${ "Slug" | translate }</label>
  54. <input class="text" type="text" name="slug" value="${ post.slug | escape }" id="slug" />
  55. </p>
  56. <p>
  57. <label for="created_at">${ "Timestamp" | translate }</label>
  58. <input class="text" type="text" name="created_at" value="${ post.created_at | fallback(now | date("r")) | strftime }" id="created_at" />
  59. <input type="hidden" name="original_time" value="${ post.created_at | fallback(now | date("r")) | strftime }" />
  60. </p>
  61. <p>
  62. <label for="trackbacks">${ "Trackbacks" | translate }</label>
  63. <input class="text" type="text" name="trackbacks" value="" id="trackbacks" />
  64. </p>
  65. {% for field in options %}
  66. <p>
  67. <label for="${ field.attr | replace("[", "_") | replace("]", "") }">
  68. $field.label
  69. {% if field.help %}
  70. <span class="sub">
  71. <a href="{% admin "help&id="~field.help %}" class="help emblem"><img src="images/icons/help.png" alt="help" /></a>
  72. </span>
  73. {% endif %}
  74. {% if field.note %}
  75. <span class="sub">$field.note</span>
  76. {% endif %}
  77. </label>
  78. {% if field.type == "text" or field.type == "file" %}
  79. <input class="$field.type{% if field.classes %} ${ field.classes | join(" ") }{% endif %}" type="$field.type" name="$field.attr" value="{% if not field.no_value %}${ field.value | fallback(post[field.attr] | escape(true, false)) }{% endif %}" id="$field.attr" />
  80. {% elseif field.type == "text_block" %}
  81. <textarea class="wide{% if field.classes %} ${ field.classes | join(" ") }{% endif %}" rows="${ field.rows | fallback(12) }" name="$field.attr" id="$field.attr" cols="50">{% if not field.no_value %}${ field.value | fallback(post[field.attr] | escape(false, false)) }{% endif %}</textarea>
  82. {% elseif field.type == "select" %}
  83. <select name="$field.attr" id="$field.attr"{% if field.classes %} class="${ field.classes | join(" ") }"{% endif %}>
  84. {% for option in field.options %}
  85. <option value="${ option.value | escape }"${ option.selected | option_selected(true) }>${ option.name | escape }</option>
  86. {% endfor %}
  87. </select>
  88. {% endif %}
  89. $field.extra
  90. </p>
  91. {% endfor %}
  92. <div class="clear"></div>
  93. </div>
  94. <br />
  95. <div class="buttons">
  96. <input type="submit" value="${ "Save" | translate }" accesskey="s" /> ${ "or" | translate }
  97. <a href="javascript:void(0)" id="post_cancel_edit_$post.id" class="cancel">${ "Cancel" | translate }</a>
  98. </div>
  99. <input type="hidden" name="id" value="$post.id" id="id" />
  100. <input type="hidden" name="feather" value="${ post.feather | escape }" id="feather" />
  101. <input type="hidden" name="hash" value="$site.secure_hashkey" id="hash" />
  102. <input type="hidden" name="ajax" value="true" id="ajax" />
  103. </fieldset>
  104. </form>