Changeset 1840

Show
Ignore:
Timestamp:
05/26/08 01:57:38 (6 months ago)
Author:
ringmaster
Message:

Add links under the manage entries search field to let users search for types and statuses without having to type.
Change css class on import page to make page look normal.

Location:
trunk/htdocs/system
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/system/admin/css/admin.css

    r1836 r1840  
    11571157    } 
    11581158 
    1159 .navigator span input { 
     1159.navigator input { 
    11601160    width: 90%; 
    11611161    margin: 0 5%; 
     
    11641164.navigator .newer { 
    11651165    text-align: right; 
     1166    } 
     1167 
     1168.navigator .special_search { 
     1169    text-align: center; 
     1170    } 
     1171 
     1172.navigator .special_search a { 
     1173    outline: none; 
     1174    padding: 0px 2px; 
     1175    margin: 2px 5px; 
     1176    } 
     1177 
     1178.navigator .special_search a.active { 
     1179    background-color: #a9a9a9; 
    11661180    } 
    11671181 
  • trunk/htdocs/system/admin/entries.php

    r1820 r1840  
    55    <span class="older pct10"><a href="#" onclick="timeline.skipLoupeLeft();return false">&laquo; <?php _e('Older'); ?></a></span> 
    66    <span class="currentposition pct15 minor"><?php _e('0-0 of 0'); ?></span> 
    7     <span class="search pct50"><input type="search" placeholder="<?php _e('Type and wait to search for any entry component'); ?>" autosave="habaricontent" results="10" value="<?php echo $search_args ?>"></span> 
     7    <span class="search pct50"> 
     8        <input id="search" type="search" placeholder="<?php _e('Type and wait to search for any entry component'); ?>" autosave="habaricontent" results="10" value="<?php echo $search_args ?>"> 
     9        <div class="special_search pct100"> 
     10            <?php foreach($special_searches as $text => $term): ?> 
     11            <a href="#<?php echo $term; ?>"><?php echo $text; ?></a> 
     12            <?php endforeach; ?> 
     13        </div> 
     14    </span> 
    815    <span class="nothing pct15">&nbsp;</span> 
    916    <span class="newer pct10"><a href="#" onclick="timeline.skipLoupeRight();return false"><?php _e('Newer'); ?> &raquo;</a></span> 
     
    7481timelineHandle.loupeUpdate = function(a,b,c) { 
    7582    spinner.start(); 
    76      
     83 
    7784    var search_args= $('.search input').val(); 
    7885 
  • trunk/htdocs/system/admin/import.php

    r1796 r1840  
    22<div class="container"> 
    33<hr> 
    4     <div class="column prepend-1 span-22 append-1"> 
     4    <div class=""> 
    55        <h1><?php _e('Import'); ?></h1> 
    66        <form method="post" action=""> 
  • trunk/htdocs/system/admin/js/admin.js

    r1820 r1840  
    179179        if (!$('.timeline').length) return; 
    180180 
    181         var timelineWidth= $('.years').width(); 
     181        var timelineWidth = $('.years').width(); 
    182182        var viewWidth= $('.timeline').width(); 
    183183        timeline.overhang= ( timelineWidth > viewWidth ) ? timelineWidth - viewWidth : 0; 
     
    199199        // find the width which makes the loupe select 20 items 
    200200        var handleWidth= timelineWidth - timeline.positionFromIndex( timeline.totalCount - 20 ); 
    201          
     201 
    202202        // make the slider bounded by the view 
    203203        var maxSliderValue= Math.min( viewWidth, timelineWidth ) - handleWidth; 
     
    333333    }, 
    334334    reset: function () { 
    335         var timelineWidth= $('.years').width(); 
     335        var timelineWidth = $('.years').width(); 
    336336        var viewWidth= $('.timeline').width(); 
    337337        timeline.overhang= ( timelineWidth > viewWidth ) ? timelineWidth - viewWidth : 0; 
     
    604604            } 
    605605        }); 
    606          
     606 
    607607        // If menu is open and mouse is clicked outside menu, close menu. 
    608608        $('html').click(function() { 
     
    660660            return liveSearch.search(); 
    661661        } 
    662          
     662 
    663663    }, 
    664664    search: null, // specific search functions are defined on the individual pages 
    665665} 
    666666 
     667// SEARCH CRITERIA TOGGLE 
     668function toggleSearch() { 
     669    var re = new RegExp('\\s*' + $(this).attr('href').substr(1), 'gi'); 
     670    if($('#search').val().match(re)) { 
     671        $('#search').val($('#search').val().replace(re, '')); 
     672        $(this).removeClass('active'); 
     673    } 
     674    else { 
     675        $('#search').val($('#search').val() + ' ' + $(this).attr('href').substr(1)); 
     676        $(this).addClass('active'); 
     677    } 
     678    liveSearch.doSearch(); 
     679    return false; 
     680} 
    667681 
    668682// RESIZABLE TEXTAREAS 
     
    853867 
    854868    // LOGIN: Focus cursor on 'Name'. 
    855     $('body.login #habari_username').focus() 
    856  
     869    $('body.login #habari_username').focus(); 
     870 
     871    // SEARCH: Set default special search terms and assign click handler 
     872    $('.special_search a') 
     873        .click(toggleSearch) 
     874        .each(function(){ 
     875            var re = new RegExp($(this).attr('href').substr(1)); 
     876            if($('#search').val().match(re)) { 
     877                $(this).addClass('active'); 
     878            } 
     879        }); 
    857880 
    858881}); 
  • trunk/htdocs/system/classes/adminhandler.php

    r1834 r1840  
    680680                                // not a dup, add to string 
    681681                                $modstatus['Approved comments on these posts: %s']= (isset($modstatus['Approved comments on these posts: %s'])? $modstatus['Approved comments on these posts: %s'] . ' &middot; ' : '') . '<a href="' . $comment->post->permalink . '">' . $comment->post->title . '</a> '; 
    682                             }                            
    683                              
     682                            } 
     683 
    684684                            $comment->status= Comment::STATUS_APPROVED; 
    685685                            $comment->update(); 
     
    928928    public function get_entries() 
    929929    { 
     930        // Get the default page contents 
    930931        $this->fetch_entries(); 
     932 
     933        // Get special search statuses 
     934        $statuses = array_keys(Post::list_post_statuses()); 
     935        array_shift($statuses); 
     936        $statuses = array_combine( 
     937            $statuses, 
     938            array_map( 
     939                create_function('$a', 'return "status:{$a}";'), 
     940                $statuses 
     941            ) 
     942        ); 
     943 
     944        // Get special search types 
     945        $types = array_keys(Post::list_active_post_types()); 
     946        array_shift($types); 
     947        $types = array_combine( 
     948            $types, 
     949            array_map( 
     950                create_function('$a', 'return "type:{$a}";'), 
     951                $types 
     952            ) 
     953        ); 
     954 
     955        $this->theme->special_searches = array_merge($statuses, $types); 
    931956        $this->display( 'entries' ); 
    932957    } 
     
    13651390 
    13661391    /** 
    1367      * Handle GET requests for /admin/tags to display the tags  
     1392     * Handle GET requests for /admin/tags to display the tags 
    13681393     */ 
    13691394    public function get_tags()