Changeset 1852

Show
Ignore:
Timestamp:
04/11/08 02:03:37 (3 months ago)
Author:
bsmith
Message:

bugzid:76495 - Move Publishing Profiles to modal triggered by action on template listing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-34/lib/MT/App/CMS.pm

    r1828 r1852  
    188188        'system_check'             => "${pkg}Tools::system_check", 
    189189        'dialog_refresh_templates' => "${pkg}Template::dialog_refresh_templates", 
     190        'dialog_publishing_profile' => "${pkg}Template::dialog_publishing_profile", 
    190191        'refresh_all_templates'    => "${pkg}Template::refresh_all_templates", 
    191192        'preview_template'         => "${pkg}Template::preview", 
     
    331332                order => 1000, 
    332333                continue_prompt => MT->translate('This action will restore your global templates to factory settings without creating a backup. Click OK to continue or Cancel to abort.'), 
     334            }, 
     335            publishing_profile => { 
     336                label => "Use Publishing Profile", 
     337                dialog => 'dialog_publishing_profile', 
     338                condition => sub { 
     339                    MT->app->blog, 
     340                }, 
     341                order => 1100, 
    333342            }, 
    334343        }, 
  • branches/release-34/lib/MT/CMS/Template.pm

    r1847 r1852  
    14101410} 
    14111411 
     1412sub dialog_publishing_profile { 
     1413    my $app = shift; 
     1414    $app->validate_magic or return; 
     1415 
     1416    my $param = {}; 
     1417    $param->{screen_id} = "publishing-profile-dialog"; 
     1418 
     1419    $app->build_page('dialog/publishing_profile.tmpl', 
     1420        $param); 
     1421} 
     1422 
    14121423sub dialog_refresh_templates { 
    14131424    my $app = shift; 
  • branches/release-34/mt-static/css/structure.css

    r1730 r1852  
    41734173} 
    41744174 
     4175/* Publishing Profiles Dialog ---------------------------------------------------------------------------------- */ 
     4176 
     4177#publishing-profile-dialog #profile-panel ul { 
     4178    list-style: none; 
     4179    margin-left: 0; 
     4180} 
     4181 
     4182#publishing-profile-dialog #profile-panel label { 
     4183    font-weight: bold; 
     4184} 
     4185 
     4186#publishing-profile-dialog #profile-panel .hint { 
     4187    font-weight: normal; 
     4188} 
     4189 
    41754190/* Edit Comment & Trackback ---------------------------------------------------------------------------------- */ 
    41764191 
  • branches/release-34/tmpl/cms/dialog/publishing_profile.tmpl

    r1850 r1852  
    11<mt:var name="page_title" value="<__trans phrase="Publishing Profile">"> 
    22 
     3<mt:setvarblock name="html_head" append="1"> 
     4<script type="text/javascript" src="<mt:var name="static_uri">js/dialog.js"></script> 
     5<script type="text/javascript"> 
     6/* <![CDATA[ */ 
     7var dialog; 
     8var panels; 
     9function dialog_closed(ok) { 
     10    if (ok) { 
     11        // fill out form and submit to create the association 
     12        var frm = getByID("publishing_profiles_form"); 
     13        frm.submit(); 
     14    } else { 
     15        closeDialog(); 
     16    } 
     17} 
     18function init() { 
     19    dialog = new Dialog.MultiPanel("profile"); 
     20    panels = []; 
     21    var panel; 
     22    panel = new ListingPanel("profile"); 
     23    panels[panels.length] = panel; 
     24    panel = new ListingPanel("confirm"); 
     25    panels[panels.length] = panel; 
     26    dialog.setPanels(panels); 
     27    dialog.open({}, dialog_closed); 
     28} 
     29TC.attachLoadEvent(init); 
     30/* ]]> */ 
     31</script> 
     32</mt:setvarblock> 
     33 
    334<mt:include name="dialog/header.tmpl"> 
     35<form name="publishing_profiles_form" id="publishing_profiles_form" method="post" action="<mt:var name="script_url">" target="_top" onsubmit="return false"> 
    436 
    5 <form action="#"> 
     37    <div id="profile-panel" class="hidden panel"> 
     38         
     39        <p><__trans phrase="Choose the profile that best matches the requirements for this blog."></p> 
     40         
     41        <mtapp:setting 
     42            id="dynamicity" 
     43            label="<__trans phrase="Publishing Profile">" 
     44            show_label="0" 
     45            label_class="top-label" 
     46            help_page="blog_settings_publishing" 
     47            help_section="dynamic_publishing"> 
     48            <ul> 
     49                <li> 
     50                    <input type="radio" id="dynamicity-sync" name="dynamicity" value="none" <mt:if name="dynamicity" eq="none"> checked="checked"</mt:if>/> 
     51                    <label for="dynamicity-sync"><__trans phrase="Static Publishing"> <span class="hint"><__trans phrase="Publish all files statically."></span></label> 
     52                </li> 
     53                <li> 
     54                    <input type="radio" id="dynamicity-async" name="dynamicity" value="async_all" <mt:if name="dynamicity" eq="async_all"> checked="checked"</mt:if>/> 
     55                    <label for="dynamicity-async"><__trans phrase="Asynchronous Publishing"> <span class="hint"><__trans phrase="Publish all files via the asynchronous job queue."></span></label> 
     56                </li> 
     57                <li> 
     58                    <input type="radio" id="dynamicity-partialasync" name="dynamicity" value="async_partial" <mt:if name="dynamicity" eq="async_partial"> checked="checked"</mt:if>/> 
     59                    <label for="dynamicity-partialasync"><__trans phrase="High Priority Static Publishing"> <span class="hint"><__trans phrase="Publish main index template and all individual archive templates statically, and publish all other files asynchronously."></span></label> 
     60                </li> 
     61                <li> 
     62                    <input type="radio" id="dynamicity-dynamic" name="dynamicity" value="all" <mt:if name="dynamicity" eq="all"> checked="checked"</mt:if>/> 
     63                    <label for="dynamicity-dynamic"><__trans phrase="Dynamic Publishing"> <span class="hint"><__trans phrase="Publish all files dynamically."></span></label> 
     64                </li> 
     65                <li> 
     66                    <input type="radio" id="dynamicity-archives" name="dynamicity" value="archives" <mt:if name="dynamicity" eq="archives"> checked="checked"</mt:if>/> 
     67                    <label for="dynamicity-archives"><__trans phrase="Dynamic Archives Only"> <span class="hint"><__trans phrase="Publish all archives dynamically. Publish all other files statically."></span></label> 
     68                </li> 
     69            </ul> 
     70        </mtapp:setting> 
     71        <div class="actions-bar"> 
     72            <div class="actions-bar-inner pkg actions"> 
     73                <button 
     74                    type="submit" 
     75                    accesskey="s" 
     76                    class="primary-button next" 
     77                    ><__trans phrase="Continue"></button> 
     78                <button 
     79                    onclick="closeDialog(); return false" 
     80                    type="submit" 
     81                    class="cancel" 
     82                    accesskey="x" 
     83                    title="<__trans phrase="Cancel (x)">" 
     84                    ><__trans phrase="Cancel"></button> 
     85            </div> 
     86        </div> 
     87    </div> 
     88    <div id="confirm-panel" class="hidden panel"> 
     89        <p><__trans phrase="This new publishing profile will update all of you templates."></p> 
    690 
    7 <mtapp:setting 
    8     id="dynamicity" 
    9     label="<__trans phrase="Publishing Profile">" 
    10     show_label="0" 
    11     help_page="blog_settings_publishing" 
    12     help_section="dynamic_publishing"> 
    13     <ul> 
    14         <li> 
    15             <input type="radio" id="dynamicity-sync" name="dynamicity" value="none" <mt:if name="dynamicity" eq="none"> checked="checked"</mt:if>/> 
    16             <label for="dynamicity-sync"><__trans phrase="Static Publishing"> <span class="hint"><__trans phrase="Publish all files statically."></span></label> 
    17         </li> 
    18         <li> 
    19             <input type="radio" id="dynamicity-async" name="dynamicity" value="async_all" <mt:if name="dynamicity" eq="async_all"> checked="checked"</mt:if>/> 
    20             <label for="dynamicity-async"><__trans phrase="Asynchronous Publishing"> <span class="hint"><__trans phrase="Publish all files via the asynchronous job queue."></span></label> 
    21         </li> 
    22         <li> 
    23             <input type="radio" id="dynamicity-partialasync" name="dynamicity" value="async_partial" <mt:if name="dynamicity" eq="async_partial"> checked="checked"</mt:if>/> 
    24             <label for="dynamicity-partialasync"><__trans phrase="High Priority Static Publishing"> <span class="hint"><__trans phrase="Publish main index template and all individual archive templates statically, and publish all other files asynchronously."></span></label> 
    25         </li> 
    26         <li> 
    27             <input type="radio" id="dynamicity-dynamic" name="dynamicity" value="all" <mt:if name="dynamicity" eq="all"> checked="checked"</mt:if>/> 
    28             <label for="dynamicity-dynamic"><__trans phrase="Dynamic Publishing"> <span class="hint"><__trans phrase="Publish all files dynamically."></span></label> 
    29         </li> 
    30         <li> 
    31             <input type="radio" id="dynamicity-archives" name="dynamicity" value="archives" <mt:if name="dynamicity" eq="archives"> checked="checked"</mt:if>/> 
    32             <label for="dynamicity-archives"><__trans phrase="Dynamic Archives Only"> <span class="hint"><__trans phrase="Publish all archives dynamically. Publish all other files statically."></span></label> 
    33         </li> 
    34         <li> 
    35             <input type="radio" id="dynamicity-custom" name="dynamicity" value="custom" <mt:if name="dynamicity" eq="custom"> checked="checked"</mt:if>/> 
    36             <label for="dynamicity-custom"><__trans phrase="Custom"> <span class="hint"><__trans phrase="Publishing options are configured on a template-by-template basis."></span></label> 
    37         </li> 
    38     </ul> 
    39 </mtapp:setting> 
     91        <p><strong><__trans phrase="Are you sure you wish to continue?"></strong></p> 
     92 
     93        <div class="actions-bar"> 
     94            <div class="actions-bar-inner pkg actions"> 
     95                <button 
     96                    type="button" 
     97                    accesskey="s" 
     98                    class="primary-button close" 
     99                    ><__trans phrase="Confirm"></button> 
     100                <button 
     101                    onclick="closeDialog(); return false" 
     102                    type="submit" 
     103                    class="cancel" 
     104                    accesskey="x" 
     105                    title="<__trans phrase="Cancel (x)">" 
     106                    ><__trans phrase="Cancel"></button> 
     107                <!-- <button 
     108                    onclick="toggleHidden('confirm-panel'); toggleHidden('refresh-panel'); return false" 
     109                    type="submit" 
     110                    accesskey="b" 
     111                    title="<__trans phrase="Back (b)">" 
     112                    ><__trans phrase="Back"></button> --> 
     113            </div> 
     114        </div> 
     115 
     116    </div> 
    40117 
    41118</form>