grandstand 0.2.4 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +1 -1
- data/README.markdown +43 -0
- data/README.txt +0 -0
- data/Rakefile +7 -1
- data/VERSION +1 -1
- data/app/controllers/galleries_controller.rb +2 -2
- data/app/controllers/{admin → grandstand}/galleries_controller.rb +9 -13
- data/app/controllers/{admin → grandstand}/images_controller.rb +6 -9
- data/app/controllers/{admin → grandstand}/main_controller.rb +8 -8
- data/app/controllers/{admin → grandstand}/pages_controller.rb +9 -9
- data/app/controllers/grandstand/posts_controller.rb +64 -0
- data/app/controllers/{admin → grandstand}/sessions_controller.rb +8 -8
- data/app/controllers/grandstand/templates_controller.rb +8 -0
- data/app/controllers/{admin → grandstand}/users_controller.rb +10 -10
- data/app/controllers/posts_controller.rb +1 -1
- data/app/helpers/galleries_helper.rb +2 -0
- data/app/helpers/grandstand/galleries_helper.rb +2 -0
- data/app/helpers/grandstand/images_helpers.rb +2 -0
- data/app/helpers/grandstand/main_helper.rb +74 -0
- data/app/helpers/grandstand/pages_helper.rb +2 -0
- data/app/helpers/grandstand/posts_helper.rb +2 -0
- data/app/helpers/grandstand/sessions_helper.rb +2 -0
- data/app/helpers/grandstand/templates_helper.rb +2 -0
- data/app/helpers/grandstand/users_helper.rb +2 -0
- data/app/models/{gallery.rb → grandstand/gallery.rb} +2 -2
- data/app/models/{image.rb → grandstand/image.rb} +10 -9
- data/app/models/{page.rb → grandstand/page.rb} +1 -1
- data/app/models/grandstand/page_section.rb +6 -0
- data/app/models/{post.rb → grandstand/post.rb} +14 -2
- data/app/models/{template.rb → grandstand/template.rb} +2 -2
- data/app/models/{user.rb → grandstand/user.rb} +1 -1
- data/app/stylesheets/application.less +103 -10
- data/app/stylesheets/global.less +47 -30
- data/app/stylesheets/login.less +1 -1
- data/app/stylesheets/wysiwyg.less +77 -65
- data/app/views/{admin → grandstand}/galleries/_form.html.erb +2 -2
- data/app/views/grandstand/galleries/_gallery.html.erb +16 -0
- data/app/views/grandstand/galleries/_list.html.erb +17 -0
- data/app/views/grandstand/galleries/delete.html.erb +8 -0
- data/app/views/grandstand/galleries/edit.html.erb +8 -0
- data/app/views/grandstand/galleries/editor.html.erb +33 -0
- data/app/views/grandstand/galleries/index.html.erb +14 -0
- data/app/views/grandstand/galleries/new.html.erb +8 -0
- data/app/views/grandstand/galleries/show.html.erb +19 -0
- data/app/views/{admin → grandstand}/images/_form.html.erb +2 -2
- data/app/views/grandstand/images/delete.html.erb +8 -0
- data/app/views/grandstand/images/edit.html.erb +8 -0
- data/app/views/grandstand/images/new.html.erb +8 -0
- data/app/views/grandstand/images/show.html.erb +33 -0
- data/app/views/{admin → grandstand}/images/upload.html.erb +2 -2
- data/app/views/grandstand/main/index.html.erb +10 -0
- data/app/views/{admin → grandstand}/pages/_form.html.erb +2 -2
- data/app/views/grandstand/pages/_left.html.erb +3 -0
- data/app/views/{admin → grandstand}/pages/_row.html.erb +3 -3
- data/app/views/{admin → grandstand}/pages/delete.html.erb +2 -2
- data/app/views/{admin → grandstand}/pages/edit.html.erb +2 -2
- data/app/views/{admin → grandstand}/pages/index.html.erb +1 -1
- data/app/views/{admin → grandstand}/pages/new.html.erb +2 -2
- data/app/views/{admin → grandstand}/pages/show.html.erb +1 -1
- data/app/views/grandstand/posts/_form.html.erb +15 -0
- data/app/views/grandstand/posts/_left.html.erb +3 -0
- data/app/views/grandstand/posts/_list.html.erb +26 -0
- data/app/views/{admin → grandstand}/posts/delete.html.erb +2 -2
- data/app/views/grandstand/posts/edit.html.erb +8 -0
- data/app/views/{admin → grandstand}/posts/index.html.erb +1 -1
- data/app/views/grandstand/posts/new.html.erb +8 -0
- data/app/views/grandstand/posts/preview.html.erb +9 -0
- data/app/views/grandstand/posts/show.html.erb +8 -0
- data/app/views/{admin → grandstand}/sessions/forgot.html.erb +2 -2
- data/app/views/{admin → grandstand}/sessions/show.html.erb +2 -2
- data/app/views/grandstand/shared/_flash.html.erb +3 -0
- data/app/views/{admin → grandstand}/users/_form.html.erb +2 -2
- data/app/views/grandstand/users/_left.html.erb +3 -0
- data/app/views/{admin → grandstand}/users/delete.html.erb +2 -2
- data/app/views/grandstand/users/edit.html.erb +8 -0
- data/app/views/{admin → grandstand}/users/index.html.erb +3 -3
- data/app/views/grandstand/users/new.html.erb +8 -0
- data/app/views/grandstand/users/show.html.erb +12 -0
- data/app/views/layouts/grandstand.html.erb +76 -0
- data/app/views/layouts/grandstand_login.html.erb +17 -0
- data/app/views/layouts/{admin_xhr.html.erb → grandstand_xhr.html.erb} +0 -0
- data/app/views/posts/show.html.erb +2 -2
- data/{lib/grandstand → config}/routes.rb +9 -7
- data/grandstand.gemspec +139 -122
- data/lib/grandstand.rb +50 -19
- data/lib/grandstand/application.rb +27 -35
- data/lib/grandstand/controller.rb +4 -6
- data/lib/grandstand/form_builder.rb +19 -0
- data/lib/grandstand/helper.rb +1 -47
- data/lib/grandstand/session.rb +2 -11
- data/lib/grandstand/stylesheets_controller.rb +14 -0
- data/public/{admin → grandstand}/images/background-input.gif +0 -0
- data/public/{admin → grandstand}/images/background-progress-bar.png +0 -0
- data/public/{admin → grandstand}/images/background-progress-complete.gif +0 -0
- data/public/{admin → grandstand}/images/background-progress.gif +0 -0
- data/public/grandstand/images/galleries-empty.png +0 -0
- data/public/{admin → grandstand}/images/icons/add.png +0 -0
- data/public/{admin → grandstand}/images/icons/collapse.png +0 -0
- data/public/{admin → grandstand}/images/icons/delete.png +0 -0
- data/public/{admin → grandstand}/images/icons/edit.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/bold.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/gallery.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/image-center.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/image-left.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/image-right.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/image.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/italic.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/ordered-list.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/quote.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/source.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/strikethrough.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/underline.png +0 -0
- data/public/{admin → grandstand}/images/icons/editor/unordered-list.png +0 -0
- data/public/{admin → grandstand}/images/icons/error.png +0 -0
- data/public/{admin → grandstand}/images/icons/expand.png +0 -0
- data/public/{admin → grandstand}/images/icons/galleries.png +0 -0
- data/public/{admin → grandstand}/images/icons/gallery.png +0 -0
- data/public/{admin → grandstand}/images/icons/image.png +0 -0
- data/public/{admin → grandstand}/images/icons/okay.png +0 -0
- data/public/{admin → grandstand}/images/icons/pages.png +0 -0
- data/public/{admin → grandstand}/images/icons/posts.png +0 -0
- data/public/grandstand/images/icons/processing.gif +0 -0
- data/public/{admin → grandstand}/images/icons/upload.png +0 -0
- data/public/{admin → grandstand}/images/icons/users.png +0 -0
- data/public/{admin → grandstand}/images/logo.png +0 -0
- data/public/{admin → grandstand}/images/spinner-dark.gif +0 -0
- data/public/{admin → grandstand}/images/uploader.swf +0 -0
- data/public/{admin → grandstand}/javascripts/application.js +139 -54
- data/public/grandstand/javascripts/jquery.js +414 -0
- data/public/{admin → grandstand}/javascripts/mustache.js +0 -0
- data/public/grandstand/javascripts/preview.js +9 -0
- data/public/{admin → grandstand}/javascripts/selection.js +77 -57
- data/public/{admin → grandstand}/javascripts/string.js +7 -6
- data/public/grandstand/javascripts/wysiwyg.js +311 -0
- data/public/{admin → grandstand}/stylesheets/wysiwyg-content.css +15 -2
- metadata +207 -126
- data/README +0 -7
- data/app/controllers/admin/posts_controller.rb +0 -48
- data/app/controllers/admin/templates_controller.rb +0 -6
- data/app/helpers/admin/main_helper.rb +0 -31
- data/app/helpers/admin/pages_helper.rb +0 -2
- data/app/helpers/admin/posts_helper.rb +0 -2
- data/app/helpers/admin/sessions_helper.rb +0 -2
- data/app/helpers/admin/templates_helper.rb +0 -2
- data/app/helpers/admin/users_helper.rb +0 -2
- data/app/models/page_section.rb +0 -6
- data/app/stylesheets/_dialogs.less +0 -85
- data/app/views/admin/galleries/_gallery.html.erb +0 -16
- data/app/views/admin/galleries/_list.html.erb +0 -17
- data/app/views/admin/galleries/delete.html.erb +0 -8
- data/app/views/admin/galleries/edit.html.erb +0 -8
- data/app/views/admin/galleries/editor.html.erb +0 -13
- data/app/views/admin/galleries/editor_with_images.html.erb +0 -19
- data/app/views/admin/galleries/index.html.erb +0 -13
- data/app/views/admin/galleries/new.html.erb +0 -8
- data/app/views/admin/galleries/show.html.erb +0 -15
- data/app/views/admin/images/delete.html.erb +0 -8
- data/app/views/admin/images/edit.html.erb +0 -8
- data/app/views/admin/images/new.html.erb +0 -8
- data/app/views/admin/main/index.html.erb +0 -10
- data/app/views/admin/pages/_left.html.erb +0 -3
- data/app/views/admin/posts/_form.html.erb +0 -29
- data/app/views/admin/posts/_left.html.erb +0 -3
- data/app/views/admin/posts/_list.html.erb +0 -22
- data/app/views/admin/posts/edit.html.erb +0 -10
- data/app/views/admin/posts/new.html.erb +0 -10
- data/app/views/admin/posts/show.html.erb +0 -4
- data/app/views/admin/shared/_flash.html.erb +0 -3
- data/app/views/admin/users/_left.html.erb +0 -3
- data/app/views/admin/users/edit.html.erb +0 -8
- data/app/views/admin/users/new.html.erb +0 -8
- data/app/views/admin/users/show.html.erb +0 -12
- data/app/views/layouts/admin.html.erb +0 -80
- data/app/views/layouts/admin_login.html.erb +0 -17
- data/lib/grandstand/controller/development.rb +0 -15
- data/public/admin/javascripts/jquery.js +0 -404
- data/public/admin/javascripts/wysiwyg.js +0 -335
- data/public/admin/stylesheets/application.css +0 -1
- data/public/admin/stylesheets/global.css +0 -1
- data/public/admin/stylesheets/login.css +0 -1
- 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,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
|
data/app/models/page_section.rb
DELETED
@@ -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,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,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>
|