Dotclear


Ignore:
Timestamp:
08/20/13 10:56:34 (12 years ago)
Author:
Dsls
Branch:
twig
Message:

Implemented last merges from default, post.php is now more flexible.
added twig function : form_field_attr

Location:
inc/admin/default-templates
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/default-templates/forms/form_layout.html.twig

    r1414 r1491  
    8787{% endspaceless %} 
    8888{% endblock field_combo %} 
    89 {# 
    90 {% block label %} 
    91 {% spaceless %} 
    92      {% if label is not empty %} 
    93           <label for="{{name}}" {% if required is not empty %}class="required"> <abbr title="{{__('Required field')}}">*</abbr>{% else %}>{% endif %} {{label}}</label> 
    94      {% endif %} 
    95 {% endspaceless %} 
    96 {% endblock label %} 
    97 #} 
    9889 
    9990{% block startlabel %} 
  • inc/admin/default-templates/forms/formfilter_layout.html.twig

    r1154 r1491  
    44{% block filterset -%} 
    55<p> 
    6      <a href="#" id="toggle-filters">{{ __('Toggle filters and display options') }} </a> 
     6     <a href="#" id="filter-control" class="form-control">{{ __('Toggle filters and display options') }} </a> 
    77</p> 
     8{% form filtersetname with {'id':'filters-form' } -%} 
     9<h3>Filtrer la liste des billets</h3> 
     10<div class="table"> 
    811<div class="two-cols"> 
    912{% set fenv = _context['filterset_' ~ filtersetname] %} 
    10 {% form filtersetname with {'class':fenv.hide_filters?'hidden':'opened' } -%} 
    1113     <div class="col70"> 
    1214          <h3>{{__('Entries filters')}}</h3> 
     
    3739     <p class="clear margintop"></p> 
    3840{%- endform -%} 
     41</div> 
    3942</div> 
    4043{%- endblock %} 
  • inc/admin/default-templates/post.html.twig

    r1319 r1491  
    11{% extends "layout.html.twig" %} 
    22{% import "js_helpers.html.twig" as js %} 
     3{% macro img_status(status) -%} 
     4     {% if status == 1 %} 
     5          {% set title,src = __('Published'),'check-on.png' %} 
     6     {% elseif status == 0 %} 
     7          {% set title,src = __('Unpublished'),'check-off.png' %} 
     8     {% elseif status == -1 %} 
     9          {% set title,src = __('Pending'),'check-wrn.png' %} 
     10     {% elseif status == -2 %} 
     11          {% set title,src = __('Junk'),'junk.png' %} 
     12     {% endif %} 
     13     <img alt="{{title}}" title="{{title}}" src="images/{{src}}" /> 
     14{%- endmacro %} 
    315{% block header %} 
    416     {{ parent() }} 
     
    2032     <div id="entry-content"> 
    2133          <div class="constrained"> 
    22                <p class="col">{{ form_field('post_title',{'class':'maximal'}) }}</p> 
    23                <p class="area" id="excerpt-area">{{ form_field('post_excerpt',{'rows':5,'cols':50}) }}</p> 
    24                <p class="area" id="content-area">{{ form_field('post_content',{'rows':current_user.options.edit_size,'cols':5}) }}</p> 
    25                <p class="area" id="notes-area">{{ form_field('post_notes',{'rows':5,'cols':50}) }}</p> 
     34               {% for bl in main_blocks %} 
     35                    {{ block(bl) }} 
     36               {% endfor %} 
    2637               <p>{{ form_field('save')}}  
    2738               {% if preview_url is defined %} 
     
    3546</div> 
    3647<div id="entry-sidebar"> 
    37      <p>{{ form_field('cat_id',{'class':'maximal'})}}</p> 
    38      <p>{{ form_field('post_status')}}</p> 
    39      <p>{{ form_field('post_dt')}}</p> 
    40      <p>{{ form_field('post_format')}}</p> 
    41      <p>{{ form_field('post_open_comment')}}</p> 
    42      <p>{{ form_field('post_open_tb')}}</p> 
    43      <p>{{ form_field('post_selected')}}</p> 
    44      <p>{{ form_field('post_lang',{"class":"maximal"},{'nestedlabel':true})}}</p> 
    45      <p>{{ form_field('post_password',{"size":10, "class":"maximal"},{'nestedlabel':true})}}</p> 
    46      <div class="lockable"> 
    47           <p>{{ form_field('post_url',{"size":10, "class":"maximal"})}} </p> 
    48           <p class="form-note warn"> 
    49           {{ __('Warning: If you set the URL manually, it may conflict with another entry.') }} 
    50           </p> 
    51      </div> 
     48     {% for id,box in sidebar_blocks  %} 
     49          <div id="{{id}}" class="box"> 
     50               <h4>{{box.title}}</h4> 
     51               {% for bl in box.items %} 
     52                    {{ block(bl)}} 
     53               {% endfor %} 
     54          </div> 
     55     {% endfor %} 
    5256</div> 
    5357{% endform %} 
     
    7579{% endblock %} 
    7680 
     81{% block field_post_status %} 
     82<p>{{ form_field('post_status',{},{'labelclass':'ib'}) }}</p> 
     83{% endblock %} 
     84 
     85{# Field-specific blocks #} 
     86 
     87{% block post_title -%} 
     88     <p class="col">{{ form_field('post_title',{'class':'maximal'}) }}</p> 
     89{%- endblock %} 
     90 
     91{% block post_excerpt -%} 
     92     <p class="area" id="excerpt-area">{{ form_field('post_excerpt',{'rows':5,'cols':50}) }}</p> 
     93{%- endblock %} 
     94 
     95{% block post_content -%} 
     96     <p class="area" id="content-area">{{ form_field('post_content',{'rows':current_user.options.edit_size,'cols':5}) }}</p> 
     97{%- endblock %} 
     98 
     99{% block post_notes -%} 
     100     <p class="area" id="notes-area">{{ form_field('post_notes',{'rows':5,'cols':50}) }}</p> 
     101{%- endblock %} 
     102 
     103{% block post_status -%} 
     104     <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> 
     105{%- endblock %} 
     106 
     107{% block post_dt -%} 
     108     <p>{{ form_field('post_dt',{},{'labelclass':'ib'})}}</p> 
     109{%- endblock %} 
     110 
     111{% block post_lang -%} 
     112     <p>{{ form_field('post_lang',{"class":"maximal"},{'nestedlabel':true, 'labelclass':'ib'})}}</p> 
     113{%- endblock %} 
     114 
     115{% block post_format -%} 
     116     <p>{{ form_field('post_format',{},{'labelclass':'ib'})}}</p> 
     117     {% if post_id and form_field_attr('post_format','value')=='xhtml' %} 
     118     <p><a id="convert-xhtml" class="button maximal" href="post.php?id={{post_id}}&amp;xconv=1"> 
     119     {{__('Convert to XHTML')}}</a></p> 
     120     {% endif %} 
     121{%- endblock %} 
     122 
     123{% block post_selected -%} 
     124     <p>{{ form_field('post_selected',{},{'labelclass':'ib'})}}</p> 
     125{%- endblock %} 
     126 
     127{% block cat_id -%} 
     128     <p>{{ form_field('cat_id',{'class':'maximal'},{'labelclass':'ib'}) }}</p> 
     129     {#{% if can_edit_categories %}#} 
     130     <div> 
     131          <p id="new_cat">{{__('Add a new category')}}</p> 
     132          <p>{{ form_field('new_cat_title') }}</p> 
     133          <p>{{ form_field('new_cat_parent') }} </p> 
     134     </div> 
     135     {#{% endif %}#} 
     136{%- endblock %} 
     137 
     138{% block post_open_comment -%} 
     139     <p>{{ form_field('post_open_comment')}}</p> 
     140     {% if post_comment_warning is defined -%} 
     141     <p class="form-note warn">{{post_comment_warning}}</p> 
     142     {%- endif %} 
     143{%- endblock %} 
     144 
     145{% block post_open_tb -%} 
     146     <p>{{ form_field('post_open_tb')}}</p> 
     147     {% if post_tb_warning is defined -%} 
     148     <p class="form-note warn">{{post_tb_warning}}</p> 
     149     {%- endif %} 
     150{%- endblock %} 
     151 
     152{% block post_password -%} 
     153     <p>{{ form_field('post_password',{"size":10, "class":"maximal"},{'nestedlabel':true, 'labelclass':'ib'})}}</p> 
     154{%- endblock %} 
     155 
     156{% block post_url -%} 
     157     <div class="lockable"> 
     158          <p>{{ form_field('post_url',{"size":10, "class":"maximal"}, {'labelclass':'ib'})}} </p> 
     159          <p class="form-note warn"> 
     160          {{ __('Warning: If you set the URL manually, it may conflict with another entry.') }} 
     161          </p> 
     162     </div> 
     163{%- endblock %} 
     164 
  • inc/admin/default-templates/posts.html.twig

    r1152 r1491  
    88     {{ js.meta_editor }} 
    99     <script type="text/javascript" src="{{theme_url}}js/_posts_list.js"></script> 
    10      <script type="text/javascript" src="{{theme_url}}js/filters.js"></script> 
     10     <script type="text/javascript" src="{{theme_url}}js/filter-control.js"></script> 
    1111     {{ js.confirm_close(['entry-form','comment-form']) }} 
    1212     {{ js.page_tabs(default_tab) }} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map