georgia 0.7.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b6c8f5fffd4a1952bcbef59916f29dcf3732132
4
- data.tar.gz: f67b41e2197d216bc13713fe0b5f206ebd5b2da0
3
+ metadata.gz: abd20d9ab3944e295ac4a7f5745aeb6bfa1a97e6
4
+ data.tar.gz: 6ba851a725b0976c07f71abd9f8b8163d886eddf
5
5
  SHA512:
6
- metadata.gz: 62c7861acc194afa2009d7f5f66b5dfbc6bc28ad3a22c5f841b117a3c48c5ba01c7a1790f62cae6d800bf2d376cea47b24d464fd0663636f07825329b2b7818f
7
- data.tar.gz: 811589698941a68330a283098346d1626fcb5e71d548e3e22d981752bfa955b19ace02d6dc384df9fdf893f6c29f47f085eff0b572505fd8d66def95499f8c49
6
+ metadata.gz: dbc9ddd0cc66f29d279b3fc906d627d4cfa1d8e2ec871f12ec31f407937961bc569fa0704a955aff468e681104c46108235a6ad156e6cdf5ae1f5e489f9a03ba
7
+ data.tar.gz: b8fb78cfcde16ffd6b0604ea7f9fee64ee73f05ed8330f7de656cf2a31ff29ba3e72f6d93a2916af52b8b3265e376a043cc777536413b40b1d4741e61c67c9b6
data/README.md CHANGED
@@ -14,12 +14,9 @@ Then run the generator to mount routes, run migrations & setup initial instances
14
14
 
15
15
  rails g georgia:install
16
16
 
17
- == Testing
18
-
19
- === Run Foreman to start Solr
17
+ Start your server (`rails server`) and go to (http://localhost:3000/admin)[http://localhost:3000/admin] to get started.
20
18
 
21
- cd spec/dummy
22
- bundle exec foreman start
19
+ == Testing
23
20
 
24
21
  === Run rspec
25
22
 
@@ -15,7 +15,6 @@ input[type="checkbox"]:indeterminate::after {
15
15
  content: image-url('georgia/indeterminate.png');
16
16
  }
17
17
 
18
- input[type="radio"],
19
18
  input[type="checkbox"] {
20
19
  border: initial;
21
20
  padding: 0;
@@ -27,8 +27,6 @@ h1, h2, h3, h4, h5, h6, legend {
27
27
  margin-top: 60px;
28
28
  }
29
29
 
30
- .body-main { @include span-columns(10); }
31
-
32
30
  a {
33
31
  text-decoration: none;
34
32
  color: $font-link;
@@ -14,8 +14,8 @@ $blue: #0362fd;
14
14
 
15
15
  $bg-header: #28b779;
16
16
  $bg-header-active: #16CA7C;
17
- $bg-header-main: #ecf5fb;
18
- $bg-header-main-rgba: rgba(236,245,251,0.9);
17
+ $bg-header-main: #f5f5f5;
18
+ $bg-header-main-rgba: rgba(245,245,245,0.9);
19
19
  $bg-sidebar: $bg-header-main;
20
20
  $bg-sidebar-rgba: $bg-header-main-rgba;
21
21
  $bg-sidebar-navlist: $white;
@@ -1,7 +1,6 @@
1
1
  .select2-container { width: 100%; }
2
2
 
3
3
  .select2-container-multi .select2-choices .select2-search-choice {
4
- @extend .tag;
5
4
  padding: 4px 6px 4px 18px !important;
6
5
  background-image: none;
7
6
  background-color: #FFF;
@@ -46,7 +46,7 @@ module Georgia
46
46
  Georgia::Page.update_tree(params[:page_tree]) if params[:page_tree]
47
47
  if @page.update_attributes(params[:page])
48
48
  respond_to do |format|
49
- format.html { redirect_to [:settings, @page], notice: "#{@page.title} was successfully updated." }
49
+ format.html { render :settings, notice: "#{@page.title} was successfully updated." }
50
50
  format.js { head :ok }
51
51
  end
52
52
  else
@@ -4,8 +4,8 @@ module Georgia
4
4
  def sortable(column, title=nil)
5
5
  title ||= column.humanize
6
6
  direction = (column.to_s == params[:o] && params[:dir] == "asc" ? "desc" : "asc")
7
- icon = direction == "asc" ? icon_tag('icon-chevron-up') : icon_tag('icon-chevron-down')
8
- "#{title} #{link_to(icon, params.merge({o: column, dir: direction}))}".html_safe
7
+ icon = direction == "asc" ? icon_tag('caret-up') : icon_tag('caret-down')
8
+ "#{title} #{link_to(icon, params.merge({o: column, dir: direction}))}".html_safe
9
9
  end
10
10
 
11
11
  def render_template template
@@ -1,9 +1,8 @@
1
1
  module Georgia
2
2
  module PaginationHelper
3
3
 
4
- def pagination_tag search
5
- return unless search and !search.total.zero?
6
- Georgia::PaginationPresenter.new(self, search)
4
+ def pagination_tag search, options={}
5
+ Georgia::PaginationPresenter.new(self, search, options)
7
6
  end
8
7
 
9
8
  end
@@ -9,5 +9,10 @@ module Georgia
9
9
  belongs_to :revision, foreign_key: :page_id
10
10
  validates :page_id, presence: true
11
11
 
12
+ # Returns a page if revision is a `current_revision` for a Georgia::Page
13
+ def page
14
+ @page ||= revision.try(:page)
15
+ end
16
+
12
17
  end
13
18
  end
@@ -1,16 +1,14 @@
1
1
  module Georgia
2
- class PaginationPresenter
2
+ class PaginationPresenter < Presenter
3
3
 
4
- attr_accessor :view_context
5
-
6
- delegate :content_tag, :icon_tag, :link_to_previous_page, :link_to_next_page, :link_to, to: :view_context
7
-
8
- def initialize view_context, search
9
- @view_context = view_context
4
+ def initialize view_context, search, options
5
+ super
10
6
  @search = search
7
+ @options = options
11
8
  end
12
9
 
13
10
  def to_s
11
+ return unless @search and !@search.total.zero?
14
12
  content_tag(:div, class: 'header-pagination') do
15
13
  search_count_tag + navigation_tags
16
14
  end
@@ -38,12 +36,12 @@ module Georgia
38
36
 
39
37
  def previous_page
40
38
  text = icon_tag('chevron-left')
41
- link_to_previous_page(@search.hits, text, class: btn_class) || link_to_disabled(text)
39
+ link_to_previous_page(@search.hits, text, class: btn_class, params: params) || link_to_disabled(text)
42
40
  end
43
41
 
44
42
  def next_page
45
43
  text = icon_tag('chevron-right')
46
- link_to_next_page(@search.hits, text, class: btn_class, role: 'button') || link_to_disabled(text)
44
+ link_to_next_page(@search.hits, text, class: btn_class, role: 'button', params: params) || link_to_disabled(text)
47
45
  end
48
46
 
49
47
  def btn_class
@@ -9,7 +9,7 @@ class CkeditorAttachmentFileUploader < CarrierWave::Uploader::Base
9
9
  end
10
10
 
11
11
  def extension_white_list
12
- %w(doc docx odt xls ods csv pdf rar zip tar tar.gz ppt pptx)
12
+ %w(doc docx odt xls ods csv pdf rar zip tar tar.gz ppt pptx) + Ckeditor.image_file_types
13
13
  end
14
14
 
15
15
 
@@ -3,7 +3,7 @@
3
3
  <h1 class='login-logo page-header'>Georgia</h1>
4
4
 
5
5
  <% flash.each do |name, msg| %>
6
- <div class="alert alert-<%= name == :notice ? "success" : "error" %>">
6
+ <div class="alert alert-<%= name == :notice ? "success" : "danger" %>">
7
7
  <a class="close" data-dismiss="alert">×</a>
8
8
  <%= msg.html_safe %>
9
9
  </div>
@@ -1,10 +1,16 @@
1
1
  class CreateGeorgiaRoles < ActiveRecord::Migration
2
2
 
3
- def change
3
+ def up
4
4
  create_table :georgia_roles do |t|
5
5
  t.string :name
6
6
  t.timestamps
7
7
  end
8
+ Georgia::Role.create(name: 'Admin')
9
+ Georgia::Role.create(name: 'Editor')
10
+ end
11
+
12
+ def down
13
+ drop_table :georgia_roles
8
14
  end
9
15
 
10
16
  end
@@ -1,9 +1,15 @@
1
1
  class CreateGeorgiaUiSections < ActiveRecord::Migration
2
2
 
3
- def change
3
+ def up
4
4
  create_table :georgia_ui_sections do |t|
5
5
  t.string :name
6
6
  end
7
+ Georgia::UiSection.create(name: 'Footer')
8
+ Georgia::UiSection.create(name: 'Sidebar')
9
+ end
10
+
11
+ def down
12
+ drop_table :georgia_ui_sections
7
13
  end
8
14
 
9
15
  end
@@ -33,6 +33,17 @@ module Georgia
33
33
  rake "db:migrate"
34
34
  end
35
35
 
36
+ def create_admin_user
37
+ say("You're almost done. You need an admin user to get started.", :yellow)
38
+ first_name = ask("First name:")
39
+ last_name = ask("Last name:")
40
+ email = ask("Email:")
41
+ password = ask("Password:")
42
+ Georgia::User.create(first_name: first_name, last_name: last_name, email: email, password: password, password_confirmation: password) do |user|
43
+ user.roles << Georgia::Role.all
44
+ end
45
+ end
46
+
36
47
  def copy_templates
37
48
  template "config/initializers/georgia.rb"
38
49
  template "app/controllers/pages_controller.rb"
@@ -47,10 +58,6 @@ module Georgia
47
58
  run "bundle"
48
59
  end
49
60
 
50
- def bootstrap
51
- rake 'georgia:install'
52
- end
53
-
54
61
  def show_readme
55
62
  readme "README"
56
63
  end
@@ -1,3 +1,4 @@
1
+ require "georgia/version"
1
2
  require "georgia/paths"
2
3
  require "georgia/engine"
3
4
  require "georgia/assets"
@@ -1,3 +1,3 @@
1
1
  module Georgia
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: georgia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathieu Gagné
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-15 00:00:00.000000000 Z
11
+ date: 2014-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -783,12 +783,10 @@ files:
783
783
  - config/locales/georgia.en.yml
784
784
  - config/initializers/ckeditor.rb
785
785
  - config/initializers/acts_as_taggable_on.rb
786
- - config/initializers/revisions.rb
787
786
  - config/initializers/inflections.rb
788
787
  - config/initializers/devise.rb
789
788
  - config/initializers/simple_form.rb
790
789
  - db/migrate/006_create_georgia_pages.rb
791
- - db/migrate/015_create_tags.rb
792
790
  - db/migrate/004_create_georgia_menus.rb
793
791
  - db/migrate/005_create_georgia_messages.rb
794
792
  - db/migrate/003_create_georgia_links.rb
@@ -804,7 +802,6 @@ files:
804
802
  - db/migrate/014_create_roles_users.rb
805
803
  - lib/tasks/solr.rake
806
804
  - lib/tasks/sidekiq.rake
807
- - lib/tasks/install.rake
808
805
  - lib/tasks/georgia.rake
809
806
  - lib/tasks/upgrade.rake
810
807
  - lib/tasks/assets.rake
@@ -1,5 +0,0 @@
1
- module ActsAsRevisionable
2
- class RevisionRecord < ActiveRecord::Base
3
- belongs_to :revisionable, polymorphic: true
4
- end
5
- end
@@ -1,20 +0,0 @@
1
- class CreateTags < ActiveRecord::Migration
2
-
3
- def change
4
- create_table :tags do |t|
5
- t.string :name
6
- end
7
-
8
- create_table :taggings do |t|
9
- t.references :tag
10
- t.references :taggable, :polymorphic => true
11
- t.references :tagger, :polymorphic => true
12
- t.string :context, :limit => 128
13
- t.datetime :created_at
14
- end
15
-
16
- add_index :taggings, :tag_id
17
- add_index :taggings, [:taggable_id, :taggable_type, :context]
18
- end
19
-
20
- end
@@ -1,19 +0,0 @@
1
- namespace :georgia do
2
-
3
- desc 'Bootstrap Georgia with necessary instances'
4
- task install: :environment do
5
-
6
- # Create an admin user to start playing around
7
- # Also creates the two main roles
8
- support_user = Georgia::User.create(first_name: 'Dummy', last_name: 'Admin', email: 'admin@dummy.com', password: 'motion11', password_confirmation: 'motion11') do |user|
9
- user.roles << Georgia::Role.create(name: 'Admin')
10
- user.roles << Georgia::Role.create(name: 'Editor')
11
- end
12
-
13
- # Creates the default main UI sections
14
- Georgia::UiSection.create(name: 'Footer')
15
- Georgia::UiSection.create(name: 'Sidebar')
16
-
17
- end
18
-
19
- end