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
@@ -0,0 +1,104 @@
1
+ #main {
2
+ padding-top: 50px;
3
+ }
4
+
5
+ .sidebar-nav {
6
+ padding: 9px 0;
7
+ }
8
+
9
+ pre code {
10
+ border: none;
11
+ }
12
+
13
+ textarea {
14
+ width: 75%;
15
+ height: 200px;
16
+ }
17
+
18
+ .jabe-admin-entries .entry, .jabe-admin-settings .entry {
19
+ border-bottom: none;
20
+ }
21
+ .jabe-admin-entries .sidebar-nav, .jabe-admin-settings .sidebar-nav {
22
+ display: none;
23
+ }
24
+
25
+ .jabe-entries #entries .entry {
26
+ border-bottom: none;
27
+ }
28
+
29
+ .jabe-admin-settings span.add-on {
30
+ width: 132px;
31
+ text-align: right;
32
+ }
33
+
34
+ .hint {
35
+ margin-left: 10px;
36
+ }
37
+
38
+ select.datetime {
39
+ width: 80px;
40
+ }
41
+
42
+ .entry {
43
+ margin-bottom: 30px;
44
+ padding-bottom: 15px;
45
+ border-bottom: solid 1px #333;
46
+ }
47
+ .entry #comment_nickname, .entry label[for=comment_nickname] {
48
+ display: none;
49
+ }
50
+ .entry .title {
51
+ font-size: 1.5em;
52
+ }
53
+ .entry .date {
54
+ font-size: .8em;
55
+ padding: 5px 0 0 .5em;
56
+ }
57
+ .entry .meta {
58
+ padding-left: .5em;
59
+ }
60
+ .entry .content p {
61
+ font-size: 1.1em;
62
+ padding: .2em;
63
+ }
64
+
65
+ #comments {
66
+ padding-top: 20px;
67
+ }
68
+ #comments .comment {
69
+ clear: both;
70
+ }
71
+ #comments .comment .delete {
72
+ float: right;
73
+ padding-top: 2px;
74
+ }
75
+ #comments .comment .gravatar {
76
+ margin: 10px 10px 10px 0;
77
+ float: left;
78
+ width: 64px;
79
+ height: 64px;
80
+ border: solid 5px #0088CC;
81
+ -webkit-border-radius: 5px;
82
+ -moz-border-radius: 5px;
83
+ border-radius: 5px;
84
+ }
85
+ #comments .comment .gravatar img {
86
+ width: 64px;
87
+ height: 64px;
88
+ }
89
+ #comments .comment .author {
90
+ font-weight: bold;
91
+ padding: 10px 0 5px 10px;
92
+ }
93
+ #comments .comment .author .when {
94
+ padding-left: 10px;
95
+ font-size: .8em;
96
+ }
97
+ #comments .comment .body {
98
+ min-height: 55px;
99
+ padding: 5px 20px;
100
+ border-bottom: solid 1px #333;
101
+ }
102
+ #comments #new_comment {
103
+ padding-top: 20px;
104
+ }
@@ -0,0 +1,30 @@
1
+ .com { color: #93a1a1; }
2
+ .lit { color: #195f91; }
3
+ .pun, .opn, .clo { color: #93a1a1; }
4
+ .fun { color: #dc322f; }
5
+ .str, .atv { color: #D14; }
6
+ .kwd, .linenums .tag { color: #1e347b; }
7
+ .typ, .atn, .dec, .var { color: teal; }
8
+ .pln { color: #48484c; }
9
+
10
+ .prettyprint {
11
+ padding: 8px;
12
+ background-color: #f7f7f9;
13
+ border: 1px solid #e1e1e8;
14
+ }
15
+ .prettyprint.linenums {
16
+ -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
17
+ -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
18
+ box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
19
+ }
20
+
21
+ /* Specify class=linenums on a pre to get line numbering */
22
+ ol.linenums {
23
+ margin: 0 0 0 33px; /* IE indents via margin-left */
24
+ }
25
+ ol.linenums li {
26
+ padding-left: 12px;
27
+ color: #bebec5;
28
+ line-height: 18px;
29
+ text-shadow: 0 1px 0 #fff;
30
+ }
@@ -2,6 +2,7 @@ module Jabe
2
2
  class Admin::BaseController < ApplicationController
3
3
  layout 'jabe/application'
4
4
  include PublicEntryUrl
5
+ include BodyClassHelper
5
6
  before_filter :authenticate_admin!
6
7
  end
7
- end
8
+ end
@@ -1,5 +1,6 @@
1
1
  module Jabe
2
2
  class ApplicationController < ActionController::Base
3
3
  include PublicEntryUrl
4
+ include BodyClassHelper
4
5
  end
5
6
  end
@@ -1,4 +1,17 @@
1
1
  module Jabe
2
2
  class SessionsController < ::Devise::SessionsController
3
+ layout 'jabe/application'
4
+ include BodyClassHelper
5
+
6
+ protected
7
+
8
+ def after_sign_in_path_for(resource)
9
+ admin_entries_path
10
+ end
11
+
12
+ def after_sign_out_path_for(resource)
13
+ root_path
14
+ end
15
+
3
16
  end
4
17
  end
@@ -2,7 +2,7 @@ module Jabe
2
2
  class Admin < ActiveRecord::Base
3
3
  # Include default devise modules. Others available are:
4
4
  # :token_authenticatable, :confirmable, :lockable and :timeoutable
5
- devise :database_authenticatable, :recoverable, :rememberable, :trackable,
5
+ devise :database_authenticatable, :rememberable, :trackable,
6
6
  :validatable
7
7
 
8
8
  # Setup accessible (or protected) attributes for your model
@@ -0,0 +1,17 @@
1
+ <%= form_for [:admin, entry] do |form| %>
2
+ <%= form.label :title %>
3
+ <%= form.text_field :title %>
4
+
5
+ <%= form.label :body %>
6
+ <%= form.text_area :body %>
7
+
8
+ <% if entry.published_at %>
9
+ <%= form.label :published_at %>
10
+ <%= form.text_field :published_at %>
11
+ <% end %>
12
+
13
+ <br>
14
+
15
+ <%= form.submit 'Save as draft', :class => 'btn' %>
16
+ <%= form.submit 'Publish', :class => 'btn btn-success' %>
17
+ <% end %>
@@ -0,0 +1 @@
1
+ <%= render 'form' %>
@@ -0,0 +1,64 @@
1
+ <p>
2
+ <%= link_to 'Start a new entry', new_admin_entry_path %>
3
+ <br>
4
+ </p>
5
+
6
+ <h2>Drafts</h2>
7
+
8
+ <% if @drafts.any? %>
9
+ <table class="entries">
10
+ <% @drafts.each do |entry| %>
11
+ <tr>
12
+ <td>
13
+ <%= link_to image_tag('jabe/delete_page.png'),
14
+ admin_entry_path(entry),
15
+ :confirm => 'Are you sure?',
16
+ :method => :delete,
17
+ :title => 'Delete'
18
+ %>
19
+ <%= link_to image_tag('jabe/full_page.png'),
20
+ entry_path(entry),
21
+ :title => 'Preview'
22
+ %>
23
+ </td>
24
+ <td>
25
+ <%= link_to entry.title, edit_admin_entry_path(entry) %>
26
+ </td>
27
+ </tr>
28
+ <% end %>
29
+ </table>
30
+ <% end %>
31
+
32
+ <br>
33
+
34
+ <h2>Published</h2>
35
+
36
+ <% if @published.any? %>
37
+ <table class="entries">
38
+ <% @published.each do |entry| %>
39
+ <tr>
40
+ <td class="icons">
41
+ <%= link_to image_tag('jabe/delete_page.png'),
42
+ admin_entry_path(entry),
43
+ :confirm => 'Are you sure?',
44
+ :method => :delete,
45
+ :title => 'Delete'
46
+ %>
47
+ <%= link_to image_tag('jabe/full_page.png'),
48
+ public_entry_url(entry),
49
+ :title => 'Preview'
50
+ %>
51
+ </td>
52
+ <td>
53
+ <%= link_to entry.title, edit_admin_entry_path(entry) %>
54
+ <div class="when">
55
+ <%= entry.published_at.to_s(:long) %>
56
+ </div>
57
+
58
+ </td>
59
+ </tr>
60
+ <% end %>
61
+ </table>
62
+ <% end %>
63
+
64
+ <%= paginate @published %>
@@ -0,0 +1 @@
1
+ <%= render 'form' %>
@@ -0,0 +1,50 @@
1
+ <h2>Site Settings</h2>
2
+ <%= form_for Jabe::SETTINGS, :url => admin_settings_path, :html => { :class => 'form-horizontal' } do |form| %>
3
+
4
+ <%= form.label :host_name %>
5
+ <%= form.text_field :host_name, :label => 'Domain and port', :input_html => { :class => "span7" }, :hint => '(e.g. pixels-and-bits.com or localhost:3000)' %>
6
+
7
+ <%= form.label :site_name %>
8
+ <%= form.text_field :site_name, :input_html => { :class => "span7" } %>
9
+
10
+ <%= form.label :tagline %>
11
+ <%= form.text_field :tagline, :input_html => { :class => "span7" } %>
12
+
13
+ <%= form.label :mail_from %>
14
+ <%= form.text_field :mail_from, :input_html => { :class => "span7" } %>
15
+
16
+ <%= form.label :time_zone %>
17
+ <%= form.select :time_zone, time_zone_options_for_select(Jabe::SETTINGS.time_zone), :label => 'Your local time zone', :input_html => { :class => "span7" } %>
18
+
19
+ <%= form.label :entries_per_page %>
20
+ <%= form.text_field :entries_per_page, :label => 'Entries per page', :input_html => { :class => "span7" } %>
21
+
22
+ <%= form.label :sidebar_heading %>
23
+ <%= form.text_field :sidebar_heading, :input_html => { :class => "span7" } %>
24
+
25
+ <%= form.label :github_username %>
26
+ <%= form.text_field :github_username, :wrapper => :prepend, :label => 'Github' do %>
27
+ <%= content_tag :span, "http://github.com/", :class => "add-on" %>
28
+ <%= form.input_field :github_username, :class => "span4" %>
29
+ <% end %>
30
+
31
+ <%= form.label :twitter_username %>
32
+ <%= form.text_field :twitter_username, :wrapper => :prepend, :label => 'Twitter' do %>
33
+ <%= content_tag :span, "https://twitter.com/#!/", :class => "add-on" %>
34
+ <%= form.input_field :twitter_username, :class => "span4" %>
35
+ <% end %>
36
+
37
+ <%= form.label :facebook_url %>
38
+ <%= form.text_field :facebook_url, :wrapper => :prepend, :label => 'Facebook' do %>
39
+ <%= content_tag :span, "http://facebook.com/", :class => "add-on" %>
40
+ <%= form.input_field :facebook_url, :class => "span4" %>
41
+ <% end %>
42
+
43
+ <%= form.label :google_tracker_id %>
44
+ <%= form.text_field :google_tracker_id, :input_html => { :class => "span7" } %>
45
+
46
+ <br><br>
47
+
48
+ <%= form.submit 'Save', :class => 'btn btn-success' %>
49
+
50
+ <% end %>
@@ -0,0 +1,21 @@
1
+ <div id="entries">
2
+ <% @entries.each do |entry| %>
3
+ <div class="entry<%= entry == @entries.last ? ' last' : '' %>">
4
+ <div class="title">
5
+ <h3>
6
+ <%= link_to entry.title, public_entry_url(entry) %>
7
+ </h3>
8
+ </div>
9
+ <div class="date">
10
+ <%= entry.published_at.to_s(:long) %>
11
+ </div>
12
+ <div class="content">
13
+ <%= entry.body.html_safe %>
14
+ </div>
15
+ <div class="meta">
16
+ <%= link_to "Comments: #{entry.comments.count}", public_entry_url(entry) + '#comments' %>
17
+ </div>
18
+ </div>
19
+ <% end %>
20
+ <div>
21
+ <%= paginate @entries %>
@@ -0,0 +1,84 @@
1
+ <% page_title entry.title %>
2
+
3
+ <div id="entries">
4
+ <div class="entry last">
5
+ <div class="title">
6
+ <h3>
7
+ <%= entry.title %>
8
+ </h3>
9
+ </div>
10
+ <div class="date">
11
+ <%= entry.published_at.try(:to_s, :long) %>
12
+ </div>
13
+ <div class="content">
14
+ <%= entry.body.html_safe %>
15
+ </div>
16
+
17
+ <a name="comments"></a>
18
+
19
+ <div id="comments">
20
+ <h4>Comments</h4>
21
+ <div class="comments">
22
+ <% if entry.comments.any? %>
23
+ <% entry.comments.each do |comment| %>
24
+ <div class="comment">
25
+ <% if admin_signed_in? %>
26
+ <div class="delete">
27
+ <%= link_to image_tag('jabe/delete.png'), entry_comment_path(entry, comment), :confirm => 'Are you sure?', :method => :delete %>
28
+ </div>
29
+ <% end %>
30
+
31
+ <% if comment.respond_to?(:gravatar_url) %>
32
+ <div class="gravatar">
33
+ <%= image_tag comment.gravatar_url(:default => default_gravatar_url) %>
34
+ </div>
35
+ <% end %>
36
+
37
+ <div class="author">
38
+ <%= comment.name %>
39
+ <span class="when">
40
+ <%= comment.created_at.to_s(:long) %>
41
+ </span>
42
+ </div>
43
+ <div class="body">
44
+ <%= comment.body.html_safe %>
45
+ </div>
46
+ </div>
47
+ <% end %>
48
+ <% else %>
49
+ <div class="comment">
50
+ <div class="author">
51
+ None yet...
52
+ </div>
53
+ </div>
54
+ <% end %>
55
+ </div>
56
+ </div>
57
+
58
+ <a name="add-comment"></a>
59
+
60
+ <div id="new_comment">
61
+ <h4>Add a comment</h4>
62
+ <%= form_for [entry, comment] do |form| %>
63
+ <%= form.label :name %>
64
+ <%= form.text_field :name %>
65
+
66
+ <%= form.label :nickname %>
67
+ <%= form.text_field :nickname %>
68
+
69
+ <%= form.label :email %>
70
+ <%= form.text_field :email, :label => 'Email (not shown to the public)' %>
71
+
72
+ <%= form.label :url, 'Website' %>
73
+ <%= form.text_field :url %>
74
+
75
+ <%= form.label :body, "Comment - Textile enabled (#{link_to 'Reference', 'http://redcloth.org/try-redcloth/', :target => '_blank'})".html_safe %>
76
+ <%= form.text_area :body %>
77
+
78
+ <br>
79
+
80
+ <%= form.submit 'Add comment', :class => 'btn btn-primary' %>
81
+ <% end %>
82
+ </div>
83
+ </div>
84
+ </div>
@@ -1,15 +1,18 @@
1
1
  <h2>Sign in</h2>
2
2
 
3
- <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
3
+ <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
4
4
  <div class="inputs">
5
- <%= f.input :email, :required => false, :autofocus => true %>
6
- <%= f.input :password, :required => false %>
7
- <%= f.input :remember_me, :as => :boolean if devise_mapping.rememberable? %>
5
+ <%= f.label :email %>
6
+ <%= f.text_field :email, :required => false, :autofocus => true %>
7
+
8
+ <%= f.label :password %>
9
+ <%= f.text_field :password, :required => false %>
10
+
11
+ <%= f.label :remember_me %>
12
+ <%= f.check_box :remember_me, :as => :boolean if devise_mapping.rememberable? %>
8
13
  </div>
9
14
 
10
15
  <div class="actions">
11
- <%= f.button :submit, "Sign in" %>
16
+ <%= f.submit "Sign in" %>
12
17
  </div>
13
18
  <% end %>
14
-
15
- <%= render :partial => "devise/shared/links" %>