governor 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +123 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +28 -0
- data/Rakefile +50 -0
- data/VERSION +1 -0
- data/app/controllers/governor/articles_controller.rb +94 -0
- data/app/helpers/governor_helper.rb +26 -0
- data/app/views/governor/articles/_article.html.erb +11 -0
- data/app/views/governor/articles/_form.html.erb +28 -0
- data/app/views/governor/articles/edit.html.erb +6 -0
- data/app/views/governor/articles/index.html.erb +4 -0
- data/app/views/governor/articles/new.html.erb +5 -0
- data/app/views/governor/articles/show.html.erb +10 -0
- data/config/locales/en.yml +6 -0
- data/governor.gemspec +198 -0
- data/lib/generators/USAGE +8 -0
- data/lib/generators/governor/create_articles_generator.rb +40 -0
- data/lib/generators/governor/install_generator.rb +9 -0
- data/lib/generators/governor/migrate_generator.rb +25 -0
- data/lib/generators/governor/templates/governor.rb +22 -0
- data/lib/generators/governor/templates/migrations/create_articles.rb +15 -0
- data/lib/generators/governor/templates/models/article.rb +3 -0
- data/lib/governor.rb +32 -0
- data/lib/governor/article.rb +26 -0
- data/lib/governor/controllers/helpers.rb +58 -0
- data/lib/governor/formatters.rb +43 -0
- data/lib/governor/mapping.rb +32 -0
- data/lib/governor/plugin.rb +13 -0
- data/lib/governor/plugin_manager.rb +20 -0
- data/lib/governor/rails.rb +7 -0
- data/lib/governor/rails/routes.rb +12 -0
- data/lib/tasks/.gitkeep +0 -0
- data/script/rails +6 -0
- data/spec/controllers/governor/articles_controller_spec.rb +64 -0
- data/spec/governor/article_spec.rb +28 -0
- data/spec/governor/plugin_manager_spec.rb +11 -0
- data/spec/governor_spec.rb +40 -0
- data/spec/rails_app/.gitignore +4 -0
- data/spec/rails_app/Gemfile +38 -0
- data/spec/rails_app/Gemfile.lock +91 -0
- data/spec/rails_app/README +256 -0
- data/spec/rails_app/Rakefile +7 -0
- data/spec/rails_app/app/controllers/application_controller.rb +3 -0
- data/spec/rails_app/app/controllers/home_controller.rb +2 -0
- data/spec/rails_app/app/helpers/application_helper.rb +2 -0
- data/spec/rails_app/app/helpers/home_helper.rb +2 -0
- data/spec/rails_app/app/models/article.rb +5 -0
- data/spec/rails_app/app/models/user.rb +9 -0
- data/spec/rails_app/app/views/home/index.html.erb +0 -0
- data/spec/rails_app/app/views/layouts/application.html.erb +14 -0
- data/spec/rails_app/config.ru +4 -0
- data/spec/rails_app/config/application.rb +42 -0
- data/spec/rails_app/config/boot.rb +14 -0
- data/spec/rails_app/config/database.yml +19 -0
- data/spec/rails_app/config/environment.rb +5 -0
- data/spec/rails_app/config/environments/development.rb +26 -0
- data/spec/rails_app/config/environments/production.rb +49 -0
- data/spec/rails_app/config/environments/test.rb +35 -0
- data/spec/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails_app/config/initializers/devise.rb +142 -0
- data/spec/rails_app/config/initializers/governor.rb +1 -0
- data/spec/rails_app/config/initializers/inflections.rb +10 -0
- data/spec/rails_app/config/initializers/mime_types.rb +5 -0
- data/spec/rails_app/config/initializers/secret_token.rb +7 -0
- data/spec/rails_app/config/initializers/session_store.rb +8 -0
- data/spec/rails_app/config/locales/devise.en.yml +39 -0
- data/spec/rails_app/config/locales/en.yml +5 -0
- data/spec/rails_app/config/routes.rb +64 -0
- data/spec/rails_app/db/migrate/20110329032256_devise_create_users.rb +26 -0
- data/spec/rails_app/db/migrate/20110330020108_governor_create_articles.rb +15 -0
- data/spec/rails_app/db/schema.rb +45 -0
- data/spec/rails_app/db/seeds.rb +7 -0
- data/spec/rails_app/lib/tasks/.gitkeep +0 -0
- data/spec/rails_app/public/404.html +26 -0
- data/spec/rails_app/public/422.html +26 -0
- data/spec/rails_app/public/500.html +26 -0
- data/spec/rails_app/public/favicon.ico +0 -0
- data/spec/rails_app/public/images/rails.png +0 -0
- data/spec/rails_app/public/javascripts/application.js +2 -0
- data/spec/rails_app/public/javascripts/controls.js +965 -0
- data/spec/rails_app/public/javascripts/dragdrop.js +974 -0
- data/spec/rails_app/public/javascripts/effects.js +1123 -0
- data/spec/rails_app/public/javascripts/prototype.js +6001 -0
- data/spec/rails_app/public/javascripts/rails.js +191 -0
- data/spec/rails_app/public/robots.txt +5 -0
- data/spec/rails_app/public/stylesheets/.gitkeep +0 -0
- data/spec/rails_app/script/rails +6 -0
- data/spec/rails_app/spec/factories.rb +11 -0
- data/spec/rails_app/vendor/plugins/.gitkeep +0 -0
- data/spec/spec_helper.rb +21 -0
- metadata +367 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rails', '~> 3.0.5'
|
4
|
+
|
5
|
+
group :development, :test do
|
6
|
+
gem 'jeweler', '~> 1.5.2'
|
7
|
+
gem 'sqlite3'
|
8
|
+
gem 'rspec-rails'
|
9
|
+
gem 'mocha'
|
10
|
+
gem 'factory_girl', '~> 2.0.0.beta'
|
11
|
+
gem 'factory_girl_rails', '~> 1.1.beta'
|
12
|
+
gem 'activerecord-nulldb-adapter'
|
13
|
+
|
14
|
+
gem 'will_paginate', '~> 3.0.beta'
|
15
|
+
gem 'devise'
|
16
|
+
gem 'governor', :path => './'
|
17
|
+
gem 'dynamic_form'
|
18
|
+
end
|
19
|
+
# group :development do
|
20
|
+
# gem "rspec", "~> 2.3.0"
|
21
|
+
# gem "bundler", "~> 1.0.0"
|
22
|
+
# gem "jeweler", "~> 1.5.2"
|
23
|
+
# gem "rcov", ">= 0"
|
24
|
+
# end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ./
|
3
|
+
specs:
|
4
|
+
governor (0.0.0)
|
5
|
+
rails (~> 3.0.5)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
abstract (1.0.0)
|
11
|
+
actionmailer (3.0.5)
|
12
|
+
actionpack (= 3.0.5)
|
13
|
+
mail (~> 2.2.15)
|
14
|
+
actionpack (3.0.5)
|
15
|
+
activemodel (= 3.0.5)
|
16
|
+
activesupport (= 3.0.5)
|
17
|
+
builder (~> 2.1.2)
|
18
|
+
erubis (~> 2.6.6)
|
19
|
+
i18n (~> 0.4)
|
20
|
+
rack (~> 1.2.1)
|
21
|
+
rack-mount (~> 0.6.13)
|
22
|
+
rack-test (~> 0.5.7)
|
23
|
+
tzinfo (~> 0.3.23)
|
24
|
+
activemodel (3.0.5)
|
25
|
+
activesupport (= 3.0.5)
|
26
|
+
builder (~> 2.1.2)
|
27
|
+
i18n (~> 0.4)
|
28
|
+
activerecord (3.0.5)
|
29
|
+
activemodel (= 3.0.5)
|
30
|
+
activesupport (= 3.0.5)
|
31
|
+
arel (~> 2.0.2)
|
32
|
+
tzinfo (~> 0.3.23)
|
33
|
+
activerecord-nulldb-adapter (0.2.1)
|
34
|
+
activerecord (>= 2.0.0, < 3.1)
|
35
|
+
activeresource (3.0.5)
|
36
|
+
activemodel (= 3.0.5)
|
37
|
+
activesupport (= 3.0.5)
|
38
|
+
activesupport (3.0.5)
|
39
|
+
arel (2.0.9)
|
40
|
+
bcrypt-ruby (2.1.4)
|
41
|
+
builder (2.1.2)
|
42
|
+
devise (1.1.7)
|
43
|
+
bcrypt-ruby (~> 2.1.2)
|
44
|
+
warden (~> 1.0.2)
|
45
|
+
diff-lcs (1.1.2)
|
46
|
+
dynamic_form (1.1.3)
|
47
|
+
erubis (2.6.6)
|
48
|
+
abstract (>= 1.0.0)
|
49
|
+
factory_girl (2.0.0.beta2)
|
50
|
+
factory_girl_rails (1.1.beta1)
|
51
|
+
factory_girl (~> 2.0.0.beta)
|
52
|
+
rails (>= 3.0.0)
|
53
|
+
git (1.2.5)
|
54
|
+
i18n (0.5.0)
|
55
|
+
jeweler (1.5.2)
|
56
|
+
bundler (~> 1.0.0)
|
57
|
+
git (>= 1.2.5)
|
58
|
+
rake
|
59
|
+
mail (2.2.15)
|
60
|
+
activesupport (>= 2.3.6)
|
61
|
+
i18n (>= 0.4.0)
|
62
|
+
mime-types (~> 1.16)
|
63
|
+
treetop (~> 1.4.8)
|
64
|
+
mime-types (1.16)
|
65
|
+
mocha (0.9.12)
|
66
|
+
polyglot (0.3.1)
|
67
|
+
rack (1.2.1)
|
68
|
+
rack-mount (0.6.13)
|
69
|
+
rack (>= 1.0.0)
|
70
|
+
rack-test (0.5.7)
|
71
|
+
rack (>= 1.0)
|
72
|
+
rails (3.0.5)
|
73
|
+
actionmailer (= 3.0.5)
|
74
|
+
actionpack (= 3.0.5)
|
75
|
+
activerecord (= 3.0.5)
|
76
|
+
activeresource (= 3.0.5)
|
77
|
+
activesupport (= 3.0.5)
|
78
|
+
bundler (~> 1.0)
|
79
|
+
railties (= 3.0.5)
|
80
|
+
railties (3.0.5)
|
81
|
+
actionpack (= 3.0.5)
|
82
|
+
activesupport (= 3.0.5)
|
83
|
+
rake (>= 0.8.7)
|
84
|
+
thor (~> 0.14.4)
|
85
|
+
rake (0.8.7)
|
86
|
+
rspec (2.5.0)
|
87
|
+
rspec-core (~> 2.5.0)
|
88
|
+
rspec-expectations (~> 2.5.0)
|
89
|
+
rspec-mocks (~> 2.5.0)
|
90
|
+
rspec-core (2.5.1)
|
91
|
+
rspec-expectations (2.5.0)
|
92
|
+
diff-lcs (~> 1.1.2)
|
93
|
+
rspec-mocks (2.5.0)
|
94
|
+
rspec-rails (2.5.0)
|
95
|
+
actionpack (~> 3.0)
|
96
|
+
activesupport (~> 3.0)
|
97
|
+
railties (~> 3.0)
|
98
|
+
rspec (~> 2.5.0)
|
99
|
+
sqlite3 (1.3.3)
|
100
|
+
thor (0.14.6)
|
101
|
+
treetop (1.4.9)
|
102
|
+
polyglot (>= 0.3.1)
|
103
|
+
tzinfo (0.3.24)
|
104
|
+
warden (1.0.3)
|
105
|
+
rack (>= 1.0.0)
|
106
|
+
will_paginate (3.0.pre2)
|
107
|
+
|
108
|
+
PLATFORMS
|
109
|
+
ruby
|
110
|
+
|
111
|
+
DEPENDENCIES
|
112
|
+
activerecord-nulldb-adapter
|
113
|
+
devise
|
114
|
+
dynamic_form
|
115
|
+
factory_girl (~> 2.0.0.beta)
|
116
|
+
factory_girl_rails (~> 1.1.beta)
|
117
|
+
governor!
|
118
|
+
jeweler (~> 1.5.2)
|
119
|
+
mocha
|
120
|
+
rails (~> 3.0.5)
|
121
|
+
rspec-rails
|
122
|
+
sqlite3
|
123
|
+
will_paginate (~> 3.0.beta)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Liam Morley
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
Governor
|
2
|
+
========
|
3
|
+
|
4
|
+
**Governor** (named after Rod Blagojevich) is the pluggable blogging platform
|
5
|
+
for Rails, built for people who want to build their blog into their website,
|
6
|
+
not build their website into their blog.
|
7
|
+
|
8
|
+
I'm just getting started, but feel free to poke around. I'm sure that when
|
9
|
+
this starts getting functional, I'll write some setup documentation here. And
|
10
|
+
try the specs, they're fresh!
|
11
|
+
|
12
|
+
Contributing to Governor
|
13
|
+
------------------------
|
14
|
+
|
15
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
16
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
17
|
+
* Fork the project
|
18
|
+
* Start a feature/bugfix branch
|
19
|
+
* Commit and push until you are happy with your contribution
|
20
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
21
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
22
|
+
|
23
|
+
Copyright
|
24
|
+
---------
|
25
|
+
|
26
|
+
Copyright © 2011 Liam Morley. See LICENSE.txt for
|
27
|
+
further details.
|
28
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "governor"
|
16
|
+
gem.homepage = "http://github.com/carpeliam/governor"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %Q{A pluggable blogging system for Rails 3.}
|
19
|
+
gem.description = %Q{Because Blogojevich would be too tough to remember. It's a pluggable blogging system for Rails 3.}
|
20
|
+
gem.email = "liam@carpeliam.com"
|
21
|
+
gem.authors = ["Liam Morley"]
|
22
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
+
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
+
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
|
+
end
|
27
|
+
Jeweler::RubygemsDotOrgTasks.new
|
28
|
+
|
29
|
+
require 'rspec/core'
|
30
|
+
require 'rspec/core/rake_task'
|
31
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
32
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
33
|
+
end
|
34
|
+
|
35
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
36
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
37
|
+
spec.rcov = true
|
38
|
+
end
|
39
|
+
|
40
|
+
task :default => :spec
|
41
|
+
|
42
|
+
require 'rake/rdoctask'
|
43
|
+
Rake::RDocTask.new do |rdoc|
|
44
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
45
|
+
|
46
|
+
rdoc.rdoc_dir = 'rdoc'
|
47
|
+
rdoc.title = "governor #{version}"
|
48
|
+
rdoc.rdoc_files.include('README*')
|
49
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
50
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,94 @@
|
|
1
|
+
class Governor::ArticlesController < ApplicationController
|
2
|
+
include Governor::Controllers::Helpers
|
3
|
+
before_filter :init_resource, :only => [:show, :edit, :update, :destroy]
|
4
|
+
before_filter :authorize_governor!, :only => [:new, :edit, :create, :update, :destroy]
|
5
|
+
helper :governor
|
6
|
+
helper Governor::Controllers::Helpers
|
7
|
+
|
8
|
+
# GET /articles
|
9
|
+
# GET /articles.xml
|
10
|
+
def index
|
11
|
+
set_resources model_class.paginate :page => params[:page], :order => 'created_at DESC'
|
12
|
+
respond_to do |format|
|
13
|
+
format.html # index.html.erb
|
14
|
+
format.xml { render :xml => resources }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# GET /articles/1
|
19
|
+
# GET /articles/1.xml
|
20
|
+
def show
|
21
|
+
respond_to do |format|
|
22
|
+
format.html # show.html.erb
|
23
|
+
format.xml { render :xml => resource }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# GET /articles/new
|
28
|
+
# GET /articles/new.xml
|
29
|
+
def new
|
30
|
+
set_resource model_class.new
|
31
|
+
|
32
|
+
respond_to do |format|
|
33
|
+
format.html # new.html.erb
|
34
|
+
format.xml { render :xml => resource }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# GET /articles/1/edit
|
39
|
+
def edit
|
40
|
+
end
|
41
|
+
|
42
|
+
# POST /articles
|
43
|
+
# POST /articles.xml
|
44
|
+
def create
|
45
|
+
set_resource model_class.new(params[mapping.singular])
|
46
|
+
resource.author = GOVERNOR_AUTHOR.call(self)
|
47
|
+
|
48
|
+
respond_to do |format|
|
49
|
+
if resource.save
|
50
|
+
flash[:notice] = "#{mapping.humanize} was successfully created."
|
51
|
+
format.html { redirect_to(resource) }
|
52
|
+
format.xml { render :xml => resource, :status => :created, :location => resource }
|
53
|
+
else
|
54
|
+
format.html { render :action => 'new' }
|
55
|
+
format.xml { render :xml => resource.errors, :status => :unprocessable_entity }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# PUT /articles/1
|
61
|
+
# PUT /articles/1.xml
|
62
|
+
def update
|
63
|
+
respond_to do |format|
|
64
|
+
if resource.update_attributes(params[mapping.singular])
|
65
|
+
flash[:notice] = "#{mapping.humanize} was successfully updated."
|
66
|
+
format.html { redirect_to(resource) }
|
67
|
+
format.xml { head :ok }
|
68
|
+
else
|
69
|
+
format.html { render :action => 'edit' }
|
70
|
+
format.xml { render :xml => resource.errors, :status => :unprocessable_entity }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# DELETE /articles/1
|
76
|
+
# DELETE /articles/1.xml
|
77
|
+
def destroy
|
78
|
+
resource.destroy
|
79
|
+
|
80
|
+
respond_to do |format|
|
81
|
+
format.html { redirect_to(resources_url) }
|
82
|
+
format.xml { head :ok }
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def find_by_date
|
87
|
+
set_resources model_class.find_all_by_date(params[:year], params[:month], params[:day], params[:page] || 1)
|
88
|
+
|
89
|
+
respond_to do |format|
|
90
|
+
format.html { render :action => 'index' }
|
91
|
+
format.xml { render :xml => resources }
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module GovernorHelper
|
2
|
+
@@months = %w(January February March April May June July August September October November December)
|
3
|
+
|
4
|
+
def render_plugin_partial(where, options = {})
|
5
|
+
output = ""
|
6
|
+
Governor::PluginManager.view_hooks[where].each do |f|
|
7
|
+
opts = options.merge( {:file => f} )
|
8
|
+
output << render(opts)
|
9
|
+
end
|
10
|
+
return output
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_date_label
|
14
|
+
if not params[:day].nil?
|
15
|
+
"#{@@months[params[:month].to_i - 1]} #{params[:day]}, #{params[:year]}"
|
16
|
+
elsif not params[:month].nil?
|
17
|
+
"#{@@months[params[:month].to_i - 1]} #{params[:year]}"
|
18
|
+
else
|
19
|
+
params[:year]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def show_time_ago(date)
|
24
|
+
%{<acronym title="#{date.strftime '%A, %B %d, %Y at %I:%M %p'}">#{distance_of_time_in_words_to_now date}</acronym> ago}.html_safe
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<h1><%= link_to_unless_current resource.title, resource %></h1>
|
2
|
+
<div class='subtitle'>
|
3
|
+
<div class='desc'>
|
4
|
+
<%= resource.description %>
|
5
|
+
<%= render_plugin_partial('after_desc', :locals => {:article => resource}) %>
|
6
|
+
</div>
|
7
|
+
<div class='date'>
|
8
|
+
posted <%= show_time_ago resource.created_at %>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<%= Governor::Formatters.format_article resource %>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<%= error_messages_for resource_sym %>
|
2
|
+
|
3
|
+
<%= form_for resource do |f| %>
|
4
|
+
<p>
|
5
|
+
<b><%= f.label :title %></b><br>
|
6
|
+
<%= f.text_field :title %>
|
7
|
+
</p>
|
8
|
+
|
9
|
+
<p>
|
10
|
+
<b><%= f.label :description %></b><br>
|
11
|
+
<%= f.text_field :description %>
|
12
|
+
</p>
|
13
|
+
|
14
|
+
<p id="article_text">
|
15
|
+
<b><%= f.label :post %></b><br>
|
16
|
+
<%= f.text_area :post %>
|
17
|
+
</p>
|
18
|
+
|
19
|
+
<p>
|
20
|
+
<b><%= f.label :format %></b> <%= f.select :format, Governor::Formatters.available_formatters.keys %>
|
21
|
+
</p>
|
22
|
+
|
23
|
+
<%= render_plugin_partial('bottom_of_form', :locals => {:f => f}) %>
|
24
|
+
|
25
|
+
<p>
|
26
|
+
<%= f.submit "#{controller.action_name.titleize} Article" %>
|
27
|
+
</p>
|
28
|
+
<% end %>
|