[issue #174] added static pages and some changes

This commit is contained in:
George Vinogradov 2012-02-10 02:55:28 +04:00
parent f9e7f3fb06
commit d0fe7f55d5
17 changed files with 438 additions and 21 deletions

View File

@ -7,26 +7,34 @@ class RegisterRequestsController < ApplicationController
end
def new
render :layout => 'sessions'
# render :layout => 'sessions'
redirect_to '/invite.html'
end
def show_message
end
def create
if @register_request = RegisterRequest.create(params[:register_request])
redirect_to show_message_register_requests_path
else
redirect_to :action => :new
RegisterRequest.create(params[:register_request])
redirect_to '/thanks.html' #show_message_register_requests_path
end
def update
case params[:update_type]
when 'approve' # see approve method
when 'reject' # see reject method
end
redirect_to :action => :index
end
def approve
@register_request.update_attributes(:approved => true, :rejected => false)
redirect_to :action => :index
end
def reject
@register_request.update_attributes(:approved => false, :rejected => true)
redirect_to :action => :index
end
end

View File

@ -27,7 +27,7 @@ class Ability
if user.guest? # Guest rights
can :create, User
can :create, RegisterRequest
can [:create, :show_message], RegisterRequest
else # Registered user rights
can [:show, :autocomplete_user_uname], User

View File

@ -8,7 +8,7 @@ class RegisterRequest < ActiveRecord::Base
before_create :generate_token
validate :name, :presence => true
validate :email, :presence => true, :uniqueness => {:case_sensitive => false}
validate :email, :presence => true, :uniqueness => {:case_sensitive => false}, :format => { :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i }
protected

View File

@ -8,20 +8,40 @@
%h2.title
= t("layout.register_request.list_header")
.inner
%table.table
%tr
%th= t("activerecord.attributes.register_request.name")
%th= t("activerecord.attributes.register_request.email")
%th= t("activerecord.attributes.register_request.created_at")
%th.last &nbsp;
- @register_requests.each do |request|
%tr{:class => cycle("odd", "even")}
%td= request.name
%td= request.email
%td
= link_to t("layout.approve"), register_request_approve_path(request) if can? :approve, request
|
= link_to t("layout.reject"), register_request_reject_path(request) if can? :reject, request
= form_tag register_requests_path, :method => :put, :class => 'update_form' do
= hidden_field_tag 'update_type'
%table.table
%tr
%th &nbsp;
%th= t("activerecord.attributes.register_request.name")
%th= t("activerecord.attributes.register_request.email")
%th= t("activerecord.attributes.register_request.created_at")
%th.last &nbsp;
- @register_requests.each do |request|
%tr{:class => cycle("odd", "even")}
%td= check_box_tag 'request_ids[]', request.id
%td= request.name
%td= request.email
%td
= link_to t("layout.approve"), register_request_approve_path(request) if can? :approve, request
|
= link_to t("layout.reject"), register_request_reject_path(request) if can? :reject, request
.actions-bar.wat-cf
.actions
= submit_tag t("layout.register_request.approve_selected"), :class => 'approve_registration'
= submit_tag t("layout.register_request.reject_selected"), :class => 'reject_registration'
.pagination
= will_paginate @register_requests
:javascript
$(function() {
var form = $('form.update_form')
var change_update_type = function (type) {
$('input#update_type').val(type);
};
$('.approve_registration').live('click', function(e) {
//set update_type to 'approve'
});
$('.approve_registration').live('click', function(e) {
//set update_type to 'reject'
});
});

View File

@ -12,6 +12,7 @@ Rosa::Application.routes.draw do
collection do
resources :register_requests, :only => [:index, :new, :create, :show_message, :approve, :reject] do
get :show_message, :on => :collection
put :update, :on => :collection
get :approve
get :reject
end

94
public/invite.html Normal file
View File

@ -0,0 +1,94 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Сборочная среда</title>
<script type="text/javascript" src="js/html5shiv.js"></script>
<link rel="stylesheet" type="text/css" href="styles/prereg.css" />
</head>
<body>
<div class="wrap">
<!--Top block-->
<header>
<div class="logo">
</div>
<div class="text">
Платформа разработки и управления жизненным циклом дистрибутивов: от исходного кода до ISO-образов
</div>
<div class="both">
</div>
</header>
<!--Page-->
<article>
<div class="left">
<p>Здравствуйте, вы попали на страницу нашего нового сервиса ABF, который сейчас проходит тестирование. <br /><br />
Это проект универсального build-сервера ABF, цель которого — автоматизировать согласование зависимостей при пересборке пакетов, облегчить работу билд-менеджеров, гарантировать, что все пакеты в образе собраны без конфликтов друг с другом.<br /><br />
<a href="#">FAQ</a>
<a href="http://wiki.rosalab.ru/index.php/ABF">Документация</a>
<a href="http://forum.rosalab.ru/viewforum.php?f=10" class="last">Обсуждение</a>
</p>
<div style="clear: both;">
</div>
</div>
<div class="right">
<form accept-charset="UTF-8" name='invite_form' action="/users/register_requests" id="new_register_request" method="post">
<p>
В настоящее время сервис работает в закрытом режиме. <br/><br/><br />
Оставьте оставьте свои контактные данные в форме ниже, если хотите поучаствовать в тестировании.
</p>
<div class="signup-left">
Имя
</div>
<div class="signup-right">
<input type="text" id="email" name="register_request[name]" class="registartion-input-signup" onkeydown="buttonCheck();" onClick="this.className='registartion-input-focus';disError(this);" onfocus="if(this.value=='Логин или email'){this.value='';this.className='registartion-input-focus';};" onblur="if(this.value==''){this.value='';this.className='registartion-input-signup';}else{this.className='registartion-input-no-focus';};buttonCheck();" />
</div>
<div style="clear: both;">
</div>
<div class="signup-left">
Электронная почта
</div>
<div class="signup-right">
<input type="text" id="email" name="register_request[email]" class="registartion-input-signup" onkeydown="buttonCheck();" onClick="this.className='registartion-input-focus';disError(this);" onfocus="if(this.value=='Логин или email'){this.value='';this.className='registartion-input-focus';};" onblur="if(this.value==''){this.value='';this.className='registartion-input-signup';}else{this.className='registartion-input-no-focus';};buttonCheck();" />
</div>
<div style="clear: both;">
</div>
<div class="button">
<input class="button" type="submit" value="Отправить">
</div>
</form>
</div>
<div style="clear: both;">
</div>
<div class="both">
</div>
</article>
</div>
<!--Footer-->
<footer>
<ul>
<li>
ROSA Лаб. © 2012 <img src="pics/square.png" alt="_" />
</li>
<li>
<img src="pics/flag.png" alt="rosa" /> <img src="pics/square.png" alt="_" />
</li>
<li>
<a href="http://www.rosalab.ru/about">О компании</a> <img src="pics/square.png" alt="_" />
</li>
<li>
<a href="http://www.rosalab.ru/about/contacts">Контакты</a>
</li>
</ul>
</footer>
</body>
</html>

BIN
public/pics/bg-signup.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
public/pics/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
public/pics/flag.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
public/pics/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
public/pics/square.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

233
public/styles/prereg.css Normal file
View File

@ -0,0 +1,233 @@
html, body {
margin: 0;
padding: 0;
font-family: Tahoma, Arial;
color: #565667;
background: #1f60a1 url("../pics/bg.png") repeat-x;
min-width: 940px;
min-height: 300px;
text-align: center;
height: 100%;
}
header, section, footer, aside, nav, article, menu {
display: block;
}
input[type="text"]:focus { outline: none; }
input[type="password"]:focus { outline: none; }
input:focus { outline: none; }
select:focus { outline: none; }
a img { border: none; }
.wrap {
width: 940px;
margin: 0 auto;
text-align: center;
min-height: 95%;
}
.both {
clear: both;
}
/* Header */
header div.logo {
background: url("../pics/logo.png") no-repeat 50% 100%;
height: 89px;
width: 233px;
margin: 0 auto;
text-align: center;
padding-top: 8%;
}
header div.text {
color: #FFF;
font-size: 28px;
width: 800px;
text-align: left;
margin-left: 90px;
margin-top: 50px;
font-family: Arial;
text-shadow: 0px 1px 1px #000000;
filter: dropshadow(color=#000000, offx=0, offy=1);
padding-left: 0px;
}
/* Content */
article {
width: 760px;
height: 305px;
background: #1c394c url("../pics/bg-signup.png") repeat-x;
border-radius: 5px;
border: 1px solid #38658c;
margin: 0 auto;
text-align: center;
margin-top: 50px;
-webkit-box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
padding-top: 5px;
color: #FFF;
font-size: 14px;
}
article p{
margin: 0;
padding: 10px 15px;
margin: 0px 0 0px 0;
}
article div.left {
float: left;
width: 340px;
text-align: left;
font-size: 14px;
margin-top: 0px;
padding: 10px 20px;
}
article div.right {
float: right;
width: 338px;
margin-top: 0px;
border-left: 2px solid #223e51;
padding: 10px 20px;
}
article div.left a {
color: #FFF;
padding-right: 29px;
}
article div.left a.last {
padding-right: 0px;
}
article div.right p {
text-align: left;
}
article div.all a {
color: #FFF;
padding-right: 29px;
}
article div.all p {
text-align: left;
}
article div.all {
float: left;
text-align: left;
font-size: 14px;
margin-top: 25px;
padding: 10px 20px;
}
article div.signup-left {
float: left;
color: #FFF;
font-size: 12px;
padding-top: 16px;
padding-left: 15px;
}
article div.signup-right {
float: right;
}
article div.signup-right input {
height: 21px;
width: 170px;
border: 1px solid #8199a9;
border-radius: 2px;
color: #cfcfcf;
font-family: Tahoma;
font-size: 12px;
padding-left: 10px;
margin-top: 6px;
margin-top: 14px;
margin-right: 15px;
}
article div.button {
float: right;
margin: 19px 15px 0px 0px;
}
a.button {
background: #125687;
background: url("../pics/button-green-normal.png");
border-radius: 3px;
color: #FFF;
font-family: Tahoma;
font-size: 12px;
-webkit-font-smoothing: antialiased;
font-weight: normal;
padding: 6px 25px;
text-align: center;
border: none;
height: 27px;
width: 106px;
text-decoration: none;
}
a.button:hover {
background: #1874b6;
background: url("../pics/button-green-hover.png");
cursor: pointer;
}
a.button:active{
background: url("../pics/button-green-press.png");
}
a.button:disabled, a.button.disabled {
background: #125687;
background: url("../pics/button-blue-disabled.png");
padding: 5px 15px;
cursor: default;
}
/* Footer */
footer {
height: 32px;
padding-left: 15px;
width: 900px;
margin: 0 auto;
text-align: center;
}
footer ul {
margin: 0;
padding: 0;
list-style: none;
font-size: 12px;
color: #FFF;
padding-top: 10px;
text-align: center;
}
footer ul li {
display: inline;
}
footer ul li a {
font-size: 12px;
color: #FFF;
text-decoration: none;
}
footer ul li a:hover {
text-decoration: underline;
}

61
public/thanks.html Normal file
View File

@ -0,0 +1,61 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Сборочная среда</title>
<script type="text/javascript" src="js/html5shiv.js"></script>
<link rel="stylesheet" type="text/css" href="styles/prereg.css" />
</head>
<body>
<div class="wrap">
<!--Top block-->
<header>
<div class="logo">
</div>
<div class="text">
Платформа разработки и управления жизненным циклом дистрибутивов: от исходного кода до ISO-образов
</div>
<div class="both">
</div>
</header>
<!--Page-->
<article>
<div class="all">
<p><span style="font-size: 28px;">Спасибо!</span><br /><br />
Благодарим за интерес к нашему сервису ABF!<br />
Приглашение будет выслано вам по указанной электронной почте. <br /><br />
Ваши замечания-комментарии-пожелания ждем по адресу: _____<br /><br />
Подробнее с ABF можно ознакомиться по ссылкам:<br /><br />
<a href="#">FAQ</a>
<a href="http://wiki.rosalab.ru/index.php/ABF">Документация</a>
<a href="http://forum.rosalab.ru/viewforum.php?f=10">Обсуждение</a>
</p>
</div>
<div class="both">
</div>
</article>
</div>
<!--Footer-->
<footer>
<ul>
<li>
ROSA Лаб. © 2012 <img src="pics/square.png" alt="_" />
</li>
<li>
<img src="pics/flag.png" alt="rosa" /> <img src="pics/square.png" alt="_" />
</li>
<li>
<a href="http://www.rosalab.ru/about">О компании</a> <img src="pics/square.png" alt="_" />
</li>
<li>
<a href="http://www.rosalab.ru/about/contacts">Контакты</a>
</li>
</ul>
</footer>
</body>
</html>