Revert ff82391b7d0d17c17568ed21176b8b0112a34e31^..HEAD

This commit is contained in:
Matthew Kaito Juyuan Fu committed 2011-10-20 10:06:06 +08:00
1 parent ff82391b7d
commit cb07a35cc9
97 files changed
+1037 -79

No files matched your search

+3 -1
View File
@@ -3,6 +3,8 @@ source "http://rubygems.org"
# Declare your gem's dependencies in NewBlog.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gem "mongoid"
gemspec
# Declare any dependencies that are still in development here instead of in
@@ -11,4 +13,4 @@ gemspec
# your gem to rubygems.org.
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
+101
View File
@@ -0,0 +1,101 @@
PATH
remote: .
specs:
NewBlog (0.0.1)
rails (~> 3.1.0.rc6)
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.0)
actionpack (= 3.1.0)
mail (~> 2.3.0)
actionpack (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
rack-cache (~> 1.0.3)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.0)
activemodel (3.1.0)
activesupport (= 3.1.0)
bcrypt-ruby (~> 3.0.0)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activeresource (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
activesupport (3.1.0)
multi_json (~> 1.0)
arel (2.2.1)
bcrypt-ruby (3.0.0)
bson (1.3.1)
builder (3.0.0)
erubis (2.7.0)
hike (1.2.1)
i18n (0.6.0)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
mongo (1.3.1)
bson (>= 1.3.1)
mongoid (2.1.9)
activemodel (~> 3.0)
mongo (~> 1.3)
tzinfo (~> 0.3.22)
multi_json (1.0.3)
polyglot (0.3.2)
rack (1.3.2)
rack-cache (1.0.3)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.0)
actionmailer (= 3.1.0)
actionpack (= 3.1.0)
activerecord (= 3.1.0)
activeresource (= 3.1.0)
activesupport (= 3.1.0)
bundler (~> 1.0)
railties (= 3.1.0)
railties (3.1.0)
actionpack (= 3.1.0)
activesupport (= 3.1.0)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2)
rdoc (3.9.4)
sprockets (2.0.0)
hike (~> 1.2)
rack (~> 1.0)
tilt (!= 1.3.0, ~> 1.1)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.29)
PLATFORMS
ruby
DEPENDENCIES
NewBlog!
mongoid
+1 -1
View File
@@ -19,5 +19,5 @@ Gem::Specification.new do |s|
s.add_dependency "rails", "~> 3.1.0.rc6"
# s.add_dependency "jquery-rails"
s.add_development_dependency "sqlite3"
#s.add_development_dependency "sqlite3"
end
@@ -0,0 +1,7 @@
/*
*This is a manifest file that'll automatically include all the stylesheets available in this directory
*and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
*the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require_tree .
*/
@@ -0,0 +1,9 @@
.preview h2 {
font-size: large;
background-color: red;
}
.production h2 {
font-size: large;
background-color: green;
}
@@ -4,6 +4,14 @@ class Panel::Blog::PostsController < ApplicationController
# GET /posts
# GET /posts.xml
def widget_index
@posts = Post.all
widget_default_layout
end
def widget_latest_post
@post = Post.all.last
widget_default_layout
end
def index
@posts = Post.all
@@ -84,3 +92,20 @@ class Panel::Blog::PostsController < ApplicationController
end
end
end
def widget_default_layout
respond_to do |format|
format.html {
if params[:edit_view]
#in the case of editing,should be displayed in modal window and
#be restricted by the border developer sat.
render :layout => 'admin'
else
#in the case of fetching data for ajax display,should
render :layout => 'production'
end
}
format.xml { render :xml => @posts }
end
end
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Blog</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
</head>
<body class="edit preview">
<div class="wapper">
<%= yield %>
</div>
</body>
</html>
@@ -0,0 +1,4 @@
<%= stylesheet_link_tag "production"%>
<div class="wapper">
<%= yield %>
</div>
@@ -0,0 +1,5 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<h2><%=@post.title%></h2>
<p>
<%= @post.body%>
</p>
@@ -0,0 +1,14 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<table>
<tr>
<th><%= t('blog.title') %></th>
<th><%= t('blog.body') %></th>
</tr>
<% @posts.each do |post| %>
<tr>
<td><%= post.title %></td>
<td><%= post.body.truncate(14) %></td>
</tr>
<% end %>
</table>
@@ -0,0 +1,5 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<h1><%= @post.title %> </h1>
<p>
<%= @post.body %>
</p>
+3
View File
@@ -2,8 +2,11 @@ Rails.application.routes.draw do
namespace :panel do
namespace :blog do
root :to => "posts#index"
resources :posts
resources :comments
match "widget_latest_post" => "posts#widget_latest_post"
match "widget_index" => "posts#widget_index"
end
end
+1
View File
@@ -1,4 +1,5 @@
require "NewBlog/engine"
module NewBlog
end
+2
View File
@@ -1,4 +1,6 @@
module NewBlog
class Engine < Rails::Engine
isolate_namespace NewBlog
PrototypeR4::Application::Orbit_Apps << "NewBlog"
end
end
+5 -1
View File
@@ -1,6 +1,10 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "rails/test_unit/railtie"
require "sprockets/railtie" # Uncomment this line for Rails 3.1+
Bundler.require
require "NewBlog"
+1
View File
@@ -0,0 +1 @@
../../../../../../../orbit/config/mongoid.yml
Binary file not shown.