This commit is contained in:
Wojciech Todryk 2011-09-09 23:44:51 +02:00
parent 7879dd49a2
commit da8d0e4389
8 changed files with 33 additions and 20 deletions

View file

@ -80,12 +80,15 @@ class MessagesController < ApplicationController
mail = Mail.new(imap_message) mail = Mail.new(imap_message)
@plain_header = mail.header.to_s @plain_header = mail.header.to_s
@from = mail.From.addrs
@to = mail.To.addrs
@cc = mail.Cc # FIXME missing fields
@bcc = mail.Bcc @from = mail.From.addrs.presence
@to = mail.To.addrs.presence
@cc = mail.Cc.presence
@bcc = mail.Bcc.presence
#@subject = mail.Subject #@subject = mail.Subject
@date = mail.date @date = mail.date.presence
if mail.multipart? == true if mail.multipart? == true
if not mail.text_part.nil? if not mail.text_part.nil?
@ -169,7 +172,7 @@ class MessagesController < ApplicationController
def prepare_multi2_buttons def prepare_multi2_buttons
@multi2_buttons = [] @multi2_buttons = []
@multi2_buttons << {:text => 'delete',:scope=>:message,:image => 'trash.png'} @multi2_buttons << {:text => 'trash',:scope=>:message,:image => 'trash.png'}
@multi2_buttons << {:text => 'set_unread',:scope=>:message,:image => 'unseen.png'} @multi2_buttons << {:text => 'set_unread',:scope=>:message,:image => 'unseen.png'}
@multi2_buttons << {:text => 'set_read',:scope=>:message,:image => 'seen.png'} @multi2_buttons << {:text => 'set_read',:scope=>:message,:image => 'seen.png'}
end end
@ -183,7 +186,7 @@ class MessagesController < ApplicationController
def prepare_multi3_buttons def prepare_multi3_buttons
@multi3_buttons = [] @multi3_buttons = []
@multi3_buttons << {:text => 'show_header',:scope=>:show,:image => 'zoom.png'} @multi3_buttons << {:text => 'show_header',:scope=>:show,:image => 'zoom.png'}
@multi3_buttons << {:text => 'delete',:scope=>:show,:image => 'trash.png'} @multi3_buttons << {:text => 'trash',:scope=>:show,:image => 'trash.png'}
@multi3_buttons << {:text => 'reply',:scope=>:show,:image => 'reply.png'} @multi3_buttons << {:text => 'reply',:scope=>:show,:image => 'reply.png'}
end end
end end

View file

@ -45,7 +45,7 @@ class MessagesOpsController < ApplicationController
set_unread set_unread
elsif params[:set_read] elsif params[:set_read]
set_read set_read
elsif params[:delete] elsif params[:trash]
trash trash
elsif params[:copy] elsif params[:copy]
copy copy

View file

@ -11,7 +11,7 @@ module MessagesHelper
end end
def date_formatter(date) def date_formatter(date)
date.nil? ? t(:no_data) : date.strftime("%Y-%m-%d %H:%M") date.nil? ? t(:no_date,:scope=>:message) : date.strftime("%Y-%m-%d %H:%M")
end end
def address_formatter(addr,mode) def address_formatter(addr,mode)

View file

@ -41,16 +41,23 @@ class Message < ActiveRecord::Base
mail = Mail.new(message.attr['RFC822.HEADER']) mail = Mail.new(message.attr['RFC822.HEADER'])
mail.date.nil? ? date = nil : date = mail.date.to_s
mail.From.nil? ? from = nil : from = mail.From.charseted
mail.To.nil? ? to = nil : to = mail.To.charseted
mail.Subject.nil? ? subject = nil : subject = mail.Subject.charseted
#logger.custom('mail',mail.inspect)
create( create(
:user_id => user.id, :user_id => user.id,
:folder_id => folder.id, :folder_id => folder.id,
:msg_id => mail.message_id, :msg_id => mail.message_id,
:uid => message.attr['UID'].to_i, :uid => message.attr['UID'].to_i,
:from_addr => mail.From.charseted, :from_addr => from,
:to_addr => mail.To.charseted, :to_addr => to,
:subject => mail.Subject.charseted, :subject => subject,
:content_type => mail.content_type, :content_type => mail.content_type,
:date => mail.date.to_s(:db), :date => date,
:unseen => !(message.attr['FLAGS'].member? :Seen), :unseen => !(message.attr['FLAGS'].member? :Seen),
:size => message.attr['RFC822.SIZE'] :size => message.attr['RFC822.SIZE']
) )

View file

@ -121,6 +121,8 @@ pl:
delete: Usuń zaznaczone delete: Usuń zaznaczone
move: Przenieś move: Przenieś
copy: Skopiuj copy: Skopiuj
trash: Usuń zaznaczone
no_date: Brak daty
compose: compose:
compose: Nowa wiadomość compose: Nowa wiadomość
@ -143,6 +145,7 @@ pl:
show_header: Pokaż nagłówek show_header: Pokaż nagłówek
delete: Usuń delete: Usuń
reply_string: "Odp: " reply_string: "Odp: "
trash: Usuń
user: user:
login_failure: Nieudane logowanie. Podano błędny e-mail lub hasło. login_failure: Nieudane logowanie. Podano błędny e-mail lub hasło.

View file

@ -363,22 +363,22 @@ a.button:link, a.button:visited, a.button:hover, a.button:active, button.button
line-height: 1.3em; line-height: 1.3em;
font-weight:bold; font-weight:bold;
cursor:pointer; cursor:pointer;
padding:5px 10px 6px 7px; padding:2px 5px 3px 3px;
text-decoration: none; text-decoration: none;
} }
button.button { button.button {
width:auto; width:auto;
overflow:visible; overflow:visible;
padding:4px 10px 3px 7px; /* IE6 */ padding:2px 5px 1px 3px; /* IE6 */
} }
button.button[type] { button.button[type] {
padding:5px 10px 5px 7px; /* Firefox */ padding:2px 5px 2px 3px; /* Firefox */
line-height:17px; /* Safari */ line-height:17px; /* Safari */
} }
*:first-child+html button.button[type] { *:first-child+html button.button[type] {
padding:4px 10px 3px 7px; /* IE7 */ padding:2px 5px 1px 3px; /* IE7 */
} }
button.button img, a.button img { button.button img, a.button img {

View file

@ -135,10 +135,10 @@ p {
} }
#sidebar ul li { #sidebar ul li {
border-bottom: 1px solid #F0F0EE;Załączniki burnet.tar.gz border-bottom: 1px solid #F0F0EE;
} }
#sidebar ul li a:hover, #sidebar ul li a:active {Załączniki burnet.tar.gz #sidebar ul li a:hover, #sidebar ul li a:active {
background: #ADBFD6; background: #ADBFD6;
color: #FFF; color: #FFF;
} }

View file

@ -1,5 +1,5 @@
<div class="block"> <div class="block">
<h3><%=t(:folders,:scope=>:folder) %> <%= link_to t(:refresh), folders_refresh_status_path, :class=>'minor' %></h3> <h3><%=t(:folders,:scope=>:folder) %></h3>
<div class="content"> <div class="content">
<% if @folders_shown.nil? or @folders_shown.size.zero? %> <% if @folders_shown.nil? or @folders_shown.size.zero? %>
<p><%= t(:no_shown,:scope=>:folder) %> <%= link_to t(:folders,:scope=>:folder), folders_path %></p> <p><%= t(:no_shown,:scope=>:folder) %> <%= link_to t(:folders,:scope=>:folder), folders_path %></p>