From ab8bf72949f7d084139f4a019c07e2376449e0a8 Mon Sep 17 00:00:00 2001 From: Eugene Korbut Date: Thu, 8 Jan 2009 06:06:34 +1000 Subject: [PATCH] webmail_controller moded from components to app --- .gitignore | 1 + app/controllers/login_controller.rb | 2 +- {components/webmail => app/controllers}/webmail_controller.rb | 4 ++-- {components/webmail => app/helpers}/webmail_helper.rb | 2 +- {components/webmail => app/views}/webmail/_contacts.rhtml | 0 {components/webmail => app/views}/webmail/_expr.rhtml | 0 {components/webmail => app/views}/webmail/_filter.rhtml | 0 {components/webmail => app/views}/webmail/_message_row.rhtml | 0 {components/webmail => app/views}/webmail/_search.rhtml | 0 {components/webmail => app/views}/webmail/compose.rhtml | 0 .../webmail => app/views}/webmail/error_connection.rhtml | 0 {components/webmail => app/views}/webmail/filter.rhtml | 0 {components/webmail => app/views}/webmail/filters.rhtml | 0 {components/webmail => app/views}/webmail/folders.rhtml | 0 {components/webmail => app/views}/webmail/mailsent.rhtml | 0 .../webmail => app/views}/webmail/manage_folders.rhtml | 0 {components/webmail => app/views}/webmail/message.rhtml | 0 {components/webmail => app/views}/webmail/messages.rhtml | 0 {components/webmail => app/views}/webmail/noattachment.rhtml | 0 {components/webmail => app/views}/webmail/prefs.rhtml | 0 {components/webmail => app/views}/webmail/view_source.rhtml | 0 config/routes.rb | 2 +- 22 files changed, 6 insertions(+), 5 deletions(-) rename {components/webmail => app/controllers}/webmail_controller.rb (99%) rename {components/webmail => app/helpers}/webmail_helper.rb (99%) rename {components/webmail => app/views}/webmail/_contacts.rhtml (100%) rename {components/webmail => app/views}/webmail/_expr.rhtml (100%) rename {components/webmail => app/views}/webmail/_filter.rhtml (100%) rename {components/webmail => app/views}/webmail/_message_row.rhtml (100%) rename {components/webmail => app/views}/webmail/_search.rhtml (100%) rename {components/webmail => app/views}/webmail/compose.rhtml (100%) rename {components/webmail => app/views}/webmail/error_connection.rhtml (100%) rename {components/webmail => app/views}/webmail/filter.rhtml (100%) rename {components/webmail => app/views}/webmail/filters.rhtml (100%) rename {components/webmail => app/views}/webmail/folders.rhtml (100%) rename {components/webmail => app/views}/webmail/mailsent.rhtml (100%) rename {components/webmail => app/views}/webmail/manage_folders.rhtml (100%) rename {components/webmail => app/views}/webmail/message.rhtml (100%) rename {components/webmail => app/views}/webmail/messages.rhtml (100%) rename {components/webmail => app/views}/webmail/noattachment.rhtml (100%) rename {components/webmail => app/views}/webmail/prefs.rhtml (100%) rename {components/webmail => app/views}/webmail/view_source.rhtml (100%) diff --git a/.gitignore b/.gitignore index 04165e1..1508667 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ log config/database.yml .*.sw? +config/site.rb diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index c7f70ae..cceb45b 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -19,7 +19,7 @@ class LoginController < ApplicationController session["wmp"] = params['login_user']["password"] end if session["return_to"] - redirect_to_path(session["return_to"]) + redirect_to(session["return_to"]) session["return_to"] = nil else redirect_to :action=>"index" diff --git a/components/webmail/webmail_controller.rb b/app/controllers/webmail_controller.rb similarity index 99% rename from components/webmail/webmail_controller.rb rename to app/controllers/webmail_controller.rb index d0ba889..489bf48 100644 --- a/components/webmail/webmail_controller.rb +++ b/app/controllers/webmail_controller.rb @@ -4,7 +4,7 @@ require 'net/imap' require 'mail2screen' require 'ezcrypto' -class Webmail::WebmailController < ApplicationController +class WebmailController < ApplicationController # uses_component_template_root # Administrative functions @@ -365,7 +365,7 @@ class Webmail::WebmailController < ApplicationController load_folders rescue Exception => ex logger.error("Exception on loggin webmail session - #{ex} - #{ex.backtrace.join("\t\n")}") - render_action "error_connection" + render :action => "error_connection" end end diff --git a/components/webmail/webmail_helper.rb b/app/helpers/webmail_helper.rb similarity index 99% rename from components/webmail/webmail_helper.rb rename to app/helpers/webmail_helper.rb index df76db1..3602989 100644 --- a/components/webmail/webmail_helper.rb +++ b/app/helpers/webmail_helper.rb @@ -1,7 +1,7 @@ require 'cdfutils' require 'mail2screen' -module Webmail::WebmailHelper +module WebmailHelper include Mail2Screen def link_folders link_to(_('Folders'), :controller=>"/webmail/webmail", :action=>"messages") diff --git a/components/webmail/webmail/_contacts.rhtml b/app/views/webmail/_contacts.rhtml similarity index 100% rename from components/webmail/webmail/_contacts.rhtml rename to app/views/webmail/_contacts.rhtml diff --git a/components/webmail/webmail/_expr.rhtml b/app/views/webmail/_expr.rhtml similarity index 100% rename from components/webmail/webmail/_expr.rhtml rename to app/views/webmail/_expr.rhtml diff --git a/components/webmail/webmail/_filter.rhtml b/app/views/webmail/_filter.rhtml similarity index 100% rename from components/webmail/webmail/_filter.rhtml rename to app/views/webmail/_filter.rhtml diff --git a/components/webmail/webmail/_message_row.rhtml b/app/views/webmail/_message_row.rhtml similarity index 100% rename from components/webmail/webmail/_message_row.rhtml rename to app/views/webmail/_message_row.rhtml diff --git a/components/webmail/webmail/_search.rhtml b/app/views/webmail/_search.rhtml similarity index 100% rename from components/webmail/webmail/_search.rhtml rename to app/views/webmail/_search.rhtml diff --git a/components/webmail/webmail/compose.rhtml b/app/views/webmail/compose.rhtml similarity index 100% rename from components/webmail/webmail/compose.rhtml rename to app/views/webmail/compose.rhtml diff --git a/components/webmail/webmail/error_connection.rhtml b/app/views/webmail/error_connection.rhtml similarity index 100% rename from components/webmail/webmail/error_connection.rhtml rename to app/views/webmail/error_connection.rhtml diff --git a/components/webmail/webmail/filter.rhtml b/app/views/webmail/filter.rhtml similarity index 100% rename from components/webmail/webmail/filter.rhtml rename to app/views/webmail/filter.rhtml diff --git a/components/webmail/webmail/filters.rhtml b/app/views/webmail/filters.rhtml similarity index 100% rename from components/webmail/webmail/filters.rhtml rename to app/views/webmail/filters.rhtml diff --git a/components/webmail/webmail/folders.rhtml b/app/views/webmail/folders.rhtml similarity index 100% rename from components/webmail/webmail/folders.rhtml rename to app/views/webmail/folders.rhtml diff --git a/components/webmail/webmail/mailsent.rhtml b/app/views/webmail/mailsent.rhtml similarity index 100% rename from components/webmail/webmail/mailsent.rhtml rename to app/views/webmail/mailsent.rhtml diff --git a/components/webmail/webmail/manage_folders.rhtml b/app/views/webmail/manage_folders.rhtml similarity index 100% rename from components/webmail/webmail/manage_folders.rhtml rename to app/views/webmail/manage_folders.rhtml diff --git a/components/webmail/webmail/message.rhtml b/app/views/webmail/message.rhtml similarity index 100% rename from components/webmail/webmail/message.rhtml rename to app/views/webmail/message.rhtml diff --git a/components/webmail/webmail/messages.rhtml b/app/views/webmail/messages.rhtml similarity index 100% rename from components/webmail/webmail/messages.rhtml rename to app/views/webmail/messages.rhtml diff --git a/components/webmail/webmail/noattachment.rhtml b/app/views/webmail/noattachment.rhtml similarity index 100% rename from components/webmail/webmail/noattachment.rhtml rename to app/views/webmail/noattachment.rhtml diff --git a/components/webmail/webmail/prefs.rhtml b/app/views/webmail/prefs.rhtml similarity index 100% rename from components/webmail/webmail/prefs.rhtml rename to app/views/webmail/prefs.rhtml diff --git a/components/webmail/webmail/view_source.rhtml b/app/views/webmail/view_source.rhtml similarity index 100% rename from components/webmail/webmail/view_source.rhtml rename to app/views/webmail/view_source.rhtml diff --git a/config/routes.rb b/config/routes.rb index 8ebec23..cfe3539 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,7 +5,7 @@ ActionController::Routing::Routes.draw do |map| # Here's a sample route: # map.connect 'products/:id', :controller => 'catalog', :action => 'view' # Keep in mind you can assign values other than :controller and :action - map.connect '', :controller=>'webmail/webmail', :action=>'index' + map.connect '', :controller=>'webmail', :action=>'index' map.connect 'webmail', :controller=>'webmail/webmail', :action=>'index'