Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update the locales of new party

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