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/app/stylesheets/login.less
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
wysiwyg.less contains the CSS for any WYSIWYG editors that are rendered
|
3
|
-
in the
|
3
|
+
in the grandstand interface or during site preview. It mostly makes sure things
|
4
4
|
look okay no matter where they happen. Important to note is that when
|
5
5
|
in preview mode, we keep the Grandstand UI theming from global.less,
|
6
6
|
even though it's nested inside someone else's UI. This may not be very
|
@@ -8,89 +8,101 @@
|
|
8
8
|
overrides you may have.
|
9
9
|
*/
|
10
10
|
@import url('_buttons');
|
11
|
-
@import url('_dialogs');
|
12
11
|
|
13
|
-
.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
-webkit-border-radius:3px;
|
18
|
-
|
19
|
-
.toolbar {
|
20
|
-
#grandstand > .styled-toolbar;
|
21
|
-
border-bottom:1px solid #444;
|
12
|
+
.grandstand {
|
13
|
+
.wysiwyg {
|
14
|
+
border:1px solid #888;
|
15
|
+
overflow:hidden;
|
22
16
|
position:relative;
|
23
|
-
|
17
|
+
-webkit-border-radius:3px;
|
24
18
|
|
25
|
-
.
|
26
|
-
|
27
|
-
|
19
|
+
.toolbar {
|
20
|
+
#grandstand > .styled-toolbar;
|
21
|
+
border-bottom:1px solid #444;
|
22
|
+
position:relative;
|
28
23
|
|
29
|
-
.
|
30
|
-
|
31
|
-
|
24
|
+
.button {
|
25
|
+
line-height:0;
|
26
|
+
padding:3px;
|
32
27
|
|
33
|
-
|
34
|
-
|
35
|
-
|
28
|
+
.icon {
|
29
|
+
background-position:center top;
|
30
|
+
}
|
36
31
|
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
.icon.bold {
|
33
|
+
background-image:url(../images/icons/editor/bold.png);
|
34
|
+
}
|
35
|
+
|
36
|
+
.icon.italic {
|
37
|
+
background-image:url(../images/icons/editor/italic.png);
|
38
|
+
}
|
39
|
+
|
40
|
+
.icon.ordered-list {
|
41
|
+
background-image:url(../images/icons/editor/ordered-list.png);
|
42
|
+
}
|
40
43
|
|
41
|
-
|
42
|
-
|
44
|
+
.icon.unordered-list {
|
45
|
+
background-image:url(../images/icons/editor/unordered-list.png);
|
46
|
+
}
|
43
47
|
}
|
44
48
|
|
45
|
-
.icon
|
46
|
-
background-
|
49
|
+
.button:hover .icon {
|
50
|
+
background-position:center bottom;
|
47
51
|
}
|
48
52
|
}
|
49
53
|
|
50
|
-
|
51
|
-
background-
|
54
|
+
iframe {
|
55
|
+
background:#fff url(../images/background-input.gif) repeat-x;
|
56
|
+
/* border-bottom:1px solid #ddd;
|
57
|
+
border-left:1px solid #c3c3c3;
|
58
|
+
border-right:1px solid #c3c3c3;
|
59
|
+
border-top:1px solid #7d7d7d;*/
|
60
|
+
display:block;
|
61
|
+
height:400px;
|
62
|
+
width:100%;
|
63
|
+
-webkit-border-bottom-left-radius:3px;
|
64
|
+
-webkit-border-bottom-right-radius:3px;
|
65
|
+
}
|
66
|
+
|
67
|
+
textarea {
|
68
|
+
border-width:0;
|
69
|
+
/* padding:0;*/
|
52
70
|
}
|
53
|
-
}
|
54
71
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
72
|
+
.cover {
|
73
|
+
background-color:#fff;
|
74
|
+
height:100%;
|
75
|
+
left:0;
|
76
|
+
position:absolute;
|
77
|
+
top:0;
|
78
|
+
width:100%;
|
79
|
+
z-index:1;
|
80
|
+
-webkit-border-radius:3px;
|
81
|
+
}
|
82
|
+
|
83
|
+
.loading {
|
84
|
+
background:rgba(0, 0, 0, 0.7) url(../images/spinner-dark.gif) center center no-repeat;
|
85
|
+
height:50px;
|
86
|
+
left:50%;
|
87
|
+
margin:-25px 0 0 -25px;
|
88
|
+
position:absolute;
|
89
|
+
top:50%;
|
90
|
+
width:50px;
|
91
|
+
z-index:2;
|
92
|
+
-moz-border-radius:5px;
|
93
|
+
-webkit-border-radius:5px;
|
94
|
+
}
|
66
95
|
}
|
67
96
|
|
68
|
-
|
69
|
-
|
70
|
-
/* padding:0;*/
|
97
|
+
.icon.image-center {
|
98
|
+
background-image:url(../images/icons/editor/image-center.png);
|
71
99
|
}
|
72
100
|
|
73
|
-
.
|
74
|
-
background-
|
75
|
-
height:100%;
|
76
|
-
left:0;
|
77
|
-
position:absolute;
|
78
|
-
top:0;
|
79
|
-
width:100%;
|
80
|
-
z-index:1;
|
81
|
-
-webkit-border-radius:3px;
|
101
|
+
.icon.image-left {
|
102
|
+
background-image:url(../images/icons/editor/image-left.png);
|
82
103
|
}
|
83
104
|
|
84
|
-
.
|
85
|
-
background:
|
86
|
-
height:50px;
|
87
|
-
left:50%;
|
88
|
-
margin:-25px 0 0 -25px;
|
89
|
-
position:absolute;
|
90
|
-
top:50%;
|
91
|
-
width:50px;
|
92
|
-
z-index:2;
|
93
|
-
-moz-border-radius:5px;
|
94
|
-
-webkit-border-radius:5px;
|
105
|
+
.icon.image-right {
|
106
|
+
background-image:url(../images/icons/editor/image-right.png);
|
95
107
|
}
|
96
108
|
}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
<%
|
1
|
+
<% wrap_grandstand_form do -%>
|
2
2
|
<div class="field">
|
3
3
|
<%= form.label :name %>
|
4
4
|
<%= form.text_field :name, :class => 'text' %>
|
5
|
-
<%= errors_on(:
|
5
|
+
<%= form.errors_on(:name) %>
|
6
6
|
</div>
|
7
7
|
<div class="field">
|
8
8
|
<%= form.label :description %>
|
@@ -0,0 +1,16 @@
|
|
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 => 22) %>
|
8
|
+
</div>
|
9
|
+
<div class="float-right">
|
10
|
+
<%= link_to '', edit_grandstand_gallery_image_path(gallery, image), :class => 'edit icon remote' %><%= link_to '', delete_grandstand_gallery_image_path(gallery, image), :class => 'delete icon remote' %>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
<% end -%>
|
14
|
+
<%= image_tag(image.file.url(:grandstand_medium), :alt => image.caption, :height => 200, :width => 200) %>
|
15
|
+
</div>
|
16
|
+
<% end -%>
|
@@ -0,0 +1,17 @@
|
|
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_grandstand_gallery_path(gallery), :class => 'edit icon remote' %>
|
9
|
+
<%= link_to '', delete_grandstand_gallery_path(gallery), :class => 'delete icon remote' %>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
<%= link_to(image_tag(gallery.cover_image.file.url(:grandstand_medium)), grandstand_gallery_path(gallery)) %>
|
13
|
+
<% gallery.images.limit(100).each do |image| -%>
|
14
|
+
<%= image_tag(image.file.url(:grandstand_medium)) %>
|
15
|
+
<% end -%>
|
16
|
+
</div>
|
17
|
+
<% end -%>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<h2>Are you sure you want to do this?</h2>
|
2
|
+
<% form_for(@gallery, :as => :gallery, :html => {:method => :delete}, :url => grandstand_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', :default => true) %>
|
6
|
+
<%= button_link_to('Cancel', return_path || grandstand_gallery_path(@gallery), :class => 'cancel') %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<h2>Edit Gallery</h2>
|
2
|
+
<% form_for(@gallery, :as => :gallery, :url => grandstand_gallery_path(@gallery)) do |form| -%>
|
3
|
+
<%= render :partial => 'form', :locals => {:form => form} %>
|
4
|
+
<div class="toolbar">
|
5
|
+
<%= button 'Save' %>
|
6
|
+
<%= button_link_to('Cancel', grandstand_galleries_path, :class => 'cancel') %>
|
7
|
+
</div>
|
8
|
+
<% end -%>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<% if @galleries.empty? -%>
|
2
|
+
<h2 class="error icon">Please Upload Images to a Gallery</h2>
|
3
|
+
<div class="center field">
|
4
|
+
<img alt="No Galleries" src="/grandstand/images/galleries-empty.png" />
|
5
|
+
</div>
|
6
|
+
<div class="toolbar">
|
7
|
+
<%= button_link_to('Add a Gallery', new_grandstand_gallery_path, :class => 'remote', :icon => 'add') %>
|
8
|
+
<%= button_link_to('Close', return_path, :class => 'cancel')%>
|
9
|
+
</div>
|
10
|
+
<% else -%>
|
11
|
+
<form action="<%= request.fullpath %>" class="two-pane" method="POST">
|
12
|
+
<div class="source">
|
13
|
+
<div class="header">Galleries</div>
|
14
|
+
<% @galleries.each_with_index do |gallery, index| -%>
|
15
|
+
<a<%= raw ' class="active"' if index.zero? %> href="<%= grandstand_gallery_path(gallery) %>" rel="gallery-<%= gallery.to_param %>">
|
16
|
+
<span class="icon" style="background-image:url(<%= gallery.cover_image.file.url(:grandstand_icon) %>);"><%= gallery.name %></span>
|
17
|
+
</a>
|
18
|
+
<% end -%>
|
19
|
+
</div>
|
20
|
+
<div class="destination">
|
21
|
+
<div class="scrollable">
|
22
|
+
<% @galleries.each_with_index do |gallery, index| -%>
|
23
|
+
<div id="gallery-<%= gallery.to_param %>"<%= raw ' style="display:none;"' unless index.zero? %>>
|
24
|
+
<%= render :partial => 'gallery', :locals => {:gallery => gallery} %>
|
25
|
+
</div>
|
26
|
+
<% end -%>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<div class="toolbar">
|
30
|
+
<%= button_link_to('Close', return_path, :class => 'cancel') %>
|
31
|
+
</div>
|
32
|
+
</form>
|
33
|
+
<% end -%>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% content_for :left do %>
|
2
|
+
<%= button_link_to('Add a Gallery', new_grandstand_gallery_path, :class => 'remote', :icon => 'add') %>
|
3
|
+
<% end %>
|
4
|
+
<% if @galleries.empty? -%>
|
5
|
+
<div class="inset">
|
6
|
+
<h2 class="">You haven't set up any galleries!</h2>
|
7
|
+
<%= image_tag('/grandstand/images/galleries-empty.png') %>
|
8
|
+
<br /><b class="grey">Get started:</b> <%= button_link_to('Add a Gallery', new_grandstand_gallery_path, :class => 'remote', :icon => 'add') %>
|
9
|
+
</div>
|
10
|
+
<% else -%>
|
11
|
+
<div class="galleries sortable">
|
12
|
+
<%= render :partial => 'list', :locals => {:galleries => @galleries} %>
|
13
|
+
</div>
|
14
|
+
<% end -%>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<h2>New Gallery</h2>
|
2
|
+
<% form_for(@gallery, :as => :gallery, :url => grandstand_galleries_path) do |form| -%>
|
3
|
+
<%= render :partial => 'form', :locals => {:form => form} %>
|
4
|
+
<div class="toolbar">
|
5
|
+
<%= button 'Add Gallery' %>
|
6
|
+
<%= button_link_to('Cancel', grandstand_galleries_path, :class => 'cancel') %>
|
7
|
+
</div>
|
8
|
+
<% end -%>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<% content_for :left do %>
|
2
|
+
<%= button_link_to('Upload An Image', new_grandstand_gallery_image_path(@gallery), :class => 'remote', :icon => 'upload') %>
|
3
|
+
<%= button_link_to('Upload Multiple', upload_grandstand_gallery_images_path(@gallery), :class => 'remote', :icon => 'upload') %>
|
4
|
+
<% end %>
|
5
|
+
<h1 class="galleries icon">
|
6
|
+
<%= @gallery.name %>
|
7
|
+
<%= button_link_to('Edit', edit_grandstand_gallery_path(@gallery), :class => 'remote', :icon => 'edit') %>
|
8
|
+
<%= button_link_to('Delete', delete_grandstand_gallery_path(@gallery), :class => 'remote', :icon => 'delete') %>
|
9
|
+
</h1>
|
10
|
+
<% if @gallery.images.empty? -%>
|
11
|
+
<div class="inset">
|
12
|
+
<h2>You haven't uploaded any images!</h2>
|
13
|
+
<b class="grey">Get started:</b> <%= button_link_to('Upload an Image', new_grandstand_gallery_image_path(@gallery), :class => 'remote') %>
|
14
|
+
</div>
|
15
|
+
<% else -%>
|
16
|
+
<div class="images sortable">
|
17
|
+
<%= render :partial => 'gallery', :locals => {:gallery => @gallery, :editable => true} %>
|
18
|
+
</div>
|
19
|
+
<% end -%>
|
@@ -1,8 +1,8 @@
|
|
1
|
-
<%
|
1
|
+
<% wrap_grandstand_form do -%>
|
2
2
|
<div class="field">
|
3
3
|
<%= form.label :file %>
|
4
4
|
<%= form.file_field :file %>
|
5
|
-
<%= errors_on(:image, :file) %>
|
5
|
+
<%= form.errors_on(:image, :file) %>
|
6
6
|
</div>
|
7
7
|
<div class="field">
|
8
8
|
<%= form.label :caption %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<h2>Are you sure you want to do this?</h2>
|
2
|
+
<% form_for(@image, :as => :image, :html => {:method => :delete}, :url => grandstand_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', :default => true) %>
|
6
|
+
<%= button_link_to('Cancel', grandstand_gallery_path(@gallery), :class => 'cancel') %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<h2>Edit Image</h2>
|
2
|
+
<% form_for(@image, :as => :image, :html => {:multipart => true}, :url => grandstand_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', grandstand_gallery_path(@gallery), :class => 'cancel') %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<h2>Upload Image</h2>
|
2
|
+
<% form_for(@image, :as => :image, :html => {:multipart => true}, :url => grandstand_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', grandstand_gallery_path(@gallery), :class => 'cancel') %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<h2>Edit Embedded Image</h2>
|
2
|
+
<form action="<%= request.fullpath %>" class="pad" method="POST">
|
3
|
+
<div class="field">
|
4
|
+
<img alt="<%= @image.caption %>" class="float-left" src="<%= @image.url(:grandstand_medium) %>" style="margin:0 10px 10px 0;" />
|
5
|
+
<div class="label">Alignment</div>
|
6
|
+
<label for="align_left">
|
7
|
+
<%= radio_button_tag(:align, :left, params[:align] ? params[:align] == 'left' : true) %>
|
8
|
+
<span class="image-left icon">Inline with text, left</span>
|
9
|
+
</label>
|
10
|
+
<label for="align_center">
|
11
|
+
<%= radio_button_tag(:align, :center, params[:align] == 'center') %>
|
12
|
+
<span class="image-center icon">Break text, centered</span>
|
13
|
+
</label>
|
14
|
+
<label for="align_right">
|
15
|
+
<%= radio_button_tag(:align, :right, params[:align] == 'right') %>
|
16
|
+
<span class="image-right icon">Inline with text, right</span>
|
17
|
+
</label>
|
18
|
+
</div>
|
19
|
+
<div class="field">
|
20
|
+
<div class="label">Size</div>
|
21
|
+
<% Grandstand::Image.sizes.each do |size, options| -%>
|
22
|
+
<label for="size_<%= size %>">
|
23
|
+
<%= radio_button_tag(:size, @image.url(size), params[:size] == size.to_s || size == Grandstand::Image.sizes.keys.first, :id => "size_#{size}") %>
|
24
|
+
<%= size.to_s.titleize %>
|
25
|
+
(<%= options[:description] %>)
|
26
|
+
</label>
|
27
|
+
<% end -%>
|
28
|
+
</div>
|
29
|
+
<div class="toolbar">
|
30
|
+
<%= button 'Update', :default => true %>
|
31
|
+
<%= button_link_to('Cancel', return_path, :class => 'cancel') %>
|
32
|
+
</div>
|
33
|
+
</form>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<h2>Upload Multiple
|
2
|
-
<%= form_for(Image.new, :html => {:multipart => true}, :url =>
|
1
|
+
<h2>Upload Multiple Images</h2>
|
2
|
+
<%= form_for(Grandstand::Image.new, :html => {:multipart => true}, :url => grandstand_gallery_images_path) do |form| %>
|
3
3
|
<%= hidden_field_tag :session_key, request.cookies[Rails.application.config.session_options[:key]] %>
|
4
4
|
<div class="field">
|
5
5
|
Use the button below to select files to upload. You can hold "shift" to select more than one file.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="inset galleries icon">
|
2
|
+
<% if (count = Grandstand::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_grandstand_gallery_path, :class => 'remote') %>
|
5
|
+
<% else %>
|
6
|
+
<h2>You have <%= pluralize(count, 'gallery') %></h2>
|
7
|
+
<%= button_link_to('Visit', grandstand_galleries_path) %>
|
8
|
+
<%= button_link_to('Add Another One', new_grandstand_gallery_path, :class => 'grey remote') %>
|
9
|
+
<% end -%>
|
10
|
+
</div>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<%= render :partial => 'left' %>
|
2
2
|
<% content_for :head do -%>
|
3
|
-
<%= stylesheet_link_tag '/
|
3
|
+
<%= stylesheet_link_tag '/grandstand/stylesheets/wysiwyg.css' %>
|
4
4
|
<% end -%>
|
5
|
-
<%
|
5
|
+
<% wrap_grandstand_form do -%>
|
6
6
|
<div class="field">
|
7
7
|
<%= form.label :parent_id %>
|
8
8
|
<%#= form.collection_select :parent_id, Page.tree, :id, :tree_name %>
|