<%= l(:label_avatar)%>
<%= avatar(@user, :size => "128") %>
<%= form_tag( { :action => 'save_avatar', :id => @user.id }, :multipart => true) do %>
<%= file_field_tag "avatar" %>
<%= submit_tag l(:button_save) %>
<%= submit_tag l(:button_delete), :confirm => l(:are_you_sure_delete_avatar) %>
<% end %>
<% html_title(l(:label_avatar)) -%>
redmine_local_avatars-1.0.1/app/views/my/avatar.html.erb 0000664 0000000 0000000 00000000042 12544723576 0023317 0 ustar 00root root 0000000 0000000 <%= render :partial => 'avatar' %> redmine_local_avatars-1.0.1/config/ 0000775 0000000 0000000 00000000000 12544723576 0017313 5 ustar 00root root 0000000 0000000 redmine_local_avatars-1.0.1/config/locales/ 0000775 0000000 0000000 00000000000 12544723576 0020735 5 ustar 00root root 0000000 0000000 redmine_local_avatars-1.0.1/config/locales/bg.yml 0000664 0000000 0000000 00000001103 12544723576 0022043 0 ustar 00root root 0000000 0000000 # Bulgarian translation by Ivan Cenov
# https://bugs.launchpad.net/redminelocalavatars/+bug/887451
bg:
label_avatar: "Аватар"
message_avatar_uploaded: "Аватарът е зареден успешно"
button_change_avatar: "Промяна на локален аватар"
are_you_sure_delete_avatar: "Сигурен ли сте, че искате да изтриете Вашия аватар?"
avatar_deleted: "Аватарът е изтрит"
unable_to_delete_avatar: "Грешка при опит за изтриване на аватара"
redmine_local_avatars-1.0.1/config/locales/de.yml 0000664 0000000 0000000 00000000641 12544723576 0022051 0 ustar 00root root 0000000 0000000 # German translation by cforce
# https://bugs.launchpad.net/redminelocalavatars/+bug/680548
de:
label_avatar: "Avatar"
message_avatar_uploaded: "Avatar erfolgreich hochgeladen"
button_change_avatar: "Avatar anpassen"
are_you_sure_delete_avatar: "Wollen Sie den Avatar entfernen?"
avatar_deleted: "Avatar entfernt."
unable_to_delete_avatar: "Leider ist beim Löschen des Avatars ein Problem aufgetreten!"
redmine_local_avatars-1.0.1/config/locales/en.yml 0000664 0000000 0000000 00000000536 12544723576 0022066 0 ustar 00root root 0000000 0000000 # English strings go here
en:
label_avatar: "Avatar"
message_avatar_uploaded: "Avatar uploaded successfully"
button_change_avatar: "Change local avatar"
are_you_sure_delete_avatar: "Are you sure you want to delete your avatar?"
avatar_deleted: "Avatar deleted"
unable_to_delete_avatar: "Sorry. There was an error deleting the avatar"
redmine_local_avatars-1.0.1/config/locales/es.yml 0000664 0000000 0000000 00000000663 12544723576 0022074 0 ustar 00root root 0000000 0000000 # Spanish strings go here
# Courtesy of Anibal Avelar
# https://bugs.launchpad.net/redminelocalavatars/+bug/716663
es:
label_avatar: "Avatar"
message_avatar_uploaded: "Avatar descargado exitosamente"
button_change_avatar: "Cambiar avatar"
are_you_sure_delete_avatar: "¿Estas seguro que quieres borrar tu avatar?"
avatar_deleted: "Avatar borrado"
unable_to_delete_avatar: "Lo sentimos. Hubo un error borrando el avatar"
redmine_local_avatars-1.0.1/config/locales/fr.yml 0000664 0000000 0000000 00000000664 12544723576 0022075 0 ustar 00root root 0000000 0000000 # French translation courtesy of luigifab
# https://bugs.launchpad.net/redminelocalavatars/+bug/692969
fr:
label_avatar: "Avatar"
message_avatar_uploaded: "Avatar enregistré"
button_change_avatar: "Modifier l'avatar"
are_you_sure_delete_avatar: "Êtes-vous certain de vouloir supprimer votre avatar?"
avatar_deleted: "Avatar supprimé"
unable_to_delete_avatar: "Une erreur est survenue lors de la suppression de l'avatar."
redmine_local_avatars-1.0.1/config/locales/it.yml 0000664 0000000 0000000 00000000526 12544723576 0022077 0 ustar 00root root 0000000 0000000 # Italian strings go here
it:
label_avatar: Immagine
message_avatar_uploaded: Immagine salvata
button_change_avatar: Cambia la tua immagine
are_you_sure_delete_avatar: "Sicuro di volere eliminare l'immagine?"
avatar_deleted: Immagine eliminata
unable_to_delete_avatar: "Mi dispiace. C'è stato un error eliminando l'immagine"
redmine_local_avatars-1.0.1/config/locales/ja.yml 0000664 0000000 0000000 00000000665 12544723576 0022061 0 ustar 00root root 0000000 0000000 # Japanese strings go here
ja:
label_avatar: "アバター"
message_avatar_uploaded: "アバターのアップロードに成功しました。"
button_change_avatar: "アバターの変更"
are_you_sure_delete_avatar: "アバターを削除してもよろしいですか?"
avatar_deleted: "アバターは削除されました。"
unable_to_delete_avatar: "アバターの削除中にエラーが発生しました。"
redmine_local_avatars-1.0.1/config/locales/pt-BR.yml 0000664 0000000 0000000 00000000625 12544723576 0022407 0 ustar 00root root 0000000 0000000 # Portugues Brazil strings go here
# Courtesy of Felipe Pinheiro
pt-BR:
label_avatar: "Avatar"
message_avatar_uploaded: "Avatar carregado com sucesso"
button_change_avatar: "Mude sua imagem de exibição."
are_you_sure_delete_avatar: "Você tem certeza que deseja apagar seu avatar?"
avatar_deleted: "Avatar apagado"
unable_to_delete_avatar: "Desculpe. Houve um erro apagando o avatar."
redmine_local_avatars-1.0.1/config/locales/ru.yml 0000664 0000000 0000000 00000000742 12544723576 0022111 0 ustar 00root root 0000000 0000000 ru:
label_avatar: "Фотография"
message_avatar_uploaded: "Фотография загружена на сервер"
button_change_avatar: "Изменить фотографию"
are_you_sure_delete_avatar: "Вы действительно хотите удалить свою фотографию?"
avatar_deleted: "Фотография удалена"
unable_to_delete_avatar: "При удалении фотографии произошла ошибка"
redmine_local_avatars-1.0.1/config/locales/zh-TW.yml 0000664 0000000 0000000 00000000476 12544723576 0022440 0 ustar 00root root 0000000 0000000 # Simplified Chinese strings go here
zh-TW:
label_avatar: "頭像"
message_avatar_uploaded: "成功上傳頭像"
button_change_avatar: "更改頭像"
are_you_sure_delete_avatar: "確定刪除頭像嗎?"
avatar_deleted: "頭像已刪除"
unable_to_delete_avatar: "對不起,刪除頭像發生錯誤"
redmine_local_avatars-1.0.1/config/locales/zh.yml 0000664 0000000 0000000 00000000473 12544723576 0022105 0 ustar 00root root 0000000 0000000 # Simplified Chinese strings go here
zh:
label_avatar: "头像"
message_avatar_uploaded: "成功上传头像"
button_change_avatar: "更改头像"
are_you_sure_delete_avatar: "确定删除头像吗?"
avatar_deleted: "头像已删除"
unable_to_delete_avatar: "对不起,删除头像发生错误"
redmine_local_avatars-1.0.1/config/routes.rb 0000664 0000000 0000000 00000001017 12544723576 0021160 0 ustar 00root root 0000000 0000000 Rails.application.routes.draw do
match 'my/avatar', :to => 'my#avatar', :via => [:get, :post]
match 'my/save_avatar/:id', :to => 'my#save_avatar', :via => [:get, :post]
match 'account/get_avatar/:id', :to => 'account#get_avatar', :constraints => {:id=>/\d+/}, :via => [:get, :post]
match 'users/save_avatar/:id', :to => 'users#save_avatar', :constraints => {:id=>/\d+/}, :via => [:get, :post]
match 'users/get_avatar/:id', :to => 'users#get_avatar', :constraints => {:id=>/\d+/}, :via => [:get, :post]
end
redmine_local_avatars-1.0.1/init.rb 0000664 0000000 0000000 00000003642 12544723576 0017343 0 ustar 00root root 0000000 0000000 # Redmine Local Avatars plugin
#
# Copyright (C) 2010 Andrew Chaika, Luca Pireddu
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'redmine'
Redmine::Plugin.register :redmine_local_avatars do
name 'Redmine Local Avatars plugin'
author 'Andrew Chaika and Luca Pireddu'
description 'This plugin lets users upload avatars directly into Redmine'
version '1.0.0'
end
ActionDispatch::Callbacks.to_prepare do
require_dependency 'project'
require_dependency 'principal'
require_dependency 'user'
AccountController.send(:include, LocalAvatarsPlugin::AccountControllerPatch)
ApplicationHelper.send(:include, LocalAvatarsPlugin::ApplicationAvatarPatch)
MyController.send(:include, LocalAvatarsPlugin::MyControllerPatch)
User.send(:include, LocalAvatarsPlugin::UsersAvatarPatch)
UsersController.send(:include, LocalAvatarsPlugin::UsersControllerPatch)
UsersHelper.send(:include, LocalAvatarsPlugin::UsersHelperPatch)
end
require 'local_avatars'
# patches to Redmine
require "account_controller_patch.rb"
require "application_helper_avatar_patch.rb"
require "my_controller_patch.rb"
require "users_avatar_patch.rb" # User model
require "users_controller_patch.rb"
require "users_helper_avatar_patch.rb" # UsersHelper
# hooks
require 'redmine_local_avatars/hooks'
redmine_local_avatars-1.0.1/lib/ 0000775 0000000 0000000 00000000000 12544723576 0016614 5 ustar 00root root 0000000 0000000 redmine_local_avatars-1.0.1/lib/account_controller_patch.rb 0000664 0000000 0000000 00000002135 12544723576 0024220 0 ustar 00root root 0000000 0000000 # Redmine Local Avatars plugin
#
# Copyright (C) 2010 Andrew Chaika, Luca Pireddu
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'local_avatars'
module LocalAvatarsPlugin
module AccountControllerPatch
def self.included(base) # :nodoc:
base.class_eval do
helper :attachments
include AttachmentsHelper
end
end
include LocalAvatars
def get_avatar
@user = User.find(params[:id])
send_avatar(@user)
end
end
end
redmine_local_avatars-1.0.1/lib/application_helper_avatar_patch.rb 0000664 0000000 0000000 00000002737 12544723576 0025531 0 ustar 00root root 0000000 0000000 # Redmine Local Avatars plugin
#
# Copyright (C) 2010 Andrew Chaika, Luca Pireddu
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'local_avatars'
module LocalAvatarsPlugin
module ApplicationAvatarPatch
def self.included(base) # :nodoc:
base.class_eval do
alias_method_chain :avatar, :local
end
end
def avatar_with_local(user, options = { })
if user.is_a?(User)then
av = user.attachments.find_by_description 'avatar'
if av then
image_url = url_for :only_path => false, :controller => 'account', :action => 'get_avatar', :id => user
options[:size] = "64" unless options[:size]
return "