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.

133 lines
9.5KB

  1. ${ trigger.call("before_post_fields", feather) }
  2. {% for field in feather.fields %}
  3. <p>
  4. <label for="${ field.attr }_field">
  5. $field.label
  6. {% if field.optional %}
  7. <span class="sub">${ "(optional)" | translate }</span>
  8. {% endif %}
  9. {% if field.help %}
  10. <span class="sub">
  11. <a href="{% admin "help&id="~field.help %}" class="help emblem"><img src="$theme_url/images/icons/help.png" alt="help" /></a>
  12. </span>
  13. {% endif %}
  14. {% if field.note %}
  15. <span class="sub">$field.note</span>
  16. {% endif %}
  17. </label>
  18. {% if field.type == "text" or field.type == "file" %}
  19. <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 }_field" />
  20. {% if post.filename and route.action == "edit_post" %}
  21. <em>Current file name: <strong>${ post.filename | escape('') }</strong></em>
  22. {% endif %}
  23. {% elseif field.type == "text_block" %}
  24. <textarea class="wide{% if field.classes %} ${ field.classes | join(" ") }{% endif %}" rows="${ field.rows | fallback(12) }" name="$field.attr" id="${ field.attr }_field" cols="50">{% if not field.no_value %}${ field.value | fallback(post[field.attr] | escape(false, false)) }{% endif %}</textarea>
  25. {% elseif field.type == "checkbox" %}
  26. <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 }_field" />
  27. {% elseif field.type == "select" %}
  28. <select name="$field.attr" id="${ field.attr }_field"{% if field.classes %} class="${ field.classes | join(" ") }"{% endif %}>
  29. {% for value, name in field.options | items %}
  30. <option value="${ value | escape }"{% if not field.no_value %}${ value | option_selected(post[field.attr]) }{% endif %}>${ name | escape }</option>
  31. {% endfor %}
  32. </select>
  33. {% endif %}
  34. $field.extra
  35. </p>
  36. {% endfor %}
  37. ${ trigger.call("after_post_fields", feather) }
  38. <div class="buttons">
  39. {% if route.action == "edit_post" %}
  40. <button type="submit" class="yay right" accesskey="s" id="save">
  41. <img src="$theme_url/images/icons/success.png" alt="success" />${ "Save" | translate }
  42. </button>
  43. {% else %}
  44. {% if visitor.group.can("add_post") %}
  45. <button type="submit" class="yay right" accesskey="s" id="publish">
  46. <img src="$theme_url/images/icons/success.png" alt="success" />${ "Publish" | translate }
  47. </button>
  48. {% endif %}
  49. <button type="submit" class="right" accesskey="s" id="save" name="draft" value="true">
  50. <img src="$theme_url/images/icons/save.png" alt="success" />${ "Save" | translate }
  51. </button>
  52. {% endif %}
  53. </div>
  54. <div class="clear"></div>
  55. <noscript><br /></noscript>
  56. <div id="more_options" class="more_options js_disabled">
  57. {% if visitor.group.can("add_post") %}
  58. <p>
  59. <label for="status">${ "Status" | translate }</label>
  60. <select name="status" id="status">
  61. {% if route.action == "edit_post" %}
  62. <option value="draft"${ post.status | option_selected("draft") }>${ "Draft" | translate }</option>
  63. {% endif %}
  64. <option value="public"${ post.status | option_selected("public") }>${ "Public" | translate }</option>
  65. <option value="private"${ post.status | option_selected("private") }>${ "Private" | translate }</option>
  66. <option value="registered_only"${ post.status | option_selected("registered_only") }>${ "Registered Only" | translate }</option>
  67. {% if groups %}
  68. <optgroup label="${ "Group" | translate }">
  69. {% for group in groups %}
  70. <option value="{$group.id}"${ post.status | option_selected("{"~ group.id ~"}") }>${ group.name | escape }</option>
  71. {% endfor %}
  72. </optgroup>
  73. {% endif %}
  74. </select>
  75. </p>
  76. {% endif %}
  77. <p>
  78. <label for="pinned">${ "Pinned?" | translate }</label>
  79. <input type="checkbox" name="pinned" id="pinned"{% if post.pinned %} checked="checked"{% endif %}/>&nbsp;
  80. <small>${ "(shows this post above all others)" | translate }</small>
  81. </p>
  82. <p>
  83. <label for="slug">
  84. ${ "Slug" | translate }
  85. <a href="{% admin "help&id=slugs" %}" class="help emblem"><img src="$theme_url/images/icons/help.png" alt="help" /></a>
  86. </label>
  87. <input class="text" type="text" name="slug" value="${ post.slug | escape }" id="slug" />
  88. </p>
  89. <p>
  90. <label for="created_at">${ "Timestamp" | translate }</label>
  91. <input class="text" type="text" name="created_at" value="${ post.created_at | fallback(now | date("r")) | strftime }" id="created_at" />
  92. <input type="hidden" name="original_time" value="${ post.created_at | fallback(now | date("r")) | strftime }" />
  93. </p>
  94. <p>
  95. <label for="trackbacks">
  96. ${ "Trackbacks" | translate }
  97. <a href="{% admin "help&id=trackbacks" %}" class="help emblem"><img src="$theme_url/images/icons/help.png" alt="help" /></a>
  98. </label>
  99. <input class="text" type="text" name="trackbacks" value="" id="trackbacks" />
  100. </p>
  101. {% for field in options %}
  102. <p>
  103. <label for="${ field.attr | replace("[", "_") | replace("]", "") }">
  104. $field.label
  105. {% if field.help %}
  106. <span class="sub">
  107. <a href="{% admin "help&id="~field.help %}" class="help emblem"><img src="$theme_url/images/icons/help.png" alt="help" /></a>
  108. </span>
  109. {% endif %}
  110. {% if field.note %}
  111. <span class="sub">$field.note</span>
  112. {% endif %}
  113. </label>
  114. {% if field.type == "text" or field.type == "file" %}
  115. <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" />
  116. {% elseif field.type == "text_block" %}
  117. <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>
  118. {% elseif field.type == "select" %}
  119. <select name="$field.attr" id="$field.attr"{% if field.classes %} class="${ field.classes | join(" ") }"{% endif %}>
  120. {% for option in field.options %}
  121. <option value="${ option.value | escape }"${ option.selected | option_selected(true) }>${ option.name | escape }</option>
  122. {% endfor %}
  123. </select>
  124. {% endif %}
  125. $field.extra
  126. </p>
  127. {% endfor %}
  128. <div class="clear"></div>
  129. </div>
  130. </div>