Dotclear

source: inc/admin/default-templates/post.html.twig @ 1498:6d67bea812f3

Revision 1498:6d67bea812f3, 5.9 KB checked in by Dsls, 12 years ago (diff)

formfilters improvement, added applied filters features

Line 
1{% extends "layout.html.twig" %}
2{% import "js_helpers.html.twig" as js %}
3
4{% macro img_status(status) -%}
5     {% if status == 1 %}
6          {% set title,src = __('Published'),'check-on.png' %}
7     {% elseif status == 0 %}
8          {% set title,src = __('Unpublished'),'check-off.png' %}
9     {% elseif status == -1 %}
10          {% set title,src = __('Pending'),'check-wrn.png' %}
11     {% elseif status == -2 %}
12          {% set title,src = __('Junk'),'junk.png' %}
13     {% endif %}
14     <img alt="{{title}}" title="{{title}}" src="images/{{src}}" />
15{%- endmacro %}
16
17{% macro post_link(id,title,link) -%}
18<a href="post.php?id={{id}}" title="{{title}}">{{link}}</a>
19{%- endmacro %}
20
21{% block header %}
22     {{ parent() }}
23     {{ js.date_picker }}
24     {{ js.tool_bar }}
25     {{ js.modal }}
26     {{ js.meta_editor }}
27     <script type="text/javascript" src="{{theme_url}}js/_post.js"></script>
28     {{ js.confirm_close(['entry-form','comment-form']) }}
29     {{ js.page_tabs(default_tab) }}
30{% endblock %}
31
32{% block content %}
33{{ parent() }}
34{% if post_id and post_status == 1 %}
35     <p><a class="onblog_link" href="{{post_url}}" onclick="window.open(this.href);return false;" title="{{post_title}}"> {{__('Go to this entry on the site') }} <img src="images/outgoing-blue.png" alt="" /></a></p>
36{% endif %}
37{% if post_id %}
38     <p class="nav_prevnext">
39     {% if prev_post %}
40          {{ _self.post_link(prev_post.id,prev_post.title,'&#171;&nbsp'~__('Previous entry')) }}
41     {% endif %}
42     {% if next_post %}
43          {{ _self.post_link(next_post.id,next_post.title,__('Next entry')~'&nbsp;&#187;') }}
44     {% endif %}
45     </p>
46{% endif %}
47
48<div class="multi-part" title="{{__('Edit entry')}}" id="edit-entry">
49{% form 'post' with {'id':'entry-form'} %}
50<div id="entry-wrapper">
51     <div id="entry-content">
52          <div class="constrained">
53          <h3 class="hidden">Edit post</h3>
54               {% for bl in main_blocks %}
55                    {{ block(bl) }}
56               {% endfor %}
57               <p>{{ form_field('save')}}
58               {% if preview_url is defined %}
59                    <a id="post-preview" href="{{ preview_url}}" class="button" accesskey="p">{{__('Preview')}} (p)</a>
60               {% endif %}
61               
62               {{form_field('delete',{'class':'delete'})}}</p>
63
64          </div>
65     </div>
66</div>
67<div id="entry-sidebar">
68     {% for id,box in sidebar_blocks  %}
69          <div id="{{id}}" class="box">
70               <h4>{{box.title}}</h4>
71               {% for bl in box.items %}
72                    {{ block(bl)}}
73               {% endfor %}
74          </div>
75     {% endfor %}
76</div>
77{% endform %}
78</div>
79
80{# Trackbacks tab #}
81{% if post_id is defined %}
82<p><a href="trackbacks.php?id={{ post_id }}" class="multi-part">{{__('Ping blogs')}}</a></p>
83
84{# Comments list tab #}
85<div class="multi-part" id="comments" title="{{__('Comments')}}">
86<!-- to be completed -->
87</div>
88
89{# Add a comment tab #}
90<div class="multi-part" id="add-comment" title="{{__('Add a comment')}}">
91<h3>{{__('Add a comment')}}</h3>
92{% form 'add-comment' %}
93<div class="constrained">
94     <p>{{ form_field('comment_author',{'size': 30}) }}</p>
95     <p>{{ form_field('comment_email',{'size': 30})}}</p>
96     <p>{{ form_field('comment_site',{'size': 30})}}</p>
97     <p class="area">{{ form_field('comment_content',{'cols': 50,'rows':8})}}</p>
98     <p>{{ form_field('add') }}</p>
99</div>
100
101{% endform %}
102</div>
103
104{% endif %}
105{% endblock %}
106
107{% block field_post_status %}
108<p>{{ form_field('post_status',{},{'labelclass':'ib'}) }}</p>
109{% endblock %}
110
111{# Field-specific blocks #}
112
113{% block post_title -%}
114     <p class="col">{{ form_field('post_title',{'class':'maximal'},{"labelclass":"no-margin"}) }}</p>
115{%- endblock %}
116
117{% block post_excerpt -%}
118     <p class="area" id="excerpt-area">{{ form_field('post_excerpt',{'rows':5,'cols':50}) }}</p>
119{%- endblock %}
120
121{% block post_content -%}
122     <p class="area" id="content-area">{{ form_field('post_content',{'rows':current_user.options.edit_size,'cols':5}) }}</p>
123{%- endblock %}
124
125{% block post_notes -%}
126     <p class="area" id="notes-area">{{ form_field('post_notes',{'rows':5,'cols':50}) }}</p>
127{%- endblock %}
128
129{% block post_status -%}
130     <p><label class="ib">{{form_field_attr('post_status','label')}} {{ _self.img_status(form_field_attr('post_status','value'))}}</label>{{ form_field('post_status',{},{'label':'','labelclass':'ib'})}}</p>
131{%- endblock %}
132
133{% block post_dt -%}
134     <p>{{ form_field('post_dt',{},{'labelclass':'ib'})}}</p>
135{%- endblock %}
136
137{% block post_lang -%}
138     <p>{{ form_field('post_lang',{"class":"maximal"},{'nestedlabel':true, 'labelclass':'ib'})}}</p>
139{%- endblock %}
140
141{% block post_format -%}
142     <p>{{ form_field('post_format',{},{'labelclass':'ib'})}}</p>
143     {% if post_id and form_field_attr('post_format','value')=='xhtml' %}
144     <p><a id="convert-xhtml" class="button maximal" href="post.php?id={{post_id}}&amp;xconv=1">
145     {{__('Convert to XHTML')}}</a></p>
146     {% endif %}
147{%- endblock %}
148
149{% block post_selected -%}
150     <p>{{ form_field('post_selected',{},{'labelclass':'ib'})}}</p>
151{%- endblock %}
152
153{% block cat_id -%}
154     <p>{{ form_field('cat_id',{'class':'maximal'},{'labelclass':'ib'}) }}</p>
155     {#{% if can_edit_categories %}#}
156     <div>
157          <p id="new_cat">{{__('Add a new category')}}</p>
158          <p>{{ form_field('new_cat_title') }}</p>
159          <p>{{ form_field('new_cat_parent') }} </p>
160     </div>
161     {#{% endif %}#}
162{%- endblock %}
163
164{% block post_open_comment -%}
165     <p>{{ form_field('post_open_comment')}}</p>
166     {% if post_comment_warning is defined -%}
167     <p class="form-note warn">{{post_comment_warning}}</p>
168     {%- endif %}
169{%- endblock %}
170
171{% block post_open_tb -%}
172     <p>{{ form_field('post_open_tb')}}</p>
173     {% if post_tb_warning is defined -%}
174     <p class="form-note warn">{{post_tb_warning}}</p>
175     {%- endif %}
176{%- endblock %}
177
178{% block post_password -%}
179     <p>{{ form_field('post_password',{"size":10, "class":"maximal"},{'nestedlabel':true, 'labelclass':'ib'})}}</p>
180{%- endblock %}
181
182{% block post_url -%}
183     <div class="lockable">
184          <p>{{ form_field('post_url',{"size":10, "class":"maximal"}, {'labelclass':'ib'})}} </p>
185          <p class="form-note warn">
186          {{ __('Warning: If you set the URL manually, it may conflict with another entry.') }}
187          </p>
188     </div>
189{%- endblock %}
190
Note: See TracBrowser for help on using the repository browser.

Sites map