From d1e57475ceed6a2efcef0ed12825b18d6e70c78c Mon Sep 17 00:00:00 2001 From: Emilio Blanco Date: Mon, 28 Mar 2011 21:59:28 -0300 Subject: [PATCH] More fixes with hard links and more translation fixes --- app/controllers/login_controller.rb | 2 +- app/controllers/webmail_controller.rb | 15 +++--- app/helpers/navigation_helper.rb | 4 +- app/helpers/webmail_helper.rb | 2 +- app/views/layouts/chooser.html.erb | 16 ++++++ app/views/layouts/chooser.rhtml | 18 ------- app/views/layouts/login.html.erb | 12 +++++ app/views/layouts/public.html.erb | 22 +++++++++ app/views/layouts/public.rhtml | 25 ---------- app/views/login/index.rhtml | 70 +++++++++++---------------- app/views/shared/_folders.html.erb | 4 +- app/views/webmail/_contacts.rhtml | 15 ++++-- app/views/webmail/compose.rhtml | 6 +-- app/views/webmail/folders.rhtml | 32 ++++++------ app/views/webmail/mailsent.rhtml | 12 ++--- app/views/webmail/messages.rhtml | 10 ++-- config/locales/es-ES.yml | 4 ++ 17 files changed, 134 insertions(+), 135 deletions(-) create mode 100644 app/views/layouts/chooser.html.erb delete mode 100644 app/views/layouts/chooser.rhtml create mode 100644 app/views/layouts/login.html.erb create mode 100644 app/views/layouts/public.html.erb delete mode 100644 app/views/layouts/public.rhtml diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index c48a0a0..979f056 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -33,7 +33,7 @@ class LoginController < ApplicationController def logout reset_session - flash["status"] = _('User successfully logged out') + flash["status"] = t(:user_logged_out) redirect_to :action => "index" end diff --git a/app/controllers/webmail_controller.rb b/app/controllers/webmail_controller.rb index 7349cf5..7cb0784 100644 --- a/app/controllers/webmail_controller.rb +++ b/app/controllers/webmail_controller.rb @@ -9,15 +9,12 @@ class WebmailController < ApplicationController # Administrative functions before_filter :login_required - 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] - before_filter :load_imap_session - - after_filter :close_imap_session - # model :filter, :expression, :mail_pref, :customer BOOL_ON = "on" @@ -70,10 +67,10 @@ class WebmailController < ApplicationController session['lsort'] = sort_query = params["scc"] session['tsort'][sort_query] = (session['tsort'][sort_query]? false : true) @search_field, @search_value = session['search_field'], session['search_value'] - when _('Search') # search + when t(:search) # search session['search_field'] = @search_field session['search_value'] = @search_value - when _('Show all') # search + when t(:show_all) # search session['search_field'] = @search_field = nil session['search_value'] = @search_value = nil else @@ -175,9 +172,9 @@ class WebmailController < ApplicationController get_parts(mail).each { |part| return send_part(part) if part.header and part.header['content-type']['name'] == params['ctype'] } - render("webmail/webmail/noattachment") + render("webmail/noattachment") else - render("webmail/webmail/noattachment") + render("webmail/noattachment") end end diff --git a/app/helpers/navigation_helper.rb b/app/helpers/navigation_helper.rb index 43a7549..3303632 100644 --- a/app/helpers/navigation_helper.rb +++ b/app/helpers/navigation_helper.rb @@ -24,7 +24,7 @@ module NavigationHelper 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_choose() "/contacts/contact/choose" end @@ -45,7 +45,7 @@ module NavigationHelper end def link_folders - link_to( t(:folders), :controller=>"/webmail", :action=>"messages") + link_to( t(:folders), :controller=>:webmail, :action=>:messages) end private diff --git a/app/helpers/webmail_helper.rb b/app/helpers/webmail_helper.rb index ab0bcbc..bbea329 100644 --- a/app/helpers/webmail_helper.rb +++ b/app/helpers/webmail_helper.rb @@ -159,6 +159,6 @@ module WebmailHelper def empty_trash_link(folder_name) link_to( "(#{t :empty})", { :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 diff --git a/app/views/layouts/chooser.html.erb b/app/views/layouts/chooser.html.erb new file mode 100644 index 0000000..7cccee7 --- /dev/null +++ b/app/views/layouts/chooser.html.erb @@ -0,0 +1,16 @@ + + + + <%=@title%> + + <%=javascript_include_tag "global" %> + <%=stylesheet_link_tag "admin", "tabs", "mailr" %> + <%=@additional_scripts%> + + + <%= @content_for_layout %> + + + + diff --git a/app/views/layouts/chooser.rhtml b/app/views/layouts/chooser.rhtml deleted file mode 100644 index 9ee145f..0000000 --- a/app/views/layouts/chooser.rhtml +++ /dev/null @@ -1,18 +0,0 @@ - - - -<%=@title%> - - - - - -<%=@additional_scripts%> - - -<%= @content_for_layout %> - - - - diff --git a/app/views/layouts/login.html.erb b/app/views/layouts/login.html.erb new file mode 100644 index 0000000..d55723e --- /dev/null +++ b/app/views/layouts/login.html.erb @@ -0,0 +1,12 @@ + + + + <%=t(:mailr) %> » <%= t(:please_login)%> + <%=stylesheet_link_tag "admin", "mailr" %> + + + <%= yield %> + + diff --git a/app/views/layouts/public.html.erb b/app/views/layouts/public.html.erb new file mode 100644 index 0000000..0f3f29c --- /dev/null +++ b/app/views/layouts/public.html.erb @@ -0,0 +1,22 @@ + + + + <%= t :mailr %> + + <%=stylesheet_link_tag "admin", "tabs", "mailr", "webmail" %> + <%=javascript_include_tag :defaults, "global", "webmail", [] %> + <%=(@content_for_scripts ? @content_for_scripts : @additional_scripts )%> + + +
+
+ +
<%= yield %>
+
+
+
+ + diff --git a/app/views/layouts/public.rhtml b/app/views/layouts/public.rhtml deleted file mode 100644 index 00b5f49..0000000 --- a/app/views/layouts/public.rhtml +++ /dev/null @@ -1,25 +0,0 @@ - - - - <%= t :mailr %> - - - - - - - <%=(@content_for_scripts ? @content_for_scripts : @additional_scripts )%> - - -
-
- -
<%= yield %>
-
-
-
- - diff --git a/app/views/login/index.rhtml b/app/views/login/index.rhtml index 0a00eec..d3d0db3 100644 --- a/app/views/login/index.rhtml +++ b/app/views/login/index.rhtml @@ -1,41 +1,29 @@ - - - - Mailr » Please Log In - - - - -
> -

Mailr

- <% if flash['error'] %> -
<%= flash['error'] %>
- <% elsif flash['status'] %> -
<%= flash['status'] %>
- <% end %> -
- - - - - - - - - - - - -
<%= text_field "login_user", "email" %>
<%= password_field "login_user", "password" %>
- -
-
- - - - -
- - +
> +

Mailr

+ <% if flash['error'] %> +
<%= flash['error'] %>
+ <% elsif flash['status'] %> +
<%= flash['status'] %>
+ <% end %> +
+ + + + + + + + + + + + +
<%= text_field "login_user", "email" %>
<%= password_field "login_user", "password" %>
+ +
+
+ + + + +
diff --git a/app/views/shared/_folders.html.erb b/app/views/shared/_folders.html.erb index 821121f..9b22322 100644 --- a/app/views/shared/_folders.html.erb +++ b/app/views/shared/_folders.html.erb @@ -1,5 +1,5 @@
-

<%=t :folders %>
<%= link_to 'add/edit', folders_path %>

+

<%=t :folders %>
<%= link_to t(:add_edit_folder), folders_path %>


- +
diff --git a/app/views/webmail/_contacts.rhtml b/app/views/webmail/_contacts.rhtml index 4908f51..f1b2a63 100644 --- a/app/views/webmail/_contacts.rhtml +++ b/app/views/webmail/_contacts.rhtml @@ -1,5 +1,12 @@ \ No newline at end of file + <% for contact in @contacts do -%> +
  • + <%=h contact.fname %> <%= h contact.lname %> + +
  • + <% end -%> + diff --git a/app/views/webmail/compose.rhtml b/app/views/webmail/compose.rhtml index 45e7379..d7a78c4 100644 --- a/app/views/webmail/compose.rhtml +++ b/app/views/webmail/compose.rhtml @@ -3,7 +3,7 @@ <% } %>

    <%= t :mailbox %>

    -
    +