From 0a7c0e4e9b49881528a21c75ab9504eb7fbc502a Mon Sep 17 00:00:00 2001 From: Alexey Nayden Date: Thu, 10 Mar 2011 14:35:46 +0300 Subject: [PATCH] Platforms list + UI enchancements --- app/controllers/git_controller.rb | 2 ++ app/controllers/projects_controller.rb | 2 ++ app/controllers/users_controller.rb | 2 ++ app/helpers/git_helper.rb | 2 ++ app/helpers/projects_helper.rb | 2 ++ app/helpers/users_helper.rb | 2 ++ app/stylesheets/partials/_page.scss | 17 ++++++++-- app/views/devise/sessions/new.html.haml | 32 +++++++++--------- app/views/devise/shared/_links.haml | 15 +-------- app/views/layouts/_footer.html.haml | 2 +- app/views/layouts/_header.html.haml | 2 +- app/views/platforms/index.html.haml | 7 ++++ config/locales/devise.ru.yml | 35 ++++++++++++++++++++ config/locales/ru.yml | 13 ++++++++ config/routes.rb | 8 +++++ spec/controllers/git_controller_spec.rb | 5 +++ spec/controllers/projects_controller_spec.rb | 5 +++ spec/controllers/users_controller_spec.rb | 5 +++ spec/helpers/git_helper_spec.rb | 15 +++++++++ spec/helpers/projects_helper_spec.rb | 15 +++++++++ spec/helpers/users_helper_spec.rb | 15 +++++++++ 21 files changed, 170 insertions(+), 33 deletions(-) create mode 100644 app/controllers/git_controller.rb create mode 100644 app/controllers/projects_controller.rb create mode 100644 app/controllers/users_controller.rb create mode 100644 app/helpers/git_helper.rb create mode 100644 app/helpers/projects_helper.rb create mode 100644 app/helpers/users_helper.rb create mode 100644 config/locales/devise.ru.yml create mode 100644 config/locales/ru.yml create mode 100644 spec/controllers/git_controller_spec.rb create mode 100644 spec/controllers/projects_controller_spec.rb create mode 100644 spec/controllers/users_controller_spec.rb create mode 100644 spec/helpers/git_helper_spec.rb create mode 100644 spec/helpers/projects_helper_spec.rb create mode 100644 spec/helpers/users_helper_spec.rb diff --git a/app/controllers/git_controller.rb b/app/controllers/git_controller.rb new file mode 100644 index 000000000..75bae3d9d --- /dev/null +++ b/app/controllers/git_controller.rb @@ -0,0 +1,2 @@ +class GitController < ApplicationController +end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb new file mode 100644 index 000000000..60b4a9e37 --- /dev/null +++ b/app/controllers/projects_controller.rb @@ -0,0 +1,2 @@ +class ProjectsController < ApplicationController +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 000000000..3e74dea87 --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,2 @@ +class UsersController < ApplicationController +end diff --git a/app/helpers/git_helper.rb b/app/helpers/git_helper.rb new file mode 100644 index 000000000..78dba95d3 --- /dev/null +++ b/app/helpers/git_helper.rb @@ -0,0 +1,2 @@ +module GitHelper +end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb new file mode 100644 index 000000000..db5c5ce1a --- /dev/null +++ b/app/helpers/projects_helper.rb @@ -0,0 +1,2 @@ +module ProjectsHelper +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb new file mode 100644 index 000000000..2310a240d --- /dev/null +++ b/app/helpers/users_helper.rb @@ -0,0 +1,2 @@ +module UsersHelper +end diff --git a/app/stylesheets/partials/_page.scss b/app/stylesheets/partials/_page.scss index 278237eea..2d47dda29 100644 --- a/app/stylesheets/partials/_page.scss +++ b/app/stylesheets/partials/_page.scss @@ -50,8 +50,21 @@ body {} #container {} -header {} +header { + display:block; + background: #ccf; + height:3em; + #logout { + float:right; + } +} -#main {} +#main { + #login_form { + margin: 0 auto; + width:250px; + padding:2em; + } +} footer {} diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 43cd65929..0222968a7 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,16 +1,18 @@ -%h2 Sign in -= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| - %p - = f.label :email - %br/ - = f.text_field :email - %p - = f.label :password - %br/ - = f.password_field :password - - if devise_mapping.rememberable? +#login_form + %h2 Вход в систему + = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %p - = f.check_box :remember_me - = f.label :remember_me - %p= f.submit "Sign in" -= render :partial => "devise/shared/links" + = f.label :email + %br/ + = f.text_field :email + %p + = f.label :password + %br/ + = f.password_field :password + - if devise_mapping.rememberable? + %p + = f.check_box :remember_me + = f.label :remember_me + %p + = f.submit "Войти" + = link_to t('devise.passwords.link'), new_password_path(resource_name) diff --git a/app/views/devise/shared/_links.haml b/app/views/devise/shared/_links.haml index a7547353f..ec5d37ee8 100644 --- a/app/views/devise/shared/_links.haml +++ b/app/views/devise/shared/_links.haml @@ -1,15 +1,2 @@ -- if controller_name != 'sessions' - = link_to "Sign in", new_session_path(resource_name) - %br/ -- if devise_mapping.registerable? && controller_name != 'registrations' - = link_to "Sign up", new_registration_path(resource_name) - %br/ - if devise_mapping.recoverable? && controller_name != 'passwords' - = link_to "Forgot your password?", new_password_path(resource_name) - %br/ -- if devise_mapping.confirmable? && controller_name != 'confirmations' - = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) - %br/ -- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' - = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) - %br/ + = link_to t('devise.passwords.link'), new_password_path(resource_name) diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml index df8cccc9c..684e09a58 100644 --- a/app/views/layouts/_footer.html.haml +++ b/app/views/layouts/_footer.html.haml @@ -1,2 +1,2 @@ %small.copyright - Copyright © #{Date.today.year} \ No newline at end of file + Copyright © #{Date.today.year} EvilMartians.ru diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 462323864..190fcfc50 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -1 +1 @@ -%h1 Header \ No newline at end of file +%h1= t('layout.global_header') - if user_signed_in? #logout = t('layout.logged_in_as') = current_user.name = link_to t('layout.logout'), destroy_user_session_path \ No newline at end of file diff --git a/app/views/platforms/index.html.haml b/app/views/platforms/index.html.haml index e69de29bb..e3d186060 100644 --- a/app/views/platforms/index.html.haml +++ b/app/views/platforms/index.html.haml @@ -0,0 +1,7 @@ +%h1= t('layout.platforms.list') +- @platforms.each do |platform| + = div_for platform do + = platform.name += link_to t('layout.platforms.new'), new_platform_path +.div + = link_to t('layout.user_list'), users_path diff --git a/config/locales/devise.ru.yml b/config/locales/devise.ru.yml new file mode 100644 index 000000000..202943f43 --- /dev/null +++ b/config/locales/devise.ru.yml @@ -0,0 +1,35 @@ +ru: + devise: + sessions: + link: 'Войти' + signed_in: 'Вы вошли.' + signed_out: 'Вы вышли.' + unauthenticated: 'Вы должны войти или зарегистрироваться, прежде чем сможете продолжить.' + unconfirmed: 'Вы должны подтвердить вашу учетную запись, прежде чем сможете продолжить.' + locked: 'Ваша учетная запись заблокирована.' + invalid: 'Неверный пароль или адрес электронной почты.' + invalid_token: 'Неверный ключ аутентификации.' + timeout: 'Ваша сессия закончена. Пожалуйста, войдите еще раз, чтобы продолжить.' + inactive: 'Ваша учетная запись еще не активирована.' + passwords: + link: 'Забыли пароль?' + send_instructions: 'Вы получите письмо с инструкциями о том, как сбросить ваш пароль, через несколько минут.' + updated: 'Ваш пароль изменен. Теперь вы можете войти.' + confirmations: + link: "Не получили инструкции для подтверждения учетной записи?" + send_instructions: 'Вы получите письмо с инструкциями о том, как подтвердить вашу учетную запись.' + confirmed: 'Ваша учетная запись успешно подтверждена. Добро пожаловать.' + registrations: + link: 'Регистрация' + signed_up: 'Вы успешно зарегистрировались.' + updated: 'Ваша учетная запись изменена.' + destroyed: 'До свидания! Ваша учетная запись удалена. Надеемся вскоре снова вас увидеть.' + unlocks: + link: "Не получили инструкции для разблокировки учетной записи?" + send_instructions: 'Вы получите письмо с инструкциями о том, как разблокировать вашу учетную запись, через несколько минут.' + unlocked: 'Ваша учетная запись разблокирована. Вы вошли.' + mailer: + confirmation_instructions: 'Инструкции для подтверждения' + reset_password_instructions: 'Инструкции для сброса пароля' + unlock_instructions: 'Инструкции для разблокировки' + diff --git a/config/locales/ru.yml b/config/locales/ru.yml new file mode 100644 index 000000000..9154e0cd3 --- /dev/null +++ b/config/locales/ru.yml @@ -0,0 +1,13 @@ +ru: + layout: + global_header: Сборочная платформа ROSA + logged_in_as: Вы вошли как + logout: Выйти + user_list: Список пользователей + platforms: + list: Платформы + new: Создать новую платформу + + attributes: + password: Пароль + remember_me: Запомнить diff --git a/config/routes.rb b/config/routes.rb index bb59c395c..2d64738ef 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,13 @@ Rosa::Application.routes.draw do devise_for :users + resources :platforms do + resources :projects do + resource :git + end + end + + resources :users + root :to => "platforms#index" end diff --git a/spec/controllers/git_controller_spec.rb b/spec/controllers/git_controller_spec.rb new file mode 100644 index 000000000..8d014fed2 --- /dev/null +++ b/spec/controllers/git_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe GitController do + +end diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb new file mode 100644 index 000000000..6c7a6268a --- /dev/null +++ b/spec/controllers/projects_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe ProjectsController do + +end diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb new file mode 100644 index 000000000..142455c99 --- /dev/null +++ b/spec/controllers/users_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe UsersController do + +end diff --git a/spec/helpers/git_helper_spec.rb b/spec/helpers/git_helper_spec.rb new file mode 100644 index 000000000..eb2e92e20 --- /dev/null +++ b/spec/helpers/git_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the GitHelper. For example: +# +# describe GitHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe GitHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb new file mode 100644 index 000000000..4dfdd6da1 --- /dev/null +++ b/spec/helpers/projects_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the ProjectsHelper. For example: +# +# describe ProjectsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe ProjectsHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb new file mode 100644 index 000000000..e65fff91c --- /dev/null +++ b/spec/helpers/users_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the UsersHelper. For example: +# +# describe UsersHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe UsersHelper do + pending "add some examples to (or delete) #{__FILE__}" +end