jabe 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/README.textile +0 -2
  2. data/Rakefile +3 -12
  3. data/app/assets/images/jabe/glyphicons-halflings-white.png +0 -0
  4. data/app/assets/images/jabe/glyphicons-halflings.png +0 -0
  5. data/app/assets/javascripts/jabe/application.js +5 -14
  6. data/app/assets/javascripts/jabe/bootstrap.js +2038 -0
  7. data/app/assets/javascripts/jabe/prettify.js +1477 -0
  8. data/app/assets/stylesheets/jabe/application.css +3 -1
  9. data/app/assets/stylesheets/jabe/bootstrap.css.erb +5837 -0
  10. data/app/assets/stylesheets/jabe/jabe.css +104 -0
  11. data/app/assets/stylesheets/jabe/prettify.css +30 -0
  12. data/app/controllers/jabe/admin/base_controller.rb +2 -1
  13. data/app/controllers/jabe/application_controller.rb +1 -0
  14. data/app/controllers/jabe/sessions_controller.rb +13 -0
  15. data/app/models/jabe/admin.rb +1 -1
  16. data/app/views/jabe/admin/entries/_form.html.erb +17 -0
  17. data/app/views/jabe/admin/entries/edit.html.erb +1 -0
  18. data/app/views/jabe/admin/entries/index.html.erb +64 -0
  19. data/app/views/jabe/admin/entries/new.html.erb +1 -0
  20. data/app/views/jabe/admin/settings/edit.html.erb +50 -0
  21. data/app/views/jabe/entries/index.html.erb +21 -0
  22. data/app/views/jabe/entries/show.html.erb +84 -0
  23. data/app/views/jabe/sessions/new.html.erb +10 -7
  24. data/app/views/kaminari/_first_page.html.erb +13 -0
  25. data/app/views/kaminari/_gap.html.erb +8 -0
  26. data/app/views/kaminari/_last_page.html.erb +13 -0
  27. data/app/views/kaminari/_next_page.html.erb +13 -0
  28. data/app/views/kaminari/_page.html.erb +12 -0
  29. data/app/views/kaminari/_paginator.html.erb +25 -0
  30. data/app/views/kaminari/_prev_page.html.erb +13 -0
  31. data/app/views/layouts/jabe/_admin.html.erb +14 -0
  32. data/app/views/layouts/jabe/_flash_messages.html.erb +10 -0
  33. data/app/views/layouts/jabe/application.html.erb +93 -0
  34. data/config/cucumber.yml +8 -0
  35. data/config/routes.rb +2 -2
  36. data/lib/jabe.rb +14 -0
  37. data/lib/jabe/version.rb +1 -1
  38. data/lib/tasks/cucumber.rake +65 -0
  39. metadata +67 -78
  40. data/app/assets/javascripts/jabe/libs/dd_belatedpng.js +0 -13
  41. data/app/assets/javascripts/jabe/libs/modernizr-1.6.min.js +0 -30
  42. data/app/assets/javascripts/jabe/plugins.js +0 -40
  43. data/app/assets/stylesheets/jabe/boilerplate.scss +0 -273
  44. data/app/assets/stylesheets/jabe/jabe.scss +0 -334
  45. data/app/views/jabe/admin/entries/_form.html.haml +0 -6
  46. data/app/views/jabe/admin/entries/edit.html.haml +0 -1
  47. data/app/views/jabe/admin/entries/index.html.haml +0 -45
  48. data/app/views/jabe/admin/entries/new.html.haml +0 -1
  49. data/app/views/jabe/admin/settings/edit.html.haml +0 -15
  50. data/app/views/jabe/confirmations/new.html.erb +0 -15
  51. data/app/views/jabe/entries/index.html.haml +0 -14
  52. data/app/views/jabe/entries/show.html.haml +0 -49
  53. data/app/views/jabe/mailer/confirmation_instructions.html.erb +0 -5
  54. data/app/views/jabe/mailer/reset_password_instructions.html.erb +0 -8
  55. data/app/views/jabe/mailer/unlock_instructions.html.erb +0 -7
  56. data/app/views/jabe/passwords/edit.html.erb +0 -19
  57. data/app/views/jabe/passwords/new.html.erb +0 -15
  58. data/app/views/jabe/registrations/edit.html.erb +0 -22
  59. data/app/views/jabe/registrations/new.html.erb +0 -17
  60. data/app/views/jabe/shared/_links.erb +0 -25
  61. data/app/views/jabe/unlocks/new.html.erb +0 -15
  62. data/app/views/layouts/jabe/_flashes.html.haml +0 -3
  63. data/app/views/layouts/jabe/_footer.html.haml +0 -2
  64. data/app/views/layouts/jabe/_header.html.haml +0 -4
  65. data/app/views/layouts/jabe/_sidebar.html.haml +0 -21
  66. data/app/views/layouts/jabe/application.html.haml +0 -63
  67. data/config/initializers/simple_form.rb +0 -93
@@ -1,6 +0,0 @@
1
- = simple_form_for [:admin, entry] do |form|
2
- = form.input :title
3
- = form.input :body
4
- = form.input :published_at if entry.published_at
5
- = form.submit 'Save as draft'
6
- = form.submit 'Publish'
@@ -1 +0,0 @@
1
- = render 'form'
@@ -1,45 +0,0 @@
1
- %p
2
- = link_to 'Start a new entry', new_admin_entry_path
3
- %br
4
-
5
- %h2 Drafts
6
-
7
- - if @drafts.any?
8
- %table.entries
9
- - @drafts.each do |entry|
10
- %tr
11
- %td
12
- = link_to image_tag('jabe/delete_page.png'),
13
- admin_entry_path(entry),
14
- :confirm => 'Are you sure?',
15
- :method => :delete,
16
- :title => 'Delete'
17
- = link_to image_tag('jabe/full_page.png'),
18
- entry_path(entry),
19
- :title => 'Preview'
20
- %td
21
- = link_to entry.title, edit_admin_entry_path(entry)
22
-
23
- %br
24
-
25
- %h2 Published
26
-
27
- - if @published.any?
28
- %table.entries
29
- - @published.each do |entry|
30
- %tr
31
- %td.icons
32
- = link_to image_tag('jabe/delete_page.png'),
33
- admin_entry_path(entry),
34
- :confirm => 'Are you sure?',
35
- :method => :delete,
36
- :title => 'Delete'
37
- = link_to image_tag('jabe/full_page.png'),
38
- public_entry_url(entry),
39
- :title => 'Preview'
40
- %td
41
- = link_to entry.title, edit_admin_entry_path(entry)
42
- .when
43
- = entry.published_at.to_s(:long)
44
-
45
- = paginate @published
@@ -1 +0,0 @@
1
- = render 'form'
@@ -1,15 +0,0 @@
1
- %h2 Site Settings
2
- = simple_form_for Jabe::SETTINGS, :url => admin_settings_path do |form|
3
- = form.input :host_name, :label => 'Domain and port', :hint => '(e.g. pixels-and-bits.com or localhost:3000)'
4
- = form.input :site_name
5
- = form.input :tagline
6
- = form.input :mail_from
7
- = form.input :time_zone, :label => 'Your local time zone'
8
- = form.input :entries_per_page, :label => 'Entries on the home page'
9
- = form.input :sidebar_heading
10
- = form.input :github_username
11
- = form.input :show_github_badge
12
- = form.input :twitter_username
13
- = form.input :facebook_url
14
- = form.input :google_tracker_id
15
- = form.submit 'Save'
@@ -1,15 +0,0 @@
1
- <h2>Resend confirmation instructions</h2>
2
-
3
- <%= simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
4
- <%= f.error_notification %>
5
-
6
- <div class="inputs">
7
- <%= f.input :email, :required => true %>
8
- </div>
9
-
10
- <div class="actions">
11
- <%= f.button :submit, "Resend confirmation instructions" %>
12
- </div>
13
- <% end %>
14
-
15
- <%= render :partial => "devise/shared/links" %>
@@ -1,14 +0,0 @@
1
- #entries
2
- - @entries.each do |entry|
3
- .entry{ :class => entry == @entries.last ? 'last' : '' }
4
- .title
5
- %h1
6
- = link_to entry.title, public_entry_url(entry)
7
- .date
8
- = entry.published_at.to_s(:long)
9
- .content
10
- ~ entry.body.html_safe
11
- .meta
12
- = link_to "Comments: #{entry.comments.count}", public_entry_url(entry) + '#comments'
13
- #pagination.apple_pagination
14
- = paginate @entries
@@ -1,49 +0,0 @@
1
- - page_title entry.title
2
-
3
- #entries
4
- .entry.last
5
- .title
6
- %h1
7
- = entry.title
8
- .date
9
- = entry.published_at.try(:to_s, :long)
10
- .content
11
- ~ entry.body.html_safe
12
-
13
- %a{ :name => 'comments' }
14
- #comments
15
- %h2 Comments
16
- - if entry.comments.any?
17
- - entry.comments.each do |comment|
18
- .comment
19
- - if admin_signed_in?
20
- .delete
21
- = link_to image_tag('jabe/delete.png'),
22
- entry_comment_path(entry, comment),
23
- :confirm => 'Are you sure?',
24
- :method => :delete
25
- - if comment.respond_to?(:gravatar_url)
26
- .gravatar
27
- = image_tag comment.gravatar_url(:default => default_gravatar_url)
28
- .author
29
- = comment.name
30
- %span.when
31
- = comment.created_at.to_s(:long)
32
- .body
33
- = comment.body.html_safe
34
- - else
35
- .comment
36
- .author
37
- None yet...
38
-
39
- %a{ :name => 'add-comment' }
40
- #new_comment
41
- %h2 Add a comment
42
- = simple_form_for [entry, comment] do |form|
43
- = form.input :name
44
- = form.input :nickname
45
- = form.input :email, :label => 'Email (not shown to the public)'
46
- = form.input :url, :label => 'Website'
47
- = form.input :body, :label => 'Comment',
48
- :hint => "Textile enabled (#{link_to 'Reference', 'http://redcloth.org/try-redcloth/', :target => '_blank'})".html_safe
49
- = form.submit 'Add comment'
@@ -1,5 +0,0 @@
1
- <p>Welcome <%= @resource.email %>!</p>
2
-
3
- <p>You can confirm your account through the link below:</p>
4
-
5
- <p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
@@ -1,8 +0,0 @@
1
- <p>Hello <%= @resource.email %>!</p>
2
-
3
- <p>Someone has requested a link to change your password, and you can do this through the link below.</p>
4
-
5
- <p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
6
-
7
- <p>If you didn't request this, please ignore this email.</p>
8
- <p>Your password won't change until you access the link above and create a new one.</p>
@@ -1,7 +0,0 @@
1
- <p>Hello <%= @resource.email %>!</p>
2
-
3
- <p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p>
4
-
5
- <p>Click the link below to unlock your account:</p>
6
-
7
- <p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
@@ -1,19 +0,0 @@
1
- <h2>Change your password</h2>
2
-
3
- <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
4
- <%= f.error_notification %>
5
-
6
- <%= f.input :reset_password_token, :as => :hidden %>
7
- <%= f.full_error :reset_password_token %>
8
-
9
- <div class="inputs">
10
- <%= f.input :password, :label => "New password", :required => true %>
11
- <%= f.input :password_confirmation, :label => "Confirm your new password", :required => true %>
12
- </div>
13
-
14
- <div class="actions">
15
- <%= f.button :submit, "Change my password" %>
16
- </div>
17
- <% end %>
18
-
19
- <%= render :partial => "devise/shared/links" %>
@@ -1,15 +0,0 @@
1
- <h2>Forgot your password?</h2>
2
-
3
- <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
4
- <%= f.error_notification %>
5
-
6
- <div class="inputs">
7
- <%= f.input :email, :required => true %>
8
- </div>
9
-
10
- <div class="actions">
11
- <%= f.button :submit, "Send me reset password instructions" %>
12
- </div>
13
- <% end %>
14
-
15
- <%= render :partial => "devise/shared/links" %>
@@ -1,22 +0,0 @@
1
- <h2>Edit <%= resource_name.to_s.humanize %></h2>
2
-
3
- <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
4
- <%= f.error_notification %>
5
-
6
- <div class="inputs">
7
- <%= f.input :email, :required => true, :autofocus => true %>
8
- <%= f.input :password, :hint => "leave it blank if you don't want to change it", :required => false %>
9
- <%= f.input :password_confirmation, :required => false %>
10
- <%= f.input :current_password, :hint => "we need your current password to confirm your changes", :required => true %>
11
- </div>
12
-
13
- <div class="actions">
14
- <%= f.button :submit, "Update" %>
15
- </div>
16
- <% end %>
17
-
18
- <h3>Cancel my account</h3>
19
-
20
- <p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>
21
-
22
- <%= link_to "Back", :back %>
@@ -1,17 +0,0 @@
1
- <h2>Sign up</h2>
2
-
3
- <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
4
- <%= f.error_notification %>
5
-
6
- <div class="inputs">
7
- <%= f.input :email, :required => true, :autofocus => true %>
8
- <%= f.input :password, :required => true %>
9
- <%= f.input :password_confirmation, :required => true %>
10
- </div>
11
-
12
- <div class="actions">
13
- <%= f.button :submit, "Sign up" %>
14
- </div>
15
- <% end %>
16
-
17
- <%= render :partial => "devise/shared/links" %>
@@ -1,25 +0,0 @@
1
- <%- if controller_name != 'sessions' %>
2
- <%= link_to "Sign in", new_session_path(resource_name) %><br />
3
- <% end -%>
4
-
5
- <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
- <%= link_to "Sign up", new_registration_path(resource_name) %><br />
7
- <% end -%>
8
-
9
- <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
10
- <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
- <% end -%>
12
-
13
- <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
- <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
- <% end -%>
16
-
17
- <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
- <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
- <% end -%>
20
-
21
- <%- if devise_mapping.omniauthable? %>
22
- <%- resource_class.omniauth_providers.each do |provider| %>
23
- <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
24
- <% end -%>
25
- <% end -%>
@@ -1,15 +0,0 @@
1
- <h2>Resend unlock instructions</h2>
2
-
3
- <%= simple_form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
4
- <%= f.error_notification %>
5
-
6
- <div class="inputs">
7
- <%= f.input :email, :required => true %>
8
- </div>
9
-
10
- <div class="actions">
11
- <%= f.button :submit, "Resend unlock instructions" %>
12
- </div>
13
- <% end %>
14
-
15
- <%= render :partial => "devise/shared/links" %>
@@ -1,3 +0,0 @@
1
- - flash.each do |key, value|
2
- %div{ :class => "flash-#{key}" }
3
- = value
@@ -1,2 +0,0 @@
1
- Powered by #{link_to 'JABE', 'http://github.com/pixels-and-bits/jabe'}
2
- a #{link_to 'Pixels and Bits', 'http://pixels-and-bits.com'} project
@@ -1,4 +0,0 @@
1
- %h1#site-title
2
- = link_to Jabe::SETTINGS.site_name, root_path
3
- %h1#site-tagline
4
- = Jabe::SETTINGS.tagline
@@ -1,21 +0,0 @@
1
- %h2
2
- = Jabe::SETTINGS.sidebar_heading
3
-
4
- - unless Jabe::SETTINGS.github_username.blank?
5
- .link
6
- = link_to 'Github', Jabe::SETTINGS.github_username
7
-
8
- - unless Jabe::SETTINGS.twitter_username.blank?
9
- .link
10
- = link_to 'Twitter', Jabe::SETTINGS.twitter_username
11
-
12
- - unless Jabe::SETTINGS.facebook_url.blank?
13
- .link
14
- = link_to 'Facebook', Jabe::SETTINGS.facebook_url
15
-
16
- - if Jabe::SETTINGS.show_github_badge
17
- #github-badge
18
-
19
- :javascript
20
- GITHUB_USERNAME="#{ Jabe::SETTINGS.github_username}";
21
- = javascript_include_tag 'http://drnicjavascript.rubyforge.org/github_badge/dist/github-badge-launcher.js'
@@ -1,63 +0,0 @@
1
- <!doctype html>
2
- /[if lt IE 7 ] <html lang="en" class="no-js ie6">
3
- /[if IE 7 ] <html lang="en" class="no-js ie7">
4
- /[if IE 8 ] <html lang="en" class="no-js ie8">
5
- /[if IE 9 ] <html lang="en" class="no-js ie9">
6
- / [if (gt IE 9)|!(IE)]><!
7
- %html.no-js{:lang => "en"}
8
- / <![endif]
9
- %head
10
- %meta{:charset => "utf-8"}/
11
- %meta{:content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}/
12
- %title
13
- = "#{@page_title} - " if @page_title
14
- = Jabe::SETTINGS.site_name
15
- %meta{:content => "", :name => "description"}/
16
- %meta{:content => "", :name => "author"}/
17
- %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}/
18
- %link{:href => "/favicon.ico", :rel => "shortcut icon"}/
19
- %link{:href => "/apple-touch-icon.png", :rel => "apple-touch-icon"}/
20
- = csrf_meta_tag
21
- = auto_discovery_link_tag :atom, feed_path
22
- = stylesheet_link_tag 'jabe/application', 'application'
23
- = javascript_include_tag 'jabe/libs/modernizr-1.6.min.js'
24
- %body
25
- #container
26
- %header
27
- = render 'layouts/jabe/header'
28
- - if admin_signed_in?
29
- %nav.nav.admin
30
- %ul
31
- %li= link_to 'Entries', admin_entries_path
32
- %li= link_to 'Settings', edit_admin_settings_path
33
- %li= link_to 'Logout', destroy_admin_session_path, :method => :delete
34
- #main
35
- #content
36
- = render 'layouts/jabe/flashes'
37
- = yield
38
- #sidebar
39
- = render 'layouts/jabe/sidebar'
40
- %footer
41
- = render 'layouts/jabe/footer'
42
- = javascript_include_tag 'jabe/application.js'
43
-
44
- /[if lt IE 7 ]
45
- = javascript_include_tag 'jabe/libs/dd_belatedpng.js'
46
- %script{ :type => 'text/javascript', :charset => 'utf-8' }
47
- DD_belatedPNG.fix('img, .png_bg')
48
-
49
- %script{ :type => 'text/javascript', :charset => 'utf-8' }
50
- $(document).ready(function() {
51
- = yield :on_ready
52
- })
53
-
54
- - unless Jabe::SETTINGS.google_tracker_id.blank?
55
- :javascript
56
- var _gaq = [['_setAccount', '#{ Jabe::SETTINGS.google_tracker_id}'], ['_trackPageview']];
57
- (function(d, t) {
58
- var g = d.createElement(t),
59
- s = d.getElementsByTagName(t)[0];
60
- g.async = true;
61
- g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
62
- s.parentNode.insertBefore(g, s);
63
- })(document, 'script');
@@ -1,93 +0,0 @@
1
- # Use this setup block to configure all options available in SimpleForm.
2
- SimpleForm.setup do |config|
3
- # Components used by the form builder to generate a complete input. You can remove
4
- # any of them, change the order, or even add your own components to the stack.
5
- # config.components = [ :placeholder, :label_input, :hint, :error ]
6
-
7
- # Default tag used on hints.
8
- # config.hint_tag = :span
9
-
10
- # CSS class to add to all hint tags.
11
- # config.hint_class = :hint
12
-
13
- # CSS class used on errors.
14
- # config.error_class = :error
15
-
16
- # Default tag used on errors.
17
- # config.error_tag = :span
18
-
19
- # Method used to tidy up errors.
20
- # config.error_method = :first
21
-
22
- # Default tag used for error notification helper.
23
- # config.error_notification_tag = :p
24
-
25
- # CSS class to add for error notification helper.
26
- # config.error_notification_class = :error_notification
27
-
28
- # ID to add for error notification helper.
29
- # config.error_notification_id = nil
30
-
31
- # You can wrap all inputs in a pre-defined tag.
32
- # config.wrapper_tag = :div
33
-
34
- # CSS class to add to all wrapper tags.
35
- # config.wrapper_class = :input
36
-
37
- # CSS class to add to the wrapper if the field has errors.
38
- # config.wrapper_error_class = :field_with_errors
39
-
40
- # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
41
- # config.collection_wrapper_tag = nil
42
-
43
- # You can wrap each item in a collection of radio/check boxes with a tag, defaulting to span.
44
- # config.item_wrapper_tag = :span
45
-
46
- # Series of attempts to detect a default label method for collection.
47
- # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
48
-
49
- # Series of attempts to detect a default value method for collection.
50
- # config.collection_value_methods = [ :id, :to_s ]
51
-
52
- # How the label text should be generated altogether with the required text.
53
- # config.label_text = lambda { |label, required| "#{required} #{label}" }
54
-
55
- # You can define the class to use on all labels. Default is nil.
56
- # config.label_class = nil
57
-
58
- # You can define the class to use on all forms. Default is simple_form.
59
- # config.form_class = :simple_form
60
-
61
- # Whether attributes are required by default (or not). Default is true.
62
- # config.required_by_default = true
63
-
64
- # Tell browsers whether to use default HTML5 validations (novalidate option).
65
- # Default is enabled.
66
- # config.browser_validations = true
67
-
68
- # Determines whether HTML5 types (:email, :url, :search, :tel) and attributes
69
- # (e.g. required) are used or not. True by default.
70
- # Having this on in non-HTML5 compliant sites can cause odd behavior in
71
- # HTML5-aware browsers such as Chrome.
72
- config.html5 = false
73
-
74
- # Custom mappings for input types. This should be a hash containing a regexp
75
- # to match as key, and the input type that will be used when the field name
76
- # matches the regexp as value.
77
- # config.input_mappings = { /count/ => :integer }
78
-
79
- # Collection of methods to detect if a file type was given.
80
- # config.file_methods = [ :mounted_as, :file?, :public_filename ]
81
-
82
- # Default priority for time_zone inputs.
83
- # config.time_zone_priority = nil
84
-
85
- # Default priority for country inputs.
86
- # config.country_priority = nil
87
-
88
- # Default size for text inputs.
89
- # config.default_input_size = 50
90
-
91
- # When false, do not use translations for labels, hints or placeholders.
92
- # config.translate = true
93
- end