Changeset 12106 for trunk/admin/themes


Ignore:
Timestamp:
Sep 8, 2011, 4:04:25 PM (13 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.

File:
1 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>
Note: See TracChangeset for help on using the changeset viewer.