diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-08-29 18:08:27 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-08-29 18:08:27 +0200 |
commit | 60c9b601aa177390c9e4807889cdcac4334b63af (patch) | |
tree | 600551ff7121e5ce202c7e36dc2235f2c22858fd /templates/part.addfeed.php | |
parent | caba39cab9ac3e5f150dc6b0211bd029655d6c6e (diff) |
validation feedback if folder exists
Diffstat (limited to 'templates/part.addfeed.php')
-rw-r--r-- | templates/part.addfeed.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/templates/part.addfeed.php b/templates/part.addfeed.php index 39063a426..b722bd8df 100644 --- a/templates/part.addfeed.php +++ b/templates/part.addfeed.php @@ -19,7 +19,7 @@ <select name="folder" title="<?php p($l->t('Folder')); ?>" ng-if="!Navigation.newFolder" - ng-model="feed.folder" + ng-model="$parent.feed.folderId" ng-options="folder.name for folder in Navigation.getAllFolders() track by folder.name"> <option value="" selected="selected">-- <?php p($l->t('None')); ?> --</option> </select> @@ -31,7 +31,8 @@ <!-- add a folder --> <input type="text" - ng-model="feed.folder" + ng-model="$parent.feed.folder" + ng-class="{'ng-invalid': Navigation.newFolder && Navigation.folderNameExists($parent.feed.folder)}" placeholder="<?php p($l->t('Folder name')); ?>" name="folderName" class="folder-input" @@ -44,9 +45,13 @@ title="<?php p($l->t('Go back')); ?>" ng-click="Navigation.newFolder=false"></button> + + <p class="error" ng-show="Navigation.folderNameExists(feed.folder)"><?php p($l->t('Folder exists already!')); ?></p> + <input type="submit" value="<?php p($l->t('Subscribe')); ?>" - class="primary"> + class="primary" + ng-disabled="Navigation.newFolder && Navigation.folderNameExists(folder.name)"> </form> </div> </li> |