Skip to content
Browse files

Update the locales of new party

  • Loading branch information...
1 parent d5c1009 commit 8dff5a7ee829e87e5f995b9a7f3d7564b6113dfd @zernel committed Mar 18, 2012
View
4 app/assets/stylesheets/parties.css.scss
@@ -5,7 +5,11 @@
margin: 100px auto;
border: solid 1px #DDD;
@include rounded-conner(5px);
+ background-color: white;
h2.title {
@include h2-title
}
+ form {
+ padding-top: 20px;
+ }
}
View
52 app/assets/stylesheets/sites.css.scss
@@ -263,33 +263,33 @@ body {
}
}
}
- .footer {
- position: absolute;
- bottom: 30px;
- width: 100%;
- font-size: 11px;
- color: #333;
- text-align: center;
- color: rgba(255, 255, 255, .15);
- margin-left: 0;
- ul {
- display: inline-block;
- list-style: none;
- li {
- display: inline;
- margin: 0 3px;
- a {
- color: rgba(255, 255, 255, .3);
- -webkit-transition: color .2s linear;
- -moz-transition: color .2s linear;
- transition: color .2s linear;
- }
+ }
+ }
+}
+.footer {
+ position: absolute;
+ bottom: 30px;
+ width: 100%;
+ font-size: 11px;
+ color: #333;
+ text-align: center;
+ color: rgba(255, 255, 255, .15);
+ margin-left: 0;
+ ul {
+ display: inline-block;
+ list-style: none;
+ li {
+ display: inline;
+ margin: 0 3px;
+ a {
+ color: rgba(255, 255, 255, .3);
+ -webkit-transition: color .2s linear;
+ -moz-transition: color .2s linear;
+ transition: color .2s linear;
}
}
}
}
- }
-}
.flex-table-primary {
width: 99%;
padding-right: 5px;
@@ -311,6 +311,12 @@ body {
}
}
+.devise {
+ .sign-in, .sign-up, .edit-user {
+ background-color: white;
+ }
+}
+
.clear {
clear: both;
}
View
2 app/controllers/parties_controller.rb
@@ -15,11 +15,9 @@ def create
respond_to do |format|
if @party.save
- binding.pry
format.html { redirect_to @party, notice: '成功发起聚会' }
format.json { render json: @party, status: :created, location: @party }
else
- binding.pry
format.html { render aciton: 'new' }
format.json { render json: @party.errors, status: :unprocessable_entity }
end
View
55 app/views/devise/registrations/edit.html.haml
@@ -1,27 +1,28 @@
-.edit-user
- %h2.title 账户管理
- = form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
- = devise_error_messages!
- %div
- = f.label :email
- %br/
- = f.email_field :email
- %div
- = f.label :password
- %i (leave blank if you don't want to change it)
- %br/
- = f.password_field :password, :autocomplete => "off"
- %div
- = f.label :password_confirmation
- %br/
- = f.password_field :password_confirmation
- %div
- = f.label :current_password
- %i (we need your current password to confirm your changes)
- %br/
- = f.password_field :current_password
- %div= f.submit "Update"
- %h3 Cancel my account
- %p
- Unhappy? #{link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete}.
- = link_to "Back", :back
+#page-container.devise.wrapper
+ .edit-user
+ %h2.title 账户管理
+ = form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
+ = devise_error_messages!
+ %div
+ = f.label :email
+ %br/
+ = f.email_field :email
+ %div
+ = f.label :password
+ %i (leave blank if you don't want to change it)
+ %br/
+ = f.password_field :password, :autocomplete => "off"
+ %div
+ = f.label :password_confirmation
+ %br/
+ = f.password_field :password_confirmation
+ %div
+ = f.label :current_password
+ %i (we need your current password to confirm your changes)
+ %br/
+ = f.password_field :current_password
+ %div= f.submit "Update"
+ %h3 Cancel my account
+ %p
+ Unhappy? #{link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete}.
+ = link_to "Back", :back
View
47 app/views/devise/registrations/new.html.haml
@@ -1,23 +1,24 @@
-.sign-up
- %h2.title= t('common.register')
- - if !devise_error_messages!.blank?
- .alert.alert-block
- %a{ class: 'close', 'data-dismiss' => 'alert'}×
- = devise_error_messages!
- = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
- .form-horizontal
- .control-group
- = f.label :email, class: 'control-label'
- .controls
- = f.email_field :email, class: 'input-medium'
- .control-group
- = f.label :password, class: 'control-label'
- .controls
- = f.password_field :password, class: 'input-medium'
- .control-group
- = f.label :password_confirmation, class: 'control-label'
- .controls
- = f.password_field :password_confirmation, class: 'input-medium'
- .form-actions
- = f.submit t('common.register'), class: 'btn btn-primary'
- = render "links"
+#page-container.devise.wrapper
+ .sign-up
+ %h2.title= t('common.register')
+ - if !devise_error_messages!.blank?
+ .alert.alert-block
+ %a{ class: 'close', 'data-dismiss' => 'alert'}×
+ = devise_error_messages!
+ = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
+ .form-horizontal
+ .control-group
+ = f.label :email, class: 'control-label'
+ .controls
+ = f.email_field :email, class: 'input-medium'
+ .control-group
+ = f.label :password, class: 'control-label'
+ .controls
+ = f.password_field :password, class: 'input-medium'
+ .control-group
+ = f.label :password_confirmation, class: 'control-label'
+ .controls
+ = f.password_field :password_confirmation, class: 'input-medium'
+ .form-actions
+ = f.submit t('common.register'), class: 'btn btn-primary'
+ = render "links"
View
41 app/views/devise/sessions/new.html.haml
@@ -1,20 +1,21 @@
-.sign-in
- %h2.title= t('common.login')
- = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
- .form-horizontal
- .control-group
- = f.label :email, class: 'control-label'
- .controls
- = f.email_field :email, class: 'input-medium'
- .control-group
- = f.label :password, class: 'control-label'
- .controls
- = f.password_field :password, class: 'input-medium'
- .control-group
- .controls
- %label.checkbox
- = f.check_box :remember_me
- = t('common.remember_me')
- .form-actions
- = f.submit t('common.login'), class: 'btn btn-primary'
- = render "links"
+#page-container.devise.wrapper
+ .sign-in
+ %h2.title= t('common.login')
+ = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
+ .form-horizontal
+ .control-group
+ = f.label :email, class: 'control-label'
+ .controls
+ = f.email_field :email, class: 'input-medium'
+ .control-group
+ = f.label :password, class: 'control-label'
+ .controls
+ = f.password_field :password, class: 'input-medium'
+ .control-group
+ .controls
+ %label.checkbox
+ = f.check_box :remember_me
+ = t('common.remember_me')
+ .form-actions
+ = f.submit t('common.login'), class: 'btn btn-primary'
+ = render "links"
View
6 app/views/layouts/_topbar.html.haml
@@ -14,6 +14,6 @@
%ul.dropdown-menu
%li= link_to('我的账户', edit_user_registration_path)
%li= link_to('退出', destroy_user_session_path, :method => :delete)
- - else
- %li= link_to('登录', new_user_session_path)
- %li= link_to('注册', new_user_registration_path)
+ -#- else
+ -#%li= link_to('登录', new_user_session_path)
+ -#%li= link_to('注册', new_user_registration_path)
View
1 app/views/layouts/application.html.haml
@@ -9,3 +9,4 @@
= render 'layouts/topbar'
#page-outer
= yield
+ = render 'layouts/copyright'
View
18 app/views/parties/_form.html.haml
@@ -1,15 +1,17 @@
-= simple_form_for(@party, html: { class: 'form-horizontal', id: 'new-party' }) do |f|
+= simple_form_for(@party, html: { class: 'form-horizontal' }) do |f|
- if @party.errors.any?
#error_explantation.alert.alert-block
%a{ class: 'close', 'data-dismiss' => 'alert'}×
%h4= "存在#{@party.errors.count}个错误导致创建失败"
%ul
- @party.errors.full_messages.each do |msg|
%li= msg
-
- = f.input :topic
- = f.input :date
- = f.input :address
- = f.input :presenter
- = f.input :introduction
- = f.submit '创建聚会'
+ %fieldset
+ = f.input :topic
+ = f.input :date
+ = f.input :address
+ = f.input :presenter
+ = f.input :introduction
+ .form-actions
+ = f.submit t('common.create_party'), class: 'btn-primary'
+ = link_to t('common.cancel'), root_path, class: 'btn'
View
7 app/views/parties/new.html.haml
@@ -1,3 +1,4 @@
-.new-party
- %h2.title 发起新聚会
- = render 'form'
+#page-container.home-container.wrapper
+ .new-party
+ %h2.title= t('common.new_party')
+ = render 'form'
View
3 config/locales/common.zh-CN.yml
@@ -6,3 +6,6 @@
forget_password: '忘记密码?'
have_not_account: '还没有账号?'
register_now: '现在注册'
+ new_party: '发起新聚会'
+ create_party: '创建聚会'
+ cancel: '取消'
View
1 db/seeds.rb
@@ -5,3 +5,4 @@
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
+User.create(nickname: 'zernel', email: 'admin@ruby-tuesday.com', password: '123456' )
View
2 spec/integration/party/create_party_spec.rb
@@ -10,7 +10,7 @@
scenario 'by user' do
visit new_party_path
- within('#new-party') do
+ within('.new-party') do
#select('杭州', :from => 'district')
fill_in 'party_topic', with: 'Javascript MVC'
fill_in 'party_presenter', with: '@nowazhu'

0 comments on commit 8dff5a7

Please sign in to comment.
Something went wrong with that request. Please try again.