wheels 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/VERSION +1 -1
  2. data/app/controllers/blogs_controller.rb +17 -0
  3. data/app/controllers/galleries_controller.rb +60 -0
  4. data/app/controllers/images_controller.rb +30 -0
  5. data/app/controllers/profiles_controller.rb +16 -0
  6. data/app/controllers/users_controller.rb +4 -0
  7. data/app/models/ability.rb +23 -0
  8. data/app/models/blog.rb +8 -0
  9. data/app/models/gallery.rb +5 -0
  10. data/app/models/image.rb +8 -0
  11. data/app/models/profile.rb +11 -0
  12. data/app/models/role.rb +8 -0
  13. data/app/models/user.rb +43 -0
  14. data/app/views/blogs/_form.html.haml +28 -0
  15. data/app/views/blogs/edit.html.haml +8 -0
  16. data/app/views/blogs/index.html.haml +19 -0
  17. data/app/views/blogs/index.xml.builder +27 -0
  18. data/app/views/blogs/new.html.haml +6 -0
  19. data/app/views/blogs/show.html.haml +10 -0
  20. data/app/views/galleries/_form.html.haml +29 -0
  21. data/app/views/galleries/_show.html.haml +21 -0
  22. data/app/views/galleries/edit.html.haml +7 -0
  23. data/app/views/galleries/index.html.haml +15 -0
  24. data/app/views/galleries/new.html.haml +5 -0
  25. data/app/views/galleries/show.html.haml +4 -0
  26. data/app/views/images/_form.html.haml +10 -0
  27. data/app/views/images/create.js.haml +3 -0
  28. data/app/views/images/destroy.js.haml +3 -0
  29. data/app/views/images/edit.html.haml +7 -0
  30. data/app/views/images/edit.js.haml +3 -0
  31. data/app/views/images/index.html.haml +17 -0
  32. data/app/views/images/index.js.haml +3 -0
  33. data/app/views/images/new.html.haml +5 -0
  34. data/app/views/images/new.js.haml +3 -0
  35. data/app/views/images/show.html.haml +5 -0
  36. data/app/views/images/show.js.haml +3 -0
  37. data/app/views/images/update.js.haml +3 -0
  38. data/app/views/layouts/image_dialog.html.haml +18 -0
  39. data/app/views/profiles/_form.html.haml +26 -0
  40. data/app/views/profiles/edit.html.haml +7 -0
  41. data/app/views/profiles/index.html.haml +25 -0
  42. data/app/views/profiles/new.html.haml +5 -0
  43. data/app/views/profiles/show.html.haml +21 -0
  44. data/app/views/users/index.html.haml +19 -0
  45. data/config/amazon_s3.yml +15 -0
  46. data/db/migrate/add_fields_to_users.rb +28 -0
  47. data/db/migrate/create_blogs.rb +16 -0
  48. data/db/migrate/create_galleries.rb +15 -0
  49. data/db/migrate/create_images.rb +17 -0
  50. data/db/migrate/create_profiles.rb +24 -0
  51. data/db/migrate/create_roles.rb +16 -0
  52. data/lib/generators/wheels/recipes/wheels.rb +0 -1
  53. data/lib/generators/wheels/wheels_generator.rb +1 -1
  54. data/lib/wheels.rb +1 -0
  55. data/public/404.html +26 -0
  56. data/public/422.html +26 -0
  57. data/public/500.html +26 -0
  58. data/public/favicon.ico +0 -0
  59. data/public/images/dreamy/Thumbs.db +0 -0
  60. data/public/images/dreamy/bg-ad-top.png +0 -0
  61. data/public/images/dreamy/bg-body.png +0 -0
  62. data/public/images/dreamy/bg-feed.gif +0 -0
  63. data/public/images/dreamy/bg-footer.jpg +0 -0
  64. data/public/images/dreamy/bg-header.jpg +0 -0
  65. data/public/images/dreamy/bg-menu-hover.png +0 -0
  66. data/public/images/dreamy/bg-menu.png +0 -0
  67. data/public/images/dreamy/bg-sidebar-bottom.gif +0 -0
  68. data/public/images/dreamy/button-feed.png +0 -0
  69. data/public/images/dreamy/icon-comment.png +0 -0
  70. data/public/images/growl/error.png +0 -0
  71. data/public/images/growl/growl_bottom.png +0 -0
  72. data/public/images/growl/growl_repeat.png +0 -0
  73. data/public/images/growl/growl_top.png +0 -0
  74. data/public/images/growl/info.png +0 -0
  75. data/public/images/menu/item-pointer-mover.gif +0 -0
  76. data/public/images/menu/item-pointer.gif +0 -0
  77. data/public/images/menu/lava.gif +0 -0
  78. data/public/images/menu/lava.png +0 -0
  79. data/public/images/menu/main-bg.png +0 -0
  80. data/public/images/menu/main-delimiter.png +0 -0
  81. data/public/javascripts/jquery.growl.js +143 -0
  82. data/public/javascripts/loadbehind.js +0 -0
  83. data/public/javascripts/menu.js +247 -0
  84. data/public/stylesheets/.gitkeep +0 -0
  85. data/public/stylesheets/dreamy.css +181 -0
  86. data/public/stylesheets/menu.css +101 -0
  87. data/public/stylesheets/sass/dreamy.sass +195 -0
  88. data/public/stylesheets/sass/menu.sass +105 -0
  89. data/public/stylesheets/scaffold.css +56 -0
  90. data/public/stylesheets/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
  91. data/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  92. data/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  93. data/public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  94. data/public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  95. data/public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  96. data/public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  97. data/public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  98. data/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  99. data/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  100. data/public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  101. data/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  102. data/public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  103. data/public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  104. data/public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  105. data/public/stylesheets/ui-lightness/jquery-ui-1.8.2.custom.css +359 -0
  106. data/wheels.gemspec +102 -1
  107. metadata +104 -3
@@ -0,0 +1,19 @@
1
+ %h1 Users
2
+ %ul
3
+ - for user in @users
4
+ %li
5
+ %table.no_border
6
+ %tr
7
+ %td= link_to user.login, user_profile_path(user)
8
+ %td= "#{user.first_name} #{user.last_name}"
9
+ %td!= image_tag user.image.url(:thumb)
10
+ - if can? :manage, User
11
+ %td!= link_to 'Edit', edit_user_path(user)
12
+ %td!= link_to 'Destroy', user, "data-confirm"=>"Really delete #{user.alias}?", :method=>"delete"
13
+ %td{:id=>user.element_id(:confirm)}
14
+ - if user.confirmed_at
15
+ Confirmed
16
+ - else
17
+ = form_for user, :remote=>true do |f|
18
+ = f.hidden_field
19
+
@@ -0,0 +1,15 @@
1
+ development:
2
+ bucket: <%= bucket %>
3
+ access_key_id: <%= access_key_id %>
4
+ secret_access_key: <%= secret_access_key %>
5
+
6
+ test:
7
+ bucket: <%= bucket %>
8
+ access_key_id: <%= access_key_id %>
9
+ secret_access_key: <%= secret_access_key %>
10
+
11
+ production:
12
+ bucket: <%= bucket %>
13
+ access_key_id: <%= access_key_id %>
14
+ secret_access_key: <%= secret_access_key %>
15
+
@@ -0,0 +1,28 @@
1
+ class AddFieldsToUsers < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :users, :confirmation_token, :string
4
+ add_column :users, :confirmed_at, :datetime
5
+ add_column :users, :confirmation_sent_at, :datetime
6
+ add_column :users, :failed_attempts, :integer, :default => 0
7
+ add_column :users, :unlock_token, :string
8
+ add_column :users, :locked_at, :datetime
9
+ add_column :users, :authentication_token, :string
10
+ add_column :users, :login, :string
11
+ add_column :users, :name, :string
12
+ add_column :users, :role_id, :integer
13
+ end
14
+
15
+ def self.down
16
+ remove_column :users, :confirmation_token
17
+ remove_column :users, :confirmed_at
18
+ remove_column :users, :confirmation_sent_at
19
+ remove_column :users, :failed_attempts
20
+ remove_column :users, :unlock_token
21
+ remove_column :users, :locked_at
22
+ remove_column :users, :authentication_token
23
+ remove_column :users, :login
24
+ remove_column :users, :name
25
+ remove_column :users, :role_id
26
+ end
27
+ end
28
+
@@ -0,0 +1,16 @@
1
+ class AddFieldsToBlogs < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :blogs do |t|
4
+ t.integer :user_id
5
+ t.string :title
6
+ t.text :body
7
+ t.timestamps
8
+ end
9
+
10
+ end
11
+
12
+ def self.down
13
+ drop_table :blogs
14
+ end
15
+ end
16
+
@@ -0,0 +1,15 @@
1
+ class CreateGalleries < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :galleries do |t|
4
+ t.string :name
5
+ t.text :description
6
+ t.integer :user_id
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :galleries
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ class CreateImages < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :images do |t|
4
+ t.string :image_file_name
5
+ t.string :image_content_type
6
+ t.integer :image_file_size
7
+ t.datetime :image_updated_at
8
+ t.integer :gallery_id
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :images
15
+ end
16
+ end
17
+
@@ -0,0 +1,24 @@
1
+ class CreateProfiles < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :profiles do |t|
4
+ t.string :first_name
5
+ t.string :last_name
6
+ t.string :alias
7
+ t.string :blog_title
8
+ t.text :about_me
9
+ t.integer :user_id
10
+ t.string :image_file_name
11
+ t.string :image_content_type
12
+ t.integer :image_file_size
13
+ t.datetime :image_updated_at
14
+ t.timestamps
15
+ end
16
+ add_index :profiles, :alias, :unique=>true
17
+ add_index :profiles, :user_id, :unique=>true
18
+ end
19
+
20
+ def self.down
21
+ drop_table :profiles
22
+ end
23
+ end
24
+
@@ -0,0 +1,16 @@
1
+ class CreateRoles < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :roles do |t|
4
+ t.string :name
5
+ t.timestamps
6
+ end
7
+ Role.create(:name=>'Super')
8
+ Role.create(:name=>'Admin')
9
+ Role.create(:name=>'User')
10
+ end
11
+
12
+ def self.down
13
+ drop_table :roles
14
+ end
15
+ end
16
+
@@ -27,7 +27,6 @@ stategies << lambda do
27
27
  run "git submodule add git://github.com/tylergannon/ckeditor.git public/ckeditor"
28
28
 
29
29
  directory 'public', 'public'
30
- directory 'app', 'app'
31
30
  gem "will_paginate", :git=>"http://github.com/mislav/will_paginate.git",
32
31
  :branch=>"rails3"
33
32
  end
@@ -6,7 +6,7 @@ require 'rails/generators/active_record'
6
6
  class WheelsGenerator < Rails::Generators::Base
7
7
  include Rails::Generators::Migration
8
8
  require File.join(File.dirname(__FILE__), 'core_extensions.rb')
9
- source_root File.expand_path('../templates/wheels/', __FILE__)
9
+ source_root File.expand_path('../../../../', __FILE__)
10
10
  desc "Installs files needed for App Template gem."
11
11
 
12
12
  # argument :scope, :required => false, :default => nil,
data/lib/wheels.rb CHANGED
@@ -1,2 +1,3 @@
1
1
  require 'wheels/routes.rb'
2
+ require 'wheels/action_controller_extensions.rb'
2
3
 
data/public/404.html ADDED
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
data/public/422.html ADDED
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
data/public/500.html ADDED
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,143 @@
1
+ /*
2
+ * jQuery Growl plugin
3
+ * Version 1.0.2 (8/1/2009)
4
+ * @requires jQuery v1.3.2 or later
5
+ *
6
+ * Examples at: http://fragmentedcode.com/jquery-growl
7
+ * Copyright (c) 2008-2009 David Higgins
8
+ *
9
+ * Special thanks to Daniel Mota for inspiration:
10
+ * http://icebeat.bitacoras.com/mootools/growl/
11
+ */
12
+
13
+ /*
14
+ USAGE:
15
+
16
+ $.growl(title, msg);
17
+ $.growl(title, msg, image);
18
+ $.growl(title, msg, image, priority);
19
+
20
+ THEME/SKIN:
21
+
22
+ You can override the default look and feel by updating these objects:
23
+ $.growl.settings.displayTimeout = 4000;
24
+ $.growl.settings.noticeTemplate = ''
25
+ + '<div>'
26
+ + '<div style="float: right; background-image: url(my.growlTheme/normalTop.png); position: relative; width: 259px; height: 16px; margin: 0pt;"></div>'
27
+ + '<div style="float: right; background-image: url(my.growlTheme/normalBackground.png); position: relative; display: block; color: #ffffff; font-family: Arial; font-size: 12px; line-height: 14px; width: 259px; margin: 0pt;">'
28
+ + ' <img style="margin: 14px; margin-top: 0px; float: left;" src="%image%" />'
29
+ + ' <h3 style="margin: 0pt; margin-left: 77px; padding-bottom: 10px; font-size: 13px;">%title%</h3>'
30
+ + ' <p style="margin: 0pt 14px; margin-left: 77px; font-size: 12px;">%message%</p>'
31
+ + '</div>'
32
+ + '<div style="float: right; background-image: url(my.growlTheme/normalBottom.png); position: relative; width: 259px; height: 16px; margin-bottom: 10px;"></div>'
33
+ + '</div>';
34
+ $.growl.settings.noticeCss = {
35
+ position: 'relative'
36
+ };
37
+
38
+ To change the 'dock' look, and position:
39
+
40
+ $.growl.settings.dockTemplate = '<div></div>';
41
+ $.growl.settings.dockCss = {
42
+ position: 'absolute',
43
+ top: '10px',
44
+ right: '10px',
45
+ width: '300px'
46
+ };
47
+
48
+ The dockCss will allow you to 'dock' the notifications to a specific area
49
+ on the page, such as TopRight (the default) or TopLeft, perhaps even in a
50
+ smaller area with "overflow: scroll" enabled?
51
+ */
52
+
53
+ (function($) {
54
+
55
+ $.growl = function(title,message,image,priority) { notify(title,message,image,priority); }
56
+ $.growl.version = "1.0.2";
57
+
58
+ function create(rebuild) {
59
+ var instance = document.getElementById('growlDock');
60
+ if(!instance || rebuild) {
61
+ instance = $(jQuery.growl.settings.dockTemplate).attr('id', 'growlDock').addClass('growl');
62
+ if(jQuery.growl.settings.defaultStylesheet) {
63
+ $('head').append('<link rel="stylesheet" type="text/css" href="' + jQuery.growl.settings.defaultStylesheet + '" />');
64
+ }
65
+
66
+ } else {
67
+ instance = $(instance);
68
+ }
69
+ $('body').append(instance.css(jQuery.growl.settings.dockCss));
70
+ return instance;
71
+ };
72
+
73
+ function r(text, expr, val) {
74
+ while(expr.test(text)) {
75
+ text = text.replace(expr, val);
76
+ }
77
+ return text;
78
+ };
79
+
80
+ function notify(title,message,image,priority) {
81
+ var instance = create();
82
+ var html = jQuery.growl.settings.noticeTemplate;
83
+ if(typeof(html) == 'object') html = $(html).html();
84
+ html = r(html, /%message%/, (message?message:''));
85
+ html = r(html, /%title%/, (title?title:''));
86
+ html = r(html, /%image%/, (image?image:jQuery.growl.settings.defaultImage));
87
+ html = r(html, /%priority%/, (priority?priority:'normal'));
88
+
89
+ var notice = $(html)
90
+ .hide()
91
+ .css(jQuery.growl.settings.noticeCss)
92
+ .fadeIn(jQuery.growl.settings.notice);;
93
+
94
+ $.growl.settings.noticeDisplay(notice);
95
+ instance.append(notice);
96
+ $('a[rel="close"]', notice).click(function() {
97
+ notice.remove();
98
+ });
99
+ if ($.growl.settings.displayTimeout > 0) {
100
+ setTimeout(function(){
101
+ jQuery.growl.settings.noticeRemove(notice, function(){
102
+ notice.remove();
103
+ });
104
+ }, jQuery.growl.settings.displayTimeout);
105
+ }
106
+ };
107
+
108
+
109
+ // default settings
110
+ $.growl.settings = {
111
+ dockTemplate: '<div></div>',
112
+ dockCss: {
113
+ position: 'fixed',
114
+ top: '10px',
115
+ right: '10px',
116
+ width: '300px',
117
+ zIndex: 50000
118
+ },
119
+ noticeTemplate:
120
+ '<div class="notice">' +
121
+ ' <h3 style="margin-top: 15px"><a rel="close">%title%</a></h3>' +
122
+ ' <p>%message%</p>' +
123
+ '</div>',
124
+ noticeCss: {
125
+ opacity: .75,
126
+ backgroundColor: '#333333',
127
+ color: '#ffffff'
128
+ },
129
+ noticeDisplay: function(notice) {
130
+ notice.css({'opacity':'0'}).fadeIn(jQuery.growl.settings.noticeFadeTimeout);
131
+ },
132
+ noticeRemove: function(notice, callback) {
133
+ notice.animate({opacity: '0', height: '0px'}, {duration:jQuery.growl.settings.noticeFadeTimeout, complete: callback});
134
+ },
135
+ noticeFadeTimeout: 'slow',
136
+ displayTimeout: 3500,
137
+ defaultImage: 'growl.jpg',
138
+ defaultStylesheet: null,
139
+ noticeElement: function(el) {
140
+ $.growl.settings.noticeTemplate = $(el);
141
+ }
142
+ };
143
+ })(jQuery);
File without changes