grandstand 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. data/.gitignore +2 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README +7 -0
  4. data/Rakefile +44 -0
  5. data/VERSION +1 -0
  6. data/app/controllers/admin/galleries_controller.rb +52 -0
  7. data/app/controllers/admin/images_controller.rb +68 -0
  8. data/app/controllers/admin/main_controller.rb +36 -0
  9. data/app/controllers/admin/pages_controller.rb +51 -0
  10. data/app/controllers/admin/posts_controller.rb +48 -0
  11. data/app/controllers/admin/sessions_controller.rb +41 -0
  12. data/app/controllers/admin/templates_controller.rb +6 -0
  13. data/app/controllers/admin/users_controller.rb +48 -0
  14. data/app/controllers/galleries_controller.rb +5 -0
  15. data/app/controllers/pages_controller.rb +5 -0
  16. data/app/controllers/posts_controller.rb +5 -0
  17. data/app/helpers/admin/main_helper.rb +31 -0
  18. data/app/helpers/admin/pages_helper.rb +2 -0
  19. data/app/helpers/admin/posts_helper.rb +2 -0
  20. data/app/helpers/admin/sessions_helper.rb +2 -0
  21. data/app/helpers/admin/templates_helper.rb +2 -0
  22. data/app/helpers/admin/users_helper.rb +2 -0
  23. data/app/helpers/pages_helper.rb +2 -0
  24. data/app/helpers/posts_helper.rb +2 -0
  25. data/app/helpers/site_helper.rb +2 -0
  26. data/app/models/gallery.rb +22 -0
  27. data/app/models/image.rb +61 -0
  28. data/app/models/page.rb +45 -0
  29. data/app/models/page_section.rb +6 -0
  30. data/app/models/post.rb +27 -0
  31. data/app/models/template.rb +33 -0
  32. data/app/models/user.rb +68 -0
  33. data/app/stylesheets/_buttons.less +76 -0
  34. data/app/stylesheets/_dialogs.less +85 -0
  35. data/app/stylesheets/application.less +238 -0
  36. data/app/stylesheets/global.less +435 -0
  37. data/app/stylesheets/login.less +30 -0
  38. data/app/stylesheets/wysiwyg.less +96 -0
  39. data/app/views/admin/galleries/_form.html.erb +11 -0
  40. data/app/views/admin/galleries/_gallery.html.erb +16 -0
  41. data/app/views/admin/galleries/_list.html.erb +17 -0
  42. data/app/views/admin/galleries/delete.html.erb +8 -0
  43. data/app/views/admin/galleries/edit.html.erb +8 -0
  44. data/app/views/admin/galleries/editor.html.erb +13 -0
  45. data/app/views/admin/galleries/editor_with_images.html.erb +19 -0
  46. data/app/views/admin/galleries/index.html.erb +13 -0
  47. data/app/views/admin/galleries/new.html.erb +8 -0
  48. data/app/views/admin/galleries/show.html.erb +15 -0
  49. data/app/views/admin/images/_form.html.erb +11 -0
  50. data/app/views/admin/images/delete.html.erb +8 -0
  51. data/app/views/admin/images/edit.html.erb +8 -0
  52. data/app/views/admin/images/new.html.erb +8 -0
  53. data/app/views/admin/images/upload.html.erb +11 -0
  54. data/app/views/admin/main/index.html.erb +10 -0
  55. data/app/views/admin/pages/_form.html.erb +33 -0
  56. data/app/views/admin/pages/_left.html.erb +3 -0
  57. data/app/views/admin/pages/_row.html.erb +9 -0
  58. data/app/views/admin/pages/delete.html.erb +8 -0
  59. data/app/views/admin/pages/edit.html.erb +8 -0
  60. data/app/views/admin/pages/index.html.erb +20 -0
  61. data/app/views/admin/pages/new.html.erb +8 -0
  62. data/app/views/admin/pages/show.html.erb +3 -0
  63. data/app/views/admin/posts/_form.html.erb +29 -0
  64. data/app/views/admin/posts/_left.html.erb +3 -0
  65. data/app/views/admin/posts/_list.html.erb +22 -0
  66. data/app/views/admin/posts/delete.html.erb +9 -0
  67. data/app/views/admin/posts/edit.html.erb +10 -0
  68. data/app/views/admin/posts/index.html.erb +10 -0
  69. data/app/views/admin/posts/new.html.erb +10 -0
  70. data/app/views/admin/posts/show.html.erb +4 -0
  71. data/app/views/admin/sessions/forgot.html.erb +8 -0
  72. data/app/views/admin/sessions/show.html.erb +12 -0
  73. data/app/views/admin/shared/_flash.html.erb +3 -0
  74. data/app/views/admin/users/_form.html.erb +16 -0
  75. data/app/views/admin/users/_left.html.erb +3 -0
  76. data/app/views/admin/users/delete.html.erb +10 -0
  77. data/app/views/admin/users/edit.html.erb +8 -0
  78. data/app/views/admin/users/index.html.erb +22 -0
  79. data/app/views/admin/users/new.html.erb +8 -0
  80. data/app/views/admin/users/show.html.erb +12 -0
  81. data/app/views/galleries/index.html.erb +0 -0
  82. data/app/views/galleries/show.html.erb +12 -0
  83. data/app/views/layouts/admin.html.erb +80 -0
  84. data/app/views/layouts/admin_login.html.erb +17 -0
  85. data/app/views/layouts/admin_xhr.html.erb +3 -0
  86. data/app/views/pages/show.html.erb +8 -0
  87. data/app/views/posts/show.html.erb +3 -0
  88. data/app/views/shared/404.html.erb +5 -0
  89. data/app/views/shared/gallery.html +14 -0
  90. data/app/views/shared/image.html +1 -0
  91. data/app/views/shared/page.html +0 -0
  92. data/app/views/shared/post.html +3 -0
  93. data/grandstand.gemspec +189 -0
  94. data/lib/grandstand/application.rb +50 -0
  95. data/lib/grandstand/controller/development.rb +15 -0
  96. data/lib/grandstand/controller.rb +104 -0
  97. data/lib/grandstand/helper.rb +117 -0
  98. data/lib/grandstand/routes.rb +59 -0
  99. data/lib/grandstand/session.rb +25 -0
  100. data/lib/grandstand.rb +27 -0
  101. data/public/.DS_Store +0 -0
  102. data/public/admin/.DS_Store +0 -0
  103. data/public/admin/images/.DS_Store +0 -0
  104. data/public/admin/images/background-input.gif +0 -0
  105. data/public/admin/images/background-progress-bar.png +0 -0
  106. data/public/admin/images/background-progress-complete.gif +0 -0
  107. data/public/admin/images/background-progress.gif +0 -0
  108. data/public/admin/images/icons/.DS_Store +0 -0
  109. data/public/admin/images/icons/add.png +0 -0
  110. data/public/admin/images/icons/collapse.png +0 -0
  111. data/public/admin/images/icons/delete.png +0 -0
  112. data/public/admin/images/icons/edit.png +0 -0
  113. data/public/admin/images/icons/editor/bold.png +0 -0
  114. data/public/admin/images/icons/editor/gallery.png +0 -0
  115. data/public/admin/images/icons/editor/image-center.png +0 -0
  116. data/public/admin/images/icons/editor/image-left.png +0 -0
  117. data/public/admin/images/icons/editor/image-right.png +0 -0
  118. data/public/admin/images/icons/editor/image.png +0 -0
  119. data/public/admin/images/icons/editor/italic.png +0 -0
  120. data/public/admin/images/icons/editor/ordered-list.png +0 -0
  121. data/public/admin/images/icons/editor/quote.png +0 -0
  122. data/public/admin/images/icons/editor/source.png +0 -0
  123. data/public/admin/images/icons/editor/strikethrough.png +0 -0
  124. data/public/admin/images/icons/editor/underline.png +0 -0
  125. data/public/admin/images/icons/editor/unordered-list.png +0 -0
  126. data/public/admin/images/icons/error.png +0 -0
  127. data/public/admin/images/icons/expand.png +0 -0
  128. data/public/admin/images/icons/galleries.png +0 -0
  129. data/public/admin/images/icons/gallery.png +0 -0
  130. data/public/admin/images/icons/image.png +0 -0
  131. data/public/admin/images/icons/okay.png +0 -0
  132. data/public/admin/images/icons/pages.png +0 -0
  133. data/public/admin/images/icons/posts.png +0 -0
  134. data/public/admin/images/icons/upload.png +0 -0
  135. data/public/admin/images/icons/users.png +0 -0
  136. data/public/admin/images/logo.png +0 -0
  137. data/public/admin/images/spinner-dark.gif +0 -0
  138. data/public/admin/images/uploader.swf +0 -0
  139. data/public/admin/javascripts/application.js +231 -0
  140. data/public/admin/javascripts/jquery.js +404 -0
  141. data/public/admin/javascripts/mustache.js +324 -0
  142. data/public/admin/javascripts/selection.js +280 -0
  143. data/public/admin/javascripts/string.js +264 -0
  144. data/public/admin/javascripts/wysiwyg.js +335 -0
  145. data/public/admin/stylesheets/application.css +1 -0
  146. data/public/admin/stylesheets/global.css +1 -0
  147. data/public/admin/stylesheets/login.css +1 -0
  148. data/public/admin/stylesheets/wysiwyg-content.css +20 -0
  149. data/public/admin/stylesheets/wysiwyg.css +1 -0
  150. data/vendor/cache/more-0.1.1.gem +0 -0
  151. metadata +216 -0
@@ -0,0 +1,11 @@
1
+ <% wrap_admin_form do -%>
2
+ <div class="field">
3
+ <%= form.label :file %>
4
+ <%= form.file_field :file %>
5
+ <%= errors_on(:image, :file) %>
6
+ </div>
7
+ <div class="field">
8
+ <%= form.label :caption %>
9
+ <%= form.text_area :caption %>
10
+ </div>
11
+ <% end %>
@@ -0,0 +1,8 @@
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 %>
@@ -0,0 +1,8 @@
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 %>
@@ -0,0 +1,8 @@
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 %>
@@ -0,0 +1,11 @@
1
+ <h2>Upload Multiple Image</h2>
2
+ <%= form_for(Image.new, :html => {:multipart => true}, :url => admin_gallery_images_path) do |form| %>
3
+ <%= hidden_field_tag :session_key, request.cookies[Rails.application.config.session_options[:key]] %>
4
+ <div class="field">
5
+ Use the button below to select files to upload. You can hold "shift" to select more than one file.
6
+ </div>
7
+ <table id="uploads" style="height:0;"><tbody></tbody></table>
8
+ <div class="toolbar">
9
+ <%= form.file_field :file %>
10
+ </div>
11
+ <% end =%>
@@ -0,0 +1,10 @@
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>
@@ -0,0 +1,33 @@
1
+ <%= render :partial => 'left' %>
2
+ <% content_for :head do -%>
3
+ <%= stylesheet_link_tag '/admin/stylesheets/wysiwyg.css' %>
4
+ <% end -%>
5
+ <% wrap_admin_form do -%>
6
+ <div class="field">
7
+ <%= form.label :parent_id %>
8
+ <%#= form.collection_select :parent_id, Page.tree, :id, :tree_name %>
9
+ </div>
10
+ <div class="field">
11
+ <%= form.label :name %>
12
+ <%= form.text_field :name, :class => 'oversized text' %>
13
+ <%= errors_on :page, :name %>
14
+ </div>
15
+ <div class="tabset">
16
+ <ul class="tabs">
17
+ <%= form.fields_for :page_sections do |page_section_form| %>
18
+ <% page_section_id = page_section_form.object.id || page_section_form.object.object_id -%>
19
+ <li>
20
+ <a href="#page-section-<%= page_section_id %>"><%= page_section_form.object.section.try(:titleize) %></a>
21
+ <%= page_section_form.hidden_field :section %>
22
+ </li>
23
+ <% content_for :page_sections do -%>
24
+
25
+ <div class="page-section" id="page-section-<%= page_section_id %>">
26
+ <%= page_section_form.text_area :content, :class => :wysiwyg %>
27
+ </div>
28
+ <% end -%>
29
+ <% end =%>
30
+ </ul>
31
+ <%= yield :page_sections %>
32
+ </div>
33
+ <% end -%>
@@ -0,0 +1,3 @@
1
+ <% content_for :left do %>
2
+ <%= button_link_to('Add a Page', new_admin_page_path, :icon => 'add') %>
3
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <tr class="row <%= cycle 'one', 'two' %><%= " child-of-#{page.parent_id}" if page.parent_id %>">
2
+ <td style="padding-left:<%= indent * 10 + 5 %>;"><%= link_to page.name, admin_page_path(page) %></td>
3
+ <td><%= link_to url = page_url(page.url), url %></td>
4
+ <td class="actions">
5
+ <%= button_link_to 'Edit', edit_admin_page_path(page), :icon => :edit %>
6
+ <%= button_link_to 'Delete', delete_admin_page_path(page), :icon => :delete %>
7
+ </td>
8
+ </tr>
9
+ <%= render :partial => 'row', :collection => page.children, :as => :page, :locals => {:indent => indent.next} %>
@@ -0,0 +1,8 @@
1
+ <h2>Are you sure you want to do this?</h2>
2
+ <% form_for(@page, :html => {:method => :delete}, :url => admin_page_path(@page)) do %>
3
+ <div class="field">You cannot undo this once it's done! This page will be dead. Not undead, like a zombie. Just plain dead.</div>
4
+ <div class="toolbar">
5
+ <%= button('Delete') %>
6
+ <%= button_link_to('Cancel', admin_pages_path, :class => 'cancel') %>
7
+ </div>
8
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <h1 class="pages icon"><%= @page.name %></h1>
2
+ <% form_for(@page, :url => admin_page_path(@page)) do |form| -%>
3
+ <%= render :partial => 'form', :locals => {:form => form} %>
4
+ <div class="toolbar">
5
+ <%= button 'Save' %>
6
+ <%= button_link_to('Cancel', admin_pages_path, :class => 'cancel') %>
7
+ </div>
8
+ <% end -%>
@@ -0,0 +1,20 @@
1
+ <%= render :partial => 'left' %>
2
+ <h1 class="pages icon">Pages</h1>
3
+ <% if @pages.empty? -%>
4
+ <div class="inset">
5
+ <h2>You haven't created any pages!</h2>
6
+ <b class="grey">Get started:</b> <%= button_link_to('Add a Page', new_admin_page_path, :icon => 'add') %>
7
+ </div>
8
+ <% else -%>
9
+ <table class="grid">
10
+ <thead>
11
+ <tr>
12
+ <th>Name</th>
13
+ <th colspan="2">URL</th>
14
+ </tr>
15
+ </thead>
16
+ <tbody>
17
+ <%= render :partial => 'row', :collection => @pages, :as => :page, :locals => {:indent => 0} %>
18
+ </tbody>
19
+ </table>
20
+ <% end -%>
@@ -0,0 +1,8 @@
1
+ <h1 class="pages icon">New Page</h1>
2
+ <%= form_for(@page, :url => admin_pages_path) do |form| %>
3
+ <%= render :partial => 'form', :locals => {:form => form} %>
4
+ <div class="toolbar">
5
+ <%= button 'Add Page' %>
6
+ <%= button_link_to('Cancel', admin_pages_path, :class => 'cancel') %>
7
+ </div>
8
+ <% end =%>
@@ -0,0 +1,3 @@
1
+ <%= render :partial => 'left' %>
2
+ <h1 class="pages icon"><%= @page.name %> <%= button_link_to('Edit', edit_admin_page_path(@page), :icon => 'edit') %></h1>
3
+ <div class="quiet"><%= link_to url = page_url(@page.url), url %></div>
@@ -0,0 +1,29 @@
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 -%>
@@ -0,0 +1,3 @@
1
+ <% content_for :left do %>
2
+ <%= button_link_to('Add a Post', new_admin_post_path, :icon => 'add') %>
3
+ <% end %>
@@ -0,0 +1,22 @@
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>
@@ -0,0 +1,9 @@
1
+ <%= render :partial => 'left' %>
2
+ <h2>Are you sure you want to do this?</h2>
3
+ <% form_for(@post, :html => {:method => :delete}, :url => admin_post_path(@post)) do %>
4
+ <div class="field">You cannot undo this once it's done! This post, and all the creative ideas therein, will be gone forever.</div>
5
+ <div class="toolbar">
6
+ <%= button('Delete') %>
7
+ <%= button_link_to('Cancel', admin_posts_path, :class => 'cancel') %>
8
+ </div>
9
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <% unless params[:preview] == 'yup' -%>
2
+ <h1 class="posts icon"><%= @post.name %></h1>
3
+ <% end -%>
4
+ <%= form_for(@post, :url => admin_post_path(@post)) do |form| %>
5
+ <%= render :partial => 'form', :locals => {:form => form} %>
6
+ <div class="toolbar">
7
+ <%= button 'Save' %>
8
+ <%= button_link_to('Cancel', return_path || admin_posts_path, :class => 'cancel') %>
9
+ </div>
10
+ <% end =%>
@@ -0,0 +1,10 @@
1
+ <%= render :partial => 'left' %>
2
+ <h1 class="posts icon">Blog Posts</h1>
3
+ <% if @posts.empty? -%>
4
+ <div class="inset">
5
+ <h2>You haven't written any posts!</h2>
6
+ <b class="grey">Get started:</b> <%= button_link_to('Add a Post', new_admin_post_path, :icon => 'add') %>
7
+ </div>
8
+ <% else -%>
9
+ <%= render :partial => 'list', :locals => {:posts => @posts} %>
10
+ <% end -%>
@@ -0,0 +1,10 @@
1
+ <% unless params[:preview] == 'yup' -%>
2
+ <h1 class="posts icon">New Blog Post</h1>
3
+ <% end -%>
4
+ <% form_for(@post, :url => admin_posts_path) do |form| -%>
5
+ <%= render :partial => 'form', :locals => {:form => form} %>
6
+ <div class="toolbar">
7
+ <%= button 'Add Post' %>
8
+ <%= button_link_to('Cancel', admin_posts_path, :class => 'cancel') %>
9
+ </div>
10
+ <% end -%>
@@ -0,0 +1,4 @@
1
+ <%= render :partial => 'left' %>
2
+ <h1 class="posts icon"><%= @post.name %> <%= button_link_to('Edit', edit_admin_post_path(@post), :icon => 'edit') %></h1>
3
+ <div class="quiet"><%= link_to url = post_url(@post.created_at.year, @post.created_at.month, @post.url), url %></div>
4
+ <%= raw @post.body %>
@@ -0,0 +1,8 @@
1
+ <h1>Forgot Password</h1>
2
+ <% form_tag(reset_admin_session_path) do %>
3
+ <p>
4
+ <label for="email">E-mail</label>
5
+ <%= text_field_tag(:email, '', :class => 'oversized text') %>
6
+ </p>
7
+ <%= button 'Reset Password', :class => 'grey' %> <%= button_link_to 'Return to Log In', admin_session_path %>
8
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <h1>Log In</h1>
2
+ <% form_tag(admin_session_path) do %>
3
+ <p>
4
+ <label for="email">E-mail</label>
5
+ <%= text_field_tag(:email, '', :class => 'oversized text') %>
6
+ </p>
7
+ <p>
8
+ <label for="password">Password</label>
9
+ <%= password_field_tag(:password, '', :class => 'oversized text') %>
10
+ </p>
11
+ <%= button 'Log In', :class => 'grey' %> <%= button_link_to 'Forgot Your Password?', forgot_admin_session_path %>
12
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <% flash.each do |key, message| -%>
2
+ <div class="flash <%= key %>"><div class="inner"><%= message %></div></div>
3
+ <% end -%>
@@ -0,0 +1,16 @@
1
+ <% wrap_admin_form do -%>
2
+ <div class="field">
3
+ <%= form.label :first_name %>
4
+ <%= form.text_field :first_name, :class => 'half oversized text' %>
5
+ <%= form.text_field :last_name, :class => 'half oversized text' %>
6
+ <%= errors_on(:user, :first_name) %>
7
+ </div>
8
+ <div class="field">
9
+ <%= form.label :email %>
10
+ <%= form.text_field :email, :class => 'text' %>
11
+ </div>
12
+ <div class="field">
13
+ <%= form.label :password %>
14
+ <%= form.text_field :password, :autocomplete => 'off', :class => 'text' %>
15
+ </div>
16
+ <% end -%>
@@ -0,0 +1,3 @@
1
+ <% content_for :left do %>
2
+ <%= button_link_to('Add a User', new_admin_user_path, :class => 'remote', :icon => 'add') %>
3
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <h2>Are you sure you want to do this?</h2>
2
+ <% form_for(@user, :html => {:method => :delete}, :url => admin_user_path(@user)) do %>
3
+ <div class="field">
4
+ You cannot undo this once it's done! This user will be gone, and so will their posts and galleries. Be careful! This could have dire effects.
5
+ </div>
6
+ <div class="toolbar">
7
+ <%= button('Delete') %>
8
+ <%= button_link_to('Cancel', admin_users_path, :class => 'cancel') %>
9
+ </div>
10
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <h2>Edit User</h2>
2
+ <% form_for(@user, :url => admin_user_path(@user)) do |form| -%>
3
+ <%= render :partial => 'form', :locals => {:form => form} %>
4
+ <div class="toolbar">
5
+ <%= button 'Save' %>
6
+ <%= button_link_to('Cancel', admin_users_path, :class => 'cancel') %>
7
+ </div>
8
+ <% end -%>
@@ -0,0 +1,22 @@
1
+ <%= render :partial => 'left' %>
2
+ <h1 class="users icon">Users</h1>
3
+ <table class="grid">
4
+ <thead>
5
+ <tr>
6
+ <th>Name</th>
7
+ <th colspan="2">Email</th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <% @users.each do |user| -%>
12
+ <tr class="row <%= cycle 'one', 'two' %>">
13
+ <td><%= link_to user.name, admin_user_path(user) %></td>
14
+ <td><%= user.email %></td>
15
+ <td class="actions">
16
+ <%= button_link_to 'Edit', edit_admin_user_path(user), :class => 'remote', :icon => :edit %>
17
+ <%= button_link_to 'Delete', delete_admin_user_path(user), :class => 'remote', :icon => :delete unless user.id == current_user.id %>
18
+ </td>
19
+ </tr>
20
+ <% end -%>
21
+ </tbody>
22
+ </table>
@@ -0,0 +1,8 @@
1
+ <h2>New User</h2>
2
+ <% form_for(@user, :url => admin_users_path) do |form| -%>
3
+ <%= render :partial => 'form', :locals => {:form => form} %>
4
+ <div class="toolbar">
5
+ <%= button 'Add User' %>
6
+ <%= button_link_to('Cancel', admin_users_path, :class => 'cancel') %>
7
+ </div>
8
+ <% end -%>
@@ -0,0 +1,12 @@
1
+ <%= render :partial => 'left' %>
2
+ <h1 class="users icon"><%= @user.name %> <%= button_link_to('Edit', edit_admin_user_path(@user), :class => 'remote', :icon => 'edit') %></h1>
3
+ <% unless @user.posts.empty? -%>
4
+ <h2>Blog Posts</h2>
5
+ <%= render :partial => 'admin/posts/list', :locals => {:posts => @user.posts} %>
6
+ <% end -%>
7
+ <% unless @user.galleries.empty? -%>
8
+ <h2>Galleries</h2>
9
+ <div class="galleries">
10
+ <%= render :partial => 'admin/galleries/list', :locals => {:galleries => @user.galleries} %>
11
+ </div>
12
+ <% end -%>
File without changes
@@ -0,0 +1,12 @@
1
+ <div id="image">
2
+ <%= image_tag(@gallery.cover_image.url(:page)) %>
3
+ </div>
4
+ <div id="thumbnails">
5
+ <% @gallery.images.each do |image| %>
6
+ <%= link_to(image_tag(image.url(:icon)), "#image-#{image.id}") %>
7
+ <% end -%>
8
+ </div>
9
+ <div class="post summary">
10
+ <h2><%= @gallery.name %></h2>
11
+ <%= raw(simple_format(@gallery.description)) %>
12
+ </div>
@@ -0,0 +1,80 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
6
+ <title>Grandstand Admin</title>
7
+ <%= javascript_include_tag('/admin/javascripts/jquery', '/admin/javascripts/application') %>
8
+ <%= stylesheet_link_tag('/admin/stylesheets/global', '/admin/stylesheets/application') %>
9
+ <%= csrf_meta_tag %>
10
+ <%= yield :head %>
11
+ </head>
12
+ <%
13
+ # sections = Hash[:left, yield(:left), :right, yield(:right)]
14
+ # classes = sections.keys.select {|key| !sections[key].blank? }
15
+ %>
16
+ <body class="admin">
17
+ <%= render :partial => 'admin/shared/flash', :locals => {:flash => flash} %>
18
+ <div id="header">
19
+ <div class="float-left">
20
+ <%= link_to(image_tag('/admin/images/logo.png', :alt => Grandstand::Application.app_name), admin_root_path, :id => 'logo') %>
21
+ </div>
22
+ <div class="float-right">
23
+ <%= link_to('View Site', '/', :target => :new) %>
24
+ <%= link_to('Logout', admin_session_path, :method => :delete) %>
25
+ </div>
26
+ </div>
27
+ <div id="content">
28
+ <div id="left">
29
+ <%= yield :left %>
30
+ <ul>
31
+ <li<%= expand(:posts, :class => 'first') %>>
32
+ <%= expand_link(:posts) %>
33
+ <%= link_to('Blog Posts', admin_posts_path) %>
34
+ <% unless Post.count.zero? -%>
35
+ <ul>
36
+ <% Post.limit(10).each do |post| -%>
37
+ <li><%= link_to(post.name, admin_post_path(post)) %></li>
38
+ <% end -%>
39
+ </ul>
40
+ <% end -%>
41
+ </li>
42
+ <li<%= expand(:galleries, :images) %>>
43
+ <%= expand_link(:galleries) %>
44
+ <%= link_to('Galleries', admin_galleries_path) %>
45
+ <% unless Gallery.count.zero? -%>
46
+ <ul>
47
+ <% Gallery.limit(10).each do |gallery| -%>
48
+ <li><%= link_to(gallery.name, admin_gallery_path(gallery)) %></li>
49
+ <% end -%>
50
+ </ul>
51
+ <% end -%>
52
+ </li>
53
+ <% if false -%>
54
+ <li<%= expand(:pages) %>>
55
+ <%= expand_link(:pages) %>
56
+ <%= link_to('Pages', admin_pages_path) %>
57
+ <% unless Page.roots.count.zero? -%>
58
+ <ul>
59
+ <% Page.roots.limit(10).each do |page| -%>
60
+ <li><%= link_to(page.name, admin_page_path(page)) %></li>
61
+ <% end -%>
62
+ </ul>
63
+ <% end -%>
64
+ </li>
65
+ <% end -%>
66
+ <li class="last">
67
+ <%= link_to('Users', admin_users_path) %>
68
+ </li>
69
+ </ul>
70
+ </div>
71
+ <div id="main">
72
+ <%= yield %>
73
+ </div>
74
+ </div>
75
+ <div id="footer">
76
+ </div>
77
+ <div id="cover" style="display:none;"></div>
78
+ <div id="pulldown" style="display:none;"></div>
79
+ </body>
80
+ </html>
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
6
+ <title><% if current_page %><%= current_page.title %> - <% end %>Grandstand</title>
7
+ <%= javascript_include_tag('/admin/javascripts/jquery', '/admin/javascripts/application', :cache => 'admin_application') %>
8
+ <%= stylesheet_link_tag('/admin/stylesheets/global', '/admin/stylesheets/login', :cache => 'admin_login') %>
9
+ </head>
10
+ <body class="admin">
11
+ <%= render :partial => 'admin/shared/flash', :locals => {:flash => flash} %>
12
+ <%= link_to(image_tag('/admin/images/logo.png', :alt => Grandstand::Application.app_name), admin_root_path, :id => 'logo') %>
13
+ <div class="inset" id="login">
14
+ <%= yield %>
15
+ </div>
16
+ </body>
17
+ </html>
@@ -0,0 +1,3 @@
1
+ <div class="xhr">
2
+ <%= yield %>
3
+ </div>
@@ -0,0 +1,8 @@
1
+ <h1><%= current_page.name %></h1>
2
+ <% current_page.page_sections.group_by(&:section).each do |section_name, page_sections| %>
3
+ <% content_for(section_name.to_sym) do -%>
4
+ <% page_sections.sort_by(&:position).each do |page_section| -%>
5
+ <%= page_content(page_section) %>
6
+ <% end -%>
7
+ <% end -%>
8
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <h1><%= @post.name %></h1>
2
+ <div class="meta">posted <%= @post.created_at.strftime('%m.%d.%Y').gsub(/^0/, '').gsub(/\.0/, '.') %></div>
3
+ <%= raw Mustache.render(::Template.post, @post.as_json) %>
@@ -0,0 +1,5 @@
1
+ <h1>Not Found</h1>
2
+ <p>
3
+ The page you were looking for does not exist! Why do you suck so much at looking for pages? Is it because you're angry at your parents? Well, don't take it out on
4
+ your browser. Uncool, dude. Uncool.
5
+ </p>
@@ -0,0 +1,14 @@
1
+ <div id="image">
2
+ {{#cover}}
3
+ <img alt="{{alt}}" height="{{height}}" src="{{src}}" width="{{width}}" />
4
+ {{/cover}}
5
+ </div>
6
+ <div id="thumbnails">
7
+ {{#images}}
8
+ <a href="#image-{{id}}"><img alt="{{alt}}" height="{{height}}" src="{{icon}}" width="{{width}}" /></a>
9
+ {{/images}}
10
+ </div>
11
+ <div class="post summary">
12
+ <h2>{{name}}</h2>
13
+ {{{description}}}
14
+ </div>
@@ -0,0 +1 @@
1
+ <img alt="{{caption}}" height="{{height}}" src="{{src}}" width="{{width}}" />
File without changes
@@ -0,0 +1,3 @@
1
+ <div class="post">
2
+ {{{body}}}
3
+ </div>