Changeset 9493


Ignore:
Timestamp:
Mar 3, 2011, 12:54:46 PM (13 years ago)
Author:
patdenice
Message:

Improve display for plugins and themes update page.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/plugins_update.php

    r9491 r9493  
    134134          'EXT_DESC' => trim($plugin_info['extension_description'], " \n\r"),
    135135          'REV_DESC' => trim($plugin_info['revision_description'], " \n\r"),
    136           'VERSION' => $plugin_info['revision_name'],
     136          'CURRENT_VERSION' => $fs_plugin['version'],
     137          'NEW_VERSION' => $plugin_info['revision_name'],
    137138          'AUTHOR' => $plugin_info['author_name'],
    138139          'DOWNLOADS' => $plugin_info['extension_nb_downloads'],
  • trunk/admin/themes/default/template/plugins_update.tpl

    r9491 r9493  
    11{combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/jquery.ui.min.js' }
    2 {combine_script id='jquery.cluetip' load='async' require='jquery' path='themes/default/js/plugins/jquery.cluetip.packed.js'}
    3 {footer_script require='jquery.cluetip'}
    4 jQuery().ready(function(){ldelim}
    5         jQuery('.cluetip').cluetip({ldelim}
    6                 width: 300,
    7                 splitTitle: '|'
     2{combine_script id='jquery.ui.effects' load='async' require='jquery.ui' path='themes/default/js/ui/minified/jquery.effects.core.min.js' }
     3{combine_script id='jquery.ui.effects.blind' load='async' require='jquery.ui.effects' path='themes/default/js/ui/minified/jquery.effects.blind.min.js' }
     4
     5{footer_script require='jquery.ui.effects.blind'}
     6jQuery(document).ready(function(){ldelim}
     7        jQuery("td[id^='desc_'], p[id^='revdesc_']").click(function() {ldelim}
     8                id = this.id.split('_');
     9                jQuery("#revdesc_"+id[1]).toggle('blind');
     10    jQuery(".button_"+id[1]).toggle();
     11                return false;
    812        });
    913});
     
    1923<legend>{'Plugins which need upgrade'|@translate}</legend>
    2024{foreach from=$plugins item=plugin name=plugins_loop}
    21 <div class="pluginBox" id="plugin_{$plugin.ID}">
     25<div class="pluginBox">
    2226  <table>
    2327    <tr>
    2428      <td class="pluginBoxNameCell">
    25         <a href="{$plugin.EXT_URL}" class="externalLink cluetip" title="{$plugin.EXT_NAME}|{$plugin.EXT_DESC|htmlspecialchars|nl2br}">{$plugin.EXT_NAME}</a>
     29        {$plugin.EXT_NAME}
    2630      </td>
    2731      <td>
    28         <a href="{$plugin.URL_UPDATE}" onclick="return confirm('{'Are you sure to install this upgrade? You must verify if this version does not need uninstallation.'|@translate|@escape:javascript}');">{'Automatic upgrade'|@translate}</a>
    29         | <a href="{$plugin.URL_DOWNLOAD}">{'Download file'|@translate}</a>
     32        <a href="{$plugin.URL_UPDATE}" onclick="return confirm('{'Are you sure to install this upgrade? You must verify if this version does not need uninstallation.'|@translate|@escape:javascript}');">{'Install'|@translate}</a>
     33        | <a href="{$plugin.URL_DOWNLOAD}">{'Download'|@translate}</a>
     34        | <a class="externalLink" href="{$plugin.EXT_URL}">{'Visit plugin site'|@translate}</a>
    3035      </td>
    3136    </tr>
    3237    <tr>
    3338      <td>
    34         <a href="{$plugin.EXT_URL}" class="externalLink cluetip" title="{'Version'|@translate} {$plugin.VERSION}|{$plugin.REV_DESC|htmlspecialchars|nl2br}"> {'Version'|@translate} {$plugin.VERSION}</a>
     39        {'Version'|@translate} {$plugin.CURRENT_VERSION}
    3540      </td>
    36       <td>
     41      <td class="pluginDesc" id="desc_{$plugin.ID}">
    3742        <em>{'Downloads'|@translate}: {$plugin.DOWNLOADS}</em>
    38         {'By %s'|@translate|@sprintf:$plugin.AUTHOR}
     43        <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plus.gif" alt="" class="button_{$plugin.ID}">
     44        <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/minus.gif" alt="" class="button_{$plugin.ID}" style="display:none;">
     45        {'New Version'|@translate} : {$plugin.NEW_VERSION}
     46        | {'By %s'|@translate|@sprintf:$plugin.AUTHOR}
     47      </td>
     48    </tr>
     49    <tr>
     50      <td></td>
     51      <td class="pluginDesc">
     52        <p id="revdesc_{$plugin.ID}" style="display:none;">{$plugin.REV_DESC|htmlspecialchars|nl2br}</p>
    3953      </td>
    4054    </tr>
  • trunk/admin/themes/default/template/themes_update.tpl

    r9472 r9493  
    1 {combine_script id='jquery.cluetip' load='async' require='jquery' path='themes/default/js/plugins/jquery.cluetip.packed.js'}
    2 {footer_script require='jquery.cluetip'}
    3 jQuery().ready(function(){ldelim}
    4         jQuery('.cluetip').cluetip({ldelim}
    5                 width: 300,
    6                 splitTitle: '|'
     1{combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/jquery.ui.min.js' }
     2{combine_script id='jquery.ui.effects' load='async' require='jquery.ui' path='themes/default/js/ui/minified/jquery.effects.core.min.js' }
     3{combine_script id='jquery.ui.effects.blind' load='async' require='jquery.ui.effects' path='themes/default/js/ui/minified/jquery.effects.blind.min.js' }
     4
     5{footer_script require='jquery.ui.effects.blind'}
     6jQuery(document).ready(function(){ldelim}
     7        jQuery("td[id^='desc_'], p[id^='revdesc_']").click(function() {ldelim}
     8                id = this.id.split('_');
     9                jQuery("#revdesc_"+id[1]).toggle('blind');
     10    jQuery(".button_"+id[1]).toggle();
     11                return false;
    712        });
    813});
     
    1015
    1116<div class="titrePage">
    12   <h2>{'Check for updates'|@translate}</h2>
     17  <h2>{'Themes'|@translate}</h2>
    1318</div>
    1419
    15 {if isset($themes_not_uptodate)}
    16 <br>
    17 <b>{'Themes which need upgrade'|@translate}</b>
    18 <table class="table2 themes">
    19 <thead>
    20   <tr class="throw">
    21     <td>{'Name'|@translate}</td>
    22     <td>{'Current<br>version'|@translate}</td>
    23     <td>{'Available<br>version'|@translate}</td>
    24     <td>{'Actions'|@translate}</td>
    25   </tr>
    26 </thead>
    27 {foreach from=$themes_not_uptodate item=theme name=themes_loop}
    28   <tr class="{if $smarty.foreach.themes_loop.index is odd}row1{else}row2{/if}">
    29     <td><a href="{$theme.EXT_URL}" class="externalLink cluetip" title="{$theme.EXT_NAME}|{$theme.EXT_DESC|htmlspecialchars|nl2br}">{$theme.EXT_NAME}</a></td>
    30     <td style="text-align:center;">{$theme.VERSION}</td>
    31     <td style="text-align:center;"><a href="{$theme.EXT_URL}" class="externalLink cluetip" title="{$theme.EXT_NAME}|{$theme.NEW_VER_DESC|htmlspecialchars|nl2br}">{$theme.NEW_VERSION}</a></td>
    32     <td style="text-align:center;"><a href="{$theme.URL_UPDATE}" onclick="return confirm('{'Are you sure to install this upgrade? You must verify if this version does not need uninstallation.'|@translate|@escape:javascript}');">{'Automatic upgrade'|@translate}</a>
    33       / <a href="{$theme.URL_DOWNLOAD}">{'Download file'|@translate}</a></td>
    34   </tr>
     20{if not empty($update_themes)}
     21<div id="availablePlugins">
     22<fieldset>
     23<legend>{'Themes which need upgrade'|@translate}</legend>
     24{foreach from=$update_themes item=theme name=themes_loop}
     25<div class="pluginBox">
     26  <table>
     27    <tr>
     28      <td class="pluginBoxNameCell">
     29        {$theme.EXT_NAME}
     30      </td>
     31      <td>
     32        <a href="{$theme.URL_UPDATE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'Install'|@translate}</a>
     33        | <a href="{$theme.URL_DOWNLOAD}">{'Download'|@translate}</a>
     34        | <a class="externalLink" href="{$theme.EXT_URL}">{'Visit theme site'|@translate}</a>
     35      </td>
     36    </tr>
     37    <tr>
     38      <td>
     39        {'Version'|@translate} {$theme.CURRENT_VERSION}
     40      </td>
     41      <td class="pluginDesc" id="desc_{$theme.ID}">
     42        <em>{'Downloads'|@translate}: {$theme.DOWNLOADS}</em>
     43        <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plus.gif" alt="" class="button_{$theme.ID}">
     44        <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/minus.gif" alt="" class="button_{$theme.ID}" style="display:none;">
     45        {'New Version'|@translate} : {$theme.NEW_VERSION}
     46        | {'By %s'|@translate|@sprintf:$theme.AUTHOR}
     47      </td>
     48    </tr>
     49    <tr>
     50      <td></td>
     51      <td class="pluginDesc">
     52        <p id="revdesc_{$theme.ID}" style="display:none;">{$theme.REV_DESC|htmlspecialchars|nl2br}</p>
     53      </td>
     54    </tr>
     55  </table>
     56</div>
    3557{/foreach}
    36 </table>
     58</fieldset>
     59</div>
     60{elseif not isset($SERVER_ERROR)}
     61<p>{'All themes are up to date.'|@translate}</p>
    3762{/if}
    38 
    39 
    40 {if isset($themes_uptodate)}
    41 <br>
    42 <b>{'Themes up to date'|@translate}</b>
    43 <table class="table2 plugins">
    44 <thead>
    45   <tr class="throw">
    46     <td>{'Name'|@translate}</td>
    47     <td>{'Version'|@translate}</td>
    48   </tr>
    49 </thead>
    50 {foreach from=$themes_uptodate item=theme name=themes_loop}
    51   <tr class="{if $smarty.foreach.themes_loop.index is odd}row1{else}row2{/if}">
    52     <td><a href="{$theme.URL}" class="externalLink cluetip" title="{$theme.NAME}|{$theme.EXT_DESC|htmlspecialchars|nl2br}">{$theme.NAME}</a></td>
    53     <td style="text-align:center;"><a href="{$theme.URL}" class="externalLink cluetip" title="{$theme.NAME}|{$theme.VER_DESC|htmlspecialchars|nl2br}">{$theme.VERSION}</a></td>
    54   </tr>
    55 {/foreach}
    56 </table>
    57 {/if}
    58 
    59 
    60 {if isset($themes_cant_check)}
    61 <br>
    62 <b>{'Theme versions can\'t be checked'|@translate}</b>
    63 <table class="table2 plugins">
    64 <thead>
    65   <tr class="throw">
    66     <td>{'Name'|@translate}</td>
    67     <td>{'Version'|@translate}</td>
    68   </tr>
    69 </thead>
    70 {foreach from=$themes_cant_check item=theme name=themes_loop}
    71   <tr class="{if $smarty.foreach.themes_loop.index is odd}row1{else}row2{/if}">
    72     <td>{$theme.NAME}</td>
    73     <td style="text-align:center;">{$theme.VERSION}</td>
    74   </tr>
    75 {/foreach}
    76 </table>
    77 {/if}
  • trunk/admin/themes_update.php

    r9472 r9493  
    9898      $theme_info = $themes->server_themes[$fs_theme['extension']];
    9999
    100       list($date, ) = explode(' ', $theme_info['revision_date']);
    101 
    102       $ext_desc = '<i>'.l10n('Downloads').':</i> '.$theme_info['extension_nb_downloads']."\r\n"
    103         ."\r\n"
    104         .$theme_info['extension_description'];
    105 
    106       $rev_desc = '<i>'.l10n('Version').':</i> '.$theme_info['revision_name']."\r\n"
    107         .'<i>'.l10n('Released on').':</i> '.$date."\r\n"
    108         .'<i>'.l10n('Downloads').':</i> '.$theme_info['revision_nb_downloads']."\r\n"
    109         ."\r\n"
    110         .$theme_info['revision_description'];
    111 
    112       if ($themes->theme_version_compare($fs_theme['version'], $theme_info['revision_name']))
     100      if (!$themes->theme_version_compare($fs_theme['version'], $theme_info['revision_name']))
    113101      {
    114         // Plugin is up to date
    115         $template->append('themes_uptodate', array(
    116           'URL' => PEM_URL.'/extension_view.php?eid='.$theme_info['extension_id'],
    117           'NAME' => $fs_theme['name'],
    118           'EXT_DESC' => $ext_desc,
    119           'VERSION' => $fs_theme['version'],
    120           'VER_DESC' => $rev_desc));
    121       }
    122       else
    123       {
    124         // Plugin need upgrade
    125102        $url_auto_update = $base_url
    126103          . '&amp;revision=' . $theme_info['revision_id']
     
    129106          ;
    130107
    131         $template->append('themes_not_uptodate', array(
     108        $template->append('update_themes', array(
     109          'ID' => $theme_info['extension_id'],
    132110          'EXT_NAME' => $fs_theme['name'],
    133111          'EXT_URL' => PEM_URL.'/extension_view.php?eid='.$theme_info['extension_id'],
    134           'EXT_DESC' => $ext_desc,
    135           'VERSION' => $fs_theme['version'],
     112          'EXT_DESC' => trim($theme_info['extension_description'], " \n\r"),
     113          'REV_DESC' => trim($theme_info['revision_description'], " \n\r"),
     114          'CURRENT_VERSION' => $fs_theme['version'],
    136115          'NEW_VERSION' => $theme_info['revision_name'],
    137           'NEW_VER_DESC' => $rev_desc,
     116          'AUTHOR' => $theme_info['author_name'],
     117          'DOWNLOADS' => $theme_info['extension_nb_downloads'],
    138118          'URL_UPDATE' => $url_auto_update,
    139           'URL_DOWNLOAD' => $theme_info['download_url'] . '&amp;origin=piwigo_download'));
     119          'URL_DOWNLOAD' => $theme_info['download_url'] . '&amp;origin=piwigo_download'
     120          )
     121        );
    140122      }
    141     }
    142     else
    143     {
    144       // Can't check theme
    145       $template->append('themes_cant_check', array(
    146         'NAME' => $fs_theme['name'],
    147         'VERSION' => $fs_theme['version']));
    148123    }
    149124  }
     
    151126else
    152127{
     128  $template->assign('SERVER_ERROR', true);
    153129  array_push($page['errors'], l10n('Can\'t connect to server.'));
    154130}
  • trunk/language/en_UK/admin.lang.php

    r9491 r9493  
    777777$lang['All themes are up to date.'] = 'All themes are up to date.';
    778778$lang['All plugins are up to date.'] = 'All plugins are up to date.';
     779$lang['Visit theme site'] = 'Visit theme site';
     780$lang['New Version'] = 'New Version';
    779781?>
  • trunk/language/fr_FR/admin.lang.php

    r9491 r9493  
    790790$lang['All themes are up to date.'] = 'Tous les thèmes sont à jour.';
    791791$lang['All plugins are up to date.'] = 'Tous les plugins sont à jour.';
     792$lang['Visit theme site'] = 'Visitez le site du thème';
     793$lang['New Version'] = 'Nouvelle version';
    792794?>
Note: See TracChangeset for help on using the changeset viewer.