{% set can_publish = can('publish') %}
<h3>{{ __("Edit Blog Post") }}</h3>
<form method="post">{{ form_token() }}
<div class="table full-width">
<div class="table-row">
<label class="table-cell table-min-width" for="blog_post_title">{{ __("Post Title") }}:</label>
<div class="table-cell bottom-pad">
<input
class="full-width"
id="blog_post_title"
name="title"
type="text"
value="{{ blogpost.title|e('html_attr') }}"
/>
</div>
</div>
<div class="table-row">
<label class="table-cell" for="blog_post_slug">{{ __("Slug") }}:</label>
<div class="table-cell bottom-pad">
<input{#
#} class="full-width"{#
#} id="blog_post_slug"{#
#} type="text"{#
#} name="slug"{#
#} data-original="{{ blogpost.slug|e('html_attr') }}"{#
#} value="{{ blogpost.slug|e('html_attr') }}"{#
#} pattern="^[a-z0-9][a-z0-9\-]+$"{#
#} />
<div id="blog_post_slug_checkbox_wrapper">
<input type="checkbox" class="large_checkbox" name="redirect_slug" id="redirect_slug" value="1" />
<label for="redirect_slug">{{ __("Redirect the old URL to the new destination?") }}</label>
</div>
</div>
</div>
{% if can_publish %}
<div class="table-row">
<label class="table-cell table-min-width" for="blog_post_publish_date">{{ __("Date/Time Published") }}:</label>
<div class="table-cell bottom-pad">
<input{#
#} class="full-width"{#
#} id="blog_post_published"{#
#} type="text"{#
#} name="published"{#
#} value="{{ blogpost.published|e('html_attr') }}"{#
#} pattern="^2[0-9]{3}\-(0[0-9]|1[0-2])\-([012][0-9]|3[0-1])(T| )([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([\.:\+0-9]+)?$"{#
#} />
</div>
</div>
{% endif %}
<div class="table-row">
<label class="table-cell" for="blog_post_category">{{ __("Category") }}:</label>
<div class="table-cell bottom-pad">
<select name="category" id="blog_post_category" class="treeselect">
<option value="0"> -- {{ __("None") }} -- </option>
{% for category in categories %}
{{
bcatmac.nonExclusiveSelectBox(category, blogpost.category)
}}
{% endfor %}
</select>
</div>
</div>
<div class="table-row">
<label class="table-cell" for="blog_post_author">{{ __("Author") }}:</label>
<div class="table-cell bottom-pad">
{% if is_admin() %}
<select name="author" id="blog_post_author" required="required">
<option value="">{% if authors %} -- {{ __("Please Select an Author") }} -- {% endif %}</option>
{% for auth in authors %}
<option{#
#} value="{{ auth.authorid }}"{#
#}{% if auth.authorid == blogpost.author %}{#
#} selected="selected"{#
#}{% endif %}>{{ auth.name }}</option>
{% endfor %}
</select>
{% else %}
{{ __("To change the authorship of an existing blog post, please contact an administrator.") }}
{% endif %}
</div>
</div>
<div class="table-row">
<label class="table-cell table-min-width" for="format">{{ __("Post Format") }}:</label>
<div class="table-cell bottom-pad">
{% include cargo("bridge_pages_select_format") with {
"format": latest.format
} %}
</div>
</div>
<div class="table-row">
<label class="table-cell" for="blog_post_cache">{{ __("Cache") }}:</label>
<div class="table-cell bottom-pad">
<input{#
#} type="checkbox"{#
#} class="large_checkbox"{#
#} id="cache"{#
#} name="cache"{#
#}{% if blogpost.cache %} checked="checked"{% endif %}{#
#} value="1"{#
#} />
<label for="cache">{{ __("Cache this blog post?") }}</label>
</div>
</div>
<div class="table-row">
<label class="table-cell" for="format">{{ __("Tags") }}:</label>
<div class="table-cell bridge_blog_post_tags bottom-pad">
{% include cargo("bridge_blog_post_tags") with {
"tags": tags,
"checked": blogpost.tags
} %}
</div>
</div>
<div class="table-row">
<label class="table-cell" for="blog_post_description">{{ __("Description") }}:</label>
<div class="table-cell bottom-pad">
<input
class="full-width"
type="text"
name="description"
placeholder="{{ __("RSS Feed Description (Summary)")|e('html_attr') }}"
value="{{ blogpost.description|e('html_attr') }}"
/>
</div>
</div>
{% include cargo("bridge_blog_post_extra_fields") ignore missing %}
</div>
<div class="bridge_blog_rich_text_wrapper">
{% include cargo("rich_text_editor") with {
"name": "blog_post_body",
"placeholder": "",
"contents": latest.body
} %}
</div>
<fieldset class="form-metadata-wrapper">
<legend>
<input type="checkbox" id="show_metadata" />
<label for="show_metadata">{{ __("Show Metadata Fields?") }}</label>
</legend>
<div class="form-table" id="blog_posts_metadata">
{% include cargo("bridge_blog_posts_metadata") with {
"metadata": latest.metadata
} %}
</div>
</fieldset>
<fieldset class="form-button-group">
{% if can_publish %}
<button type="submit" name="save_btn" value="publish" class="pure-button pure-button-secondary">
<i class="fa fa-check"></i>
{{ __("Publish") }}
</button>
<button type="submit" name="save_btn" value="draft" class="pure-button pure-button-tertiary">
<i class="fa fa-save"></i>
{{ __("Save Draft") }}
</button>
{% else %}
<button type="submit" name="save_btn" value="draft" class="pure-button pure-button-tertiary">
<i class="fa fa-save"></i>
{{ __("Save Draft") }}
</button>
{% endif %}
</fieldset>
</form>
|