diff --git a/public/templates/accountedit.tpl b/public/templates/accountedit.tpl
index e75bcf12b6..4909ae4d5b 100644
--- a/public/templates/accountedit.tpl
+++ b/public/templates/accountedit.tpl
@@ -140,7 +140,12 @@ $(document).ready(function() {
$('#uploadForm').submit(function() {
status('uploading the file ...');
-
+
+ if(!$('#userPhotoInput').val()) {
+ error('select an image to upload!');
+ return false;
+ }
+
$(this).ajaxSubmit({
error: function(xhr) {
@@ -248,15 +253,19 @@ $(document).ready(function() {
var gravatarPicture = $('#user-data-gravatarpicture').html();
var uploadedPicture = $('#user-data-uploadedpicture').html();
- if(gravatarPicture)
+ if(gravatarPicture) {
$('#user-gravatar-picture').attr('src', gravatarPicture);
+ $('#gravatar-box').show();
+ }
else
- $('#user-gravatar-picture').addClass('hide');
+ $('#gravatar-box').hide();
- if(uploadedPicture)
+ if(uploadedPicture) {
$('#user-uploaded-picture').attr('src', uploadedPicture);
+ $('#uploaded-box').show();
+ }
else
- $('#user-uploaded-picture').addClass('hide');
+ $('#uploaded-box').hide();
if(currentPicture == gravatarPicture)
diff --git a/public/templates/users.tpl b/public/templates/users.tpl
index 85862bf432..f22d55675c 100644
--- a/public/templates/users.tpl
+++ b/public/templates/users.tpl
@@ -11,11 +11,11 @@
{users.username}