Dotclear

Changeset 1493:10ad6c13c906


Ignore:
Timestamp:
08/20/13 11:45:52 (11 years ago)
Author:
Dsls
Branch:
twig
Message:

prev/next link, labels, ...

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/post.php

    r1492 r1493  
    171171               'maxlength'         => 255, 
    172172               'required'     => true, 
    173                'label'        => __('Title')))) 
     173               'label'        => __('Title:')))) 
    174174     ->addField( 
    175175          new dcFieldTextArea('post_excerpt','', array( 
    176176               'cols'         => 50, 
    177177               'rows'         => 5, 
    178                'label'        => __("Excerpt:")))) 
     178               'label'        => __("Excerpt:").'<span class="form-note">'. 
     179               __('Add an introduction to the post.').'</span>'))) 
    179180     ->addField( 
    180181          new dcFieldTextArea('post_content','', array( 
     
    267268          $form->can_edit_post = $post->isEditable(); 
    268269          $form->can_delete= $post->isDeletable(); 
     270          $next_rs = $core->blog->getNextPost($post,1); 
     271          $prev_rs = $core->blog->getNextPost($post,-1); 
     272           
     273          if ($next_rs !== null) { 
     274               $_ctx->next_post = array('id' => $next_rs->post_id,'title' => $next_rs->post_title); 
     275          } 
     276          if ($prev_rs !== null) { 
     277               $_ctx->prev_post = array('id' => $prev_rs->post_id,'title' => $prev_rs->post_title); 
     278          } 
    269279          $page_title = __('Edit entry'); 
    270280 
     
    348358     )) 
    349359     ->default_tab = $default_tab; 
    350  
     360$_ctx->post_status = $form->post_status; 
     361$_ctx->post_title = $form->post_title; 
     362if ($form->post_status == 1) { 
     363     $_ctx->post_url = $post->getURL(); 
     364} 
    351365      
    352366      
  • inc/admin/default-templates/post.html.twig

    r1491 r1493  
    1313     <img alt="{{title}}" title="{{title}}" src="images/{{src}}" /> 
    1414{%- endmacro %} 
     15{% macro post_link(id,title,link) -%} 
     16<a href="post.php?id={{id}}" title="{{title}}">{{link}}</a> 
     17{%- endmacro %} 
     18 
    1519{% block header %} 
    1620     {{ parent() }} 
     
    2630{% block content %} 
    2731{{ parent() }} 
     32{% if post_id and post_status == 1 %} 
     33     <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> 
     34{% endif %} 
     35{% if post_id %} 
     36     <p class="nav_prevnext"> 
     37     {% if prev_post %} 
     38          {{ _self.post_link(prev_post.id,prev_post.title,'&#171;&nbsp'~__('Previous entry')) }} 
     39     {% endif %} 
     40     {% if next_post %} 
     41          {{ _self.post_link(next_post.id,next_post.title,__('Next entry')~'&nbsp;&#187;') }} 
     42     {% endif %} 
     43     </p> 
     44{% endif %} 
    2845 
    2946<div class="multi-part" title="{{__('Edit entry')}}" id="edit-entry"> 
    30 {% form 'post' %} 
     47{% form 'post' with {'id':'entry-form'} %} 
    3148<div id="entry-wrapper"> 
    3249     <div id="entry-content"> 
    3350          <div class="constrained"> 
     51          <h3 class="hidden">Edit post</h3> 
    3452               {% for bl in main_blocks %} 
    3553                    {{ block(bl) }} 
     
    86104 
    87105{% block post_title -%} 
    88      <p class="col">{{ form_field('post_title',{'class':'maximal'}) }}</p> 
     106     <p class="col">{{ form_field('post_title',{'class':'maximal'},{"labelclass":"no-margin"}) }}</p> 
    89107{%- endblock %} 
    90108 
Note: See TracChangeset for help on using the changeset viewer.

Sites map