Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Finally got sick of Wordpress B.S

  • Loading branch information...
commit e1bcc9a8ec6bf993cbe0af0149a2bfd209073493 0 parents
@pothibo authored
Showing with 3,764 additions and 0 deletions.
  1. BIN  .DS_Store
  2. +18 −0 .gitignore
  3. +43 −0 Gemfile
  4. +154 −0 Gemfile.lock
  5. +28 −0 README.rdoc
  6. +6 −0 Rakefile
  7. BIN  admin/.DS_Store
  8. +8 −0 admin/.gitignore
  9. +14 −0 admin/Gemfile
  10. +88 −0 admin/Gemfile.lock
  11. +20 −0 admin/MIT-LICENSE
  12. +3 −0  admin/README.rdoc
  13. +34 −0 admin/Rakefile
  14. +22 −0 admin/admin.gemspec
  15. BIN  admin/app/.DS_Store
  16. BIN  admin/app/assets/.DS_Store
  17. 0  admin/app/assets/images/admin/.keep
  18. +16 −0 admin/app/assets/javascripts/admin/application.js
  19. +45 −0 admin/app/assets/javascripts/admin/editor.coffee
  20. +13 −0 admin/app/assets/stylesheets/admin/application.css
  21. +23 −0 admin/app/assets/stylesheets/admin/base.css.scss
  22. +140 −0 admin/app/assets/stylesheets/admin/editor.css.scss
  23. +6 −0 admin/app/controllers/admin/application_controller.rb
  24. +44 −0 admin/app/controllers/admin/posts_controller.rb
  25. +4 −0 admin/app/helpers/admin/application_helper.rb
  26. BIN  admin/app/views/.DS_Store
  27. 0  admin/app/views/admin/posts/edit.html.erb
  28. +7 −0 admin/app/views/admin/posts/index.html.erb
  29. +33 −0 admin/app/views/admin/posts/new.html.erb
  30. +14 −0 admin/app/views/layouts/admin/application.html.erb
  31. +8 −0 admin/bin/rails
  32. +4 −0 admin/config/routes.rb
  33. +4 −0 admin/lib/admin.rb
  34. +5 −0 admin/lib/admin/engine.rb
  35. +3 −0  admin/lib/admin/version.rb
  36. +4 −0 admin/lib/tasks/admin_tasks.rake
  37. +7 −0 admin/test/admin_test.rb
  38. +28 −0 admin/test/dummy/README.rdoc
  39. +6 −0 admin/test/dummy/Rakefile
  40. 0  admin/test/dummy/app/assets/images/.keep
  41. +13 −0 admin/test/dummy/app/assets/javascripts/application.js
  42. +13 −0 admin/test/dummy/app/assets/stylesheets/application.css
  43. +5 −0 admin/test/dummy/app/controllers/application_controller.rb
  44. 0  admin/test/dummy/app/controllers/concerns/.keep
  45. +2 −0  admin/test/dummy/app/helpers/application_helper.rb
  46. 0  admin/test/dummy/app/mailers/.keep
  47. 0  admin/test/dummy/app/models/.keep
  48. 0  admin/test/dummy/app/models/concerns/.keep
  49. +14 −0 admin/test/dummy/app/views/layouts/application.html.erb
  50. +3 −0  admin/test/dummy/bin/bundle
  51. +4 −0 admin/test/dummy/bin/rails
  52. +4 −0 admin/test/dummy/bin/rake
  53. +4 −0 admin/test/dummy/config.ru
  54. +23 −0 admin/test/dummy/config/application.rb
  55. +5 −0 admin/test/dummy/config/boot.rb
  56. +25 −0 admin/test/dummy/config/database.yml
  57. +5 −0 admin/test/dummy/config/environment.rb
  58. +29 −0 admin/test/dummy/config/environments/development.rb
  59. +80 −0 admin/test/dummy/config/environments/production.rb
  60. +36 −0 admin/test/dummy/config/environments/test.rb
  61. +7 −0 admin/test/dummy/config/initializers/backtrace_silencers.rb
  62. +4 −0 admin/test/dummy/config/initializers/filter_parameter_logging.rb
  63. +16 −0 admin/test/dummy/config/initializers/inflections.rb
  64. +5 −0 admin/test/dummy/config/initializers/mime_types.rb
  65. +12 −0 admin/test/dummy/config/initializers/secret_token.rb
  66. +3 −0  admin/test/dummy/config/initializers/session_store.rb
  67. +14 −0 admin/test/dummy/config/initializers/wrap_parameters.rb
  68. +23 −0 admin/test/dummy/config/locales/en.yml
  69. +4 −0 admin/test/dummy/config/routes.rb
  70. 0  admin/test/dummy/lib/assets/.keep
  71. 0  admin/test/dummy/log/.keep
  72. +58 −0 admin/test/dummy/public/404.html
  73. +58 −0 admin/test/dummy/public/422.html
  74. +57 −0 admin/test/dummy/public/500.html
  75. 0  admin/test/dummy/public/favicon.ico
  76. +10 −0 admin/test/integration/navigation_test.rb
  77. +15 −0 admin/test/test_helper.rb
  78. BIN  app/.DS_Store
  79. BIN  app/assets/.DS_Store
  80. 0  app/assets/images/.keep
  81. BIN  app/assets/images/background.png
  82. BIN  app/assets/images/comments.png
  83. BIN  app/assets/images/github-logo.png
  84. BIN  app/assets/images/header-code.png
  85. BIN  app/assets/images/header-golang.png
  86. BIN  app/assets/images/header-javascript.png
  87. BIN  app/assets/images/header-rails.png
  88. BIN  app/assets/images/profile.png
  89. BIN  app/assets/images/twitter-logo.png
  90. +16 −0 app/assets/javascripts/application.js
  91. +296 −0 app/assets/javascripts/keymaster.js
  92. +60 −0 app/assets/javascripts/keymaster.sequence.js
  93. +2 −0  app/assets/javascripts/login.coffee
  94. +591 −0 app/assets/javascripts/prism.js
  95. +25 −0 app/assets/javascripts/prism/prism.ruby.js
  96. +13 −0 app/assets/stylesheets/application.css
  97. +14 −0 app/assets/stylesheets/base.scss
  98. +98 −0 app/assets/stylesheets/index.scss
  99. +19 −0 app/assets/stylesheets/login.css.scss
  100. +26 −0 app/assets/stylesheets/mobile.scss
  101. 0  app/assets/stylesheets/mobile/index.css.scss
  102. +119 −0 app/assets/stylesheets/post.scss
  103. +160 −0 app/assets/stylesheets/prism.scss
  104. +11 −0 app/assets/stylesheets/prism/ruby.scss
  105. +6 −0 app/assets/stylesheets/responsive/full/index.css.scss
  106. +22 −0 app/controllers/application_controller.rb
  107. 0  app/controllers/concerns/.keep
  108. +19 −0 app/controllers/posts_controller.rb
  109. +12 −0 app/controllers/sessions_controller.rb
  110. +12 −0 app/controllers/unauthenticated_controller.rb
  111. +2 −0  app/helpers/application_helper.rb
  112. 0  app/mailers/.keep
  113. 0  app/models/.keep
  114. 0  app/models/concerns/.keep
  115. +55 −0 app/models/post.rb
  116. +16 −0 app/models/user.rb
  117. +16 −0 app/strategies/password_strategy.rb
  118. +18 −0 app/views/layouts/application.html.erb
  119. +6 −0 app/views/posts/_post.html.erb
  120. +35 −0 app/views/posts/index.html.erb
  121. +45 −0 app/views/posts/show.html.erb
  122. +7 −0 app/views/unauthenticated/_menu.html.erb
  123. +10 −0 app/views/unauthenticated/show.js.erb
  124. +3 −0  bin/bundle
  125. +4 −0 bin/rails
  126. +4 −0 bin/rake
  127. +4 −0 config.ru
  128. +23 −0 config/application.rb
  129. +4 −0 config/boot.rb
  130. +20 −0 config/database.yml
  131. +5 −0 config/environment.rb
  132. +29 −0 config/environments/development.rb
  133. +80 −0 config/environments/production.rb
  134. +36 −0 config/environments/test.rb
  135. +7 −0 config/initializers/backtrace_silencers.rb
  136. +4 −0 config/initializers/filter_parameter_logging.rb
  137. +16 −0 config/initializers/inflections.rb
  138. +5 −0 config/initializers/mime_types.rb
  139. +3 −0  config/initializers/session_store.rb
  140. +14 −0 config/initializers/wrap_parameters.rb
  141. +13 −0 config/locales/en.yml
  142. +10 −0 config/routes.rb
  143. +9 −0 config/settings.yml
  144. +16 −0 db/migrate/20131111222709_create_posts.rb
  145. +12 −0 db/migrate/20131113200949_create_users.rb
  146. +5 −0 db/migrate/20131114205041_add_excerpt_to_post.rb
  147. +41 −0 db/schema.rb
  148. +7 −0 db/seeds.rb
  149. 0  lib/assets/.keep
  150. 0  lib/tasks/.keep
  151. 0  log/.keep
  152. BIN  public/.DS_Store
  153. +58 −0 public/404.html
  154. +58 −0 public/422.html
  155. +57 −0 public/500.html
  156. 0  public/favicon.ico
  157. BIN  public/fonts/.DS_Store
  158. BIN  public/fonts/entypo.woff
  159. +5 −0 public/robots.txt
  160. 0  test/controllers/.keep
  161. 0  test/fixtures/.keep
  162. +12 −0 test/fixtures/posts.yml
  163. +11 −0 test/fixtures/users.yml
  164. 0  test/helpers/.keep
  165. 0  test/integration/.keep
  166. 0  test/mailers/.keep
  167. 0  test/models/.keep
  168. +33 −0 test/models/post_test.rb
  169. +7 −0 test/models/user_test.rb
  170. +15 −0 test/test_helper.rb
  171. 0  vendor/assets/javascripts/.keep
  172. 0  vendor/assets/stylesheets/.keep
BIN  .DS_Store
Binary file not shown
18 .gitignore
@@ -0,0 +1,18 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+#
+# If you find yourself ignoring temporary files generated by your text editor
+# or operating system, you probably want to add a global ignore instead:
+# git config --global core.excludesfile '~/.gitignore_global'
+
+# Ignore bundler config.
+/.bundle
+
+# Ignore the default SQLite database.
+/db/*.sqlite3
+/db/*.sqlite3-journal
+
+# Ignore all logfiles and tempfiles.
+/log/*.log
+/tmp
+
+settings.local.yml
43 Gemfile
@@ -0,0 +1,43 @@
+source 'https://rubygems.org'
+
+# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
+gem 'rails', '4.0.0'
+
+gem 'choices'
+
+gem 'warden'
+gem 'bcrypt-ruby'
+gem 'admin', path: 'admin'
+
+gem 'pg'
+
+gem 's3'
+
+# Use SCSS for stylesheets
+gem 'sass-rails', '~> 4.0.0'
+
+# Use Uglifier as compressor for JavaScript assets
+gem 'uglifier', '>= 1.3.0'
+
+# Use CoffeeScript for .js.coffee assets and views
+gem 'coffee-rails', '~> 4.0.0'
+
+# Use jquery as the JavaScript library
+gem 'jquery-rails'
+
+# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
+gem 'turbolinks'
+
+gem 'kaminari'
+gem 'exits'
+
+gem 'nokogiri'
+
+group :development do
+ gem 'debugger'
+end
+
+group :doc do
+ # bundle exec rake doc:rails generates the API under doc/api.
+ gem 'sdoc', require: false
+end
154 Gemfile.lock
@@ -0,0 +1,154 @@
+PATH
+ remote: admin
+ specs:
+ admin (0.0.1)
+ rails (~> 4.0.0)
+
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (4.0.0)
+ actionpack (= 4.0.0)
+ mail (~> 2.5.3)
+ actionpack (4.0.0)
+ activesupport (= 4.0.0)
+ builder (~> 3.1.0)
+ erubis (~> 2.7.0)
+ rack (~> 1.5.2)
+ rack-test (~> 0.6.2)
+ activemodel (4.0.0)
+ activesupport (= 4.0.0)
+ builder (~> 3.1.0)
+ activerecord (4.0.0)
+ activemodel (= 4.0.0)
+ activerecord-deprecated_finders (~> 1.0.2)
+ activesupport (= 4.0.0)
+ arel (~> 4.0.0)
+ activerecord-deprecated_finders (1.0.3)
+ activesupport (4.0.0)
+ i18n (~> 0.6, >= 0.6.4)
+ minitest (~> 4.2)
+ multi_json (~> 1.3)
+ thread_safe (~> 0.1)
+ tzinfo (~> 0.3.37)
+ arel (4.0.1)
+ atomic (1.1.14)
+ bcrypt-ruby (3.1.2)
+ builder (3.1.4)
+ choices (0.3.2)
+ hashie (>= 0.4.0)
+ coffee-rails (4.0.1)
+ coffee-script (>= 2.2.0)
+ railties (>= 4.0.0, < 5.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.6.3)
+ columnize (0.3.6)
+ debugger (1.6.2)
+ columnize (>= 0.3.1)
+ debugger-linecache (~> 1.2.0)
+ debugger-ruby_core_source (~> 1.2.3)
+ debugger-linecache (1.2.0)
+ debugger-ruby_core_source (1.2.3)
+ erubis (2.7.0)
+ execjs (2.0.2)
+ exits (0.0.4)
+ activesupport (>= 4.0)
+ hashie (2.0.5)
+ hike (1.2.3)
+ i18n (0.6.5)
+ jquery-rails (3.0.4)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ json (1.8.1)
+ kaminari (0.14.1)
+ actionpack (>= 3.0.0)
+ activesupport (>= 3.0.0)
+ mail (2.5.4)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.25)
+ mini_portile (0.5.1)
+ minitest (4.7.5)
+ multi_json (1.8.2)
+ nokogiri (1.6.0)
+ mini_portile (~> 0.5.0)
+ pg (0.17.0)
+ polyglot (0.3.3)
+ proxies (0.2.1)
+ rack (1.5.2)
+ rack-test (0.6.2)
+ rack (>= 1.0)
+ rails (4.0.0)
+ actionmailer (= 4.0.0)
+ actionpack (= 4.0.0)
+ activerecord (= 4.0.0)
+ activesupport (= 4.0.0)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 4.0.0)
+ sprockets-rails (~> 2.0.0)
+ railties (4.0.0)
+ actionpack (= 4.0.0)
+ activesupport (= 4.0.0)
+ rake (>= 0.8.7)
+ thor (>= 0.18.1, < 2.0)
+ rake (10.1.0)
+ rdoc (3.12.2)
+ json (~> 1.4)
+ s3 (0.3.17)
+ proxies (~> 0.2.0)
+ sass (3.2.12)
+ sass-rails (4.0.1)
+ railties (>= 4.0.0, < 5.0)
+ sass (>= 3.1.10)
+ sprockets-rails (~> 2.0.0)
+ sdoc (0.3.20)
+ json (>= 1.1.3)
+ rdoc (~> 3.10)
+ sprockets (2.10.0)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sprockets-rails (2.0.1)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (~> 2.8)
+ thor (0.18.1)
+ thread_safe (0.1.3)
+ atomic
+ tilt (1.4.1)
+ treetop (1.4.15)
+ polyglot
+ polyglot (>= 0.3.1)
+ turbolinks (1.3.0)
+ coffee-rails
+ tzinfo (0.3.38)
+ uglifier (2.3.1)
+ execjs (>= 0.3.0)
+ json (>= 1.8.0)
+ warden (1.2.3)
+ rack (>= 1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ admin!
+ bcrypt-ruby
+ choices
+ coffee-rails (~> 4.0.0)
+ debugger
+ exits
+ jquery-rails
+ kaminari
+ nokogiri
+ pg
+ rails (= 4.0.0)
+ s3
+ sass-rails (~> 4.0.0)
+ sdoc
+ turbolinks
+ uglifier (>= 1.3.0)
+ warden
28 README.rdoc
@@ -0,0 +1,28 @@
+== README
+
+This README would normally document whatever steps are necessary to get the
+application up and running.
+
+Things you may want to cover:
+
+* Ruby version
+
+* System dependencies
+
+* Configuration
+
+* Database creation
+
+* Database initialization
+
+* How to run the test suite
+
+* Services (job queues, cache servers, search engines, etc.)
+
+* Deployment instructions
+
+* ...
+
+
+Please feel free to use a different markup language if you do not plan to run
+<tt>rake doc:app</tt>.
6 Rakefile
@@ -0,0 +1,6 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+PothiboCom::Application.load_tasks
BIN  admin/.DS_Store
Binary file not shown
8 admin/.gitignore
@@ -0,0 +1,8 @@
+.bundle/
+log/*.log
+pkg/
+test/dummy/db/*.sqlite3
+test/dummy/db/*.sqlite3-journal
+test/dummy/log/*.log
+test/dummy/tmp/
+test/dummy/.sass-cache
14 admin/Gemfile
@@ -0,0 +1,14 @@
+source "https://rubygems.org"
+
+# Declare your gem's dependencies in admin.gemspec.
+# Bundler will treat runtime dependencies like base dependencies, and
+# development dependencies will be added by default to the :development group.
+gemspec
+
+# Declare any dependencies that are still in development here instead of in
+# your gemspec. These might include edge Rails or gems from your path or
+# Git. Remember to move these dependencies to your gemspec before releasing
+# your gem to rubygems.org.
+
+# To use debugger
+# gem 'debugger'
88 admin/Gemfile.lock
@@ -0,0 +1,88 @@
+PATH
+ remote: .
+ specs:
+ admin (0.0.1)
+ rails (~> 4.0.0)
+
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (4.0.1)
+ actionpack (= 4.0.1)
+ mail (~> 2.5.4)
+ actionpack (4.0.1)
+ activesupport (= 4.0.1)
+ builder (~> 3.1.0)
+ erubis (~> 2.7.0)
+ rack (~> 1.5.2)
+ rack-test (~> 0.6.2)
+ activemodel (4.0.1)
+ activesupport (= 4.0.1)
+ builder (~> 3.1.0)
+ activerecord (4.0.1)
+ activemodel (= 4.0.1)
+ activerecord-deprecated_finders (~> 1.0.2)
+ activesupport (= 4.0.1)
+ arel (~> 4.0.0)
+ activerecord-deprecated_finders (1.0.3)
+ activesupport (4.0.1)
+ i18n (~> 0.6, >= 0.6.4)
+ minitest (~> 4.2)
+ multi_json (~> 1.3)
+ thread_safe (~> 0.1)
+ tzinfo (~> 0.3.37)
+ arel (4.0.1)
+ atomic (1.1.14)
+ builder (3.1.4)
+ erubis (2.7.0)
+ hike (1.2.3)
+ i18n (0.6.5)
+ mail (2.5.4)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.25)
+ minitest (4.7.5)
+ multi_json (1.8.2)
+ polyglot (0.3.3)
+ rack (1.5.2)
+ rack-test (0.6.2)
+ rack (>= 1.0)
+ rails (4.0.1)
+ actionmailer (= 4.0.1)
+ actionpack (= 4.0.1)
+ activerecord (= 4.0.1)
+ activesupport (= 4.0.1)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 4.0.1)
+ sprockets-rails (~> 2.0.0)
+ railties (4.0.1)
+ actionpack (= 4.0.1)
+ activesupport (= 4.0.1)
+ rake (>= 0.8.7)
+ thor (>= 0.18.1, < 2.0)
+ rake (10.1.0)
+ sprockets (2.10.0)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sprockets-rails (2.0.1)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (~> 2.8)
+ sqlite3 (1.3.8)
+ thor (0.18.1)
+ thread_safe (0.1.3)
+ atomic
+ tilt (1.4.1)
+ treetop (1.4.15)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.38)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ admin!
+ sqlite3
20 admin/MIT-LICENSE
@@ -0,0 +1,20 @@
+Copyright 2013 YOURNAME
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3  admin/README.rdoc
@@ -0,0 +1,3 @@
+= Admin
+
+This project rocks and uses MIT-LICENSE.
34 admin/Rakefile
@@ -0,0 +1,34 @@
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
+
+require 'rdoc/task'
+
+RDoc::Task.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'Admin'
+ rdoc.options << '--line-numbers'
+ rdoc.rdoc_files.include('README.rdoc')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
+APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
+load 'rails/tasks/engine.rake'
+
+
+
+Bundler::GemHelper.install_tasks
+
+require 'rake/testtask'
+
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = false
+end
+
+
+task default: :test
22 admin/admin.gemspec
@@ -0,0 +1,22 @@
+$:.push File.expand_path("../lib", __FILE__)
+
+# Maintain your gem's version:
+require "admin/version"
+
+# Describe your gem and declare its dependencies:
+Gem::Specification.new do |s|
+ s.name = "admin"
+ s.version = Admin::VERSION
+ s.authors = ["TODO: Your name"]
+ s.email = ["TODO: Your email"]
+ s.homepage = "TODO"
+ s.summary = "TODO: Summary of Admin."
+ s.description = "TODO: Description of Admin."
+
+ s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
+ s.test_files = Dir["test/**/*"]
+
+ s.add_dependency "rails", "~> 4.0.0"
+
+ s.add_development_dependency "sqlite3"
+end
BIN  admin/app/.DS_Store
Binary file not shown
BIN  admin/app/assets/.DS_Store
Binary file not shown
0  admin/app/assets/images/admin/.keep
No changes.
16 admin/app/assets/javascripts/admin/application.js
@@ -0,0 +1,16 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// compiled file.
+//
+// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
+// about supported directives.
+//
+//= require jquery
+//= require jquery_ujs
+//= require turbolinks
+//= require_tree .
45 admin/app/assets/javascripts/admin/editor.coffee
@@ -0,0 +1,45 @@
+$ ->
+ window.Editor = new Editor()
+
+ $("#post_editing_options").on "click", "a", ->
+ $el = $("##{$(this).attr("binding")}")
+ $("form .editor").not($el).hide()
+ $el.show()
+
+
+class Editor
+ constructor: (opts) ->
+ @elements = {
+ $content: $("#post_content"),
+ $stylesheet: $("#post_stylesheet"),
+ $preview: $("#content_preview > .preview"),
+ title: new Title()
+ }
+ @listen(@elements)
+
+ listen: (elements) ->
+ elements.$content.get(0).addEventListener 'input', () ->
+ elements.$preview.html elements.$content.val()
+
+ elements.$stylesheet.get(0).addEventListener 'input', () ->
+ elements.$preview.siblings("style").text element.$stylesheet.value
+
+
+class Title
+ constructor: ->
+ @elements = {
+ $wrapper: $("#post_title_wrapper"),
+ $title: $("#post_title"),
+ $slug: $("#post_slug")
+ }
+
+ @listen(@elements)
+
+ listen: (elements) ->
+ elements.$wrapper.on 'click', 'a.toggle', =>
+ @toggle(elements)
+
+ toggle: (elements) ->
+ elements.$wrapper.toggleClass("slug")
+ elements.$title.add(elements.$slug).toggle()
+
13 admin/app/assets/stylesheets/admin/application.css
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * 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 .
+ */
23 admin/app/assets/stylesheets/admin/base.css.scss
@@ -0,0 +1,23 @@
+$fonts: Helvetica, sans-serif;
+
+html, body {
+ height: 100%;
+ font-size: 13px;
+}
+
+body {
+ margin: 0;
+ padding: 0;
+}
+
+* {
+ box-sizing: border-box;
+}
+
+input, textarea {
+ font: 100% $fonts;
+}
+
+.hidden {
+ display: none;
+}
140 admin/app/assets/stylesheets/admin/editor.css.scss
@@ -0,0 +1,140 @@
+@font-face {
+ font-family: 'entypo';
+ font-style: 'normal';
+ font-weight: 'normal';
+ src: url('/fonts/entypo.woff') format('woff');
+}
+
+[class*="entypo-"]:before {
+ font-family: 'entypo', sans-serif;
+}
+
+@mixin fields {
+ border: none;
+ margin: 0;
+ outline: none;
+ padding: 4px 12px;
+}
+
+#new_post {
+ position: relative;
+ height: 100%;
+ width: 100%;
+
+ .wrapper {
+ position: relative;
+ height: 100%;
+ }
+
+ .height.spacing {
+ position: absolute;
+ top: 85px;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ }
+
+}
+
+#post_title_wrapper {
+ margin-top: 10px;
+ background: #FAFAFA;
+ position: relative;
+
+ #post_title, #post_slug {
+ @include fields;
+ font-size: 2.5em;
+ width: 100%;
+ margin: 0;
+ padding-left: 40px;
+ font-weight: lighter;
+ background: none;
+ }
+
+ .toggle {
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ padding: 0 12px;
+ line-height: 3.8em;
+ cursor: pointer;
+ border-left: 1px solid transparent;
+
+ &:hover {
+ opacity: 0.4;
+ }
+
+ &:before {
+ content: "\1f517";
+ }
+ }
+ &.slug {
+ .toggle {
+ border-left-color: #CACACA;
+ box-shadow: inset 1px 0px 4px -2px rgba(0, 0, 0, 0.3);
+ background: rgba(0,0,0,0.1);
+ }
+ }
+}
+
+#post_content, #post_stylesheet {
+ @include fields;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 50%;
+ font-weight: lighter;
+ bottom: 0;
+ padding-top: 8px;
+ resize: none;
+ font-size: 1.2em;
+ background: #FAFAFA;
+ border-right: 1px solid #CACACA;
+}
+
+#post_editing_options {
+ height: 3.0em;
+ line-height: 3.0em;
+ border-bottom: 1px solid #CACACA;
+ position: relative;
+ .wrapper {
+ width: 50%;
+ text-align: center;
+ }
+ a {
+ cursor: pointer;
+ border: 1px solid #aaa;
+ background: #E2E9EF;
+ padding: 4px 8px;
+ border-radius: 3px;
+ &:first-child {
+ margin-right: 24px;
+ }
+ }
+
+ .actions.overlay {
+ position: absolute;
+ top: 4px;
+ right: 4px;
+ }
+}
+
+#content_preview {
+ position: absolute;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ width: 50%;
+ overflow-y: scroll;
+ & > .preview {
+ position: relative;
+ padding: 24px 8px 8px;
+ }
+ .sticky {
+ position: absolute;
+ top: 4px;
+ right: 4px;
+ color: #BABABA;
+ }
+}
6 admin/app/controllers/admin/application_controller.rb
@@ -0,0 +1,6 @@
+module Admin
+ class ApplicationController < ::ApplicationController
+ before_action :authenticate!
+
+ end
+end
44 admin/app/controllers/admin/posts_controller.rb
@@ -0,0 +1,44 @@
+module Admin
+ class PostsController < Admin::ApplicationController
+ before_action :pagination
+
+ def index
+ @posts = Post.page(params[:page]).per(params[:per_page])
+ if params.has_key? :status
+ @posts = @posts.status params[:status]
+ end
+ end
+
+ def create
+ @post = Post.new post_params
+ unless @post.save
+ # Errors!
+ puts @post.errors.full_messages
+ end
+
+ if @post.draft?
+ redirect_to :back
+ else
+ redirect_to root_url
+ end
+ end
+
+ def edit
+ @post = Post.find_by_slug(params[:id])
+ end
+
+ def update
+ end
+
+ protected
+
+ def pagination
+ params[:per_page] ||= 10
+ params[:page] ||= 1
+ end
+
+ def post_params
+ params.require(:post).permit(:title, :content, :status, :stylesheet, :slug)
+ end
+ end
+end
4 admin/app/helpers/admin/application_helper.rb
@@ -0,0 +1,4 @@
+module Admin
+ module ApplicationHelper
+ end
+end
BIN  admin/app/views/.DS_Store
Binary file not shown
0  admin/app/views/admin/posts/edit.html.erb
No changes.
7 admin/app/views/admin/posts/index.html.erb
@@ -0,0 +1,7 @@
+<%= link_to "Create a new post", new_post_path %>
+<%= link_to "Published", posts_path(status: "published") %>
+<%= link_to "Drafted", posts_path(status: "drafted") %>
+
+<% @posts.each do |post| %>
+ <%= link_to post.title, edit_post_path(post) %>
+<% end %>
33 admin/app/views/admin/posts/new.html.erb
@@ -0,0 +1,33 @@
+<%= form_for Post.new do |f| %>
+ <%= content_tag :div, id: "post_title_wrapper" do %>
+ <%= f.text_field :title, placeholder: t('.title') %>
+ <%= content_tag :a, nil, class: %w(toggle entypo-link) %>
+ <%= f.text_field :slug, placeholder: t('.slug'), class: %w(hidden) %>
+ <% end %>
+
+ <%= content_tag :div, id: "post_editing_options" do %>
+ <%= content_tag :div, class: %w(wrapper) do %>
+ <%= content_tag :a, t('.text'), binding: "post_content", class: %w(active) %>
+ <%= content_tag :a, t('.CSS'), binding: "post_stylesheet" %>
+ <% end %>
+ <%= content_tag :div, class: %w(actions overlay) do %>
+ <%= f.button "Save Draft", name: "post[status]", value: "draft" %>
+ <%= f.button "Publish", name: "post[status]", value: "publish" %>
+ <% end %>
+ <% end %>
+
+ <%= content_tag :div, class: %w(height spacing) do %>
+ <%= content_tag :div, class: %w(wrapper) do %>
+ <%= f.text_area :content, placeholder: t('.content'), class: %w(editor) %>
+ <%= f.text_area :stylesheet, placeholder: t('.stylesheet'), class: %w(hidden editor) %>
+
+
+ <%= content_tag :div, id: "content_preview" do %>
+ <%= content_tag :span, t('.preview'), class: %w(sticky) %>
+ <%= content_tag :style %>
+ <%= content_tag :div, class: %w(preview) do %>
+ <% end %>
+ <% end %>
+ <% end %>
+ <% end %>
+<% end %>
14 admin/app/views/layouts/admin/application.html.erb
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Manage your blog</title>
+ <%= stylesheet_link_tag "admin/application", media: "all" %>
+ <%= javascript_include_tag "admin/application" %>
+ <%= csrf_meta_tags %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
8 admin/bin/rails
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
+
+ENGINE_ROOT = File.expand_path('../..', __FILE__)
+ENGINE_PATH = File.expand_path('../../lib/admin/engine', __FILE__)
+
+require 'rails/all'
+require 'rails/engine/commands'
4 admin/config/routes.rb
@@ -0,0 +1,4 @@
+Admin::Engine.routes.draw do
+ root "posts#index"
+ resources :posts
+end
4 admin/lib/admin.rb
@@ -0,0 +1,4 @@
+require "admin/engine"
+
+module Admin
+end
5 admin/lib/admin/engine.rb
@@ -0,0 +1,5 @@
+module Admin
+ class Engine < ::Rails::Engine
+ isolate_namespace Admin
+ end
+end
3  admin/lib/admin/version.rb
@@ -0,0 +1,3 @@
+module Admin
+ VERSION = "0.0.1"
+end
4 admin/lib/tasks/admin_tasks.rake
@@ -0,0 +1,4 @@
+# desc "Explaining what the task does"
+# task :admin do
+# # Task goes here
+# end
7 admin/test/admin_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class AdminTest < ActiveSupport::TestCase
+ test "truth" do
+ assert_kind_of Module, Admin
+ end
+end
28 admin/test/dummy/README.rdoc
@@ -0,0 +1,28 @@
+== README
+
+This README would normally document whatever steps are necessary to get the
+application up and running.
+
+Things you may want to cover:
+
+* Ruby version
+
+* System dependencies
+
+* Configuration
+
+* Database creation
+
+* Database initialization
+
+* How to run the test suite
+
+* Services (job queues, cache servers, search engines, etc.)
+
+* Deployment instructions
+
+* ...
+
+
+Please feel free to use a different markup language if you do not plan to run
+<tt>rake doc:app</tt>.
6 admin/test/dummy/Rakefile
@@ -0,0 +1,6 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Dummy::Application.load_tasks
0  admin/test/dummy/app/assets/images/.keep
No changes.
13 admin/test/dummy/app/assets/javascripts/application.js
@@ -0,0 +1,13 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// compiled file.
+//
+// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
+// about supported directives.
+//
+//= require_tree .
13 admin/test/dummy/app/assets/stylesheets/application.css
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * 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 .
+ */
5 admin/test/dummy/app/controllers/application_controller.rb
@@ -0,0 +1,5 @@
+class ApplicationController < ActionController::Base
+ # Prevent CSRF attacks by raising an exception.
+ # For APIs, you may want to use :null_session instead.
+ protect_from_forgery with: :exception
+end
0  admin/test/dummy/app/controllers/concerns/.keep
No changes.
2  admin/test/dummy/app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
0  admin/test/dummy/app/mailers/.keep
No changes.
0  admin/test/dummy/app/models/.keep
No changes.
0  admin/test/dummy/app/models/concerns/.keep
No changes.
14 admin/test/dummy/app/views/layouts/application.html.erb
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Dummy</title>
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
+ <%= csrf_meta_tags %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
3  admin/test/dummy/bin/bundle
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+load Gem.bin_path('bundler', 'bundle')
4 admin/test/dummy/bin/rails
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require_relative '../config/boot'
+require 'rails/commands'
4 admin/test/dummy/bin/rake
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require_relative '../config/boot'
+require 'rake'
+Rake.application.run
4 admin/test/dummy/config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Rails.application
23 admin/test/dummy/config/application.rb
@@ -0,0 +1,23 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+Bundler.require(*Rails.groups)
+require "admin"
+
+module Dummy
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+ end
+end
+
5 admin/test/dummy/config/boot.rb
@@ -0,0 +1,5 @@
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
+$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
25 admin/test/dummy/config/database.yml
@@ -0,0 +1,25 @@
+# SQLite version 3.x
+# gem install sqlite3
+#
+# Ensure the SQLite 3 gem is defined in your Gemfile
+# gem 'sqlite3'
+development:
+ adapter: sqlite3
+ database: db/development.sqlite3
+ pool: 5
+ timeout: 5000
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ adapter: sqlite3
+ database: db/test.sqlite3
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: sqlite3
+ database: db/production.sqlite3
+ pool: 5
+ timeout: 5000
5 admin/test/dummy/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the Rails application.
+require File.expand_path('../application', __FILE__)
+
+# Initialize the Rails application.
+Dummy::Application.initialize!
29 admin/test/dummy/config/environments/development.rb
@@ -0,0 +1,29 @@
+Dummy::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the web server when you make code changes.
+ config.cache_classes = false
+
+ # Do not eager load code on boot.
+ config.eager_load = false
+
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Don't care if the mailer can't send.
+ config.action_mailer.raise_delivery_errors = false
+
+ # Print deprecation notices to the Rails logger.
+ config.active_support.deprecation = :log
+
+ # Raise an error on page load if there are pending migrations
+ config.active_record.migration_error = :page_load
+
+ # Debug mode disables concatenation and preprocessing of assets.
+ # This option may cause significant delays in view rendering with a large
+ # number of complex assets.
+ config.assets.debug = true
+end
80 admin/test/dummy/config/environments/production.rb
@@ -0,0 +1,80 @@
+Dummy::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # Code is not reloaded between requests.
+ config.cache_classes = true
+
+ # Eager load code on boot. This eager loads most of Rails and
+ # your application in memory, allowing both thread web servers
+ # and those relying on copy on write to perform better.
+ # Rake tasks automatically ignore this option for performance.
+ config.eager_load = true
+
+ # Full error reports are disabled and caching is turned on.
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
+ # Add `rack-cache` to your Gemfile before enabling this.
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
+ # config.action_dispatch.rack_cache = true
+
+ # Disable Rails's static asset server (Apache or nginx will already do this).
+ config.serve_static_assets = false
+
+ # Compress JavaScripts and CSS.
+ config.assets.js_compressor = :uglifier
+ # config.assets.css_compressor = :sass
+
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
+ config.assets.compile = false
+
+ # Generate digests for assets URLs.
+ config.assets.digest = true
+
+ # Version of your assets, change this if you want to expire all your assets.
+ config.assets.version = '1.0'
+
+ # Specifies the header that your server uses for sending files.
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
+
+ # Set to :debug to see everything in the log.
+ config.log_level = :info
+
+ # Prepend all log lines with the following tags.
+ # config.log_tags = [ :subdomain, :uuid ]
+
+ # Use a different logger for distributed setups.
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
+
+ # Use a different cache store in production.
+ # config.cache_store = :mem_cache_store
+
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Precompile additional assets.
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
+ # config.assets.precompile += %w( search.js )
+
+ # Ignore bad email addresses and do not raise email delivery errors.
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found).
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners.
+ config.active_support.deprecation = :notify
+
+ # Disable automatic flushing of the log to improve performance.
+ # config.autoflush_log = false
+
+ # Use default logging formatter so that PID and timestamp are not suppressed.
+ config.log_formatter = ::Logger::Formatter.new
+end
36 admin/test/dummy/config/environments/test.rb
@@ -0,0 +1,36 @@
+Dummy::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+
+ # Do not eager load code on boot. This avoids loading your whole application
+ # just for the purpose of running a single test. If you are using a tool that
+ # preloads Rails for running tests, you may have to set it to true.
+ config.eager_load = false
+
+ # Configure static asset server for tests with Cache-Control for performance.
+ config.serve_static_assets = true
+ config.static_cache_control = "public, max-age=3600"
+
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Raise exceptions instead of rendering exception templates.
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment.
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Print deprecation notices to the stderr.
+ config.active_support.deprecation = :stderr
+end
7 admin/test/dummy/config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
4 admin/test/dummy/config/initializers/filter_parameter_logging.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Configure sensitive parameters which will be filtered from the log file.
+Rails.application.config.filter_parameters += [:password]
16 admin/test/dummy/config/initializers/inflections.rb
@@ -0,0 +1,16 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format. Inflections
+# are locale specific, and you may define rules for as many different
+# locales as you wish. All of these examples are active by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
+
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.acronym 'RESTful'
+# end
5 admin/test/dummy/config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
12 admin/test/dummy/config/initializers/secret_token.rb
@@ -0,0 +1,12 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key is used for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+# You can use `rake secret` to generate a secure secret key.
+
+# Make sure your secret_key_base is kept private
+# if you're sharing your code publicly.
+Dummy::Application.config.secret_key_base = 'ecd2b358fa8e250080fd4e995af9fcc152dbdd410c5d97f105beee8aa66b800574c93231aedb95eadb8542dda6183c8954f17eb23915c89942288ee91f890049'
3  admin/test/dummy/config/initializers/session_store.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
14 admin/test/dummy/config/initializers/wrap_parameters.rb
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
+end
+
+# To enable root element in JSON for ActiveRecord objects.
+# ActiveSupport.on_load(:active_record) do
+# self.include_root_in_json = true
+# end
23 admin/test/dummy/config/locales/en.yml
@@ -0,0 +1,23 @@
+# Files in the config/locales directory are used for internationalization
+# and are automatically loaded by Rails. If you want to use locales other
+# than English, add the necessary files in this directory.
+#
+# To use the locales, use `I18n.t`:
+#
+# I18n.t 'hello'
+#
+# In views, this is aliased to just `t`:
+#
+# <%= t('hello') %>
+#
+# To use a different locale, set it with `I18n.locale`:
+#
+# I18n.locale = :es
+#
+# This would use the information in config/locales/es.yml.
+#
+# To learn more, please read the Rails Internationalization guide
+# available at http://guides.rubyonrails.org/i18n.html.
+
+en:
+ hello: "Hello world"
4 admin/test/dummy/config/routes.rb
@@ -0,0 +1,4 @@
+Rails.application.routes.draw do
+
+ mount Admin::Engine => "/admin"
+end
0  admin/test/dummy/lib/assets/.keep
No changes.
0  admin/test/dummy/log/.keep
No changes.
58 admin/test/dummy/public/404.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The page you were looking for doesn't exist (404)</title>
+ <style>
+ body {
+ background-color: #EFEFEF;
+ color: #2E2F30;
+ text-align: center;
+ font-family: arial, sans-serif;
+ }
+
+ div.dialog {
+ width: 25em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-left-color: #999;
+ border-bottom-color: #BBB;
+ border-top: #B00100 solid 4px;
+ border-top-left-radius: 9px;
+ border-top-right-radius: 9px;
+ background-color: white;
+ padding: 7px 4em 0 4em;
+ }
+
+ h1 {
+ font-size: 100%;
+ color: #730E15;
+ line-height: 1.5em;
+ }
+
+ body > p {
+ width: 33em;
+ margin: 0 auto 1em;
+ padding: 1em 0;
+ background-color: #F7F7F7;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
+ border-top-color: #DADADA;
+ color: #666;
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
+ }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/404.html -->
+ <div class="dialog">
+ <h1>The page you were looking for doesn't exist.</h1>
+ <p>You may have mistyped the address or the page may have moved.</p>
+ </div>
+ <p>If you are the application owner check the logs for more information.</p>
+</body>
+</html>
58 admin/test/dummy/public/422.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The change you wanted was rejected (422)</title>
+ <style>
+ body {
+ background-color: #EFEFEF;
+ color: #2E2F30;
+ text-align: center;
+ font-family: arial, sans-serif;
+ }
+
+ div.dialog {
+ width: 25em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-left-color: #999;
+ border-bottom-color: #BBB;
+ border-top: #B00100 solid 4px;
+ border-top-left-radius: 9px;
+ border-top-right-radius: 9px;
+ background-color: white;
+ padding: 7px 4em 0 4em;
+ }
+
+ h1 {
+ font-size: 100%;
+ color: #730E15;
+ line-height: 1.5em;
+ }
+
+ body > p {
+ width: 33em;
+ margin: 0 auto 1em;
+ padding: 1em 0;
+ background-color: #F7F7F7;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
+ border-top-color: #DADADA;
+ color: #666;
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
+ }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/422.html -->
+ <div class="dialog">
+ <h1>The change you wanted was rejected.</h1>
+ <p>Maybe you tried to change something you didn't have access to.</p>
+ </div>
+ <p>If you are the application owner check the logs for more information.</p>
+</body>
+</html>
57 admin/test/dummy/public/500.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>We're sorry, but something went wrong (500)</title>
+ <style>
+ body {
+ background-color: #EFEFEF;
+ color: #2E2F30;
+ text-align: center;
+ font-family: arial, sans-serif;
+ }
+
+ div.dialog {
+ width: 25em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-left-color: #999;
+ border-bottom-color: #BBB;
+ border-top: #B00100 solid 4px;
+ border-top-left-radius: 9px;
+ border-top-right-radius: 9px;
+ background-color: white;
+ padding: 7px 4em 0 4em;
+ }
+
+ h1 {
+ font-size: 100%;
+ color: #730E15;
+ line-height: 1.5em;
+ }
+
+ body > p {
+ width: 33em;
+ margin: 0 auto 1em;
+ padding: 1em 0;
+ background-color: #F7F7F7;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
+ border-top-color: #DADADA;
+ color: #666;
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
+ }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/500.html -->
+ <div class="dialog">
+ <h1>We're sorry, but something went wrong.</h1>
+ </div>
+ <p>If you are the application owner check the logs for more information.</p>
+</body>
+</html>
0  admin/test/dummy/public/favicon.ico
No changes.
10 admin/test/integration/navigation_test.rb
@@ -0,0 +1,10 @@
+require 'test_helper'
+
+class NavigationTest < ActionDispatch::IntegrationTest
+ fixtures :all
+
+ # test "the truth" do
+ # assert true
+ # end
+end
+
15 admin/test/test_helper.rb
@@ -0,0 +1,15 @@
+# Configure Rails Environment
+ENV["RAILS_ENV"] = "test"
+
+require File.expand_path("../dummy/config/environment.rb", __FILE__)
+require "rails/test_help"
+
+Rails.backtrace_cleaner.remove_silencers!
+
+# Load support files
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
+
+# Load fixtures from the engine
+if ActiveSupport::TestCase.method_defined?(:fixture_path=)
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
+end
BIN  app/.DS_Store
Binary file not shown
BIN  app/assets/.DS_Store
Binary file not shown
0  app/assets/images/.keep
No changes.
BIN  app/assets/images/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/comments.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/github-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/header-code.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/header-golang.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/header-javascript.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/header-rails.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/profile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/twitter-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 app/assets/javascripts/application.js
@@ -0,0 +1,16 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// compiled file.
+//
+// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
+// about supported directives.
+//
+//= require jquery
+//= require jquery_ujs
+//= require turbolinks
+//= require_tree .
296 app/assets/javascripts/keymaster.js
@@ -0,0 +1,296 @@
+// keymaster.js
+// (c) 2011-2012 Thomas Fuchs
+// keymaster.js may be freely distributed under the MIT license.
+
+;(function(global){
+ var k,
+ _handlers = {},
+ _mods = { 16: false, 18: false, 17: false, 91: false },
+ _scope = 'all',
+ // modifier keys
+ _MODIFIERS = {
+ '': 16, shift: 16,
+ '': 18, alt: 18, option: 18,
+ '': 17, ctrl: 17, control: 17,
+ '': 91, command: 91
+ },
+ // special keys
+ _MAP = {
+ backspace: 8, tab: 9, clear: 12,
+ enter: 13, 'return': 13,
+ esc: 27, escape: 27, space: 32,
+ left: 37, up: 38,
+ right: 39, down: 40,
+ del: 46, 'delete': 46,
+ home: 36, end: 35,
+ pageup: 33, pagedown: 34,
+ ',': 188, '.': 190, '/': 191,
+ '`': 192, '-': 189, '=': 187,
+ ';': 186, '\'': 222,
+ '[': 219, ']': 221, '\\': 220
+ },
+ code = function(x){
+ return _MAP[x] || x.toUpperCase().charCodeAt(0);
+ },
+ _downKeys = [];
+
+ for(k=1;k<20;k++) _MAP['f'+k] = 111+k;
+
+ // IE doesn't support Array#indexOf, so have a simple replacement
+ function index(array, item){
+ var i = array.length;
+ while(i--) if(array[i]===item) return i;
+ return -1;
+ }
+
+ // for comparing mods before unassignment
+ function compareArray(a1, a2) {
+ if (a1.length != a2.length) return false;
+ for (var i = 0; i < a1.length; i++) {
+ if (a1[i] !== a2[i]) return false;
+ }
+ return true;
+ }
+
+ var modifierMap = {
+ 16:'shiftKey',
+ 18:'altKey',
+ 17:'ctrlKey',
+ 91:'metaKey'
+ };
+ function updateModifierKey(event) {
+ for(k in _mods) _mods[k] = event[modifierMap[k]];
+ };
+
+ // handle keydown event
+ function dispatch(event) {
+ var key, handler, k, i, modifiersMatch, scope;
+ key = event.keyCode;
+
+ if (index(_downKeys, key) == -1) {
+ _downKeys.push(key);
+ }
+
+ // if a modifier key, set the key.<modifierkeyname> property to true and return
+ if(key == 93 || key == 224) key = 91; // right command on webkit, command on Gecko
+ if(key in _mods) {
+ _mods[key] = true;
+ // 'assignKey' from inside this closure is exported to window.key
+ for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = true;
+ return;
+ }
+ updateModifierKey(event);
+
+ // see if we need to ignore the keypress (filter() can can be overridden)
+ // by default ignore key presses if a select, textarea, or input is focused
+ if(!assignKey.filter.call(this, event)) return;
+
+ // abort if no potentially matching shortcuts found
+ if (!(key in _handlers)) return;
+
+ scope = getScope();
+
+ // for each potential shortcut
+ for (i = 0; i < _handlers[key].length; i++) {
+ handler = _handlers[key][i];
+
+ // see if it's in the current scope
+ if(handler.scope == scope || handler.scope == 'all'){
+ // check if modifiers match if any
+ modifiersMatch = handler.mods.length > 0;
+ for(k in _mods)
+ if((!_mods[k] && index(handler.mods, +k) > -1) ||
+ (_mods[k] && index(handler.mods, +k) == -1)) modifiersMatch = false;
+ // call the handler and stop the event if neccessary
+ if((handler.mods.length == 0 && !_mods[16] && !_mods[18] && !_mods[17] && !_mods[91]) || modifiersMatch){
+ if(handler.method(event, handler)===false){
+ if(event.preventDefault) event.preventDefault();
+ else event.returnValue = false;
+ if(event.stopPropagation) event.stopPropagation();
+ if(event.cancelBubble) event.cancelBubble = true;
+ }
+ }
+ }
+ }
+ };
+
+ // unset modifier keys on keyup
+ function clearModifier(event){
+ var key = event.keyCode, k,
+ i = index(_downKeys, key);
+
+ // remove key from _downKeys
+ if (i >= 0) {
+ _downKeys.splice(i, 1);
+ }
+
+ if(key == 93 || key == 224) key = 91;
+ if(key in _mods) {
+ _mods[key] = false;
+ for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;
+ }
+ };
+
+ function resetModifiers() {
+ for(k in _mods) _mods[k] = false;
+ for(k in _MODIFIERS) assignKey[k] = false;
+ };
+
+ // parse and assign shortcut
+ function assignKey(key, scope, method){
+ var keys, mods;
+ keys = getKeys(key);
+ if (method === undefined) {
+ method = scope;
+ scope = 'all';
+ }
+
+ // for each shortcut
+ for (var i = 0; i < keys.length; i++) {
+ // set modifier keys if any
+ mods = [];
+ key = keys[i].split('+');
+ if (key.length > 1){
+ mods = getMods(key);
+ key = [key[key.length-1]];
+ }
+ // convert to keycode and...
+ key = key[0]
+ key = code(key);
+ // ...store handler
+ if (!(key in _handlers)) _handlers[key] = [];
+ _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });
+ }
+ };
+
+ // unbind all handlers for given key in current scope
+ function unbindKey(key, scope) {
+ var multipleKeys, keys,
+ mods = [],
+ i, j, obj;
+
+ multipleKeys = getKeys(key);
+
+ for (j = 0; j < multipleKeys.length; j++) {
+ keys = multipleKeys[j].split('+');
+
+ if (keys.length > 1) {
+ mods = getMods(keys);
+ key = keys[keys.length - 1];
+ }
+
+ key = code(key);
+
+ if (scope === undefined) {
+ scope = getScope();
+ }
+ if (!_handlers[key]) {
+ return;
+ }
+ for (i in _handlers[key]) {
+ obj = _handlers[key][i];
+ // only clear handlers if correct scope and mods match
+ if (obj.scope === scope && compareArray(obj.mods, mods)) {
+ _handlers[key][i] = {};
+ }
+ }
+ }
+ };
+
+ // Returns true if the key with code 'keyCode' is currently down
+ // Converts strings into key codes.
+ function isPressed(keyCode) {
+ if (typeof(keyCode)=='string') {
+ keyCode = code(keyCode);
+ }
+ return index(_downKeys, keyCode) != -1;
+ }
+
+ function getPressedKeyCodes() {
+ return _downKeys.slice(0);
+ }
+
+ function filter(event){
+ var tagName = (event.target || event.srcElement).tagName;
+ // ignore keypressed in any elements that support keyboard data input
+ return !(tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA');
+ }
+
+ // initialize key.<modifier> to false
+ for(k in _MODIFIERS) assignKey[k] = false;
+
+ // set current scope (default 'all')
+ function setScope(scope){ _scope = scope || 'all' };
+ function getScope(){ return _scope || 'all' };
+
+ // delete all handlers for a given scope
+ function deleteScope(scope){
+ var key, handlers, i;
+
+ for (key in _handlers) {
+ handlers = _handlers[key];
+ for (i = 0; i < handlers.length; ) {
+ if (handlers[i].scope === scope) handlers.splice(i, 1);
+ else i++;
+ }
+ }
+ };
+
+ // abstract key logic for assign and unassign
+ function getKeys(key) {
+ var keys;
+ key = key.replace(/\s/g, '');
+ keys = key.split(',');
+ if ((keys[keys.length - 1]) == '') {
+ keys[keys.length - 2] += ',';
+ }
+ return keys;
+ }
+
+ // abstract mods logic for assign and unassign
+ function getMods(key) {
+ var mods = key.slice(0, key.length - 1);
+ for (var mi = 0; mi < mods.length; mi++)
+ mods[mi] = _MODIFIERS[mods[mi]];
+ return mods;
+ }
+
+ // cross-browser events
+ function addEvent(object, event, method) {
+ if (object.addEventListener)
+ object.addEventListener(event, method, false);
+ else if(object.attachEvent)
+ object.attachEvent('on'+event, function(){ method(window.event) });
+ };
+
+ // set the handlers globally on document
+ addEvent(document, 'keydown', function(event) { dispatch(event) }); // Passing _scope to a callback to ensure it remains the same by execution. Fixes #48
+ addEvent(document, 'keyup', clearModifier);
+
+ // reset modifiers to false whenever the window is (re)focused.
+ addEvent(window, 'focus', resetModifiers);
+
+ // store previously defined key
+ var previousKey = global.key;
+
+ // restore previously defined key and return reference to our key object
+ function noConflict() {
+ var k = global.key;
+ global.key = previousKey;
+ return k;
+ }
+
+ // set window.key and window.key.set/get/deleteScope, and the default filter
+ global.key = assignKey;
+ global.key.setScope = setScope;
+ global.key.getScope = getScope;
+ global.key.deleteScope = deleteScope;
+ global.key.filter = filter;
+ global.key.isPressed = isPressed;
+ global.key.getPressedKeyCodes = getPressedKeyCodes;
+ global.key.noConflict = noConflict;
+ global.key.unbind = unbindKey;
+
+ if(typeof module !== 'undefined') module.exports = key;
+
+})(this);
60 app/assets/javascripts/keymaster.sequence.js
@@ -0,0 +1,60 @@
+// keymaster.sequence.js
+// (c) 2011 Ron Derksen
+// keymaster.sequence.js may be freely distributed under the MIT license.
+;(function (keymaster) {
+ _seqScope = "seq_";
+
+ if (!Function.prototype.bind) {
+ Function.prototype.bind = function (obj) {
+ // closest thing possible to the ECMAScript 5 internal IsCallable function
+ if (typeof this !== 'function') {
+ throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
+ }
+ var slice = [].slice,
+ args = slice.call(arguments, 1),
+ self = this,
+ nop = function () { },
+ bound = function () {
+ return self.apply(this instanceof nop ? this : (obj || {}),
+ args.concat(slice.call(arguments)));
+ };
+ bound.prototype = this.prototype;
+ return bound;
+ };
+ }
+
+ keymaster.sequence = function (keys, scope, method) {
+ if (method == undefined) {
+ method = scope;
+ scope = 'all';
+ }
+
+ var _origScope = scope;
+ for(i = 0; i < keys.length; i++) {
+ if (i < keys.length-1) {
+ //create specific scope for current key in sequence
+ _seqScope = _seqScope + keys[i];
+
+ keymaster(keys[i], scope, function (ev, key) {
+ keymaster.setScope(this.toString());
+
+ // reset scope after 1 second
+ _timer = setTimeout(function () {
+ keymaster.setScope(_origScope);
+ }, 1000);
+ }.bind(_seqScope));
+ } else {
+ // last key should perform the method
+ keymaster(keys[i], _seqScope, function() {
+ // Set the scope back to the original, then
+ // call our passed in method
+ keymaster.setScope(_origScope);
+ return method.apply(this, arguments);
+ });
+ }
+ scope = _seqScope;
+ }
+ // reset _seqScope for new sequence
+ _seqScope = "seq_";
+ }
+})(key);
2  app/assets/javascripts/login.coffee
@@ -0,0 +1,2 @@
+key.sequence ["l","o","g", "i", "n"], ->
+ $.getScript("/admin")
591 app/assets/javascripts/prism.js
@@ -0,0 +1,591 @@
+/**
+ * Prism: Lightweight, robust, elegant syntax highlighting
+ * MIT license http://www.opensource.org/licenses/mit-license.php/
+ * @author Lea Verou http://lea.verou.me
+ */
+
+(function(){
+
+// Private helper vars
+var lang = /\blang(?:uage)?-(?!\*)(\w+)\b/i;
+
+var _ = self.Prism = {
+ util: {
+ type: function (o) {
+ return Object.prototype.toString.call(o).match(