diff --git a/Gemfile b/Gemfile index da253f7..f1e3dfb 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'http://ruby.taobao.org' -gem 'rails', '3.2.6' +gem 'rails', '3.2.3' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' diff --git a/Gemfile.lock b/Gemfile.lock index 5119d5b..9de07a4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,37 +1,38 @@ GEM remote: http://ruby.taobao.org/ specs: - actionmailer (3.2.6) - actionpack (= 3.2.6) + actionmailer (3.2.3) + actionpack (= 3.2.3) mail (~> 2.4.4) - actionpack (3.2.6) - activemodel (= 3.2.6) - activesupport (= 3.2.6) + actionpack (3.2.3) + activemodel (= 3.2.3) + activesupport (= 3.2.3) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.1) rack (~> 1.4.0) rack-cache (~> 1.2) rack-test (~> 0.6.1) - sprockets (~> 2.1.3) - activemodel (3.2.6) - activesupport (= 3.2.6) + sprockets (~> 2.1.2) + activemodel (3.2.3) + activesupport (= 3.2.3) builder (~> 3.0.0) - activerecord (3.2.6) - activemodel (= 3.2.6) - activesupport (= 3.2.6) + activerecord (3.2.3) + activemodel (= 3.2.3) + activesupport (= 3.2.3) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.6) - activemodel (= 3.2.6) - activesupport (= 3.2.6) - activesupport (3.2.6) + activeresource (3.2.3) + activemodel (= 3.2.3) + activesupport (= 3.2.3) + activesupport (3.2.3) i18n (~> 0.6) multi_json (~> 1.0) + addressable (2.2.8) arel (3.0.2) - bson (1.6.0) - bson_ext (1.6.0) - bson (= 1.6.0) + bson (1.6.4) + bson_ext (1.6.4) + bson (~> 1.6.4) builder (3.0.0) capybara (1.1.2) mime-types (>= 1.16) @@ -40,7 +41,7 @@ GEM rack-test (>= 0.5.4) selenium-webdriver (~> 2.0) xpath (~> 0.1.4) - childprocess (0.3.1) + childprocess (0.3.2) ffi (~> 1.0.6) coffee-rails (3.2.2) coffee-script (>= 2.2.0) @@ -49,12 +50,11 @@ GEM coffee-script-source execjs coffee-script-source (1.3.3) - cucumber (1.1.9) + cucumber (1.2.1) builder (>= 2.1.2) - diff-lcs (>= 1.1.2) - gherkin (~> 2.9.0) + diff-lcs (>= 1.1.3) + gherkin (~> 2.11.0) json (>= 1.4.6) - term-ansicolor (>= 1.0.6) cucumber-rails (1.3.0) capybara (>= 1.1.2) cucumber (>= 1.1.8) @@ -63,10 +63,10 @@ GEM erubis (2.7.0) execjs (1.4.0) multi_json (~> 1.0) - factory_girl (2.6.0) - activesupport (>= 2.3.9) + factory_girl (3.5.0) + activesupport (>= 3.0.0) ffi (1.0.11) - gherkin (2.9.0) + gherkin (2.11.0) json (>= 1.4.6) hike (1.2.1) i18n (0.6.0) @@ -75,23 +75,26 @@ GEM railties (>= 3.2.0, < 5.0) thor (~> 0.14) json (1.7.3) - json_pure (1.6.5) + libwebsocket (0.1.3) + addressable mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.19) - mongo (1.6.0) - bson (= 1.6.0) - mongoid (2.4.11) + mongoid (3.0.0.rc) activemodel (~> 3.1) - mongo (<= 1.6.2) + moped (~> 1.0.0.rc) + origin (~> 1.0.0.rc) tzinfo (~> 0.3.22) - mongoid-rspec (1.4.4) - mongoid (~> 2.0) - rspec (~> 2) + mongoid-rspec (1.4.6) + mongoid (>= 3.0.0.rc) + rake + rspec (>= 2.9) + moped (1.0.0.rc) multi_json (1.3.6) - nokogiri (1.5.2) + nokogiri (1.5.4) + origin (1.0.1) polyglot (0.3.3) rack (1.4.1) rack-cache (1.2) @@ -100,54 +103,53 @@ GEM rack rack-test (0.6.1) rack (>= 1.0) - rails (3.2.6) - actionmailer (= 3.2.6) - actionpack (= 3.2.6) - activerecord (= 3.2.6) - activeresource (= 3.2.6) - activesupport (= 3.2.6) + rails (3.2.3) + actionmailer (= 3.2.3) + actionpack (= 3.2.3) + activerecord (= 3.2.3) + activeresource (= 3.2.3) + activesupport (= 3.2.3) bundler (~> 1.0) - railties (= 3.2.6) - railties (3.2.6) - actionpack (= 3.2.6) - activesupport (= 3.2.6) + railties (= 3.2.3) + railties (3.2.3) + actionpack (= 3.2.3) + activesupport (= 3.2.3) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) + thor (~> 0.14.6) 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.10.0) + rspec-core (~> 2.10.0) + rspec-expectations (~> 2.10.0) + rspec-mocks (~> 2.10.0) + rspec-core (2.10.1) + rspec-expectations (2.10.0) + diff-lcs (~> 1.1.3) + rspec-mocks (2.10.1) + rspec-rails (2.10.1) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec (~> 2.8.0) - rubyzip (0.9.6.1) + rspec (~> 2.10.0) + rubyzip (0.9.9) sass (3.1.19) sass-rails (3.2.5) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - selenium-webdriver (2.13.0) - childprocess (>= 0.2.1) - ffi (~> 1.0.9) - json_pure + selenium-webdriver (2.24.0) + childprocess (>= 0.2.5) + libwebsocket (~> 0.1.3) + multi_json (~> 1.0) rubyzip sprockets (2.1.3) hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - term-ansicolor (1.0.7) - thor (0.15.3) + thor (0.14.6) tilt (1.3.3) treetop (1.4.10) polyglot @@ -171,7 +173,7 @@ DEPENDENCIES jquery-rails mongoid mongoid-rspec - rails (= 3.2.6) + rails (= 3.2.3) rspec-rails sass-rails (~> 3.2.3) uglifier (>= 1.0.3) diff --git a/app/assets/images/bg_fn_blog.png b/app/assets/images/bg_fn_blog.png new file mode 100644 index 0000000..13abf69 Binary files /dev/null and b/app/assets/images/bg_fn_blog.png differ diff --git a/app/assets/images/bg_fn_blog_corner.png b/app/assets/images/bg_fn_blog_corner.png new file mode 100644 index 0000000..fcda1f8 Binary files /dev/null and b/app/assets/images/bg_fn_blog_corner.png differ diff --git a/app/assets/javascripts/blogs.js.coffee b/app/assets/javascripts/blogs.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/blogs.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 3192ec8..f2f4d6e 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -11,3 +11,52 @@ *= require_self *= require_tree . */ + +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/app/assets/stylesheets/blogs.css.scss b/app/assets/stylesheets/blogs.css.scss new file mode 100644 index 0000000..8c4f941 --- /dev/null +++ b/app/assets/stylesheets/blogs.css.scss @@ -0,0 +1,34 @@ +// Place all the styles related to the blogs controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ + +div.blog { + background: url('bg_fn_blog_corner.png') no-repeat; + padding: 2em 19px; + width: 641px; + border-radius: 5px; + border: 1px solid #E6E6E6; + h2 { + font-size: 40px; + margin-bottom: 19px; + a { + text-decoration: none; + &:hover { + strong { + display: inline; + } + } + strong { + font-size: 10px; + line-height: 40px; + margin-left: 1em; + display: none; + } + } + } +} +div.bottom { + background: url('bg_fn_blog.png') no-repeat; + height: 40px; + width: 679px; +} diff --git a/app/assets/stylesheets/global.css.scss b/app/assets/stylesheets/global.css.scss new file mode 100644 index 0000000..0f996c3 --- /dev/null +++ b/app/assets/stylesheets/global.css.scss @@ -0,0 +1,4 @@ +.container { + width: 1100px; + margin: 0 auto; +} diff --git a/app/assets/stylesheets/head.css.scss b/app/assets/stylesheets/head.css.scss new file mode 100644 index 0000000..59b3033 --- /dev/null +++ b/app/assets/stylesheets/head.css.scss @@ -0,0 +1,43 @@ +div.head { + margin-bottom: 2em; + background-color: #EFEFEF; + border-bottom: 1px solid #E6E6E6; + margin: 0 auto 1em; + div.container { + .descrip { + margin-left: 2em; + } + ul.nav { + list-style: none; + display: inline-block; + li { + display: inline-block; + margin-right: 0.3em; + width: 78px; + a { + display: block; + padding: 40px 0 10px 10px; + background-color: black; + color: white; + text-decoration: none; + strong { + display: block; + margin-top: 8px; + } + } + a#home { + background-color: #333; + } + a#tech { + background-color: #224b8f; + } + a#life { + background-color: #f15b6c; + } + a#creator { + background-color: #78cdd1; + } + } + } + } +} diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb new file mode 100644 index 0000000..a776700 --- /dev/null +++ b/app/controllers/blogs_controller.rb @@ -0,0 +1,8 @@ +class BlogsController < ApplicationController + def index + @posts = Post.all + end + + def show + end +end diff --git a/app/helpers/blogs_helper.rb b/app/helpers/blogs_helper.rb new file mode 100644 index 0000000..cc0dbd2 --- /dev/null +++ b/app/helpers/blogs_helper.rb @@ -0,0 +1,2 @@ +module BlogsHelper +end diff --git a/app/models/posts.rb b/app/models/post.rb similarity index 69% rename from app/models/posts.rb rename to app/models/post.rb index 27d2246..d13c755 100644 --- a/app/models/posts.rb +++ b/app/models/post.rb @@ -1,6 +1,5 @@ -class Posts +class Post include Mongoid::Document field :title, :type => String field :content, :type => String - field :type, :type => String end diff --git a/app/views/blogs/_post.html.erb b/app/views/blogs/_post.html.erb new file mode 100644 index 0000000..22e598a --- /dev/null +++ b/app/views/blogs/_post.html.erb @@ -0,0 +1,5 @@ +
Find me in app/views/blogs/show.html.erb
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ecd53e4..e460d95 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,14 +1,29 @@ -