diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 4e9ed16..26de1ca 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -1,14 +1,7 @@ class AccountController < ApplicationController - - uses_flexible_template :owner => 'owner' - # Be sure to include AuthenticationSystem in Application Controller instead - include AuthenticatedSystem - # If you want "remember me" functionality, add this before_filter to Application Controller - before_filter :login_from_cookie - # say something nice, you goof! something sweet. def index unless logged_in? @@ -25,7 +18,9 @@ class AccountController < ApplicationController cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at } end redirect_back_or_default(:controller => '/account', :action => 'index') - flash[:notice] = "Logged in successfully" + flash[:notice] = _("Logged in successfully") + else + flash[:notice] = _('Incorrect username or password') end end @@ -35,7 +30,7 @@ class AccountController < ApplicationController @user.save! self.current_user = @user redirect_back_or_default(:controller => '/account', :action => 'index') - flash[:notice] = "Thanks for signing up!" + flash[:notice] = _("Thanks for signing up!") rescue ActiveRecord::RecordInvalid render :action => 'signup' end @@ -44,7 +39,7 @@ class AccountController < ApplicationController self.current_user.forget_me if logged_in? cookies.delete :auth_token reset_session - flash[:notice] = "You have been logged out." + flash[:notice] = _("You have been logged out.") redirect_back_or_default(:controller => '/account', :action => 'index') end diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 334707a..9481a1c 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -1,11 +1,13 @@ -# This is the application's main controller. Features defined here are +# his is the application's main controller. Features defined here are # available in all controllers. class ApplicationController < ActionController::Base + # Be sure to include AuthenticationSystem in Application Controller instead + include AuthenticatedSystem + before_filter :detect_stuff_by_domain attr_reader :virtual_community - before_filter :load_owner # Load the owner def load_owner @@ -15,7 +17,6 @@ class ApplicationController < ActionController::Base end end - protected # TODO: move this logic somewhere else (Domain class?) @@ -29,6 +30,10 @@ class ApplicationController < ActionController::Base end end + def flexible_template_onwer + @virtual_community_admin || @profile + end + def self.acts_as_virtual_community_admin_controller before_filter :load_admin_controller layout 'virtual_community_admin' diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5ad70b7..51f8d0f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -90,4 +90,17 @@ module ApplicationHelper content_tag('div', links, :id => 'user_links') end + def header + virtual_community_identification + (logged_in? ? user_links : login_box) + end + + def login_box + link_to _('Login'), :controller => 'account', :action => 'login' + end + + # FIXME + def footer + 'nothing in the footer yet' + end + end diff --git a/app/views/edit_template/index.rhtml b/app/views/edit_template/index.rhtml index e69de29..ddfa21b 100644 --- a/app/views/edit_template/index.rhtml +++ b/app/views/edit_template/index.rhtml @@ -0,0 +1,7 @@ +<%= link_to _('Show Layout'), :controller => 'home' %> +<%= link_to _('Edit Layout'), :controller => 'edit_template' %> + +<%= select_template %> +<%= select_theme %> +<%= select_icons_theme %> +<%= display_icon('back')%> diff --git a/app/views/layouts/account.rhtml b/app/views/layouts/account.rhtml deleted file mode 100644 index 4bc2fde..0000000 --- a/app/views/layouts/account.rhtml +++ /dev/null @@ -1,18 +0,0 @@ - -
- <%= javascript_include_tag :defaults %> - <%= javascript_include_tag_template %> - <%= stylesheet_link_tag_template %> - - - - <%= virtual_community_identification %> - <%= user_links %> - -when 800px just isn't enough...
+ <%= header %>