Changeset 12106


Ignore:
Timestamp:
Sep 8, 2011, 4:04:25 PM (9 years ago)
Author:
plg
Message:

bug 2435 fixed: on the upload form, when no album available, hide the album
selection listbox and if no album is selected, trigger an error before starting
any upload.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/photos_add_direct.tpl

    r12065 r12106  
    1515    jQuery("#formErrors").hide();
    1616    jQuery("#formErrors li").hide();
     17
     18    if (jQuery("#albumSelect option:selected").length == 0) {
     19      jQuery("#formErrors #noAlbum").show();
     20      nbErrors++;
     21    }
    1722
    1823    var nbFiles = 0;
     
    97102  fillCategoryListbox("category_parent");
    98103*/
    99  
     104
    100105  jQuery(".addAlbumOpen").colorbox({inline:true, href:"#addAlbumForm"});
    101106
     
    123128          /* we refresh the album creation form, in case the user wants to create another album */
    124129          jQuery("#category_parent").find("option").remove();
     130
     131          jQuery("<option/>")
     132            .attr("value", 0)
     133            .text("------------")
     134            .appendTo("#category_parent")
     135          ;
     136
    125137          fillCategoryListbox("category_parent", newAlbum);
    126138
    127139          jQuery("#addAlbumForm form input[name=category_name]").val('');
     140
     141          jQuery("#albumSelection").show();
    128142
    129143          return true;
     
    331345<div id="formErrors" class="errors" style="display:none">
    332346  <ul>
     347    <li id="noAlbum">{'Select an album'|@translate}</li>
    333348    <li id="noPhoto">{'Select at least one photo'|@translate}</li>
    334349  </ul>
     
    359374      <legend>{'Drop into album'|@translate}</legend>
    360375
     376      <span id="albumSelection"{if count($category_options) == 0} style="display:none"{/if}>
    361377      <select id="albumSelect" name="category">
    362378        {html_options options=$category_options selected=$category_options_selected}
    363379      </select>
    364       <br>{'... or '|@translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
     380      <br>{'... or '|@translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
    365381     
    366382    </fieldset>
  • trunk/language/en_UK/admin.lang.php

    r12094 r12106  
    859859$lang['Select at least two tags for merging'] = 'Select at least two tags for merging';
    860860$lang['Learn more'] = 'Learn more';
     861$lang['Select an album'] = 'Select an album';
    861862?>
  • trunk/language/fr_FR/admin.lang.php

    r12105 r12106  
    150150$lang['Save order'] = "Sauvegarder l'ordre";
    151151$lang['Save to permalink history'] = "Sauvegarder dans l'historique des liens permanents";
    152 $lang['Select at least one album'] = 'Sélectionner au moins un album';
    153 $lang['Select at least one photo'] = "Sélectionner au moins une photo";
    154 $lang['Select at least one user'] = "Sélectionner au moins un utilisateur";
     152$lang['Select at least one album'] = 'Sélectionnez au moins un album';
     153$lang['Select at least one photo'] = "Sélectionnez au moins une photo";
     154$lang['Select at least one user'] = "Sélectionnez au moins un utilisateur";
    155155$lang['Show info'] = "Montrer les informations";
    156156$lang['Site manager'] = "Gestionnaire des sites";
     
    870870$lang['Rate'] = 'Note';
    871871$lang['Learn more'] = 'En savoir plus';
     872$lang['Select an album'] = 'Selectionnez un album';
    872873?>
Note: See TracChangeset for help on using the changeset viewer.