georgia_blog 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 873c373459eba195409c2c28d6a5d607c9f53edd
4
+ data.tar.gz: 950416a5d33a968cf5e5a2430f5f5b0d0eb1536f
5
+ SHA512:
6
+ metadata.gz: aec5888f4b02ec3e78f5c653911d2a4059c2ec0bb37633488f5c36e4f0484b6e6e5e4f95cec12e673cf5f1dca3b7d22813ea2698905a5ed45f098dd17122b66a
7
+ data.tar.gz: bbaeedb96ad023469e129ba2567f1de21dac413a0a94ff57dc4754c61205435b7aa80523f3eebfa92c98c80a9229c9763a8941fcba2f26b8143c4b8c9b970abe
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012-2014 Motion Eleven
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.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = Georgia Blog
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'Georgia Blog'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,4 @@
1
+ module Georgia
2
+ class PostsController < Georgia::PagesController
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Georgia
2
+ class PostDecorator < Georgia::PageDecorator
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Georgia
2
+ class PostsDecorator < PaginationDecorator
3
+ end
4
+ end
@@ -0,0 +1,73 @@
1
+ module Georgia
2
+ class Post < Georgia::Page
3
+
4
+ attr_accessible :published_at
5
+
6
+ scope :recent, order("published_at DESC")
7
+ class << self
8
+ alias_method :latest, :recent
9
+ end
10
+
11
+ def month
12
+ @month ||= published_at.strftime('%B %Y') if published_at.present?
13
+ end
14
+
15
+ def year
16
+ @year ||= published_at.year if published_at.present?
17
+ end
18
+
19
+ searchable do
20
+ text :title, stored: true do
21
+ revisions.map{|r| r.contents.map(&:title)}.flatten.uniq.join(', ')
22
+ end
23
+ text :excerpt, stored: true do
24
+ revisions.map{|r| r.contents.map(&:excerpt)}.flatten.uniq.join(', ')
25
+ end
26
+ text :text do
27
+ revisions.map{|r| r.contents.map(&:text)}.flatten.uniq.join(', ')
28
+ end
29
+ text :keywords do
30
+ revisions.map{|r| r.contents.map(&:keyword_list)}.flatten.uniq.join(', ')
31
+ end
32
+ text :tags do
33
+ tag_list.join(', ')
34
+ end
35
+ text :url
36
+ text :template
37
+ string :title
38
+ string :excerpt
39
+ string :text
40
+ string :url
41
+ string :template
42
+ string :state do
43
+ public? ? 'public' : 'private'
44
+ end
45
+ string :class_name do
46
+ self.class.name
47
+ end
48
+ string :keywords, stored: true, multiple: true do
49
+ revisions.map{|r| r.contents.map(&:keyword_list)}.flatten.uniq
50
+ end
51
+ string :tag_list, stored: true, multiple: true # Array for facets
52
+ string :tags, stored: true do # Single list for ordering
53
+ tag_list.join(', ')
54
+ end
55
+ string :month, stored: true
56
+ string :year, stored: true
57
+ time :published_at
58
+ time :updated_at # default order
59
+ end
60
+
61
+ class << self
62
+
63
+ def extra_search_params
64
+ Proc.new {
65
+ facet :month, :tags
66
+ with(:month, params[:m]) unless params[:m].blank?
67
+ with(:tags, params[:c]) unless params[:t].blank?
68
+ }
69
+ end
70
+
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,5 @@
1
+ <% if can? :manage, Georgia::Post %>
2
+ <li class="<%= 'active' if controller_name == 'posts' %>">
3
+ <%= link_to 'Blog', georgia.search_posts_url %>
4
+ </li>
5
+ <% end -%>
@@ -0,0 +1,13 @@
1
+ <fieldset>
2
+ <div class="fieldset-help">
3
+ <legend>Published Date</legend>
4
+ </div>
5
+ <div class="fieldset-fields">
6
+ <div class='input-group date'>
7
+ <%= f.input_field :published_at, as: :string, class: "form-control js-datepicker", data: {format: "DD-MM-YYYY HH:mm"}, value: f.object.published_at.strftime('%d-%m-%Y %H:%M') %>
8
+ <span class="input-group-addon">
9
+ <span class="fa fa-calendar"></span>
10
+ </span>
11
+ </div>
12
+ </div>
13
+ </fieldset>
@@ -0,0 +1,3 @@
1
+ Georgia.setup do |config|
2
+ config.navigation += %w(blog)
3
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,33 @@
1
+ Georgia::Engine.routes.draw do
2
+
3
+ concern :pageable do
4
+
5
+ collection do
6
+ get :search
7
+ post :sort
8
+ post :publish
9
+ post :unpublish
10
+ post 'flush-cache', to: :flush_cache, as: :flush_cache
11
+ delete '/', to: :destroy
12
+ end
13
+
14
+ member do
15
+ get :copy
16
+ get :settings
17
+ end
18
+
19
+ resources :revisions do
20
+ member do
21
+ get :preview
22
+ get :review
23
+ get :approve
24
+ get :store
25
+ get :decline
26
+ get :restore
27
+ end
28
+ end
29
+ end
30
+
31
+ resources :posts, concerns: [:pageable]
32
+
33
+ end
@@ -0,0 +1,10 @@
1
+ class CreateGeorgiaPostData < ActiveRecord::Migration
2
+ def change
3
+ create_table :georgia_post_data do |t|
4
+ t.datetime :published_at
5
+ t.integer :post_id
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ module GeorgiaBlog
2
+ class Engine < ::Rails::Engine
3
+ require 'rubygems'
4
+ require 'georgia'
5
+
6
+ extend Georgia::Paths
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module GeorgiaBlog
2
+ VERSION = "0.7.1"
3
+ end
@@ -0,0 +1 @@
1
+ require "georgia_blog/engine"
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: georgia_blog
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.1
5
+ platform: ruby
6
+ authors:
7
+ - Mathieu Gagné
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.13
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.13
27
+ - !ruby/object:Gem::Dependency
28
+ name: georgia
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Adds a blogging engine to Motion Eleven's Georgia CMS system.
42
+ email:
43
+ - mathieu@motioneleven.com
44
+ - gagne.mathieu@hotmail.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - MIT-LICENSE
50
+ - README.rdoc
51
+ - Rakefile
52
+ - app/controllers/georgia/posts_controller.rb
53
+ - app/decorators/georgia/post_decorator.rb
54
+ - app/decorators/georgia/posts_decorator.rb
55
+ - app/models/georgia/post.rb
56
+ - app/views/georgia/header/_blog.html.erb
57
+ - app/views/georgia/posts/fields/_extra-fields.html.erb
58
+ - config/initializers/georgia.rb
59
+ - config/routes.rb
60
+ - db/migrate/001_create_georgia_post_data.rb
61
+ - lib/georgia_blog.rb
62
+ - lib/georgia_blog/engine.rb
63
+ - lib/georgia_blog/version.rb
64
+ homepage: https://github.com/georgia-cms/georgia_blog
65
+ licenses:
66
+ - MIT
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.2.1
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: Blogging Engine - addon to Georgia
88
+ test_files: []