From 2eab873028424ac5bc66dfc6a0d5b117087c0ffd Mon Sep 17 00:00:00 2001 From: Tide Date: Tue, 6 Aug 2013 02:24:51 -0400 Subject: [PATCH] Added link to Gravatar website if Gravatars are enabled. Changed the design of the avatar section for the my account page. Changed the design of the avatar tab for the edit user page. Changed the size of the displayed avatar. Upped version. --- app/views/my/_avatar.html.erb | 28 ++++++++++++++-------------- app/views/users/_avatar.html.erb | 22 ++++++++++++++-------- config/locales/de.yml | 4 ++++ config/locales/en.yml | 4 ++++ config/locales/es.yml | 4 ++++ config/locales/ja.yml | 4 ++++ config/locales/pl.yml | 4 ++++ config/locales/pt-BR.yml | 4 ++++ config/locales/pt.yml | 4 ++++ config/locales/ru.yml | 4 ++++ init.rb | 2 +- lang/en.yml | 2 -- test/test_helper.rb | 5 ----- 13 files changed, 61 insertions(+), 30 deletions(-) delete mode 100644 lang/en.yml delete mode 100644 test/test_helper.rb diff --git a/app/views/my/_avatar.html.erb b/app/views/my/_avatar.html.erb index e1c8336..2b044de 100644 --- a/app/views/my/_avatar.html.erb +++ b/app/views/my/_avatar.html.erb @@ -11,17 +11,17 @@ element.setAttributeNode(attr);
<%= l(:label_avatar)%> -
- <%= avatar(@user, :size => "128") %> - <% av = user.attachments.find_by_description('avatar') %> - <% if not av.nil? %> - <%= link_to image_tag('delete.png'), { :controller => 'attachments', :action => 'destroy', :id => av }, - :confirm => l(:text_are_you_sure), - :method => :delete, - :class => 'delete', - :title => l(:button_delete) %> - <% end %> -

- - <%= file_field_tag "avatar" %>
- +

<%= avatar(@user, :size => "64") %>

+ <% av = user.attachments.find_by_description('avatar') %> + <% if Setting.gravatar_enabled? %> +

<%= link_to(l(:label_change_gravatar), 'http://gravatar.com/', {:target=>'_blank'}) %>

+ <% end %> + <% if not av.nil? %> +

+ <%= link_to image_tag('delete.png'), { :controller => 'attachments', :action => 'destroy', :id => av }, + :confirm => l(:text_are_you_sure), + :method => :delete, + :class => 'delete', + :title => l(:button_delete) %>

+ <% end %> +

<%= file_field_tag "avatar" %>

\ No newline at end of file diff --git a/app/views/users/_avatar.html.erb b/app/views/users/_avatar.html.erb index f344dfe..052c5d5 100644 --- a/app/views/users/_avatar.html.erb +++ b/app/views/users/_avatar.html.erb @@ -1,10 +1,16 @@ -
-

<%= l(:label_avatar)%>

-
-<%= avatar(@user, :size => "128") %> -

<%= form_tag( { :action => 'save_avatar', :id => @user }, :multipart => true) do %> - <%= file_field_tag "avatar" %>
+
+

<%= avatar(@user, :size => "64") %>

+ <% av = @user.attachments.find_by_description('avatar') %> + <% if not av.nil? %> +

+ <%= link_to image_tag('delete.png'), { :controller => 'attachments', :action => 'destroy', :id => av }, + :confirm => l(:text_are_you_sure), + :method => :delete, + :class => 'delete', + :title => l(:button_delete) %>

+ <% end %> +

<%= file_field_tag "avatar" %>

+
<%= submit_tag l(:button_save) %> -<% end %> -
+<% end %> \ No newline at end of file diff --git a/config/locales/de.yml b/config/locales/de.yml index 26fd9b0..bedc3d2 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1,4 +1,8 @@ # German strings go here de: label_avatar: "Avatar" + label_gravatar: "Gravatar" + label_change_gravatar: "Change gravatar" + label_delete: "Delete local avatar" + label_add_avatar: "Add local avatar" message_avatar_uploaded: "Avatar erfolgreich hochgeladen" diff --git a/config/locales/en.yml b/config/locales/en.yml index 83ac376..9301b7c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,4 +1,8 @@ # English strings go here en: label_avatar: "Avatar" + label_gravatar: "Gravatar" + label_change_gravatar: "Change gravatar" + label_delete: "Delete local avatar" + label_add_avatar: "Add local avatar" message_avatar_uploaded: "Avatar uploaded successfully" diff --git a/config/locales/es.yml b/config/locales/es.yml index e08ee46..a7f7e7c 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1,3 +1,7 @@ es: label_avatar: "Avatar" + label_gravatar: "Gravatar" + label_change_gravatar: "Change gravatar" + label_delete: "Delete local avatar" + label_add_avatar: "Add local avatar" message_avatar_uploaded: "Avatar cargado correctamente" diff --git a/config/locales/ja.yml b/config/locales/ja.yml index f4693fd..5276fb9 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1,5 +1,9 @@ # Japanese strings go here ja: label_avatar: "アバター" + label_gravatar: "Gravatar" + label_change_gravatar: "Change gravatar" + label_delete: "Delete local avatar" + label_add_avatar: "Add local avatar" message_avatar_uploaded: "アバターのアップロードを完了しました" diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 4b1360c..0fd14dd 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1,4 +1,8 @@ # Polish strings go here pl: label_avatar: "Awatar" + label_gravatar: "Gravatar" + label_change_gravatar: "Change gravatar" + label_delete: "Delete local avatar" + label_add_avatar: "Add local avatar" message_avatar_uploaded: "Awatar został poprawnie załadowany" diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index d9583da..0910ff2 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1,4 +1,8 @@ # Brazilian portuguese strings go here pt-BR: label_avatar: "Avatar" + label_gravatar: "Gravatar" + label_change_gravatar: "Change gravatar" + label_delete: "Delete local avatar" + label_add_avatar: "Add local avatar" message_avatar_uploaded: "Avatar carregado com sucesso" diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 8453b50..9ae6086 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -1,4 +1,8 @@ # portuguese strings go here pt: label_avatar: "Avatar" + label_gravatar: "Gravatar" + label_change_gravatar: "Change gravatar" + label_delete: "Delete local avatar" + label_add_avatar: "Add local avatar" message_avatar_uploaded: "Avatar carregado com sucesso" diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 96e278c..655c5fb 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1,4 +1,8 @@ # Russian strings go here ru: label_avatar: "Аватар" + label_gravatar: "Gravatar" + label_change_gravatar: "Change gravatar" + label_delete: "Delete local avatar" + label_add_avatar: "Add local avatar" message_avatar_uploaded: "Аватар успешно загружен" diff --git a/init.rb b/init.rb index 5229801..0cb727d 100644 --- a/init.rb +++ b/init.rb @@ -11,5 +11,5 @@ name 'Redmine Local Avatars plugin' author 'A. Chaika' description 'This is a plugin for Redmine' - version '0.0.3-forked' + version '0.0.4-forked' end diff --git a/lang/en.yml b/lang/en.yml deleted file mode 100644 index e338591..0000000 --- a/lang/en.yml +++ /dev/null @@ -1,2 +0,0 @@ -# English strings go here -my_label: "My label" diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index bd1ed0c..0000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the normal Rails helper -require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper') - -# Ensure that we are using the temporary fixture path -Engines::Testing.set_fixture_path