From aad7a3a5476b8c05070994de8830faf95366d3f3 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 18 May 2012 22:54:57 +0600 Subject: [PATCH] [refs #443] invite localization --- .../users/register_requests_controller.rb | 13 +- app/views/layouts/invite.html.haml | 22 +++ .../users/register_requests/invite.html.haml | 44 ++++++ .../users/register_requests/thanks.html.haml | 3 + config/locales/invite.en.yml | 29 ++++ config/locales/invite.ru.yml | 30 +++++ config/routes.rb | 2 +- public/invite.html | 126 ------------------ public/pics/registration.png | Bin 0 -> 4020 bytes public/styles/prereg.css | 37 +++++ public/thanks.html | 72 ---------- 11 files changed, 177 insertions(+), 201 deletions(-) create mode 100644 app/views/layouts/invite.html.haml create mode 100644 app/views/users/register_requests/invite.html.haml create mode 100644 app/views/users/register_requests/thanks.html.haml create mode 100644 config/locales/invite.en.yml create mode 100644 config/locales/invite.ru.yml delete mode 100644 public/invite.html create mode 100644 public/pics/registration.png delete mode 100644 public/thanks.html diff --git a/app/controllers/users/register_requests_controller.rb b/app/controllers/users/register_requests_controller.rb index 5772334d3..234ef39ab 100644 --- a/app/controllers/users/register_requests_controller.rb +++ b/app/controllers/users/register_requests_controller.rb @@ -1,11 +1,20 @@ # -*- encoding : utf-8 -*- class Users::RegisterRequestsController < ApplicationController + before_filter :user_choose_locale + layout 'invite' + def new - redirect_to '/invite.html' + render :invite end def create RegisterRequest.create(params[:register_request]) - redirect_to '/thanks.html' + render :thanks + end + + protected + + def user_choose_locale + I18n.locale = params[:format] if User::LANGUAGES.include?(params[:format]) end end diff --git a/app/views/layouts/invite.html.haml b/app/views/layouts/invite.html.haml new file mode 100644 index 000000000..9a9d732b0 --- /dev/null +++ b/app/views/layouts/invite.html.haml @@ -0,0 +1,22 @@ +!!! +%html + %head + %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}/ + %title=t 'invites.title' + %script{:src => "http://html5shiv.googlecode.com/svn/trunk/html5.js", :type => "text/javascript"} + %link{:href => "/styles/prereg.css", :rel => "stylesheet", :type => "text/css"}/ + %body + .wrap + = yield :nav if content_for?(:nav) + / Top block + %header + .logo + .text=t 'invites.header' + .both + / Page + %article + =yield + .both + / Footer + %footer= render "layouts/menu/bottom" + = render 'layouts/counters' unless current_user.try(:admin?) \ No newline at end of file diff --git a/app/views/users/register_requests/invite.html.haml b/app/views/users/register_requests/invite.html.haml new file mode 100644 index 000000000..9a947155f --- /dev/null +++ b/app/views/users/register_requests/invite.html.haml @@ -0,0 +1,44 @@ +-content_for :nav do + %nav + -if I18n.locale == :ru + %a{:href => "#{new_register_request_path}.en"} + %p + English + %br>/ + version + -elsif I18n.locale == :en + %a{:href => "#{new_register_request_path}.ru"} + %p + Русская + %br>/ + версия + +.left + %p + =raw t 'invites.description' + %div{:style => "clear: both;"} +.right + %h3=t 'invites.want' + %form#new_register_request{"accept-charset" => "UTF-8", :action => "/register_requests", :method => "post", :name => "invite_form"} + .signup-left=t 'invites.name' + .signup-right + %input#email.registartion-input-signup{:name => "register_request[name]", :onClick => "this.className='registartion-input-focus';disError(this);", :onblur => "if(this.value==''){this.value='';this.className='registartion-input-signup';}else{this.className='registartion-input-no-focus';};buttonCheck();", :onfocus => "if(this.value=='#{t 'invites.login_email'}'){this.value='';this.className='registartion-input-focus';};", :onkeydown => "buttonCheck();", :type => "text"}/ + %div{:style => "clear: both;"} + .signup-left=t 'invites.email' + .signup-right + %input#email.registartion-input-signup{:name => "register_request[email]", :onClick => "this.className='registartion-input-focus';disError(this);", :onblur => "if(this.value==''){this.value='';this.className='registartion-input-signup';}else{this.className='registartion-input-no-focus';};buttonCheck();", :onfocus => "if(this.value=='#{t 'invites.login_email'}'){this.value='';this.className='registartion-input-focus';};", :onkeydown => "buttonCheck();", :type => "text"}/ + %div{:style => "clear: both;"} + .signup-left=raw t 'invites.interest' + .signup-right + %select.registartion-input-signup{:name => "register_request[interest]"} + -t('invites.interests').each do |base, title| + %option=title + %div{:style => "clear: both;"} + .signup-left=t 'invites.comments' + .signup-right + %textarea.registartion-input-signup{:name => "register_request[more]", :rows => "3"} + %div{:style => "clear: both;"} + =hidden_field_tag :format, I18n.locale + .button + %input.button{:type => "submit", :value => t('invites.send')} +%div{:style => "clear: both;"} diff --git a/app/views/users/register_requests/thanks.html.haml b/app/views/users/register_requests/thanks.html.haml new file mode 100644 index 000000000..bfd406e14 --- /dev/null +++ b/app/views/users/register_requests/thanks.html.haml @@ -0,0 +1,3 @@ +.all + %p + %span{:style => "font-size: 28px;"}=raw t 'invites.thanks' diff --git a/config/locales/invite.en.yml b/config/locales/invite.en.yml new file mode 100644 index 000000000..c727140e8 --- /dev/null +++ b/config/locales/invite.en.yml @@ -0,0 +1,29 @@ +en: + invites: + title: ABF + + header: 'A platform for distribution development and lifecycle management: from source code to ISO images.' + description: | + Welcome!

+ On this page you can submit a request to participate in beta testing of ABF build service of ROSA company.

+ In the first place we process requests from prospective maintainers and representatives of distribution teams.

+ You can get detailed documentation here.

+ We will be glad to answer your questions at the project here.

+ thanks: | + Thank You!

+ We are glad that you have expressed interest in our ABF service!

+ Your registration confirmation will be sent to the e-mail address you have specified in the registration form.

+ We will be glad to get feedback and to answer your questions in our forum.

+ You can get detailed documentation here. + + want: I want to become ABF beta-tester! + login_email: Login or email + name: 'First/Last name' + email: E-mail address + interest: Interest in the project + Comments: Comments + send: Send + interests: + evaluate: Evaluate ABF possibilities + maintainer: I want to become ROSA maintainer + build: I want to build a distribution using ABF \ No newline at end of file diff --git a/config/locales/invite.ru.yml b/config/locales/invite.ru.yml new file mode 100644 index 000000000..b37438230 --- /dev/null +++ b/config/locales/invite.ru.yml @@ -0,0 +1,30 @@ +ru: + invites: + title: Сборочная среда + + header: 'Платформа разработки и управления жизненным циклом дистрибутивов: от исходного кода до ISO-образов.' + description: | + Приветствуем Вас!

+ Вы находитесь на странице размещения заявок на участие в бета-тестировании сборочного сервиса ABF компании РОСА.

+ В первую очередь одобряются заявки от потенциальных майнтейнеров и представителей дистрибутивных команд.

+ Ознакомиться с документацией можно здесь.

+ Мы будем рады ответить на Ваши вопросы на форуме проекта. + thanks: | + Спасибо!

+ Благодарим за интерес к нашему сервису ABF!

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

+ Приглашаем Вас на форум проекта, + где мы будем рады ответить на Ваши вопросы и получить Ваши пожелания.

+ Ознакомиться с документацией можно здесь. + + want: Хочу стать бета-тестером ABF! + login_email: Логин или email + name: Имя, Фамилия + email: Электронная почта + interest: Степень интереса
к проекту + Comments: Также хочу сказать + send: Отправить + interests: + evaluate: Общеобразовательные цели + maintainer: Хочу стать майнтейнером РОСы + build: Хочу собрать в ABF дистрибутив diff --git a/config/routes.rb b/config/routes.rb index a9eb1befc..fe3ff9eac 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,7 +80,7 @@ Rosa::Application.routes.draw do resources :users, :controller => 'profile', :only => [] do get :autocomplete_user_uname, :on => :collection end - resources :register_requests, :only => [:new, :create] + resources :register_requests, :only => [:new, :create], :format => /ru|en/ #view support only two languages end scope :module => 'groups' do diff --git a/public/invite.html b/public/invite.html deleted file mode 100644 index cf0af6f33..000000000 --- a/public/invite.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - Сборочная среда - - - - -
- -
- - -
- Платформа разработки и управления жизненным циклом дистрибутивов: от исходного кода до ISO-образов -
- -
-
-
- - -
-
-

- Приветствуем Вас!

- Вы находитесь на странице размещения заявок на участие в бета-тестировании сборочного сервиса ABF компании РОСА.

- В первую очередь одобряются заявки от потенциальных майнтейнеров и представителей дистрибутивных команд.

- Ознакомиться с документацией можно здесь.

- Мы будем рады ответить на Ваши вопросы на форуме проекта. -

- -
-
- - -
-
-

Хочу стать бета-тестером ABF!

- -
- - -
-
- - -
-
- - -
-
- - -
-
- -
- -
-
-
- -
-
- -
-
-
- -
- - - - - diff --git a/public/pics/registration.png b/public/pics/registration.png new file mode 100644 index 0000000000000000000000000000000000000000..78bcca569aaf6adf6deccdae9d196168567552e5 GIT binary patch literal 4020 zcmV;l4@>ZgP)KLZ*U+IBfRsybQWXdwQ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WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000EvNkl^OEDJAsf;D-DIF6oCY&^rEDdxZ$GreSq+PpR>v6!c^Pv7_$u(u6xs=ewliN!n_ zdBYE=s|MH{HlM^|o|=u8v$F#nG;v5Q=E=R!6$O;G0g9q3Zi&S_iHYNE8(>#^ox>7~ znKK9n;8@*)T21Vdig^+f=jjLnY!Zuk5))@Ngl&qd?3Gx|lbAT_(+u!A!xD?RIovsd zRLR4lELig@WnKnEIy*qh?8x@bp|M{W=m#)#cQaPG(Z|4Wsw0*eW~(LqOi_@diGLoQKGQUfEw^vqA*uYqqzdK z6rcsv>RP=lv6!cooRI?R?GUc5sO zJ7Vv$J0-I1Q|i~ut-GJkeNnhkngV8kV&_c=8{h^8fkVLIq4SZC!e>M8I=xQ$z8uKbx9P|E0zBYa4-o5d;3u zi1F}b=uH3n!3p<%SKxI8Un|uf=dTy%9!w>ES;-qWfqTIHjlgflfVDSek%ra8sPy3fCE6(GvYoPITt?N zJK-I*ciCUb?;8|mic8r`xf_{_xy!&^0Y53W8smAvZ-)VG*#Q?20QLjXJ%07A;Cq1+ z;j^KmuR>0UF*Bc8?YDf17YAG5DlK{I}te9cjRRp zPx?|Nm%moHBgV{vSR)?*S)c+mwgcLB%LX{bSt2C5;-KnR-;8`1IvG427~joZv0CjH z($};_{kEv~1>ljW_Uem{8M6&oZ#?-sLi?caZSRrrWaxO$Soh#=$cjd_Q7_LfCyF;q zcauM+E{XLq20R3EKzS=;#!3S^|BouRr=VD6M}gt+WaxO`3ICye22ZG?qOGOr#fR5`fu48 zqhQR7FpY~qEdu&ZRr_u+V7*n=5A=)ApN4>e@MP#%chocN9q$?1N@i43)v^}TQ_J_X z`^leD*Tqn)lxjNB@$5oDu6{5m**K6*I@n%WS}U0p2A{af#m@Yu literal 0 HcmV?d00001 diff --git a/public/styles/prereg.css b/public/styles/prereg.css index 1c7db632f..eeebb5887 100644 --- a/public/styles/prereg.css +++ b/public/styles/prereg.css @@ -240,4 +240,41 @@ footer ul li a { footer ul li a:hover { text-decoration: underline; +} + +/*language*/ + +div.langlist { + width: 760px; + margin: 0 auto; + text-align: center; +} + +div.lang { + float: right; + margin: 2px 0px 2px 7px; + cursor: pointer; +} + +nav { + width: 96px; + height: 47px; + background: url("../pics/registration.png") no-repeat; + float: right; + cursor: pointer; +} + +nav p { + font-size: 14px; + color: #FFF; + margin: 0; + padding: 0; + padding-top: 0px; + font-weight: 700; +} + +/* custom */ + +nav a { + text-decoration: none; } \ No newline at end of file diff --git a/public/thanks.html b/public/thanks.html deleted file mode 100644 index 0e9f8ae7e..000000000 --- a/public/thanks.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Сборочная среда - - - - -
- -
- - -
- Платформа разработки и управления жизненным циклом дистрибутивов: от исходного кода до ISO-образов -
- -
-
-
- - -
-
-

- Спасибо!

- Благодарим за интерес к нашему сервису ABF!

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

- Приглашаем Вас на форум проекта, где мы будем рады ответить на Ваши вопросы и получить Ваши пожелания.

- Ознакомиться с документацией можно здесь. -

-
- -
-
-
- -
- - - - - \ No newline at end of file