sbdevcore 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/28DaysLater.ttf +0 -0
- data/app/assets/images/ajax-loader.gif +0 -0
- data/app/assets/javascripts/jquery.tools.min.js +16 -108
- data/app/assets/javascripts/rails.validations.custom.js +5 -0
- data/app/assets/javascripts/sbdev-ajax.js +14 -0
- data/app/assets/javascripts/sbdevcore-tools.js +24 -37
- data/app/assets/javascripts/sbdevcore.js +8 -3
- data/app/assets/javascripts/tiny_mce_config.js +2 -0
- data/app/assets/stylesheets/_bar_nav.scss +6 -4
- data/app/assets/stylesheets/_buttons.scss +16 -10
- data/app/assets/stylesheets/_forms.scss +51 -0
- data/app/assets/stylesheets/_mixins.scss +40 -15
- data/app/assets/stylesheets/_overlay.scss +4 -7
- data/app/assets/stylesheets/_sbdev_core.scss +55 -19
- data/app/assets/stylesheets/_yui_base.scss +142 -0
- data/app/controllers/contacts_controller.rb +2 -36
- data/app/controllers/downloadables_controller.rb +6 -46
- data/app/controllers/galleries_controller.rb +4 -49
- data/app/controllers/indices_controller.rb +2 -45
- data/app/controllers/photos_controller.rb +4 -48
- data/app/controllers/sbdev_core_controller.rb +40 -0
- data/app/controllers/texts_controller.rb +3 -46
- data/app/controllers/videos_controller.rb +4 -45
- data/app/models/contact.rb +5 -1
- data/app/models/downloadable.rb +3 -1
- data/app/models/index.rb +4 -1
- data/app/models/photo.rb +3 -1
- data/app/models/video.rb +2 -0
- data/app/views/admins/mailer/confirmation_instructions.html.haml +4 -0
- data/app/views/admins/mailer/reset_password_instructions.html.haml +6 -0
- data/app/views/admins/mailer/unlock_instructions.html.haml +5 -0
- data/app/views/admins/passwords/edit.html.haml +8 -0
- data/app/views/admins/passwords/new.html.haml +6 -0
- data/app/views/admins/sessions/new.html.haml +8 -0
- data/app/views/admins/shared/_links.haml +19 -0
- data/app/views/application/_header.html.haml +1 -0
- data/app/views/application/_secondary_nav.html.haml +3 -0
- data/app/views/contacts/_form.html.haml +5 -0
- data/app/views/contacts/edit.html.haml +6 -0
- data/app/views/contacts/index.html.haml +21 -0
- data/app/views/contacts/new.html.haml +2 -0
- data/app/views/contacts/show.html.haml +24 -0
- data/app/views/downloadables/_form.html.haml +6 -0
- data/app/views/downloadables/_show.html.haml +7 -0
- data/app/views/downloadables/edit.html.haml +3 -0
- data/app/views/downloadables/new.html.haml +4 -0
- data/app/views/galleries/_form.html.haml +22 -0
- data/app/views/galleries/edit.html.haml +10 -0
- data/app/views/galleries/index.html.haml +9 -0
- data/app/views/galleries/new.html.haml +3 -0
- data/app/views/galleries/show.html.haml +9 -0
- data/app/views/indices/_form.html.haml +43 -0
- data/app/views/indices/_show.html.haml +17 -0
- data/app/views/indices/edit.html.haml +3 -0
- data/app/views/indices/index.html.haml +17 -0
- data/app/views/layouts/application.html.haml +16 -1
- data/app/views/layouts/bar_nav.html.haml +7 -14
- data/app/views/layouts/sbdev_core.html.haml +39 -0
- data/app/views/layouts/tab_nav.html.haml +9 -14
- data/app/views/mailer/message.haml +4 -0
- data/app/views/photos/_form.html.haml +10 -0
- data/app/views/photos/_show.html.haml +7 -0
- data/app/views/photos/edit.html.haml +3 -0
- data/app/views/photos/index.html.haml +21 -0
- data/app/views/photos/new.html.haml +4 -0
- data/app/views/photos/show.html.haml +4 -0
- data/app/views/sbdev_core/index.html.haml +1 -0
- data/app/views/sbdev_core/show.html.haml +4 -0
- data/app/views/sbdev_core/show.js.haml +1 -0
- data/app/views/shared/_asset_show.html.haml +1 -0
- data/app/views/shared/_devise_links.haml +15 -0
- data/app/views/shared/_gallery.html.haml +14 -0
- data/app/views/shared/_prioritizable_fields.html.haml +5 -0
- data/app/views/texts/_form.html.haml +3 -0
- data/app/views/texts/_show.html.haml +6 -0
- data/app/views/texts/edit.html.haml +3 -0
- data/app/views/texts/new.html.haml +4 -0
- data/app/views/texts/show.html.haml +8 -0
- data/app/views/videos/_form.html.haml +7 -0
- data/app/views/videos/_show.html.haml +12 -0
- data/app/views/videos/edit.html.haml +3 -0
- data/app/views/videos/index.html.haml +11 -0
- data/app/views/videos/new.html.haml +4 -0
- data/app/views/videos/show.html.haml +9 -0
- data/app/views/videos/show.js.haml +4 -0
- data/config/initializers/client_side_validations.rb +14 -0
- data/config/initializers/custom_validators.rb +15 -0
- data/config/initializers/load_app_config.rb +2 -0
- data/config/initializers/simple_form.rb +93 -0
- data/config/locales/en.yml +4 -1
- data/db/migrate/20110811000613_create_indices.rb +3 -0
- data/db/seeds.rb +23 -57
- data/lib/generators/sbdevcore/install_generator.rb +0 -2
- data/lib/generators/sbdevcore/templates/application.scss +1 -0
- data/lib/generators/sbdevcore/templates/application/_404.html.haml +2 -0
- data/lib/generators/sbdevcore/templates/application/_footer.html.haml +2 -1
- data/lib/generators/sbdevcore/templates/application/_inline_nav.html.haml +3 -0
- data/lib/generators/sbdevcore/templates/application/_nav.html.haml +1 -1
- data/lib/generators/sbdevcore/templates/config/initializers/mailer_setup.rb +2 -2
- data/lib/generators/sbdevcore/templates/config/initializers/simple_form.rb +93 -0
- data/lib/generators/sbdevcore/templates/new_contact.html.haml +4 -0
- data/lib/sbdevcore.rb +25 -2
- data/lib/sbdevcore/engine.rb +13 -34
- data/lib/sbdevcore/version.rb +1 -1
- data/lib/tasks/sbdevcore.rake +1 -1
- data/public/404.html +2 -2
- data/sbdevcore.gemspec +7 -2
- metadata +296 -156
- data/app/assets/stylesheets/_js_errors.scss +0 -26
- data/app/controllers/core_controller.rb +0 -5
- data/app/controllers/sbdevcore/application_controller_extensions.rb +0 -13
- data/app/controllers/statics_controller.rb +0 -6
- data/app/models/asset.rb +0 -27
- data/app/views/admins/confirmations/new.html.erb +0 -12
- data/app/views/admins/mailer/confirmation_instructions.html.erb +0 -5
- data/app/views/admins/mailer/reset_password_instructions.html.erb +0 -8
- data/app/views/admins/mailer/unlock_instructions.html.erb +0 -7
- data/app/views/admins/passwords/edit.html.erb +0 -16
- data/app/views/admins/passwords/new.html.erb +0 -12
- data/app/views/admins/registrations/edit.html.erb +0 -25
- data/app/views/admins/registrations/new.html.erb +0 -18
- data/app/views/admins/sessions/new.html.erb +0 -17
- data/app/views/admins/unlocks/new.html.erb +0 -12
- data/app/views/contacts/_form.html.erb +0 -18
- data/app/views/contacts/edit.html.erb +0 -8
- data/app/views/contacts/index.html.erb +0 -27
- data/app/views/contacts/new.html.erb +0 -4
- data/app/views/contacts/show.html.erb +0 -32
- data/app/views/downloadables/_form.html.erb +0 -17
- data/app/views/downloadables/_show.html.erb +0 -8
- data/app/views/downloadables/edit.html.erb +0 -4
- data/app/views/downloadables/new.html.erb +0 -6
- data/app/views/galleries/_form.html.erb +0 -33
- data/app/views/galleries/edit.html.erb +0 -13
- data/app/views/galleries/index.html.erb +0 -16
- data/app/views/galleries/new.html.erb +0 -8
- data/app/views/galleries/show.html.erb +0 -17
- data/app/views/indices/_form.html.erb +0 -60
- data/app/views/indices/_show.html.erb +0 -22
- data/app/views/indices/edit.html.erb +0 -12
- data/app/views/indices/index.html.erb +0 -23
- data/app/views/indices/new.html.erb +0 -8
- data/app/views/indices/show.html.erb +0 -4
- data/app/views/indices/show.js.erb +0 -1
- data/app/views/photos/_form.html.erb +0 -27
- data/app/views/photos/_show.html.erb +0 -14
- data/app/views/photos/edit.html.erb +0 -4
- data/app/views/photos/index.html.erb +0 -27
- data/app/views/photos/new.html.erb +0 -6
- data/app/views/photos/overlay.html.erb +0 -1
- data/app/views/photos/show.html.erb +0 -5
- data/app/views/shared/_asset_show.html.erb +0 -1
- data/app/views/shared/_gallery.html.erb +0 -21
- data/app/views/shared/_prioritizable_fields.html.erb +0 -10
- data/app/views/shared/course_type_index.html.erb +0 -16
- data/app/views/texts/_form.html.erb +0 -9
- data/app/views/texts/_new.html.erb +0 -6
- data/app/views/texts/_show.html.erb +0 -9
- data/app/views/texts/edit.html.erb +0 -4
- data/app/views/texts/new.html.erb +0 -6
- data/app/views/texts/show.html.erb +0 -9
- data/app/views/videos/_form.html.erb +0 -17
- data/app/views/videos/_show.html.erb +0 -16
- data/app/views/videos/edit.html.erb +0 -4
- data/app/views/videos/index.html.erb +0 -17
- data/app/views/videos/new.html.erb +0 -6
- data/app/views/videos/show.html.erb +0 -12
- data/lib/generators/sbdevcore/templates/application/_404.html.erb +0 -2
- data/lib/generators/sbdevcore/templates/application/_inline_nav.html.erb +0 -7
- data/lib/generators/sbdevcore/templates/config/tiny_mce.yml +0 -46
- data/lib/generators/sbdevcore/templates/new_contact.html.erb +0 -4
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/plugins/.gitkeep +0 -0
@@ -2,20 +2,18 @@
|
|
2
2
|
|
3
3
|
/* must be initially hidden */
|
4
4
|
display:none;
|
5
|
-
|
6
5
|
/* place overlay on top of other elements */
|
7
6
|
z-index:10000;
|
8
|
-
|
7
|
+
position: absolute;
|
9
8
|
/* styling */
|
10
9
|
background-color: $content-background-color;
|
11
10
|
|
12
|
-
width:
|
11
|
+
width: $content-width - 100px;
|
13
12
|
padding: 20px;
|
14
13
|
min-height:200px;
|
15
14
|
top: 0 !important;
|
16
|
-
|
17
|
-
|
18
|
-
@include box-shadow(90px);
|
15
|
+
@include box-shadow(50px);
|
16
|
+
@include corners-all(10px);
|
19
17
|
}
|
20
18
|
|
21
19
|
/* close button positioned on upper right corner */
|
@@ -31,5 +29,4 @@
|
|
31
29
|
|
32
30
|
.overlay img {
|
33
31
|
max-width: 800px;
|
34
|
-
max-height: 600px;
|
35
32
|
}
|
@@ -1,36 +1,62 @@
|
|
1
|
+
@import 'yui_base';
|
1
2
|
@import 'mixins';
|
2
3
|
@import 'gallery';
|
3
4
|
@import 'buttons';
|
4
5
|
@import 'tooltips';
|
5
|
-
@import 'js_errors';
|
6
6
|
@import 'trip_advisor';
|
7
7
|
@import 'overlay';
|
8
8
|
@import 'testimonials';
|
9
|
+
@import 'forms';
|
10
|
+
@import 'bar_nav';
|
9
11
|
|
10
12
|
/*layout*/
|
13
|
+
@font-face {
|
14
|
+
font-family: "28Days";
|
15
|
+
src: url("28DaysLater.ttf") format("truetype");
|
16
|
+
}
|
17
|
+
|
11
18
|
body {
|
12
|
-
|
13
|
-
font
|
14
|
-
padding: 0;
|
15
|
-
margin: 0;
|
19
|
+
background-color: $button-background-color;
|
20
|
+
font: 14px/1.5 Georgia,arial,helvetica,clean,sans-serif;
|
16
21
|
}
|
17
22
|
|
18
23
|
#container {
|
19
24
|
width: $window-width;
|
20
25
|
margin: 0 auto;
|
21
|
-
overflow: hidden;
|
22
26
|
}
|
23
27
|
|
24
28
|
#header {
|
25
|
-
background-color:
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
margin: 0;
|
29
|
+
background-color: $content-background-color;
|
30
|
+
height: 120px;
|
31
|
+
border-bottom: 2px solid silver;
|
32
|
+
.inner {
|
33
|
+
width: $content-width;
|
34
|
+
margin: 0 auto;
|
35
|
+
position: relative;
|
36
|
+
h1 {
|
37
|
+
margin: 10px 0;
|
38
|
+
font-size: 300%;
|
39
|
+
letter-spacing: 3px;
|
40
|
+
word-spacing: 7px;
|
41
|
+
font-family: "28Days";
|
42
|
+
text-shadow: 4px 4px 3px steelblue;
|
43
|
+
display: inline-block;
|
44
|
+
font-weight: normal;
|
45
|
+
}
|
31
46
|
}
|
32
47
|
}
|
33
48
|
|
49
|
+
#main {
|
50
|
+
width: 75%;
|
51
|
+
float: left;
|
52
|
+
}
|
53
|
+
|
54
|
+
#side_bar {
|
55
|
+
width: 24%;
|
56
|
+
float: left;
|
57
|
+
border-left: 1px dashed silver;
|
58
|
+
}
|
59
|
+
|
34
60
|
.content {
|
35
61
|
background-color: $content-background-color;
|
36
62
|
padding: $padding;
|
@@ -132,17 +158,25 @@ form {
|
|
132
158
|
}
|
133
159
|
|
134
160
|
/*Flash*/
|
135
|
-
|
161
|
+
.asset {
|
162
|
+
padding: 5px;
|
163
|
+
}
|
164
|
+
|
165
|
+
.highlight-section {
|
166
|
+
padding: 4px;
|
167
|
+
}
|
168
|
+
|
169
|
+
#flash_notice, #flash_error, .error {
|
136
170
|
padding: 5px 8px;
|
137
171
|
margin: 10px 0;
|
138
172
|
}
|
139
173
|
|
140
|
-
#flash_notice {
|
174
|
+
#flash_notice, .highlight-section, .error {
|
141
175
|
background-color: #CFC;
|
142
176
|
border: solid 1px #6C6;
|
143
177
|
}
|
144
178
|
|
145
|
-
#flash_error {
|
179
|
+
#flash_error, .error {
|
146
180
|
background-color: #FCC;
|
147
181
|
border: solid 1px #C66;
|
148
182
|
}
|
@@ -166,10 +200,6 @@ table.mceLayout {
|
|
166
200
|
text-align: center;
|
167
201
|
}
|
168
202
|
|
169
|
-
.highlight-section {
|
170
|
-
background-color: #FFE87C;
|
171
|
-
}
|
172
|
-
|
173
203
|
.justify_right {
|
174
204
|
text-align: right;
|
175
205
|
}
|
@@ -194,3 +224,9 @@ td {
|
|
194
224
|
float: right;
|
195
225
|
}
|
196
226
|
|
227
|
+
.ajax-loader {
|
228
|
+
background: url('/assets/ajax-loader.gif') center center no-repeat;
|
229
|
+
* {
|
230
|
+
opacity: .5;
|
231
|
+
}
|
232
|
+
}
|
@@ -0,0 +1,142 @@
|
|
1
|
+
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td {
|
2
|
+
margin: 0;
|
3
|
+
padding: 0; }
|
4
|
+
|
5
|
+
table {
|
6
|
+
border-collapse: collapse;
|
7
|
+
border-spacing: 0; }
|
8
|
+
|
9
|
+
fieldset, img {
|
10
|
+
border: 0; }
|
11
|
+
|
12
|
+
address, caption, cite, code, dfn, em, strong, th, var {
|
13
|
+
font-style: normal;
|
14
|
+
font-weight: normal; }
|
15
|
+
|
16
|
+
li {
|
17
|
+
list-style: none; }
|
18
|
+
|
19
|
+
caption, th {
|
20
|
+
text-align: left; }
|
21
|
+
|
22
|
+
h1, h2, h3, h4, h5, h6 {
|
23
|
+
font-size: 100%;
|
24
|
+
font-weight: normal; }
|
25
|
+
|
26
|
+
q {
|
27
|
+
&:before, &:after {
|
28
|
+
content: ''; } }
|
29
|
+
|
30
|
+
abbr, acronym {
|
31
|
+
border: 0;
|
32
|
+
font-variant: normal; }
|
33
|
+
|
34
|
+
/* to preserve line-height and selector appearance */
|
35
|
+
|
36
|
+
sup {
|
37
|
+
vertical-align: text-top; }
|
38
|
+
|
39
|
+
sub {
|
40
|
+
vertical-align: text-bottom; }
|
41
|
+
|
42
|
+
input, textarea, select {
|
43
|
+
font-family: inherit;
|
44
|
+
font-size: inherit;
|
45
|
+
font-weight: inherit; }
|
46
|
+
|
47
|
+
/*to enable resizing for IE*/
|
48
|
+
|
49
|
+
input, textarea, select {
|
50
|
+
*font-size: 100%; }
|
51
|
+
|
52
|
+
/*because legend doesn't inherit in IE */
|
53
|
+
|
54
|
+
legend {
|
55
|
+
color: #000; }
|
56
|
+
|
57
|
+
body {
|
58
|
+
font: 13px / 1.231 arial, helvetica, clean, sans-serif;
|
59
|
+
*font-size: small;
|
60
|
+
/* for IE */
|
61
|
+
*font: x-small;
|
62
|
+
/* for IE in quirks mode */ }
|
63
|
+
|
64
|
+
select, input, button, textarea {
|
65
|
+
font: 99% arial,helvetica,clean,sans-serif; }
|
66
|
+
|
67
|
+
table {
|
68
|
+
font-size: inherit;
|
69
|
+
font: 100%; }
|
70
|
+
pre, code, kbd, samp, tt {
|
71
|
+
font-family: monospace;
|
72
|
+
*font-size: 108%;
|
73
|
+
line-height: 100%; }
|
74
|
+
|
75
|
+
h1 {
|
76
|
+
/*18px via YUI Fonts CSS foundation*/
|
77
|
+
font-size: 138.5%; }
|
78
|
+
|
79
|
+
h2 {
|
80
|
+
/*16px via YUI Fonts CSS foundation*/
|
81
|
+
font-size: 123.1%; }
|
82
|
+
|
83
|
+
h3 {
|
84
|
+
/*14px via YUI Fonts CSS foundation*/
|
85
|
+
font-size: 108%; }
|
86
|
+
|
87
|
+
h1, h2, h3 {
|
88
|
+
/* top & bottom margin based on font size */
|
89
|
+
margin: 1em 0; }
|
90
|
+
|
91
|
+
h1, h2, h3, h4, h5, h6, strong {
|
92
|
+
/*bringing boldness back to headers and the strong element*/
|
93
|
+
font-weight: bold; }
|
94
|
+
|
95
|
+
abbr, acronym {
|
96
|
+
/*indicating to users that more info is available */
|
97
|
+
border-bottom: 1px dotted #000;
|
98
|
+
cursor: help; }
|
99
|
+
|
100
|
+
em {
|
101
|
+
/*bringing italics back to the em element*/
|
102
|
+
font-style: italic; }
|
103
|
+
|
104
|
+
blockquote, ul, ol, dl {
|
105
|
+
/*giving blockquotes and lists room to breath*/
|
106
|
+
margin: 1em; }
|
107
|
+
|
108
|
+
ol, ul, dl {
|
109
|
+
/*bringing lists on to the page with breathing room */
|
110
|
+
margin-left: 2em; }
|
111
|
+
|
112
|
+
ol li {
|
113
|
+
/*giving OL's LIs generated numbers*/
|
114
|
+
list-style: decimal outside; }
|
115
|
+
|
116
|
+
ul li {
|
117
|
+
/*giving UL's LIs generated disc markers*/
|
118
|
+
list-style: disc outside; }
|
119
|
+
|
120
|
+
dl dd {
|
121
|
+
/*providing spacing for definition terms*/
|
122
|
+
margin-left: 1em; }
|
123
|
+
|
124
|
+
th, td {
|
125
|
+
/*borders and padding to make the table readable*/
|
126
|
+
border: 1px solid #000;
|
127
|
+
padding: .5em; }
|
128
|
+
|
129
|
+
th {
|
130
|
+
/*distinguishing table headers from data cells*/
|
131
|
+
font-weight: bold;
|
132
|
+
text-align: center; }
|
133
|
+
|
134
|
+
caption {
|
135
|
+
/*coordinated margin to match cell's padding*/
|
136
|
+
margin-bottom: .5em;
|
137
|
+
/*centered so it doesn't blend in to other content*/
|
138
|
+
text-align: center; }
|
139
|
+
|
140
|
+
p, fieldset, table, pre {
|
141
|
+
/*so things don't run into each other*/
|
142
|
+
margin-bottom: 1em; }
|
@@ -1,38 +1,4 @@
|
|
1
|
-
class ContactsController <
|
2
|
-
before_filter :get_index, :only => [:new]
|
1
|
+
class ContactsController < SbdevCoreController
|
3
2
|
before_filter :authenticate_admin!, :except => [:new, :create]
|
4
|
-
|
5
|
-
def index
|
6
|
-
@contacts = Contact.all
|
7
|
-
end
|
8
|
-
|
9
|
-
def show
|
10
|
-
@contact = Contact.find(params[:id])
|
11
|
-
end
|
12
|
-
|
13
|
-
def new
|
14
|
-
@contact = Contact.new
|
15
|
-
render :layout => false
|
16
|
-
end
|
17
|
-
|
18
|
-
def create
|
19
|
-
@contact = Contact.new(params[:contact])
|
20
|
-
if @contact.save
|
21
|
-
flash[:notice] = "Your message has been sent."
|
22
|
-
redirect_to root_url
|
23
|
-
else
|
24
|
-
render :action => 'new'
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def destroy
|
29
|
-
@contact = Contact.find(params[:id])
|
30
|
-
@contact.destroy
|
31
|
-
flash[:notice] = "Successfully destroyed contact."
|
32
|
-
redirect_to contacts_url
|
33
|
-
end
|
34
|
-
|
35
|
-
def get_index
|
36
|
-
Index.find_by_name(controller_name)
|
37
|
-
end
|
3
|
+
before_filter :get_index, :only => :new
|
38
4
|
end
|
@@ -1,51 +1,11 @@
|
|
1
|
-
class DownloadablesController <
|
2
|
-
before_filter :authenticate_admin!, :except =>
|
3
|
-
|
1
|
+
class DownloadablesController < SbdevCoreController
|
2
|
+
before_filter :authenticate_admin!, :except => :show
|
3
|
+
skip_before_filter :get_index
|
4
|
+
belongs_to :index, :optional => true
|
4
5
|
|
5
|
-
def index
|
6
|
-
@downloadables = Downloadable.all
|
7
|
-
end
|
8
|
-
|
9
6
|
def show
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
def new
|
15
|
-
@index = Index.find(params[:index_id])
|
16
|
-
@downloadable = @index.downloadables.build(:priority => ((@index.assets.first.lowest_priority + 1) rescue 0))
|
17
|
-
render :layout => false
|
18
|
-
end
|
19
|
-
|
20
|
-
def create
|
21
|
-
@downloadable = Downloadable.new(params[:downloadable])
|
22
|
-
if @downloadable.save
|
23
|
-
flash[:notice] = "Successfully created downloadable."
|
24
|
-
redirect_to :back
|
25
|
-
else
|
26
|
-
render :action => 'new'
|
7
|
+
show! do |format|
|
8
|
+
format.html {send_data(@downloadable.asset.url, :filename => @downloadable.asset_file_name, :type => @downloadable.asset_content_type, :disposition => 'attachment')}
|
27
9
|
end
|
28
10
|
end
|
29
|
-
|
30
|
-
def edit
|
31
|
-
@downloadable = Downloadable.find(params[:id])
|
32
|
-
render :layout => false
|
33
|
-
end
|
34
|
-
|
35
|
-
def update
|
36
|
-
@downloadable = Downloadable.find(params[:id])
|
37
|
-
if @downloadable.update_attributes(params[:downloadable])
|
38
|
-
flash[:notice] = "Successfully updated downloadable."
|
39
|
-
redirect_to :back
|
40
|
-
else
|
41
|
-
render :action => 'edit'
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def destroy
|
46
|
-
@downloadable = Downloadable.find(params[:id])
|
47
|
-
@downloadable.destroy
|
48
|
-
flash[:notice] = "Successfully destroyed downloadable."
|
49
|
-
redirect_to :back
|
50
|
-
end
|
51
11
|
end
|
@@ -1,50 +1,5 @@
|
|
1
|
-
class GalleriesController <
|
2
|
-
before_filter :authenticate_admin
|
3
|
-
|
4
|
-
|
5
|
-
def index
|
6
|
-
@galleries = Gallery.all
|
7
|
-
end
|
8
|
-
|
9
|
-
def show
|
10
|
-
@gallery = Gallery.find(params[:id])
|
11
|
-
@index = @gallery.index
|
12
|
-
@photo = @gallery.photos.first
|
13
|
-
end
|
14
|
-
|
15
|
-
def new
|
16
|
-
@gallery = Gallery.new
|
17
|
-
@gallery.build_index
|
18
|
-
end
|
19
|
-
|
20
|
-
def create
|
21
|
-
@gallery = Gallery.new(params[:gallery])
|
22
|
-
if @gallery.save
|
23
|
-
flash[:notice] = "Successfully created gallery."
|
24
|
-
redirect_to @gallery
|
25
|
-
else
|
26
|
-
render :action => 'new'
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def edit
|
31
|
-
@gallery = Gallery.find(params[:id])
|
32
|
-
end
|
33
|
-
|
34
|
-
def update
|
35
|
-
@gallery = Gallery.find(params[:id])
|
36
|
-
if @gallery.update_attributes(params[:gallery])
|
37
|
-
flash[:notice] = "Successfully updated gallery."
|
38
|
-
redirect_to @gallery
|
39
|
-
else
|
40
|
-
render :action => 'edit'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def destroy
|
45
|
-
@gallery = Gallery.find(params[:id])
|
46
|
-
@gallery.destroy
|
47
|
-
flash[:notice] = "Successfully destroyed gallery."
|
48
|
-
redirect_to galleries_url
|
49
|
-
end
|
1
|
+
class GalleriesController < SbdevCoreController
|
2
|
+
before_filter :authenticate_admin!
|
3
|
+
skip_before_filter :get_index
|
4
|
+
belongs_to :index, :optional => true
|
50
5
|
end
|