grandstand 0.2.4 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. data/MIT-LICENSE +1 -1
  2. data/README.markdown +43 -0
  3. data/README.txt +0 -0
  4. data/Rakefile +7 -1
  5. data/VERSION +1 -1
  6. data/app/controllers/galleries_controller.rb +2 -2
  7. data/app/controllers/{admin → grandstand}/galleries_controller.rb +9 -13
  8. data/app/controllers/{admin → grandstand}/images_controller.rb +6 -9
  9. data/app/controllers/{admin → grandstand}/main_controller.rb +8 -8
  10. data/app/controllers/{admin → grandstand}/pages_controller.rb +9 -9
  11. data/app/controllers/grandstand/posts_controller.rb +64 -0
  12. data/app/controllers/{admin → grandstand}/sessions_controller.rb +8 -8
  13. data/app/controllers/grandstand/templates_controller.rb +8 -0
  14. data/app/controllers/{admin → grandstand}/users_controller.rb +10 -10
  15. data/app/controllers/posts_controller.rb +1 -1
  16. data/app/helpers/galleries_helper.rb +2 -0
  17. data/app/helpers/grandstand/galleries_helper.rb +2 -0
  18. data/app/helpers/grandstand/images_helpers.rb +2 -0
  19. data/app/helpers/grandstand/main_helper.rb +74 -0
  20. data/app/helpers/grandstand/pages_helper.rb +2 -0
  21. data/app/helpers/grandstand/posts_helper.rb +2 -0
  22. data/app/helpers/grandstand/sessions_helper.rb +2 -0
  23. data/app/helpers/grandstand/templates_helper.rb +2 -0
  24. data/app/helpers/grandstand/users_helper.rb +2 -0
  25. data/app/models/{gallery.rb → grandstand/gallery.rb} +2 -2
  26. data/app/models/{image.rb → grandstand/image.rb} +10 -9
  27. data/app/models/{page.rb → grandstand/page.rb} +1 -1
  28. data/app/models/grandstand/page_section.rb +6 -0
  29. data/app/models/{post.rb → grandstand/post.rb} +14 -2
  30. data/app/models/{template.rb → grandstand/template.rb} +2 -2
  31. data/app/models/{user.rb → grandstand/user.rb} +1 -1
  32. data/app/stylesheets/application.less +103 -10
  33. data/app/stylesheets/global.less +47 -30
  34. data/app/stylesheets/login.less +1 -1
  35. data/app/stylesheets/wysiwyg.less +77 -65
  36. data/app/views/{admin → grandstand}/galleries/_form.html.erb +2 -2
  37. data/app/views/grandstand/galleries/_gallery.html.erb +16 -0
  38. data/app/views/grandstand/galleries/_list.html.erb +17 -0
  39. data/app/views/grandstand/galleries/delete.html.erb +8 -0
  40. data/app/views/grandstand/galleries/edit.html.erb +8 -0
  41. data/app/views/grandstand/galleries/editor.html.erb +33 -0
  42. data/app/views/grandstand/galleries/index.html.erb +14 -0
  43. data/app/views/grandstand/galleries/new.html.erb +8 -0
  44. data/app/views/grandstand/galleries/show.html.erb +19 -0
  45. data/app/views/{admin → grandstand}/images/_form.html.erb +2 -2
  46. data/app/views/grandstand/images/delete.html.erb +8 -0
  47. data/app/views/grandstand/images/edit.html.erb +8 -0
  48. data/app/views/grandstand/images/new.html.erb +8 -0
  49. data/app/views/grandstand/images/show.html.erb +33 -0
  50. data/app/views/{admin → grandstand}/images/upload.html.erb +2 -2
  51. data/app/views/grandstand/main/index.html.erb +10 -0
  52. data/app/views/{admin → grandstand}/pages/_form.html.erb +2 -2
  53. data/app/views/grandstand/pages/_left.html.erb +3 -0
  54. data/app/views/{admin → grandstand}/pages/_row.html.erb +3 -3
  55. data/app/views/{admin → grandstand}/pages/delete.html.erb +2 -2
  56. data/app/views/{admin → grandstand}/pages/edit.html.erb +2 -2
  57. data/app/views/{admin → grandstand}/pages/index.html.erb +1 -1
  58. data/app/views/{admin → grandstand}/pages/new.html.erb +2 -2
  59. data/app/views/{admin → grandstand}/pages/show.html.erb +1 -1
  60. data/app/views/grandstand/posts/_form.html.erb +15 -0
  61. data/app/views/grandstand/posts/_left.html.erb +3 -0
  62. data/app/views/grandstand/posts/_list.html.erb +26 -0
  63. data/app/views/{admin → grandstand}/posts/delete.html.erb +2 -2
  64. data/app/views/grandstand/posts/edit.html.erb +8 -0
  65. data/app/views/{admin → grandstand}/posts/index.html.erb +1 -1
  66. data/app/views/grandstand/posts/new.html.erb +8 -0
  67. data/app/views/grandstand/posts/preview.html.erb +9 -0
  68. data/app/views/grandstand/posts/show.html.erb +8 -0
  69. data/app/views/{admin → grandstand}/sessions/forgot.html.erb +2 -2
  70. data/app/views/{admin → grandstand}/sessions/show.html.erb +2 -2
  71. data/app/views/grandstand/shared/_flash.html.erb +3 -0
  72. data/app/views/{admin → grandstand}/users/_form.html.erb +2 -2
  73. data/app/views/grandstand/users/_left.html.erb +3 -0
  74. data/app/views/{admin → grandstand}/users/delete.html.erb +2 -2
  75. data/app/views/grandstand/users/edit.html.erb +8 -0
  76. data/app/views/{admin → grandstand}/users/index.html.erb +3 -3
  77. data/app/views/grandstand/users/new.html.erb +8 -0
  78. data/app/views/grandstand/users/show.html.erb +12 -0
  79. data/app/views/layouts/grandstand.html.erb +76 -0
  80. data/app/views/layouts/grandstand_login.html.erb +17 -0
  81. data/app/views/layouts/{admin_xhr.html.erb → grandstand_xhr.html.erb} +0 -0
  82. data/app/views/posts/show.html.erb +2 -2
  83. data/{lib/grandstand → config}/routes.rb +9 -7
  84. data/grandstand.gemspec +139 -122
  85. data/lib/grandstand.rb +50 -19
  86. data/lib/grandstand/application.rb +27 -35
  87. data/lib/grandstand/controller.rb +4 -6
  88. data/lib/grandstand/form_builder.rb +19 -0
  89. data/lib/grandstand/helper.rb +1 -47
  90. data/lib/grandstand/session.rb +2 -11
  91. data/lib/grandstand/stylesheets_controller.rb +14 -0
  92. data/public/{admin → grandstand}/images/background-input.gif +0 -0
  93. data/public/{admin → grandstand}/images/background-progress-bar.png +0 -0
  94. data/public/{admin → grandstand}/images/background-progress-complete.gif +0 -0
  95. data/public/{admin → grandstand}/images/background-progress.gif +0 -0
  96. data/public/grandstand/images/galleries-empty.png +0 -0
  97. data/public/{admin → grandstand}/images/icons/add.png +0 -0
  98. data/public/{admin → grandstand}/images/icons/collapse.png +0 -0
  99. data/public/{admin → grandstand}/images/icons/delete.png +0 -0
  100. data/public/{admin → grandstand}/images/icons/edit.png +0 -0
  101. data/public/{admin → grandstand}/images/icons/editor/bold.png +0 -0
  102. data/public/{admin → grandstand}/images/icons/editor/gallery.png +0 -0
  103. data/public/{admin → grandstand}/images/icons/editor/image-center.png +0 -0
  104. data/public/{admin → grandstand}/images/icons/editor/image-left.png +0 -0
  105. data/public/{admin → grandstand}/images/icons/editor/image-right.png +0 -0
  106. data/public/{admin → grandstand}/images/icons/editor/image.png +0 -0
  107. data/public/{admin → grandstand}/images/icons/editor/italic.png +0 -0
  108. data/public/{admin → grandstand}/images/icons/editor/ordered-list.png +0 -0
  109. data/public/{admin → grandstand}/images/icons/editor/quote.png +0 -0
  110. data/public/{admin → grandstand}/images/icons/editor/source.png +0 -0
  111. data/public/{admin → grandstand}/images/icons/editor/strikethrough.png +0 -0
  112. data/public/{admin → grandstand}/images/icons/editor/underline.png +0 -0
  113. data/public/{admin → grandstand}/images/icons/editor/unordered-list.png +0 -0
  114. data/public/{admin → grandstand}/images/icons/error.png +0 -0
  115. data/public/{admin → grandstand}/images/icons/expand.png +0 -0
  116. data/public/{admin → grandstand}/images/icons/galleries.png +0 -0
  117. data/public/{admin → grandstand}/images/icons/gallery.png +0 -0
  118. data/public/{admin → grandstand}/images/icons/image.png +0 -0
  119. data/public/{admin → grandstand}/images/icons/okay.png +0 -0
  120. data/public/{admin → grandstand}/images/icons/pages.png +0 -0
  121. data/public/{admin → grandstand}/images/icons/posts.png +0 -0
  122. data/public/grandstand/images/icons/processing.gif +0 -0
  123. data/public/{admin → grandstand}/images/icons/upload.png +0 -0
  124. data/public/{admin → grandstand}/images/icons/users.png +0 -0
  125. data/public/{admin → grandstand}/images/logo.png +0 -0
  126. data/public/{admin → grandstand}/images/spinner-dark.gif +0 -0
  127. data/public/{admin → grandstand}/images/uploader.swf +0 -0
  128. data/public/{admin → grandstand}/javascripts/application.js +139 -54
  129. data/public/grandstand/javascripts/jquery.js +414 -0
  130. data/public/{admin → grandstand}/javascripts/mustache.js +0 -0
  131. data/public/grandstand/javascripts/preview.js +9 -0
  132. data/public/{admin → grandstand}/javascripts/selection.js +77 -57
  133. data/public/{admin → grandstand}/javascripts/string.js +7 -6
  134. data/public/grandstand/javascripts/wysiwyg.js +311 -0
  135. data/public/{admin → grandstand}/stylesheets/wysiwyg-content.css +15 -2
  136. metadata +207 -126
  137. data/README +0 -7
  138. data/app/controllers/admin/posts_controller.rb +0 -48
  139. data/app/controllers/admin/templates_controller.rb +0 -6
  140. data/app/helpers/admin/main_helper.rb +0 -31
  141. data/app/helpers/admin/pages_helper.rb +0 -2
  142. data/app/helpers/admin/posts_helper.rb +0 -2
  143. data/app/helpers/admin/sessions_helper.rb +0 -2
  144. data/app/helpers/admin/templates_helper.rb +0 -2
  145. data/app/helpers/admin/users_helper.rb +0 -2
  146. data/app/models/page_section.rb +0 -6
  147. data/app/stylesheets/_dialogs.less +0 -85
  148. data/app/views/admin/galleries/_gallery.html.erb +0 -16
  149. data/app/views/admin/galleries/_list.html.erb +0 -17
  150. data/app/views/admin/galleries/delete.html.erb +0 -8
  151. data/app/views/admin/galleries/edit.html.erb +0 -8
  152. data/app/views/admin/galleries/editor.html.erb +0 -13
  153. data/app/views/admin/galleries/editor_with_images.html.erb +0 -19
  154. data/app/views/admin/galleries/index.html.erb +0 -13
  155. data/app/views/admin/galleries/new.html.erb +0 -8
  156. data/app/views/admin/galleries/show.html.erb +0 -15
  157. data/app/views/admin/images/delete.html.erb +0 -8
  158. data/app/views/admin/images/edit.html.erb +0 -8
  159. data/app/views/admin/images/new.html.erb +0 -8
  160. data/app/views/admin/main/index.html.erb +0 -10
  161. data/app/views/admin/pages/_left.html.erb +0 -3
  162. data/app/views/admin/posts/_form.html.erb +0 -29
  163. data/app/views/admin/posts/_left.html.erb +0 -3
  164. data/app/views/admin/posts/_list.html.erb +0 -22
  165. data/app/views/admin/posts/edit.html.erb +0 -10
  166. data/app/views/admin/posts/new.html.erb +0 -10
  167. data/app/views/admin/posts/show.html.erb +0 -4
  168. data/app/views/admin/shared/_flash.html.erb +0 -3
  169. data/app/views/admin/users/_left.html.erb +0 -3
  170. data/app/views/admin/users/edit.html.erb +0 -8
  171. data/app/views/admin/users/new.html.erb +0 -8
  172. data/app/views/admin/users/show.html.erb +0 -12
  173. data/app/views/layouts/admin.html.erb +0 -80
  174. data/app/views/layouts/admin_login.html.erb +0 -17
  175. data/lib/grandstand/controller/development.rb +0 -15
  176. data/public/admin/javascripts/jquery.js +0 -404
  177. data/public/admin/javascripts/wysiwyg.js +0 -335
  178. data/public/admin/stylesheets/application.css +0 -1
  179. data/public/admin/stylesheets/global.css +0 -1
  180. data/public/admin/stylesheets/login.css +0 -1
  181. data/public/admin/stylesheets/wysiwyg.css +0 -1
data/README DELETED
@@ -1,7 +0,0 @@
1
- Grandstand
2
- ==========
3
-
4
- Grandstand is a Rails 3 (only!) Gem that allows you to build totally simple blogs and portfolios using a gallery and blog post
5
- editor. It's under active development, so don't get all excited just yet!
6
-
7
- Copyright (c) 2010 Flip Sasser, released under the MIT license
@@ -1,48 +0,0 @@
1
- class Admin::PostsController < Admin::MainController
2
- before_filter :find_post, :except => [:create, :index, :new]
3
- layout :check_form_layout
4
-
5
- def create
6
- @post = Post.new(params[:post].merge(:user => current_user))
7
- if @post.save
8
- flash[:success] = "#{@post.name} was successfully added"
9
- redirect_to admin_post_path(@post)
10
- else
11
- flash[:error] = 'There was a problem creating this post'
12
- render :new
13
- end
14
- end
15
-
16
- def destroy
17
- @post.destroy
18
- flash[:delete] = 'Your post has been deleted'
19
- redirect_to admin_posts_path
20
- end
21
-
22
- def index
23
- @posts = Post.all
24
- end
25
-
26
- def new
27
- @post = Post.new
28
- end
29
-
30
- def update
31
- if @post.update_attributes(params[:post])
32
- flash[:success] = "#{@post.name} was successfully saved"
33
- request.xhr? ? render(:json => {:status => :ok}) : redirect_to(admin_post_path(@post))
34
- else
35
- flash[:error] = 'There was a problem saving this post'
36
- render :edit
37
- end
38
- end
39
-
40
- protected
41
- def check_form_layout
42
- %w(create edit new update).include?(params[:action]) && params[:preview] == 'yup' ? 'application' : admin_layout
43
- end
44
-
45
- def find_post
46
- return admin_not_found unless @post = Post.where(:id => params[:id]).first
47
- end
48
- end
@@ -1,6 +0,0 @@
1
- class Admin::TemplatesController < Admin::MainController
2
- def show
3
- return admin_not_found unless @template = Template[params[:id]]
4
- render :text => @template.render
5
- end
6
- end
@@ -1,31 +0,0 @@
1
- module Admin::MainHelper
2
- def expand(*controllers)
3
- options = controllers.extract_options!
4
- options[:class] = Array(options[:class]).compact
5
- options[:class].push(:expandable)
6
- section = controllers.first
7
- controllers.map!(&:to_s)
8
- if controllers.include?(controller_name) || !((session[:expand] ||= []) & controllers).empty?
9
- options[:class].push(:expanded)
10
- end
11
- raw %( class="#{options[:class].join(' ')}")
12
- end
13
-
14
- def expand_link(section)
15
- link_to(raw('<span></span>'), '#', :class => 'expand', :rel => section)
16
- end
17
-
18
- def hide(condition)
19
- raw ' style="display:none;"' if condition
20
- end
21
-
22
- # A form wrapper that's used to override the default field_error_proc in a thread-safeish way.
23
- # The new field_error_proc returns a <div> with class "errors" on it, instead of an irritating
24
- # "fieldWithErrors" classname that nobody likes or wants to use. Only used in admin at the moment.
25
- def wrap_admin_form(&block)
26
- field_error_proc = ActionView::Base.field_error_proc
27
- ActionView::Base.field_error_proc = Proc.new {|html_tag, instance| raw("<div class=\"errors\">#{html_tag}</div>") }
28
- concat(capture(&block))
29
- ActionView::Base.field_error_proc = field_error_proc
30
- end
31
- end
@@ -1,2 +0,0 @@
1
- module Admin::PagesHelper
2
- end
@@ -1,2 +0,0 @@
1
- module Admin::PostsHelper
2
- end
@@ -1,2 +0,0 @@
1
- module Admin::SessionsHelper
2
- end
@@ -1,2 +0,0 @@
1
- module Admin::TemplatesHelper
2
- end
@@ -1,2 +0,0 @@
1
- module Admin::UsersHelper
2
- end
@@ -1,6 +0,0 @@
1
- class PageSection < ActiveRecord::Base
2
- belongs_to :page
3
- Grandstand::Application.page_sections.each do |section|
4
- scope section.to_sym, where(:section => section)
5
- end
6
- end
@@ -1,85 +0,0 @@
1
- /*
2
- dialogs.less contains the styling for drop-down dialogs in the WYSIWYG editor. Ideally,
3
- it should be merged with the #pulldown styling from application.less to create something
4
- a bit more seamless
5
- */
6
- .admin .wysiwyg .dialog {
7
- > form {
8
- background:#fff;
9
- left:50%;
10
- margin-left:-40%;
11
- position:absolute;
12
- top:0;
13
- width:80%;
14
- z-index:3;
15
- -moz-border-radius-bottomleft:5px;
16
- -moz-border-radius-bottomright:5px;
17
- -moz-box-shadow:#444 0 2px 2px;
18
- -webkit-border-bottom-left-radius:5px;
19
- -webkit-border-bottom-right-radius:5px;
20
- -webkit-box-shadow:#444 0 2px 2px;
21
- }
22
-
23
- .pad {
24
- padding:10px;
25
- }
26
-
27
- .xhr, form, .source, .destination {
28
- /* height:100%;*/
29
- }
30
-
31
- .source {
32
- background:#d9dfe8;
33
- border-right:1px solid #aaa;
34
- float:left;
35
- overflow-x:hidden;
36
- overflow-y:auto;
37
- width:200px;
38
- -moz-border-radius-bottomleft:5px;
39
- -webkit-border-bottom-left-radius:5px;
40
-
41
- .header {
42
- background-image:none !important;
43
- border-width:0 !important;
44
- color:#505d81;
45
- font-weight:bold;
46
- padding:10px 10px 5px 10px;
47
- text-shadow:#f1f5f8 0 1px 0;
48
- text-transform:uppercase;
49
- }
50
-
51
- a {
52
- border-top:1px solid #d9dfe8;
53
- color:#000;
54
- display:block;
55
- padding:5px 5px 5px 20px;
56
- text-decoration:none;
57
- }
58
-
59
- a.active {
60
- background:-webkit-gradient(linear, left top, left bottom, from(#63a4e2), to(#0066c0));
61
- border-top:1px solid #4691d6;
62
- color:#fff;
63
- text-shadow:#000 0 1px 0;
64
- }
65
- }
66
-
67
- .destination {
68
- margin-left:201px;
69
- }
70
-
71
- .image {
72
- cursor:pointer;
73
- }
74
-
75
- .scrollable {
76
- /* height:100%;*/
77
- overflow-x:hidden;
78
- overflow-y:auto;
79
- padding:10px 0;
80
- width:100%;
81
- -moz-box-sizing:border-box;
82
- -ms-box-sizing:border-box;
83
- -webkit-box-sizing:border-box;
84
- }
85
- }
@@ -1,16 +0,0 @@
1
- <% editable ||= false -%>
2
- <% gallery.images.each do |image| -%>
3
- <div class="inset image container" id="images_<%= image.id %>">
4
- <% if editable -%>
5
- <div class="header">
6
- <div class="float-left image icon">
7
- <%= truncate(image.file.original_filename, :length => 23) %>
8
- </div>
9
- <div class="float-right">
10
- <%= link_to '', edit_admin_gallery_image_path(gallery, image), :class => 'edit icon remote' %><%= link_to '', delete_admin_gallery_image_path(gallery, image), :class => 'delete icon remote' %>
11
- </div>
12
- </div>
13
- <% end -%>
14
- <%= image_tag(image.file.url(:admin_medium), :alt => image.caption) %>
15
- </div>
16
- <% end -%>
@@ -1,17 +0,0 @@
1
- <% galleries.each do |gallery| -%>
2
- <div class="inset gallery container" id="galleries_<%= gallery.url %>">
3
- <div class="header">
4
- <div class="float-left gallery icon">
5
- <%= (gallery.name) %>
6
- </div>
7
- <div class="float-right">
8
- <%= link_to '', edit_admin_gallery_path(gallery), :class => 'edit icon remote' %>
9
- <%= link_to '', delete_admin_gallery_path(gallery), :class => 'delete icon remote' %>
10
- </div>
11
- </div>
12
- <%= link_to(image_tag(gallery.cover_image.file.url(:admin_medium)), admin_gallery_path(gallery)) %>
13
- <% gallery.images.limit(100).each do |image| -%>
14
- <%= image_tag(image.file.url(:admin_medium)) %>
15
- <% end -%>
16
- </div>
17
- <% end -%>
@@ -1,8 +0,0 @@
1
- <h2>Are you sure you want to do this?</h2>
2
- <% form_for(@gallery, :html => {:method => :delete}, :url => admin_gallery_path(@gallery)) do %>
3
- <div class="field">You cannot undo this once it's done! This gallery, and all of its pictures, will be gone forever - poof!</div>
4
- <div class="toolbar">
5
- <%= button('Delete') %>
6
- <%= button_link_to('Cancel', return_path || admin_gallery_path(@gallery), :class => 'cancel') %>
7
- </div>
8
- <% end %>
@@ -1,8 +0,0 @@
1
- <h2>Edit Gallery</h2>
2
- <% form_for(@gallery, :url => admin_gallery_path(@gallery)) do |form| -%>
3
- <%= render :partial => 'form', :locals => {:form => form} %>
4
- <div class="toolbar">
5
- <%= button 'Save' %>
6
- <%= button_link_to('Cancel', admin_galleries_path, :class => 'cancel') %>
7
- </div>
8
- <% end -%>
@@ -1,13 +0,0 @@
1
- <form action="<%= request.fullpath %>" method="POST">
2
- <div class="source">
3
- <span class="header">Galleries</span>
4
- <% @galleries.each do |gallery| -%>
5
- <a href="<%= admin_gallery_path(gallery) %>">
6
- <span class="icon" style="background-image:url(<%= gallery.cover_image.file.url(:admin_icon) %>);"><%= gallery.name %></span>
7
- </a>
8
- <% end -%>
9
- </div>
10
- <div class="destination">
11
-
12
- </div>
13
- </form>
@@ -1,19 +0,0 @@
1
- <form action="<%= request.fullpath %>" method="POST">
2
- <div class="source">
3
- <div class="header">Galleries</div>
4
- <% @galleries.each_with_index do |gallery, index| -%>
5
- <a<%= raw ' class="active"' if index.zero? %> href="<%= admin_gallery_path(gallery) %>" rel="gallery-<%= gallery.to_param %>">
6
- <span class="icon" style="background-image:url(<%= gallery.cover_image.file.url(:admin_icon) %>);"><%= gallery.name %></span>
7
- </a>
8
- <% end -%>
9
- </div>
10
- <div class="destination">
11
- <div class="scrollable">
12
- <% @galleries.each_with_index do |gallery, index| -%>
13
- <div id="gallery-<%= gallery.to_param %>"<%= raw ' style="display:none;"' unless index.zero? %>>
14
- <%= render :partial => 'gallery', :locals => {:gallery => gallery} %>
15
- </div>
16
- <% end -%>
17
- </div>
18
- </div>
19
- </form>
@@ -1,13 +0,0 @@
1
- <% content_for :left do %>
2
- <%= button_link_to('Add a Gallery', new_admin_gallery_path, :class => 'remote', :icon => 'add') %>
3
- <% end %>
4
- <% if @galleries.empty? -%>
5
- <div class="inset">
6
- <h2>You haven't set up any galleries!</h2>
7
- <b class="grey">Get started:</b> <%= button_link_to('Add a Gallery', new_admin_gallery_path, :class => 'remote', :icon => 'add') %>
8
- </div>
9
- <% else -%>
10
- <div class="galleries sortable">
11
- <%= render :partial => 'list', :locals => {:galleries => @galleries} %>
12
- </div>
13
- <% end -%>
@@ -1,8 +0,0 @@
1
- <h2>New Gallery</h2>
2
- <% form_for(@gallery, :url => admin_galleries_path) do |form| -%>
3
- <%= render :partial => 'form', :locals => {:form => form} %>
4
- <div class="toolbar">
5
- <%= button 'Add Gallery' %>
6
- <%= button_link_to('Cancel', admin_galleries_path, :class => 'cancel') %>
7
- </div>
8
- <% end -%>
@@ -1,15 +0,0 @@
1
- <% content_for :left do %>
2
- <%= button_link_to('Upload An Image', new_admin_gallery_image_path(@gallery), :class => 'remote', :icon => 'upload') %>
3
- <%= button_link_to('Upload Multiple', upload_admin_gallery_images_path(@gallery), :class => 'remote', :icon => 'upload') %>
4
- <% end %>
5
- <h1 class="galleries icon"><%= @gallery.name %> <%= button_link_to('Edit', edit_admin_gallery_path(@gallery), :class => 'remote', :icon => 'edit') %></h1>
6
- <% if @gallery.images.empty? -%>
7
- <div class="inset">
8
- <h2>You haven't uploaded any images!</h2>
9
- <b class="grey">Get started:</b> <%= button_link_to('Upload an Image', new_admin_gallery_image_path(@gallery), :class => 'remote') %>
10
- </div>
11
- <% else -%>
12
- <div class="images sortable">
13
- <%= render :partial => 'gallery', :locals => {:gallery => @gallery, :editable => true} %>
14
- </div>
15
- <% end -%>
@@ -1,8 +0,0 @@
1
- <h2>Are you sure you want to do this?</h2>
2
- <% form_for(@image, :html => {:method => :delete}, :url => admin_gallery_image_path(@gallery, @image)) do %>
3
- <div class="field">You cannot undo this once it's done! This image will be gone forever - poof!</div>
4
- <div class="toolbar">
5
- <%= button('Delete') %>
6
- <%= button_link_to('Cancel', admin_gallery_path(@gallery), :class => 'cancel') %>
7
- </div>
8
- <% end %>
@@ -1,8 +0,0 @@
1
- <h2>Edit Image</h2>
2
- <% form_for(@image, :html => {:multipart => true}, :url => admin_gallery_image_path(@gallery, @image)) do |form| %>
3
- <%= render :partial => 'form', :locals => {:form => form} %>
4
- <div class="toolbar">
5
- <%= button 'Save' %>
6
- <%= button_link_to('Cancel', admin_gallery_path(@gallery), :class => 'cancel') %>
7
- </div>
8
- <% end %>
@@ -1,8 +0,0 @@
1
- <h2>Upload Image</h2>
2
- <% form_for(@image, :html => {:multipart => true}, :url => admin_gallery_images_path) do |form| %>
3
- <%= render :partial => 'form', :locals => {:form => form} %>
4
- <div class="toolbar">
5
- <%= button 'Add Image' %>
6
- <%= button_link_to('Cancel', admin_gallery_path(@gallery), :class => 'cancel') %>
7
- </div>
8
- <% end %>
@@ -1,10 +0,0 @@
1
- <div class="inset galleries icon">
2
- <% if (count = Gallery.count).zero? -%>
3
- <h2>You haven't set up any galleries!</h2>
4
- <b class="grey">Get started:</b> <%= button_link_to('Add a Gallery', new_admin_gallery_path, :class => 'remote') %>
5
- <% else %>
6
- <h2>You have <%= pluralize(count, 'gallery') %></h2>
7
- <%= button_link_to('Visit', admin_galleries_path) %>
8
- <%= button_link_to('Add Another One', new_admin_gallery_path, :class => 'grey remote') %>
9
- <% end -%>
10
- </div>
@@ -1,3 +0,0 @@
1
- <% content_for :left do %>
2
- <%= button_link_to('Add a Page', new_admin_page_path, :icon => 'add') %>
3
- <% end %>
@@ -1,29 +0,0 @@
1
- <% if params[:preview] == 'yup' %>
2
- <% content_for :head do -%>
3
- <%= javascript_include_tag '/admin/javascripts/jquery.js', '/admin/javascripts/application.js' %>
4
- <%= stylesheet_link_tag '/admin/stylesheets/external.css' %>
5
- <% end -%>
6
- <% post = Post.new(
7
- :body => form.text_area(:body, :class => 'wysiwyg'),
8
- :name => form.text_field(:name, :class => 'oversized text')
9
- ) -%>
10
- <div class="admin">
11
- <%= raw Mustache.render(::Template.post, post.as_json) %>
12
- </div>
13
- <% else -%>
14
- <%= render :partial => 'left' %>
15
- <% content_for :head do -%>
16
- <%= stylesheet_link_tag '/admin/stylesheets/wysiwyg.css' %>
17
- <% end -%>
18
- <% wrap_admin_form do -%>
19
- <div class="field">
20
- <%= form.label :name %>
21
- <%= form.text_field :name, :class => 'oversized text' %>
22
- <%= errors_on(:post, :name) %>
23
- </div>
24
- <div class="field">
25
- <%= form.label :body %>
26
- <%= form.text_area :body, :class => 'wysiwyg' %>
27
- </div>
28
- <% end -%>
29
- <% end -%>
@@ -1,3 +0,0 @@
1
- <% content_for :left do %>
2
- <%= button_link_to('Add a Post', new_admin_post_path, :icon => 'add') %>
3
- <% end %>
@@ -1,22 +0,0 @@
1
- <table class="grid">
2
- <thead>
3
- <tr>
4
- <th>Name</th>
5
- <th>Author</th>
6
- <th colspan="2">Date</th>
7
- </tr>
8
- </thead>
9
- <tbody>
10
- <% posts.each do |post| -%>
11
- <tr class="row <%= cycle 'one', 'two' %>">
12
- <td><%= link_to post.name, admin_post_path(post) %></td>
13
- <td><%= link_to_if(post.user, post.user.try(:name), admin_user_path(post.user)) %></td>
14
- <td><%= post.created_at.to_date %>
15
- <td class="actions">
16
- <%= button_link_to 'Edit', edit_admin_post_path(post), :icon => :edit %>
17
- <%= button_link_to 'Delete', delete_admin_post_path(post), :icon => :delete %>
18
- </td>
19
- </tr>
20
- <% end -%>
21
- </tbody>
22
- </table>