added unknown page

from_scratch
Wojciech Todryk 2011-07-22 22:57:36 +02:00
parent 5ef1414979
commit 99fcbbb8d0
10 changed files with 54 additions and 7 deletions

View File

@ -0,0 +1,5 @@
class MessagesController < ApplicationController
def index
end
end

View File

@ -13,6 +13,14 @@ class UserController < ApplicationController
end
def authenticate
redirect_to :action => 'unknown'
#redirect_to :controller => "messages", :action => "index"
end
def setup
end
def unknown
end
end

View File

@ -0,0 +1,2 @@
module MessagesHelper
end

View File

@ -0,0 +1,2 @@
<h1>Messages#index</h1>
<p>Find me in app/views/messages/index.html.erb</p>

View File

@ -67,4 +67,7 @@ en:
please_login: Log in
site_link: https://github.com/lmanolov/mailr
user_logged_out: User was logged out
unknown_user_title: Unknown user
unknown_user_flash: Your email identifier was not found in database
unknown_user_login: Go to login page and try to login once more.
unknown_user_setup: Go to setup page and do the setup of Your mail account.

View File

@ -1,11 +1,14 @@
Mailr::Application.routes.draw do
themes_for_rails
get "user/login"
root :to => "messages#index"
get "messages/index"
get "user/logout"
post "user/authenticate"
get "user/login"
get "user/setup"
get "user/unknown"
themes_for_rails
# The priority is based upon order of creation:
# first created -> highest priority.
@ -20,7 +23,6 @@ Mailr::Application.routes.draw do
# Sample resource route (maps HTTP verbs to controller actions automatically):
# resources :products
# Sample resource route with options:
# resources :products do
# member do
@ -56,7 +58,7 @@ Mailr::Application.routes.draw do
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => "welcome#index"
# See how all your routes lay out with "rake routes"

View File

@ -0,0 +1,9 @@
require 'test_helper'
class MessagesControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end
end

View File

@ -0,0 +1,4 @@
require 'test_helper'
class MessagesHelperTest < ActionView::TestCase
end

View File

@ -3,7 +3,7 @@ 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) %> - <%= t(:please_login)%></title>
<title><%=t(:mailr) %></title>
<%=stylesheet_link_tag current_theme_stylesheet_path('base') %>
<%=stylesheet_link_tag current_theme_stylesheet_path('style') %>
</head>

View File

@ -0,0 +1,12 @@
<div id="box">
<div class="block" id="block-login">
<div id="logo"><a href="<%= t(:site_link) %>"><img src="<%= current_theme_image_path('logo_small.png')%>" alt="Mailr"/></a>
</div>
<h2><%= t(:unknown_user_title) %></h2>
<div class="content">
<div class="flash"><div class="message warning"><p><%= t(:unknown_user_flash) %></p></div></div>
<p><%= t(:unknown_user_login) %> -> <%= link_to "Login",:controller => "user",:action =>"login" %></p>
<p><%= t(:unknown_user_setup) %> -> <%= link_to "Setup",:controller => "user",:action => "setup" %></p>
</div>
</div>
</div>