rails_blog_engine 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/BOOTSTRAP-LICENSE.txt +13 -0
  2. data/MIT-LICENSE +20 -0
  3. data/PYGMENTS-LICENSE.txt +28 -0
  4. data/RAILS-LICENSE.txt +22 -0
  5. data/README.md +165 -0
  6. data/Rakefile +79 -0
  7. data/app/assets/javascripts/rails_blog_engine/comments.js +2 -0
  8. data/app/assets/javascripts/rails_blog_engine/posts.js +3 -0
  9. data/app/assets/javascripts/rails_blog_engine.js +3 -0
  10. data/app/assets/stylesheets/rails_blog_engine/bootstrap_extracts.css.scss +252 -0
  11. data/app/assets/stylesheets/rails_blog_engine/code.css.scss +71 -0
  12. data/app/assets/stylesheets/rails_blog_engine/comments.css.scss +29 -0
  13. data/app/assets/stylesheets/rails_blog_engine/posts.css.scss +46 -0
  14. data/app/assets/stylesheets/rails_blog_engine/simple_form.css.scss +70 -0
  15. data/app/assets/stylesheets/rails_blog_engine.css +6 -0
  16. data/app/controllers/rails_blog_engine/application_controller.rb +26 -0
  17. data/app/controllers/rails_blog_engine/comments_controller.rb +47 -0
  18. data/app/controllers/rails_blog_engine/posts_controller.rb +67 -0
  19. data/app/helpers/rails_blog_engine/application_helper.rb +52 -0
  20. data/app/helpers/rails_blog_engine/comments_helper.rb +4 -0
  21. data/app/helpers/rails_blog_engine/posts_helper.rb +13 -0
  22. data/app/models/rails_blog_engine/comment.rb +74 -0
  23. data/app/models/rails_blog_engine/post.rb +73 -0
  24. data/app/views/rails_blog_engine/comments/_comment.html.haml +10 -0
  25. data/app/views/rails_blog_engine/comments/_form.html.haml +6 -0
  26. data/app/views/rails_blog_engine/comments/_tools.html.haml +10 -0
  27. data/app/views/rails_blog_engine/comments/new.html.haml +6 -0
  28. data/app/views/rails_blog_engine/posts/_comments_section.html.haml +11 -0
  29. data/app/views/rails_blog_engine/posts/_form.html.haml +7 -0
  30. data/app/views/rails_blog_engine/posts/_post.html.haml +20 -0
  31. data/app/views/rails_blog_engine/posts/_tools.html.haml +2 -0
  32. data/app/views/rails_blog_engine/posts/edit.html.haml +5 -0
  33. data/app/views/rails_blog_engine/posts/index.atom.builder +14 -0
  34. data/app/views/rails_blog_engine/posts/index.html.haml +15 -0
  35. data/app/views/rails_blog_engine/posts/new.html.haml +5 -0
  36. data/app/views/rails_blog_engine/posts/show.html.haml +8 -0
  37. data/config/locales/rails_blog_engine.en.yml +15 -0
  38. data/config/locales/simple_form.en.yml +24 -0
  39. data/config/routes.rb +24 -0
  40. data/db/migrate/20110912153527_create_rails_blog_engine_posts.rb +10 -0
  41. data/db/migrate/20110913190319_add_fields_to_rails_blog_engine_post.rb +12 -0
  42. data/db/migrate/20111125111958_create_rails_blog_engine_comments.rb +21 -0
  43. data/lib/generators/rails_blog_engine/install/USAGE +11 -0
  44. data/lib/generators/rails_blog_engine/install/install_generator.rb +51 -0
  45. data/lib/generators/rails_blog_engine/install/templates/rails_blog_engine.rb +13 -0
  46. data/lib/rails_blog_engine/ability.rb +16 -0
  47. data/lib/rails_blog_engine/engine.rb +5 -0
  48. data/lib/rails_blog_engine/filters/base.rb +17 -0
  49. data/lib/rails_blog_engine/filters/code.rb +21 -0
  50. data/lib/rails_blog_engine/filters.rb +53 -0
  51. data/lib/rails_blog_engine/version.rb +3 -0
  52. data/lib/rails_blog_engine.rb +18 -0
  53. data/lib/tasks/rails_blog_engine_tasks.rake +4 -0
  54. metadata +384 -0
@@ -0,0 +1,13 @@
1
+ Copyright 2011 Twitter, Inc.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2011 YOURNAME
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.
@@ -0,0 +1,28 @@
1
+ (This applies to the CSS rules for syntax highlighting
2
+ that we copied in from Pygments.)
3
+
4
+ Copyright (c) 2006-2010 by the respective authors (see AUTHORS file).
5
+ All rights reserved.
6
+
7
+ Redistribution and use in source and binary forms, with or without
8
+ modification, are permitted provided that the following conditions are
9
+ met:
10
+
11
+ * Redistributions of source code must retain the above copyright
12
+ notice, this list of conditions and the following disclaimer.
13
+
14
+ * Redistributions in binary form must reproduce the above copyright
15
+ notice, this list of conditions and the following disclaimer in the
16
+ documentation and/or other materials provided with the distribution.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/RAILS-LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ This license covers the 'routes' task in our Rakefile.
2
+
3
+ Copyright (c) 2004-2011 David Heinemeier Hansson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,165 @@
1
+ # Rails Blog Engine
2
+
3
+ **Pre-beta release. Public APIs may change.**
4
+
5
+ Add a blog to any Rails 3.1 site using `rails_blog_engine`. If you're
6
+ already using `cancan` for authorization, then add the following line to
7
+ your `Gemfile`:
8
+
9
+ gem 'rails_blog_engine'
10
+
11
+ ...and run:
12
+
13
+ bundle install
14
+ rails generate rails_blog_engine:install
15
+ rake db:migrate
16
+
17
+ Then edit your `app/models/ability.rb` file to authorize reading and
18
+ writing the blog. For example:
19
+
20
+ class Ability
21
+ include CanCan::Ability
22
+ include RailsBlogEngine::Ability
23
+
24
+ def initialize(user)
25
+ # Everybody can read the blog, even if they're not logged in.
26
+ can_read_blog
27
+
28
+ # Test to see whether a user can manage the blog. For example,
29
+ # if you identify administrators using an 'admin?' flag, you
30
+ # might write 'if user.admin?' instead.
31
+ if user
32
+ can_manage_blog
33
+ end
34
+ end
35
+ end
36
+
37
+ You should now be able to access your blog at `http://0.0.0.0:3000/blog`
38
+ and start posting!
39
+
40
+ ## What if I'm not already using `cancan`?
41
+
42
+ You can still use `rails_blog_engine`! First, install `rails_blog_engine`
43
+ as described above, and then add the following lines to your `Gemfile`:
44
+
45
+ gem 'devise' # Optional.
46
+ gem 'cancan'
47
+
48
+ You don't have to use `devise`—you can use `rails_blog_engine` with the
49
+ authentication framework of your choice. If you are using Devise, however,
50
+ you will now need to generate a user class:
51
+
52
+ rails generate devise:install
53
+ rails generate devise User
54
+
55
+ To prevent random members of the public from signing up for a user account,
56
+ edit `app/models/user.rb` and remove `:registerable`. To create a new user,
57
+ you must now run the following command from the Rails console:
58
+
59
+ User.create!(:email => "me@example.com", :password => "12345",
60
+ :password_confirmation => "12345")
61
+
62
+ (Alternatively, you keep `:registerable` on your `User` model, and add a
63
+ new field `admin?` which you set from the console.)
64
+
65
+ Once you have a working user model, you can generate a new
66
+ `app/models/ability.rb` file:
67
+
68
+ rails generate cancan:ability
69
+
70
+ ...and edit it as described above.
71
+
72
+ ### How can I make this work without a Devise `User` class?
73
+
74
+ Basically, all `cancan` cares about is whether your controller defines a
75
+ `current_ability` class. So for example, if you don't use Devise, but the
76
+ currently logged-in administrator is available as `current_admin`, you can
77
+ edit `app/controllers/application_controller.rb` to override
78
+ `current_ability`:
79
+
80
+ class ApplicationController < ActionController::Base
81
+ # ...other stuff here...
82
+
83
+ def current_ability
84
+ @current_ability ||= ::Ability.new(current_admin)
85
+ end
86
+ end
87
+
88
+ ## Setting up titles and <head> tags
89
+
90
+ To set up titles, add the two following `yield` lines to the `<head>` tag
91
+ in your `app/views/layouts/application.html.erb`:
92
+
93
+ <head>
94
+ <title><%= yield(:title) %></title>
95
+ <%= yield(:head) %>
96
+ <!-- etc. -->
97
+ </head>
98
+
99
+ ## Turning on the spam filter
100
+
101
+ To enable the spam filter, create an Akismet account at http://akismet.com/
102
+ and set the environment variables `RAKISMET_KEY` and `RAKISMET_URL`. If
103
+ you're deploying to Heroku, you can do this using:
104
+
105
+ heroku config:add RAKISMET_KEY="mykey" RAKISMET_URL="http://example.com/"
106
+
107
+ On your development machine, you can create a file named `.env` in the root
108
+ directory of your project, and specify the variables as follows:
109
+
110
+ RAKISMET_KEY=mykey
111
+ RAKISMET_URL=http://example.com/
112
+
113
+ Then launch your application using the `foreman start` command. This will
114
+ require adding the `foreman` gem to your `Gemfile`, and creating a
115
+ `Procfile`.
116
+
117
+ ## Philosophy and planned features
118
+
119
+ `rails_blog_engine` should...
120
+
121
+ * ...be installable in under 5 minutes.
122
+ * ...be simple and easily hackable.
123
+ * ...be opinionated.
124
+ * ...be customized by overriding templates or forking the source, not by
125
+ adding configuration options.
126
+ * ...be secure.
127
+ * ...follow all white-hat SEO best practices.
128
+ * ...have excellent unit test coverage, including tests for JavaScript.
129
+
130
+ CoffeeScript, SCSS and other standard Rails 3.1 features are fair game, as
131
+ are RSpec, HAML and CanCan.
132
+
133
+ The following features are on my wishlist:
134
+
135
+ * Pagination
136
+ * More generators to aid customization
137
+ * Caching
138
+ * Optional comments, with spam filtering via a 3rd-party service
139
+ * Why? Intelligent discussion adds value and may make it easier
140
+ for searchers to find your blog posts.
141
+ * A basic editor: Auto-save, with preview and a "Publish" button
142
+
143
+ In other words, we want just enough features to make blogging pleasant, and
144
+ nothing more.
145
+
146
+ ## Syntax highlighting
147
+
148
+ If you want to be able to display source code snippets with syntax
149
+ highlighting, you'll need to add the following line to your `Gemfile`:
150
+
151
+ gem 'pygments', :git => 'https://github.com/nathany/pygments-gem.git'
152
+
153
+ Next, run `bundle install` and restart your server. This will allow
154
+ you to include code snippets in your posts as follows:
155
+
156
+ <filter:code lang="ruby">
157
+ def hello
158
+ puts "Hello!"
159
+ end
160
+ </filter:code>
161
+
162
+ You can also add your own filters. Documentation and generators should be
163
+ available soon.
164
+
165
+
data/Rakefile ADDED
@@ -0,0 +1,79 @@
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 = 'RailsBlogEngine'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+ Bundler::GemHelper.install_tasks
28
+
29
+ require 'rspec/core/rake_task'
30
+
31
+ desc "Verify against specifications"
32
+ RSpec::Core::RakeTask.new do |t|
33
+ end
34
+
35
+ # Copy database tables from development to test.
36
+ task :spec => 'app:db:test:load'
37
+
38
+ task :default => :spec
39
+
40
+ # This code was copied from the Rails source, and is under an MIT license.
41
+ desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
42
+ task :routes => 'app:environment' do
43
+
44
+ Rails.application.reload_routes!
45
+ all_routes = RailsBlogEngine::Engine.routes.routes
46
+ prefix = RailsBlogEngine::Engine.routes.url_helpers.root_path.sub(/\/\z/, '')
47
+
48
+ if ENV['CONTROLLER']
49
+ all_routes = all_routes.select{ |route| route.defaults[:controller] == ENV['CONTROLLER'] }
50
+ end
51
+
52
+ routes = all_routes.collect do |route|
53
+
54
+ reqs = route.requirements.dup
55
+ rack_app = route.app unless route.app.class.name.to_s =~ /^ActionDispatch::Routing/
56
+
57
+ endpoint = rack_app ? rack_app.inspect : "#{reqs[:controller]}##{reqs[:action]}"
58
+ constraints = reqs.except(:controller, :action)
59
+
60
+ reqs = endpoint == '#' ? '' : endpoint
61
+
62
+ unless constraints.empty?
63
+ reqs = reqs.empty? ? constraints.inspect : "#{reqs} #{constraints.inspect}"
64
+ end
65
+
66
+ {:name => route.name.to_s, :verb => route.verb.to_s, :path => prefix + route.path, :reqs => reqs}
67
+ end
68
+
69
+ # Skip the route if it's internal info route
70
+ routes.reject! { |r| r[:path] =~ %r{/rails/info/properties|^/assets} }
71
+
72
+ name_width = routes.map{ |r| r[:name].length }.max
73
+ verb_width = routes.map{ |r| r[:verb].length }.max
74
+ path_width = routes.map{ |r| r[:path].length }.max
75
+
76
+ routes.each do |r|
77
+ puts "#{r[:name].rjust(name_width)} #{r[:verb].ljust(verb_width)} #{r[:path].ljust(path_width)} #{r[:reqs]}"
78
+ end
79
+ end
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,3 @@
1
+ // Kaminari generates this HTML 5 element, so let's trick old versions of IE
2
+ // into recognizing it. Note that this may not be sufficient when printing.
3
+ document.createElement("nav");
@@ -0,0 +1,3 @@
1
+ // Require all our supporting JavaScript.
2
+ //
3
+ //= require_tree ./rails_blog_engine
@@ -0,0 +1,252 @@
1
+
2
+ // This code is imported manually from bootstrap-sass at
3
+ // https://github.com/thomas-mcdonald/bootstrap-sass
4
+ // because we don't want to add a dependency on a full-fleged bootstrap
5
+ // library.
6
+
7
+ // Grays
8
+ $black: #000;
9
+ $grayLight: lighten($black, 75%);
10
+ $white: #fff;
11
+
12
+ // Accent Colors
13
+ $blue: #049CDB;
14
+ $blueDark: #0064CD;
15
+
16
+ // Baseline grid
17
+ $basefont: 13px;
18
+ $baseline: 18px;
19
+
20
+ // Font Stacks
21
+ @mixin sans-serif-font($weight: normal, $size: 14px, $lineHeight: 20px) {
22
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
23
+ font-size: $size;
24
+ font-weight: $weight;
25
+ line-height: $lineHeight;
26
+ }
27
+
28
+ // Border Radius
29
+ @mixin border-radius($radius: 5px) {
30
+ -webkit-border-radius: $radius;
31
+ -moz-border-radius: $radius;
32
+ border-radius: $radius;
33
+ }
34
+
35
+ // Drop shadows
36
+ @mixin box-shadow($shadow: 0 1px 3px rgba(0,0,0,.25)) {
37
+ -webkit-box-shadow: $shadow;
38
+ -moz-box-shadow: $shadow;
39
+ box-shadow: $shadow;
40
+ }
41
+
42
+ // Transitions
43
+ @mixin transition($transition) {
44
+ -webkit-transition: $transition;
45
+ -moz-transition: $transition;
46
+ -ms-transition: $transition;
47
+ -o-transition: $transition;
48
+ transition: $transition;
49
+ }
50
+
51
+ // Gradient Bar Colors for buttons and allerts
52
+ @mixin gradientBar($primaryColor, $secondaryColor) {
53
+ @include vertical-gradient($primaryColor, $secondaryColor);
54
+ text-shadow: 0 -1px 0 rgba(0,0,0,.25);
55
+ border-color: $secondaryColor $secondaryColor darken($secondaryColor, 15%);
56
+ border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
57
+ }
58
+
59
+ // Gradients
60
+ @mixin vertical-gradient($startColor: #555, $endColor: #333) {
61
+ background-color: $endColor;
62
+ background-repeat: repeat-x;
63
+ background-image: -khtml-gradient(linear, left top, left bottom, from($startColor), to($endColor)); // Konqueror
64
+ background-image: -moz-linear-gradient(top, $startColor, $endColor); // FF 3.6+
65
+ background-image: -ms-linear-gradient(top, $startColor, $endColor); // IE10
66
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, $startColor), color-stop(100%, $endColor)); // Safari 4+, Chrome 2+
67
+ background-image: -webkit-linear-gradient(top, $startColor, $endColor); // Safari 5.1+, Chrome 10+
68
+ background-image: -o-linear-gradient(top, $startColor, $endColor); // Opera 11.10
69
+ background-image: linear-gradient(top, $startColor, $endColor); // The standard
70
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$startColor}, endColorstr=#{$endColor}, GradientType=0); // IE9 and down
71
+ }
72
+
73
+ // Shared colors for buttons and alerts
74
+ .btn, .alert-message {
75
+ // Set text color
76
+ &.danger, &.danger:hover, &.error, &.error:hover, &.success, &.success:hover, &.info, &.info:hover {
77
+ color: $white
78
+ }
79
+ // Sets the close button to the middle of message
80
+ .close {
81
+ font-family: Arial, sans-serif;
82
+ line-height: 18px;
83
+ }
84
+ // Danger and error appear as red
85
+ &.danger, &.error {
86
+ @include gradientBar(#ee5f5b, #c43c35);
87
+ }
88
+ // Success appears as green
89
+ &.success {
90
+ @include gradientBar(#62c462, #57a957);
91
+ }
92
+ // Info appears as a neutral blue
93
+ &.info {
94
+ @include gradientBar(#5bc0de, #339bb9);
95
+ }
96
+ }
97
+ @mixin vertical-three-colors-gradient($startColor: #00b3ee, $midColor: #7a43b6, $colorStop: 50%, $endColor: #c3325f) {
98
+ background-color: $endColor;
99
+ background-repeat: no-repeat;
100
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from($startColor), color-stop($colorStop, $midColor), to($endColor));
101
+ background-image: -webkit-linear-gradient($startColor, $midColor $colorStop, $endColor);
102
+ background-image: -moz-linear-gradient(top, $startColor, $midColor $colorStop, $endColor);
103
+ background-image: -ms-linear-gradient($startColor, $midColor $colorStop, $endColor);
104
+ background-image: -o-linear-gradient($startColor, $midColor $colorStop, $endColor);
105
+ background-image: linear-gradient($startColor, $midColor $colorStop, $endColor);
106
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$startColor}, endColorstr=#{$endColor}, GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback
107
+ }
108
+
109
+ // Reset filters for IE
110
+ @mixin reset-filter() {
111
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false)
112
+ }
113
+
114
+ // Opacity
115
+ @mixin opacity($opacity: 100) {
116
+ filter: alpha(opacity=#{$opacity});
117
+ -khtml-opacity: $opacity / 100;
118
+ -moz-opacity: $opacity / 100;
119
+ opacity: $opacity / 100;
120
+ }
121
+
122
+ .rails_blog_engine_posts, .rails_blog_engine_post {
123
+
124
+ // Base .btn styles
125
+ .btn {
126
+ // Button Base
127
+ cursor: pointer;
128
+ display: inline-block;
129
+ @include vertical-three-colors-gradient(#ffffff, #ffffff, 25%, darken(#ffffff, 10%)); // Don't use .gradientbar() here since it does a three-color gradient
130
+ padding: 5px 14px 6px;
131
+ text-shadow: 0 1px 1px rgba(255,255,255,.75);
132
+ color: #333;
133
+ font-size: $basefont;
134
+ line-height: normal;
135
+ border: 1px solid #ccc;
136
+ border-bottom-color: #bbb;
137
+ @include border-radius(4px);
138
+ $shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
139
+ @include box-shadow($shadow);
140
+
141
+ // We added this manually because they were needed to make the buttons
142
+ // look like regular Bootstrap buttons.
143
+ @include sans-serif-font(normal,$basefont,$baseline);
144
+ text-decoration: none;
145
+
146
+ &:hover {
147
+ background-position: 0 -15px;
148
+ color: #333;
149
+ text-decoration: none;
150
+ }
151
+
152
+ // Focus state for keyboard and accessibility
153
+ &:focus {
154
+ outline: 1px dotted #666;
155
+ }
156
+
157
+ // Primary Button Type
158
+ &.primary {
159
+ color: $white;
160
+ @include gradientBar($blue, $blueDark)
161
+ }
162
+
163
+ // Transitions
164
+ @include transition(.1s linear all);
165
+
166
+ // Active and Disabled states
167
+ &:active, &.active {
168
+ $shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.05);
169
+ @include box-shadow($shadow);
170
+ }
171
+ &.disabled {
172
+ cursor: default;
173
+ background-image: none;
174
+ @include reset-filter();
175
+ @include opacity(65);
176
+ @include box-shadow(none);
177
+ }
178
+ &[disabled] {
179
+ // disabled pseudo can't be included with .disabled
180
+ // def because IE8 and below will drop it ;_;
181
+ cursor: default;
182
+ background-image: none;
183
+ @include reset-filter();
184
+ @include opacity(65);
185
+ @include box-shadow(none);
186
+ }
187
+
188
+ // Button Sizes
189
+ &.large {
190
+ font-size: $basefont + 2px;
191
+ line-height: normal;
192
+ padding: 9px 14px 9px;
193
+ @include border-radius(6px);
194
+ }
195
+ &.small {
196
+ padding: 7px 9px 7px;
197
+ font-size: $basefont - 2px;
198
+ }
199
+ }
200
+ // Super jank hack for removing border-radius from IE9 so we can keep filter gradients on alerts and buttons
201
+ :root .alert-message, :root .btn {
202
+ border-radius: 0 \0;
203
+ }
204
+
205
+ // Help Firefox not be a jerk about adding extra padding to buttons
206
+ button.btn, input[type=submit].btn {
207
+ &::-moz-focus-inner {
208
+ padding: 0;
209
+ border: 0;
210
+ }
211
+ }
212
+
213
+
214
+ // PAGINATION
215
+ // ----------
216
+ //
217
+ // This has been modified for compatibility with Kaminari.
218
+
219
+ .pagination {
220
+ height: $baseline * 2;
221
+ margin: $baseline 0;
222
+
223
+ float: left;
224
+ margin: 0;
225
+ border: 1px solid #ddd;
226
+ border: 1px solid rgba(0,0,0,.15);
227
+ border-right: 0;
228
+ @include box-shadow(0 1px 2px rgba(0,0,0,.05));
229
+
230
+ span {
231
+ display: inline;
232
+ }
233
+ .current, a {
234
+ float: left;
235
+ padding: 0 14px;
236
+ line-height: ($baseline * 2);
237
+ border-right: 1px solid;
238
+ border-right-color: #ddd;
239
+ border-right-color: rgba(0,0,0,.15);
240
+ *border-right-color: #ddd; /* IE6-7 */
241
+ text-decoration: none;
242
+ }
243
+ a:hover, .current {
244
+ background-color: lighten($blue, 45%);
245
+ }
246
+ .disabled a, .disabled a:hover {
247
+ background-color: transparent;
248
+ color: $grayLight;
249
+ }
250
+ }
251
+
252
+ }
@@ -0,0 +1,71 @@
1
+ .rails_blog_engine_post .highlight {
2
+ pre {
3
+ margin-left: 1em;
4
+ overflow-x: auto;
5
+ }
6
+
7
+ // Copied from https://github.com/trevorturk/pygments/blob/master/default.css
8
+ // and nested inside our namespace.
9
+ .hll { background-color: #ffffcc }
10
+ .c { color: #408080; font-style: italic } /* Comment */
11
+ .err { border: 1px solid #FF0000 } /* Error */
12
+ .k { color: #008000; font-weight: bold } /* Keyword */
13
+ .o { color: #666666 } /* Operator */
14
+ .cm { color: #408080; font-style: italic } /* Comment.Multiline */
15
+ .cp { color: #BC7A00 } /* Comment.Preproc */
16
+ .c1 { color: #408080; font-style: italic } /* Comment.Single */
17
+ .cs { color: #408080; font-style: italic } /* Comment.Special */
18
+ .gd { color: #A00000 } /* Generic.Deleted */
19
+ .ge { font-style: italic } /* Generic.Emph */
20
+ .gr { color: #FF0000 } /* Generic.Error */
21
+ .gh { color: #000080; font-weight: bold } /* Generic.Heading */
22
+ .gi { color: #00A000 } /* Generic.Inserted */
23
+ .go { color: #808080 } /* Generic.Output */
24
+ .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
25
+ .gs { font-weight: bold } /* Generic.Strong */
26
+ .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
27
+ .gt { color: #0040D0 } /* Generic.Traceback */
28
+ .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
29
+ .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
30
+ .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
31
+ .kp { color: #008000 } /* Keyword.Pseudo */
32
+ .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
33
+ .kt { color: #B00040 } /* Keyword.Type */
34
+ .m { color: #666666 } /* Literal.Number */
35
+ .s { color: #BA2121 } /* Literal.String */
36
+ .na { color: #7D9029 } /* Name.Attribute */
37
+ .nb { color: #008000 } /* Name.Builtin */
38
+ .nc { color: #0000FF; font-weight: bold } /* Name.Class */
39
+ .no { color: #880000 } /* Name.Constant */
40
+ .nd { color: #AA22FF } /* Name.Decorator */
41
+ .ni { color: #999999; font-weight: bold } /* Name.Entity */
42
+ .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
43
+ .nf { color: #0000FF } /* Name.Function */
44
+ .nl { color: #A0A000 } /* Name.Label */
45
+ .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
46
+ .nt { color: #008000; font-weight: bold } /* Name.Tag */
47
+ .nv { color: #19177C } /* Name.Variable */
48
+ .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
49
+ .w { color: #bbbbbb } /* Text.Whitespace */
50
+ .mf { color: #666666 } /* Literal.Number.Float */
51
+ .mh { color: #666666 } /* Literal.Number.Hex */
52
+ .mi { color: #666666 } /* Literal.Number.Integer */
53
+ .mo { color: #666666 } /* Literal.Number.Oct */
54
+ .sb { color: #BA2121 } /* Literal.String.Backtick */
55
+ .sc { color: #BA2121 } /* Literal.String.Char */
56
+ .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
57
+ .s2 { color: #BA2121 } /* Literal.String.Double */
58
+ .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
59
+ .sh { color: #BA2121 } /* Literal.String.Heredoc */
60
+ .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
61
+ .sx { color: #008000 } /* Literal.String.Other */
62
+ .sr { color: #BB6688 } /* Literal.String.Regex */
63
+ .s1 { color: #BA2121 } /* Literal.String.Single */
64
+ .ss { color: #19177C } /* Literal.String.Symbol */
65
+ .bp { color: #008000 } /* Name.Builtin.Pseudo */
66
+ .vc { color: #19177C } /* Name.Variable.Class */
67
+ .vg { color: #19177C } /* Name.Variable.Global */
68
+ .vi { color: #19177C } /* Name.Variable.Instance */
69
+ .il { color: #666666 } /* Literal.Number.Integer.Long */
70
+
71
+ }