Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 14 commits
  • 31 files changed
  • 0 commit comments
  • 1 contributor
View
1 Gemfile
@@ -36,6 +36,7 @@ end
group :development, :test do
gem 'pry'
+ gem 'thin'
gem 'ffaker'
gem 'rspec-rails'
gem 'capybara'
View
53 Gemfile.lock
@@ -37,9 +37,9 @@ GEM
arel (3.0.2)
bcrypt-ruby (3.0.1)
bootstrap-sass (2.0.1)
- bson (1.6.0)
- bson_ext (1.6.0)
- bson (= 1.6.0)
+ bson (1.6.1)
+ bson_ext (1.6.1)
+ bson (~> 1.6.1)
builder (3.0.0)
cancan (1.6.7)
capybara (1.1.2)
@@ -49,7 +49,7 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
- capybara-webkit (0.10.1)
+ capybara-webkit (0.11.0)
capybara (>= 1.0.0, < 1.2)
json
childprocess (0.3.1)
@@ -62,6 +62,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.2.0)
+ daemons (1.1.8)
database_cleaner (0.7.1)
devise (2.0.4)
bcrypt-ruby (~> 3.0)
@@ -70,9 +71,10 @@ GEM
warden (~> 1.1.1)
diff-lcs (1.1.3)
erubis (2.7.0)
+ eventmachine (0.12.10)
execjs (1.3.0)
multi_json (~> 1.0)
- factory_girl (2.6.1)
+ factory_girl (2.6.4)
activesupport (>= 2.3.9)
factory_girl_rails (1.7.0)
factory_girl (~> 2.6.0)
@@ -93,31 +95,31 @@ GEM
thor (~> 0.14)
json (1.6.5)
libv8 (3.3.10.4)
- mail (2.4.1)
+ mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.7.1)
mime-types (1.17.2)
- mongo (1.6.0)
- bson (= 1.6.0)
+ mongo (1.6.1)
+ bson (~> 1.6.1)
mongo-rails-instrumentation (0.2.4)
- mongoid (2.4.5)
+ mongoid (2.4.6)
activemodel (~> 3.1)
mongo (~> 1.3)
tzinfo (~> 0.3.22)
mongoid_auto_increment_id (0.4.0)
mongoid (~> 2.4.0)
multi_json (1.1.0)
- nokogiri (1.5.0)
+ nokogiri (1.5.2)
orm_adapter (0.0.6)
polyglot (0.3.3)
- pry (0.9.8.3)
+ pry (0.9.8.4)
coderay (~> 1.0.5)
method_source (~> 0.7.1)
slop (>= 2.4.4, < 3)
rack (1.4.1)
- rack-cache (1.1)
+ rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
@@ -144,19 +146,19 @@ GEM
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
- rspec (2.8.0)
- rspec-core (~> 2.8.0)
- rspec-expectations (~> 2.8.0)
- rspec-mocks (~> 2.8.0)
- rspec-core (2.8.0)
- rspec-expectations (2.8.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.8.0)
- rspec-rails (2.8.1)
+ rspec (2.9.0)
+ rspec-core (~> 2.9.0)
+ rspec-expectations (~> 2.9.0)
+ rspec-mocks (~> 2.9.0)
+ rspec-core (2.9.0)
+ rspec-expectations (2.9.0)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.9.0)
+ rspec-rails (2.9.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
- rspec (~> 2.8.0)
+ rspec (~> 2.9.0)
rubyzip (0.9.6.1)
sass (3.1.15)
sass-rails (3.2.4)
@@ -184,12 +186,16 @@ GEM
tilt (~> 1.1, != 1.3.0)
therubyracer (0.9.10)
libv8 (~> 3.3.10)
+ thin (1.3.1)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.31)
+ tzinfo (0.3.32)
uglifier (1.2.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
@@ -230,4 +236,5 @@ DEPENDENCIES
simple_form
simplecov
therubyracer
+ thin
uglifier (>= 1.0.3)
View
BIN app/assets/images/city-balcony.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/cricket.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/rails.png
Deleted file not rendered
View
BIN app/assets/images/toolkit-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/wash-white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
15 app/assets/stylesheets/parties.css.scss
@@ -0,0 +1,15 @@
+@import 'mixin';
+
+.new-party {
+ width: 500px;
+ margin: 100px auto;
+ border: solid 1px #DDD;
+ @include rounded-conner(5px);
+ background-color: white;
+ h2.title {
+ @include h2-title
+ }
+ form {
+ padding-top: 20px;
+ }
+}
View
324 app/assets/stylesheets/sites.css.scss
@@ -1,12 +1,322 @@
@import 'mixin';
+html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, cite, code, em, img, small, strike, strong, sub, sup, b, u, i, dl, dt, dd, ol, ul, li, fieldset, form, button, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, embed, figure, figcaption, footer, header, hgroup, nav, section, summary, time, mark, audio, video {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ /*font-size: 100%;*/
+ /*font: inherit;*/
+ vertical-align: baseline;
+}
+
body {
- .content {
- @include rounded-conner(5px);
- width: 940px;
- margin: 0 auto;
- margin-top: 50px;
- *zoom: 1;
- border: solid 1px #ddd;
+ font: 14px/18px "HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif;
+ color: #333;
+ background-position: left 40px;
+ background-attachment: fixed;
+ background-repeat: repeat;
+ background-repeat: no-repeat;
+ background-color: #352726;
+
+ #page-outer {
+ height: 100%;
+ .wrapper {
+ position: relative;
+ width: 940px;
+ min-height: 100%;
+ padding: 54px 14px 15px;
+ margin: 0 auto;
+ background: url(wash-white.png);
+ }
+ #page-container {
+ zoom: 1;
+ .content {
+ @include rounded-conner(5px);
+ width: 940px;
+ margin: 0 auto;
+ margin-top: 50px;
+ *zoom: 1;
+ border: solid 1px #ddd;
+ }
+ .dashboard {
+ float: left;
+ width: 302px;
+ }
+ .content-main {
+ float: right;
+ width: 522px;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+ border-radius: 6px;
+ }
+ }
+ #front-container {
+ display: block;
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ min-height: 545px;
+ max-height: 750px;
+ .front-card {
+ top: 50%;
+ height: 328px;
+ width: 838px;
+ margin: -154px 0 0 -418px;
+ position: absolute;
+ left: 50%;
+ .front-welcome {
+ @include rounded-conner(4px);
+ -webkit-box-shadow: 0 1px 0 rgba(0,0,0,.2),0 0 125px rgba(255,190,43,.35);
+ -moz-box-shadow: 0 1px 0 rgba(0,0,0,.2),0 0 125px rgba(255,190,43,.35);
+ box-shadow: 0 1px 0 rgba(0,0,0,.2),0 0 125px rgba(255,190,43,.35);
+ position: absolute;
+ top: 0;
+ left: 0;
+ display: block;
+ width: 520px;
+ height: 328px;
+ background: black url(city-balcony.jpg) no-repeat left top;
+ border: 0;
+ .front-welcome-text {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 470px;
+ padding: 20px;
+ font-size: 20px;
+ font-weight: 300;
+ line-height: 22px;
+ color: #EEE;
+ text-align: left;
+ text-shadow: black 0 1px 2px;
+ h1 {
+ margin-bottom: 2px;
+ font-size: 25px;
+ font-weight: 700;
+ color: white;
+ display: block;
+ -webkit-margin-before: 0.67em;
+ -webkit-margin-after: 0.67em;
+ -webkit-margin-start: 0px;
+ -webkit-margin-end: 0px;
+ font-weight: bold;
+ }
+ p {
+ display: block;
+ -webkit-margin-before: 1em;
+ -webkit-margin-after: 1em;
+ -webkit-margin-start: 0px;
+ -webkit-margin-end: 0px;
+ }
+ }
+ }
+ .front-signin, .front-signup {
+ @include rounded-conner(4px);
+ background: white;
+ background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,white),color-stop(100%,#DDD));
+ background: -webkit-linear-gradient(top,white 0,#DDD 100%);
+ background: -moz-linear-gradient(top,white 0,#DDD 100%);
+ background: -ms-linear-gradient(top,white 0,#DDD 100%);
+ background: -o-linear-gradient(top,white 0,#DDD 100%);
+ background: linear-gradient(top,white 0,#DDD 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#dddddd',GradientType=0);
+ border-left: solid 1px #EEE;
+ border-right: solid 1px #EEE;
+ border-bottom: solid 1px #CCC;
+ -webkit-box-shadow: 0 1px 0 rgba(0,0,0,.1);
+ -moz-box-shadow: 0 1px 0 rgba(0,0,0,.1);
+ box-shadow: 0 1px 0 rgba(0,0,0,.1);
+ }
+ .front-signin {
+ position: absolute;
+ top: 0;
+ left: 536px;
+ width: 300px;
+ height: 108px;
+ .placeholding-input {
+ height: 30px;
+ }
+ .login-name {
+ position: absolute;
+ top: 12px;
+ left: 12px;
+ width: 276px;
+ color: #999;
+ font-size: 13px;
+ input {
+ width: 266px;
+ }
+ }
+ .password-signin {
+ border-collapse: collapse;
+ border-spacing: 0;
+ position: absolute;
+ top: 48px;
+ left: 12px;
+ width: 276px;
+ }
+ .remember-forgot {
+ position: absolute;
+ top: 82px;
+ left: 12px;
+ margin: 0;
+ width: 276px;
+ .remember {
+ font-size: 11px;
+ line-height: 13px;
+ color: #999;
+ text-shadow: 0 1px 0 rgba(255, 255, 255, .6)
+ }
+ .separator {
+ margin: 0 1px 0 2px;
+ font-weight: bold;
+ color: #999;
+ }
+ .forgot {
+ display: inline;
+ margin: 0;
+ font-size: 11px;
+ line-height: 13px;
+ color: #999;
+ -webkit-text-shadow: 0 1px 0 rgba(255,255,255,.6);
+ -moz-text-shadow: 0 1px 0 rgba(255,255,255,.6);
+ text-shadow: 0 1px 0 rgba(255, 255, 255, .6)
+ }
+ }
+ }
+ .front-signup {
+ position: absolute;
+ top: 121px;
+ left: 536px;
+ width: 300px;
+ height: 206px;
+ h2 {
+ display: block;
+ padding: 0 12px;
+ font-size: 16px;
+ font-weight: 300;
+ color:
+ #777;
+ border-bottom: 1px solid
+ #E2E2E2;
+ -webkit-box-shadow: 0 1px 0
+ white;
+ -moz-box-shadow: 0 1px 0 #fff;
+ box-shadow: 0 1px 0
+ white;
+ -webkit-text-shadow: 0 1px 0 rgba(255,255,255,.6);
+ -moz-text-shadow: 0 1px 0 rgba(255,255,255,.6);
+ text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
+ strong {
+ font-weight: 500;
+ color: #333;
+ font-style: inherit;
+ }
+ }
+ .signup {
+ padding: 10px 0;
+ @include rounded-conner(5px);
+ .placeholding-input {
+ display: block;
+ width: 276px;
+ height: 30px;
+ margin: 5px auto 6px auto;
+ position: relative;
+ overflow: visible;
+ .text-input {
+ width: 266px;
+ height: 20px;
+ border: 1px solid #CCC;
+ -webkit-box-shadow: inset 0 1px 0 #EEE,white 0 1px 0;
+ -moz-box-shadow: inset 0 1px 0 #eee,#fff 0 1px 0;
+ box-shadow: inset 0 1px 0 #eee,#fff 0 1px 0;
+ position: absolute;
+ top: 0;
+ }
+ }
+ .btn {
+ position: absolute;
+ right: 12px;
+ bottom: 12px;
+ height: 30px;
+ padding-left: 12px;
+ padding-right: 12px;
+ margin: 0;
+ -webkit-box-shadow: 0 1px 0 white;
+ -moz-box-shadow: 0 1px 0 #fff;
+ box-shadow: 0 1px 0 white;
+ }
+ .signup-btn {
+ background-color: #FD9A0F;
+ background-repeat: repeat-x;
+ background-image: -moz-linear-gradient(top, #FEE94F 0, #FD9A0F 100%);
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0%, #FEE94F),color-stop(100%,#FD9A0F));
+ background-image: -webkit-linear-gradient(top, #FEE94F 0, #FD9A0F 100%);
+ background-image: -ms-linear-gradient(top, #FEE94F 0, #FD9A0F 100%);
+ background-image: -o-linear-gradient(top,#FEE94F 0,#FD9A0F 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fee94f',endColorstr='#fd9a0f',GradientType=0);
+ background-image: linear-gradient(top, #FEE94F 0, #FD9A0F 100%);
+ border-color: #FA2;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+.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;
+}
+.flex-table-secondary {
+ width: 1%;
+ max-width: 1%;
+}
+
+#toolkit {
+ padding: 0;
+ padding-top: 5px;
+ b {
+ margin-top: 15px;
+ }
+ img {
+ width: 30px;
+ height: 30px;
}
}
+
+.devise {
+ .sign-in, .sign-up, .edit-user {
+ background-color: white;
+ }
+}
+
+.clear {
+ clear: both;
+}
View
30 app/controllers/parties_controller.rb
@@ -18,7 +18,7 @@ def create
format.html { redirect_to @party, notice: '成功发起聚会' }
format.json { render json: @party, status: :created, location: @party }
else
- format.html { render aciton: 'new'}
+ format.html { render aciton: 'new' }
format.json { render json: @party.errors, status: :unprocessable_entity }
end
end
@@ -32,4 +32,32 @@ def show
format.json { render json: @party }
end
end
+
+ def edit
+ @party = Party.find(params[:id])
+ end
+
+ def update
+ @party = Party.find(params[:id])
+
+ respond_to do |format|
+ if @party.update_attributes(params[:party])
+ format.html { redirect_to @party, notice: '成功更新聚会信息' }
+ format.json { head :no_content }
+ else
+ format.html { render aciton: 'edit'}
+ format.json { render json: @party.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ def destroy
+ @party = Party.find(params[:id])
+ @party.destroy
+
+ respond_to do |format|
+ format.html { redirect_to parties_url }
+ format.json { head :no_content }
+ end
+ end
end
View
1 app/controllers/sites_controller.rb
@@ -1,4 +1,5 @@
class SitesController < ApplicationController
def index
+ render action: :welcome unless user_signed_in?
end
end
View
4 app/models/party.rb
@@ -6,4 +6,8 @@ class Party
field :date, :type => String
field :address, :type => String
field :introduction
+
+ validates :topic, presence: true
+ validates :date, presence: true
+ validates :address, presence: true
end
View
5 app/models/user.rb
@@ -1,11 +1,12 @@
class User
include Mongoid::Document
# Include default devise modules. Others available are:
- # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
+ # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable, :validatable and :omniauthable
devise :database_authenticatable, :registerable,
- :recoverable, :rememberable, :trackable, :validatable
+ :recoverable, :rememberable, :trackable
## Database authenticatable
+ field :nickname, :type => String, :null => false, :default => ""
field :email, :type => String, :null => false, :default => ""
field :encrypted_password, :type => String, :null => false, :default => ""
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
7 app/views/layouts/_copyright.html.haml
@@ -0,0 +1,7 @@
+.footer
+ %ul
+ %li= link_to 'About', '#'
+ %li= link_to 'Blog', '#'
+ %li= link_to 'Blog', '#'
+ %li
+ %span.copyright &copy; 2012 Twitter Bootstrap & Zernel
View
0 app/views/layouts/_footer.html.haml
No changes.
View
14 app/views/layouts/_topbar.html.haml
@@ -3,17 +3,17 @@
.container
= link_to 'Ruby Tuesday', root_path, class: 'brand'
.nav-collapse
- %ul.nav
- %li= link_to '社区', root_path
+ -#%ul.nav
+ -#%li= link_to '社区', root_path
%ul.nav.pull-right
- if user_signed_in?
%li.dropdown
- %a{ href: '#', class: 'dropdown-toggle', 'data-toggle' => 'dropdown'}<
- 系统管理
+ %a{ href: '#', class: 'dropdown-toggle', id: 'toolkit', 'data-toggle' => 'dropdown'}<
+ = image_tag 'toolkit-icon.png'
%b.caret
%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
5 app/views/layouts/application.html.haml
@@ -7,5 +7,6 @@
= csrf_meta_tags
%body
= render 'layouts/topbar'
- = yield
- = render 'layouts/footer'
+ #page-outer
+ = yield
+ = render 'layouts/copyright'
View
17 app/views/parties/_form.html.haml
@@ -0,0 +1,17 @@
+= 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
+ %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
12 app/views/parties/new.html.haml
@@ -1,8 +1,4 @@
-.new-party
- = simple_form_for(@party, html: { class: 'form-horizontal', id: 'new-party' }) do |f|
- = f.input :topic
- = f.input :presenter
- = f.input :date
- = f.input :address
- = f.input :introduction
- = f.submit '创建聚会'
+#page-container.home-container.wrapper
+ .new-party
+ %h2.title= t('common.new_party')
+ = render 'form'
View
8 app/views/sites/index.html.haml
@@ -1,3 +1,5 @@
-.content
- %h1 Sites#index
- %p Find me in app/views/sites/index.html.haml
+#page-container.home-container.wrapper
+ .dashboard
+ %h1 Sites#index
+ .content-main
+ %p Find me in app/views/sites/index.html.haml
View
9 app/views/sites/welcome.html.haml
@@ -0,0 +1,9 @@
+#front-container
+ .front-card
+ .front-welcome
+ .front-welcome-text
+ %h1 Welcome to Ruby Tuesday
+ %p Ruby-Tuesday is a light weight plaform for rubyist organize the Ruby-Tuesday party. It is in developing.
+ = render 'sites/welcome/signin_form'
+ = render 'sites/welcome/signup_form'
+ = render 'layouts/copyright'
View
18 app/views/sites/welcome/_signin_form.html.haml
@@ -0,0 +1,18 @@
+.front-signin
+ = form_tag user_session_path, class: 'signin' do
+ .placeholding-input.login-name
+ = text_field_tag 'user[email]', nil, class: 'email-input', placeholder: t('mongoid.attributes.user.email')
+ %table.flex-table.password-signin
+ %tbody
+ %tr
+ %td.flex-table-primary
+ .placeholding-input.password.flex-table-form
+ = password_field_tag 'user[password]', nil, class: 'text-input flex-table-input', placeholder: t('mongoid.attributes.user.password')
+ %td.flex-table-secondary
+ %input.btn-info{ type: 'submit', value: t('common.login') }
+ .remember-forgot
+ %label.remember.checkbox
+ = check_box_tag 'user[remember_me]'
+ %span= t('common.remember_me')
+ %span.separator ·
+ = link_to t('common.forget_password'), new_password_path('user'), class: 'forgot'
View
12 app/views/sites/welcome/_signup_form.html.haml
@@ -0,0 +1,12 @@
+.front-signup
+ %h2<
+ %strong= t('common.have_not_account')
+ = t('common.register_now')
+ = form_tag user_registration_path, class: 'signup' do
+ .placeholding-input
+ = text_field_tag 'user[nickname]', nil, class: 'text-input', autocomplete: 'off', placeholder: t('mongoid.attributes.user.nickname')
+ .placeholding-input
+ = text_field_tag 'user[email]', nil, class: 'text-input email-input', autocomplete: 'off', placeholder: t('mongoid.attributes.user.email')
+ .placeholding-input
+ = password_field_tag 'user[password]', nil, class: 'text-input', placeholder: t('mongoid.attributes.user.password')
+ %input{ type: 'submit', class: 'btn signup-btn', value: t('common.register') }
View
6 config/locales/common.zh-CN.yml
@@ -3,3 +3,9 @@
register: '注册'
login: '登录'
remember_me: '记住我'
+ forget_password: '忘记密码?'
+ have_not_account: '还没有账号?'
+ register_now: '现在注册'
+ new_party: '发起新聚会'
+ create_party: '创建聚会'
+ cancel: '取消'
View
8 config/locales/mongoid.zh-CN.yml
@@ -5,13 +5,13 @@
attributes:
user:
name: "名字"
- login: "用户名"
- email: "Email"
+ nickname: "昵称"
+ email: "电子邮箱"
avatar: "头像"
location: "城市"
bio: "个人介绍"
- password: "密码"
- password_confirmation: "确认密码"
+ password: "登录密码"
+ password_confirmation: "确认登录密码"
website: "个人主页"
last_logined_at: "上次登录时间"
tagline: "签名"
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
1 spec/controllers/parties_controller_spec.rb
@@ -18,6 +18,7 @@
it { should respond_with_content_type /json/ }
end
+
describe 'POST create' do
context 'with valid params' do
before(:each) do
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'

No commit comments for this range

Something went wrong with that request. Please try again.