More fixes with hard links and more translation fixes

This commit is contained in:
Emilio Blanco 2011-03-28 21:59:28 -03:00
parent eff724bdb5
commit d1e57475ce
17 changed files with 134 additions and 135 deletions

View file

@ -33,7 +33,7 @@ class LoginController < ApplicationController
def logout def logout
reset_session reset_session
flash["status"] = _('User successfully logged out') flash["status"] = t(:user_logged_out)
redirect_to :action => "index" redirect_to :action => "index"
end end

View file

@ -9,15 +9,12 @@ class WebmailController < ApplicationController
# Administrative functions # Administrative functions
before_filter :login_required before_filter :login_required
before_filter :obtain_cookies_for_search_and_nav, :only=>[:messages] before_filter :obtain_cookies_for_search_and_nav, :only=>[:messages]
before_filter :load_imap_session
after_filter :close_imap_session
layout "public", :except => [:view_source, :download] layout "public", :except => [:view_source, :download]
before_filter :load_imap_session
after_filter :close_imap_session
# model :filter, :expression, :mail_pref, :customer # model :filter, :expression, :mail_pref, :customer
BOOL_ON = "on" BOOL_ON = "on"
@ -70,10 +67,10 @@ class WebmailController < ApplicationController
session['lsort'] = sort_query = params["scc"] session['lsort'] = sort_query = params["scc"]
session['tsort'][sort_query] = (session['tsort'][sort_query]? false : true) session['tsort'][sort_query] = (session['tsort'][sort_query]? false : true)
@search_field, @search_value = session['search_field'], session['search_value'] @search_field, @search_value = session['search_field'], session['search_value']
when _('Search') # search when t(:search) # search
session['search_field'] = @search_field session['search_field'] = @search_field
session['search_value'] = @search_value session['search_value'] = @search_value
when _('Show all') # search when t(:show_all) # search
session['search_field'] = @search_field = nil session['search_field'] = @search_field = nil
session['search_value'] = @search_value = nil session['search_value'] = @search_value = nil
else else
@ -175,9 +172,9 @@ class WebmailController < ApplicationController
get_parts(mail).each { |part| get_parts(mail).each { |part|
return send_part(part) if part.header and part.header['content-type']['name'] == params['ctype'] return send_part(part) if part.header and part.header['content-type']['name'] == params['ctype']
} }
render("webmail/webmail/noattachment") render("webmail/noattachment")
else else
render("webmail/webmail/noattachment") render("webmail/noattachment")
end end
end end

View file

@ -24,7 +24,7 @@ module NavigationHelper
end end
def link_import_preview() "/contacts/import_preview" end def link_import_preview() "/contacts/import_preview" end
def link_main_index() "/" end def link_main_index() root_url end
def link_contact_import() "/contacts/import" end def link_contact_import() "/contacts/import" end
def link_contact_choose() "/contacts/contact/choose" end def link_contact_choose() "/contacts/contact/choose" end
@ -45,7 +45,7 @@ module NavigationHelper
end end
def link_folders def link_folders
link_to( t(:folders), :controller=>"/webmail", :action=>"messages") link_to( t(:folders), :controller=>:webmail, :action=>:messages)
end end
private private

View file

@ -159,6 +159,6 @@ module WebmailHelper
def empty_trash_link(folder_name) def empty_trash_link(folder_name)
link_to( "(#{t :empty})", link_to( "(#{t :empty})",
{ :controller => "webmail", :action => "empty", :params=>{"folder_name"=>folder_name}}, { :controller => "webmail", :action => "empty", :params=>{"folder_name"=>folder_name}},
:confirm => _('Do you really want to empty trash?')) :confirm => t(:want_to_empty_trash_message))
end end
end end

View file

@ -0,0 +1,16 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= @htmllang %>" lang="<%= @htmllang %>">
<head>
<title><%=@title%></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<%=javascript_include_tag "global" %>
<%=stylesheet_link_tag "admin", "tabs", "mailr" %>
<%=@additional_scripts%>
</head>
<body id="bodyID" onload="<%=@onload_function%>">
<%= @content_for_layout %>
</body>
</html>

View file

@ -1,18 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= @htmllang %>" lang="<%= @htmllang %>">
<head>
<title><%=@title%></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/javascripts/global.js"></script>
<link rel="stylesheet" href="/stylesheets/admin.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/stylesheets/tabs.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/stylesheets/mailr.css" type="text/css" media="screen" />
<%=@additional_scripts%>
</head>
<body id="bodyID" onload="<%=@onload_function%>">
<%= @content_for_layout %>
</body>
</html>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><%=t(:mailr) %> &raquo; <%= t(:please_login)%></title>
<%=stylesheet_link_tag "admin", "mailr" %>
</head>
<body>
<%= yield %>
</body>
</html>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= @htmllang %>" lang="<%= @htmllang %>">
<head>
<title><%= t :mailr %></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<%=stylesheet_link_tag "admin", "tabs", "mailr", "webmail" %>
<%=javascript_include_tag :defaults, "global", "webmail", [] %>
<%=(@content_for_scripts ? @content_for_scripts : @additional_scripts )%>
</head>
<body id="bodyID" onload="<%=@onload_function%>">
<div id="wholepage">
<div id="container">
<div id="sidebar_outer">
<div id="sidebar"><%= yield :sidebar %></div>
</div>
<div id="content"><%= yield %></div>
<br class="clear"/>
</div>
</div>
</body>
</html>

View file

@ -1,25 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= @htmllang %>" lang="<%= @htmllang %>">
<head>
<title><%= t :mailr %></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/stylesheets/admin.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/stylesheets/tabs.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/stylesheets/mailr.css" type="text/css" media="screen" />
<script type="text/javascript" src="/javascripts/global.js"></script>
<script type="text/javascript" src="/javascripts/prototype.js"></script>
<%=(@content_for_scripts ? @content_for_scripts : @additional_scripts )%>
</head>
<body id="bodyID" onload="<%=@onload_function%>">
<div id="wholepage">
<div id="container">
<div id="sidebar_outer">
<div id="sidebar"><%= yield :sidebar %></div>
</div>
<div id="content"><%= yield %></div>
<br class="clear"/>
</div>
</div>
</body>
</html>

View file

@ -1,41 +1,29 @@
<!DOCTYPE html <div id="login" <%= 'class="login_error"' if flash['error'] %>>
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <h1>Mailr</h1>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <% if flash['error'] %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <div id="SystemError"><%= flash['error'] %></div>
<head> <% elsif flash['status'] %>
<title>Mailr &raquo; Please Log In</title> <div id="SystemStatus"><%= flash['status'] %></div>
<link rel="stylesheet" type="text/css" href="/stylesheets/admin.css" /> <% end %>
<link rel="stylesheet" href="/stylesheets/mailr.css" type="text/css" media="screen" /> <form action="<%=url_for(:controller => 'login', :action => 'authenticate')%>" method="post">
</head> <table class="form_layout">
<body> <tr>
<div id="login" <%= 'class="login_error"' if flash['error'] %>> <th><label for="email"><%= t :email %>:</label></th>
<h1>Mailr</h1> <td><%= text_field "login_user", "email" %></td>
<% if flash['error'] %> </tr>
<div id="SystemError"><%= flash['error'] %></div> <tr>
<% elsif flash['status'] %> <th><label for="password"><%= t :password %>:</label></th>
<div id="SystemStatus"><%= flash['status'] %></div> <td><%= password_field "login_user", "password" %></td>
<% end %> </tr>
<form action="<%=url_for(:controller => 'login', :action => 'authenticate')%>" method="post"> <tr>
<table class="form_layout"> <td colspan="2" class="form_actions">
<tr> <input type="submit" name="submit" value="<%= t :log_in %>"/>
<th><label for="email"><%= t :email %>:</label></th> </td>
<td><%= text_field "login_user", "email" %></td> </tr>
</tr> </table>
<tr> </form>
<th><label for="password"><%= t :password %>:</label></th> <b class='cn tl'></b>
<td><%= password_field "login_user", "password" %></td> <b class='cn tr'></b>
</tr> <b class='cn bl'></b>
<tr> <b class='cn br'></b>
<td colspan="2" class="form_actions"> </div>
<input type="submit" name="submit" value="<%= t :log_in %>"/>
</td>
</tr>
</table>
</form>
<b class='cn tl'></b>
<b class='cn tr'></b>
<b class='cn bl'></b>
<b class='cn br'></b>
</div>
</body>
</html>

View file

@ -1,5 +1,5 @@
<div id="folders"> <div id="folders">
<h4><%=t :folders %><br/><%= link_to 'add/edit', folders_path %></h4> <h4><%=t :folders %><br/><%= link_to t(:add_edit_folder), folders_path %></h4>
<hr/> <hr/>
<ul> <ul>
<% @folders.each do |folder| -%> <% @folders.each do |folder| -%>
@ -8,5 +8,5 @@
</ul> </ul>
</div> </div>
<div style="text-align: center; padding: 10px;"> <div style="text-align: center; padding: 10px;">
<input type="button" value="<%= t :logout %>" onclick="window.location='/login/logout'"> <input type="button" value="<%= t :logout %>" onclick="window.location='<%= url_for(:controller => :login, :action => :logout) %>'">
</div> </div>

View file

@ -1,5 +1,12 @@
<ul class="contacts"> <ul class="contacts">
<% for contact in @contacts do -%> <% for contact in @contacts do -%>
<li class="contact"><%=h contact.fname %> <%= h contact.lname %> <div class='email'><div class="notviscode">&amp;lt;</div><%= h contact.email %><div class="notviscode">&amp;gt;</div></div></li> <li class="contact">
<% end -%> <%=h contact.fname %> <%= h contact.lname %>
</ul> <div class='email'>
<div class="notviscode">&lt;</div>
<%= h contact.email %>
<div class="notviscode">&gt;</div>
</div>
</li>
<% end -%>
</ul>

View file

@ -3,7 +3,7 @@
<% } %> <% } %>
<h1><%= t :mailbox %></h1> <h1><%= t :mailbox %></h1>
<form name="composeMail" id='composeMail' action="/webmail/compose" enctype="multipart/form-data" method="post"> <form name="composeMail" id='composeMail' action="<%= url_for(:controller => :webmail, :action => :compose) %>" enctype="multipart/form-data" method="post">
<div id="header"> <div id="header">
<ul id="primary"> <ul id="primary">
<li><%= link_folders %></li> <li><%= link_folders %></li>
@ -64,8 +64,4 @@
<% if ['text/html', 'multipart'].include?(@mail.content_type) %> <% if ['text/html', 'multipart'].include?(@mail.content_type) %>
<%= include_tinymce %> <%= include_tinymce %>
<% end %> <% end %>
<%= javascript_include_tag "controls" %>
<%= javascript_include_tag "dragdrop" %>
<%= javascript_include_tag "effects" %>
<% %>
<% } %> <% } %>

View file

@ -1,11 +1,11 @@
<h1><%=_('Mailbox')%></h1> <h1><%=_('Mailbox')%></h1>
<div id="header"> <div id="header">
<ul id="primary"> <ul id="primary">
<li><span><%= _('Folders') %></span> <li><span><%= _('Folders') %></span>
<ul id="secondary"> <ul id="secondary">
<li><%=link_refresh%></li> <li><%=link_refresh%></li>
</ul> </ul>
</li> </li>
<li><%=link_send_mail%></li> <li><%=link_send_mail%></li>
<li><%=link_mail_prefs%></li> <li><%=link_mail_prefs%></li>
<li><%=link_mail_filters%></li> <li><%=link_mail_filters%></li>
@ -13,17 +13,17 @@
</ul> </ul>
</div> </div>
<div id="tab_main"> <div id="tab_main">
<div id="tab_content"> <div id="tab_content">
<% content_for('sidebar') { %> <% content_for('sidebar') { %>
<%= render :partial => 'shared' %> <%= render :partial => 'shared' %>
<% } %> <% } %>
<div id="messages"> <div id="messages">
<% if not(request['msg_id'] == '') %> <% if not(request['msg_id'] == '') %>
<%= render_component(:controller => "webmail/webmail", :action => "message", :params => { 'msg_id' => request['msg_id']})%> <%= render_component(:controller => "webmail/webmail", :action => "message", :params => { 'msg_id' => request['msg_id']})%>
<% else %> <% else %>
<%= render_component(:controller => "webmail/webmail", :action => "messages") %> <%= render_component(:controller => "webmail/webmail", :action => "messages") %>
<% end %> <% end %>
</div> </div>
</div></div> </div></div>

View file

@ -1,8 +1,8 @@
<h1><%=_('Mailbox')%></h1> <h1><%=t(:mailbox)%></h1>
<div id="header"> <div id="header">
<ul id="primary"> <ul id="primary">
<li><%=link_folders%></li> <li><%=link_folders%></li>
<li><span><%= _('Compose') %></span> <li><span><%= t(:compose) %></span>
<ul id="secondary"> <ul id="secondary">
<li><%=link_compose_new%></li> <li><%=link_compose_new%></li>
</ul> </ul>
@ -17,14 +17,14 @@
<div class="msghdr"> <div class="msghdr">
<dl> <dl>
<dt><%=_('To')%></dt><dd><%= CGI.escapeHTML(@mail.to) %></dd> <dt><%=t(:to)%></dt><dd><%= CGI.escapeHTML(@mail.to) %></dd>
<% if @mail.cc %> <% if @mail.cc %>
<dt><%=_('CC')%></dt><dd><%= CGI.escapeHTML(@mail.cc) %></dd> <dt><%=t(:cc)%></dt><dd><%= CGI.escapeHTML(@mail.cc) %></dd>
<% end <% end
if @mail.bcc %> if @mail.bcc %>
<dt><%=_('BCC')%></dt><dd><%= CGI.escapeHTML(@mail.bcc) %></dd> <dt><%=t(:bcc)%></dt><dd><%= CGI.escapeHTML(@mail.bcc) %></dd>
<% end %> <% end %>
<dt><%=_('Subject')%></dt><dd><%= CGI.escapeHTML(@mail.subject) %></dd> <dt><%=t(:subject)%></dt><dd><%= CGI.escapeHTML(@mail.subject) %></dd>
</dl> </dl>
</div> </div>
</div> </div>

View file

@ -55,13 +55,13 @@
<tr> <tr>
<th width="1%"><input type="checkbox" name="allbox" onclick="checkAll(this.form)" style="margin: 0 0 0 4px" /></th> <th width="1%"><input type="checkbox" name="allbox" onclick="checkAll(this.form)" style="margin: 0 0 0 4px" /></th>
<% if @folder_name == CDF::CONFIG[:mail_sent] %> <% if @folder_name == CDF::CONFIG[:mail_sent] %>
<th width="20%"><%= link_to(t(:to), :controller=>'/webmail/webmail', :action=>'messages', :op=>'SORT', :page=>@page, :scc=>'to_flat')%></th> <th width="20%"><%= link_to(t(:to), :controller=>:webmail, :action=>:messages, :op=>'SORT', :page=>@page, :scc=>'to_flat')%></th>
<% else %> <% else %>
<th width="20%"><%= link_to(t(:from), :controller=>'/webmail/webmail', :action=>'messages', :op=>'SORT', :page=>@page, :scc=>'from_flat')%></th> <th width="20%"><%= link_to(t(:from), :controller=>:webmail, :action=>:messages, :op=>'SORT', :page=>@page, :scc=>'from_flat')%></th>
<% end%> <% end%>
<th width='60%'><%= link_to(t(:subject), :controller=>'/webmail/webmail', :action=>'messages', :op=>'SORT', :page=>@page, :scc=>'subject')%></th> <th width='60%'><%= link_to(t(:subject), :controller=>:webmail, :action=>:messages, :op=>'SORT', :page=>@page, :scc=>'subject')%></th>
<th><%= link_to(t(:date), :controller=>'/webmail/webmail', :action=>'messages', :op=>'SORT', :page=>@page, :scc=>'date')%></th> <th><%= link_to(t(:date), :controller=>:webmail, :action=>:messages, :op=>'SORT', :page=>@page, :scc=>'date')%></th>
<th><%= link_to(t(:size), :controller=>'/webmail/webmail', :action=>'messages', :op=>'SORT', :page=>@page, :scc=>'size')%></th> <th><%= link_to(t(:size), :controller=>:webmail, :action=>:messages, :op=>'SORT', :page=>@page, :scc=>'size')%></th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
</thead> </thead>

View file

@ -78,3 +78,7 @@ es-ES:
select_file: Selecionar archivo select_file: Selecionar archivo
import: Importar import: Importar
back_to_folders: Volver a carpetas back_to_folders: Volver a carpetas
add_edit_folder: agregar/editar
user_logged_out: Sesi&oacute;n cerrada correctamente
please_login: Por favor, inicie sesi&oacute;n
want_to_empty_trash_message: ¿Realmente quieres vaciar la papelera?