]> source.dussan.org Git - nextcloud-server.git/commitdiff
display error icon on non-success
authorMaxence Lange <maxence@nextcloud.com>
Mon, 31 Jul 2017 13:22:25 +0000 (15:22 +0200)
committerMaxence Lange <maxence@nextcloud.com>
Mon, 31 Jul 2017 13:22:25 +0000 (15:22 +0200)
Signed-off-by: Maxence Lange <maxence@nextcloud.com>
settings/css/settings.css
settings/js/federationsettingsview.js
settings/templates/personal.php

index 83e037d53f546a00d1463d634a5ebcf77dd230d0..f8d5d24f3d9f6ca9cc413dd94fdbc12532b1d5c3 100644 (file)
@@ -175,6 +175,13 @@ input#openid, input#webdav {
        pointer-events: none;
 }
 
+#personal-settings-container > div > form span[class^="icon-error"] {
+       position: absolute;
+       left: 228px;
+       top: 82px;
+       pointer-events: none;
+}
+
 /* verify accounts */
 #personal-settings-container .verify {
        position: absolute;
index 1a0a3dcb4d1843a317843fb9bfc06e5f9ea80979..8edce271f2f730a83dc093cbb940b271aa0c534a 100644 (file)
                                }
                        });
 
-                       $.when(savingData).done(function() {
-                               //OC.msg.finishedSaving('#personal-settings-container .msg', result)
-                               self._showInputChangeSuccess(field);
+                       $.when(savingData).done(function(data) {
+                               if (data.status === "success") {
+                                       self._showInputChangeSuccess(field);
+                               } else {
+                                       self._showInputChangeFail(field);
+                               }
                        });
                },
 
                        }
                },
 
+               _showInputChangeFail: function(field) {
+                       var $icon = this.$('#' + field + 'form > .icon-error');
+                       $icon.fadeIn(200);
+                       setTimeout(function() {
+                               $icon.fadeOut(300);
+                       }, 2000);
+               },
+
                _setFieldScopeIcon: function(field, scope) {
                        var $icon = this.$('#' + field + 'form > h2 > span');
                        $icon.removeClass('icon-password');
index 9bb96ba22ce2743a683be7126c4cf9ed69bcc546..07356979e377de98b8525e9fbad1698327b97884 100644 (file)
@@ -66,7 +66,7 @@
                                <div class="inlineblock button primary" id="sendcropperbutton"><?php p($l->t('Choose as profile picture')); ?></div>
                        </div>
                </div>
-               <span class="icon-checkmark hidden"/>
+               <span class="icon-checkmark hidden"></span>
                <?php if($_['lookupServerUploadEnabled']) { ?>
                <input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>">
                <?php } ?>
@@ -84,7 +84,8 @@
                                <?php if(!$_['displayNameChangeSupported']) { print_unescaped('disabled="1"'); } ?>
                                value="<?php p($_['displayName']) ?>"
                                autocomplete="on" autocapitalize="none" autocorrect="off" />
-                       <span class="icon-checkmark hidden"/>
+                       <span class="icon-checkmark hidden" ></span>
+                       <span class="icon-error hidden" ></span>
                        <?php if($_['lookupServerUploadEnabled']) { ?>
                        <input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
                        <?php } ?>
                                <br />
                                <em><?php p($l->t('For password reset and notifications')); ?></em>
                        <?php } ?>
-                       <span class="icon-checkmark hidden"/>
+                       <span class="icon-checkmark hidden"></span>
+                       <span class="icon-error hidden" ></span>
                        <?php if($_['lookupServerUploadEnabled']) { ?>
                        <input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>">
                        <?php } ?>