diff --git a/app/controllers/register_requests_controller.rb b/app/controllers/register_requests_controller.rb index 78bd523cc..1c2c9ef35 100644 --- a/app/controllers/register_requests_controller.rb +++ b/app/controllers/register_requests_controller.rb @@ -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 diff --git a/app/models/ability.rb b/app/models/ability.rb index 741909db3..113b50dd1 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -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 diff --git a/app/models/register_request.rb b/app/models/register_request.rb index d59416607..ba4fb2295 100644 --- a/app/models/register_request.rb +++ b/app/models/register_request.rb @@ -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 diff --git a/app/views/register_requests/index.html.haml b/app/views/register_requests/index.html.haml index 88eb17602..a5fcb474d 100644 --- a/app/views/register_requests/index.html.haml +++ b/app/views/register_requests/index.html.haml @@ -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   - - @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   + %th= t("activerecord.attributes.register_request.name") + %th= t("activerecord.attributes.register_request.email") + %th= t("activerecord.attributes.register_request.created_at") + %th.last   + - @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' + }); + }); diff --git a/config/routes.rb b/config/routes.rb index b4922adc2..0ec6e9dcd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 diff --git a/public/invite.html b/public/invite.html new file mode 100644 index 000000000..32ac74325 --- /dev/null +++ b/public/invite.html @@ -0,0 +1,94 @@ + + + + + Сборочная среда + + + + +
+ +
+ + +
+ Платформа разработки и управления жизненным циклом дистрибутивов: от исходного кода до ISO-образов +
+ +
+
+
+ + +
+
+

Здравствуйте, вы попали на страницу нашего нового сервиса ABF, который сейчас проходит тестирование.

+ Это проект универсального build-сервера ABF, цель которого — автоматизировать согласование зависимостей при пересборке пакетов, облегчить работу билд-менеджеров, гарантировать, что все пакеты в образе собраны без конфликтов друг с другом.

+ FAQ + Документация + Обсуждение +

+ +
+
+ + +
+
+
+

+ В настоящее время сервис работает в закрытом режиме.


+ Оставьте оставьте свои контактные данные в форме ниже, если хотите поучаствовать в тестировании. +

+ + +
+
+ + +
+
+ +
+ +
+
+
+ +
+
+ +
+
+
+ +
+ + + + diff --git a/public/pics/bg-signup.png b/public/pics/bg-signup.png new file mode 100644 index 000000000..79676f161 Binary files /dev/null and b/public/pics/bg-signup.png differ diff --git a/public/pics/bg.png b/public/pics/bg.png new file mode 100644 index 000000000..62e74e049 Binary files /dev/null and b/public/pics/bg.png differ diff --git a/public/pics/button-green-disabled.png b/public/pics/button-green-disabled.png new file mode 100644 index 000000000..21159cb78 Binary files /dev/null and b/public/pics/button-green-disabled.png differ diff --git a/public/pics/button-green-hover.png b/public/pics/button-green-hover.png new file mode 100644 index 000000000..b639aa0ab Binary files /dev/null and b/public/pics/button-green-hover.png differ diff --git a/public/pics/button-green-normal.png b/public/pics/button-green-normal.png new file mode 100644 index 000000000..5fb90051c Binary files /dev/null and b/public/pics/button-green-normal.png differ diff --git a/public/pics/button-green-press.png b/public/pics/button-green-press.png new file mode 100644 index 000000000..66ce78c4a Binary files /dev/null and b/public/pics/button-green-press.png differ diff --git a/public/pics/flag.png b/public/pics/flag.png new file mode 100644 index 000000000..85b84ce4f Binary files /dev/null and b/public/pics/flag.png differ diff --git a/public/pics/logo.png b/public/pics/logo.png new file mode 100644 index 000000000..0fbda66db Binary files /dev/null and b/public/pics/logo.png differ diff --git a/public/pics/square.png b/public/pics/square.png new file mode 100644 index 000000000..a6f4b5f9b Binary files /dev/null and b/public/pics/square.png differ diff --git a/public/styles/prereg.css b/public/styles/prereg.css new file mode 100644 index 000000000..6950dddb4 --- /dev/null +++ b/public/styles/prereg.css @@ -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; +} \ No newline at end of file diff --git a/public/thanks.html b/public/thanks.html new file mode 100644 index 000000000..cf88c9a86 --- /dev/null +++ b/public/thanks.html @@ -0,0 +1,61 @@ + + + + + Сборочная среда + + + + +
+ +
+ + +
+ Платформа разработки и управления жизненным циклом дистрибутивов: от исходного кода до ISO-образов +
+ +
+
+
+ + +
+
+

Спасибо!

+ Благодарим за интерес к нашему сервису ABF!
+ Приглашение будет выслано вам по указанной электронной почте.

+ Ваши замечания-комментарии-пожелания ждем по адресу: _____

+ Подробнее с ABF можно ознакомиться по ссылкам:

+ FAQ + Документация + Обсуждение +

+
+ +
+
+
+ +
+ + + + \ No newline at end of file