app-themer 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.md +158 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/app-themer.gemspec +82 -0
- data/images/avatar.png +0 -0
- data/images/icons/application_edit.png +0 -0
- data/images/icons/cross.png +0 -0
- data/images/icons/key.png +0 -0
- data/images/icons/tick.png +0 -0
- data/index.html +347 -0
- data/javascripts/dd_belatedpng.js +328 -0
- data/javascripts/modernizr-1.5.min.js +28 -0
- data/lib/app_themer.rb +2 -0
- data/lib/generators/app_themer/layout/layout_generator.rb +71 -0
- data/lib/generators/app_themer/layout/templates/admin.html.erb +59 -0
- data/lib/generators/app_themer/layout/templates/login.html.erb +0 -0
- data/lib/generators/app_themer/views/templates/_form.html.erb +13 -0
- data/lib/generators/app_themer/views/templates/_sidebar.html.erb +13 -0
- data/lib/generators/app_themer/views/templates/edit.html.erb +18 -0
- data/lib/generators/app_themer/views/templates/new.html.erb +16 -0
- data/lib/generators/app_themer/views/templates/show.html.erb +23 -0
- data/lib/generators/app_themer/views/templates/tables.html.erb +50 -0
- data/lib/generators/app_themer/views/templates/text.html.erb +16 -0
- data/lib/generators/app_themer/views/views_generator.rb +126 -0
- data/stylesheets/base.css +204 -0
- data/stylesheets/handheld.css +6 -0
- data/stylesheets/override.css +1 -0
- data/stylesheets/themes/default/images/arrow.png +0 -0
- data/stylesheets/themes/default/images/boxbar-background.png +0 -0
- data/stylesheets/themes/default/images/button-background-active.png +0 -0
- data/stylesheets/themes/default/images/button-background.png +0 -0
- data/stylesheets/themes/default/images/menubar-background.png +0 -0
- data/stylesheets/themes/default/style.css +444 -0
- data/test/helper.rb +10 -0
- data/test/test_app-themer.rb +5 -0
- metadata +115 -0
@@ -0,0 +1,328 @@
|
|
1
|
+
/**
|
2
|
+
* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>.
|
3
|
+
* Author: Drew Diller
|
4
|
+
* Email: drew.diller@gmail.com
|
5
|
+
* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
|
6
|
+
* Version: 0.0.8a
|
7
|
+
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
|
8
|
+
*
|
9
|
+
* Example usage:
|
10
|
+
* DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector
|
11
|
+
* DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement
|
12
|
+
**/
|
13
|
+
|
14
|
+
/*
|
15
|
+
PLEASE READ:
|
16
|
+
Absolutely everything in this script is SILLY. I know this. IE's rendering of certain pixels doesn't make sense, so neither does this code!
|
17
|
+
*/
|
18
|
+
|
19
|
+
var DD_belatedPNG = {
|
20
|
+
ns: 'DD_belatedPNG',
|
21
|
+
imgSize: {},
|
22
|
+
delay: 10,
|
23
|
+
nodesFixed: 0,
|
24
|
+
createVmlNameSpace: function () { /* enable VML */
|
25
|
+
if (document.namespaces && !document.namespaces[this.ns]) {
|
26
|
+
document.namespaces.add(this.ns, 'urn:schemas-microsoft-com:vml');
|
27
|
+
}
|
28
|
+
},
|
29
|
+
createVmlStyleSheet: function () { /* style VML, enable behaviors */
|
30
|
+
/*
|
31
|
+
Just in case lots of other developers have added
|
32
|
+
lots of other stylesheets using document.createStyleSheet
|
33
|
+
and hit the 31-limit mark, let's not use that method!
|
34
|
+
further reading: http://msdn.microsoft.com/en-us/library/ms531194(VS.85).aspx
|
35
|
+
*/
|
36
|
+
var screenStyleSheet, printStyleSheet;
|
37
|
+
screenStyleSheet = document.createElement('style');
|
38
|
+
screenStyleSheet.setAttribute('media', 'screen');
|
39
|
+
document.documentElement.firstChild.insertBefore(screenStyleSheet, document.documentElement.firstChild.firstChild);
|
40
|
+
if (screenStyleSheet.styleSheet) {
|
41
|
+
screenStyleSheet = screenStyleSheet.styleSheet;
|
42
|
+
screenStyleSheet.addRule(this.ns + '\\:*', '{behavior:url(#default#VML)}');
|
43
|
+
screenStyleSheet.addRule(this.ns + '\\:shape', 'position:absolute;');
|
44
|
+
screenStyleSheet.addRule('img.' + this.ns + '_sizeFinder', 'behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;'); /* large negative top value for avoiding vertical scrollbars for large images, suggested by James O'Brien, http://www.thanatopsic.org/hendrik/ */
|
45
|
+
this.screenStyleSheet = screenStyleSheet;
|
46
|
+
|
47
|
+
/* Add a print-media stylesheet, for preventing VML artifacts from showing up in print (including preview). */
|
48
|
+
/* Thanks to Rémi Prévost for automating this! */
|
49
|
+
printStyleSheet = document.createElement('style');
|
50
|
+
printStyleSheet.setAttribute('media', 'print');
|
51
|
+
document.documentElement.firstChild.insertBefore(printStyleSheet, document.documentElement.firstChild.firstChild);
|
52
|
+
printStyleSheet = printStyleSheet.styleSheet;
|
53
|
+
printStyleSheet.addRule(this.ns + '\\:*', '{display: none !important;}');
|
54
|
+
printStyleSheet.addRule('img.' + this.ns + '_sizeFinder', '{display: none !important;}');
|
55
|
+
}
|
56
|
+
},
|
57
|
+
readPropertyChange: function () {
|
58
|
+
var el, display, v;
|
59
|
+
el = event.srcElement;
|
60
|
+
if (!el.vmlInitiated) {
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
if (event.propertyName.search('background') != -1 || event.propertyName.search('border') != -1) {
|
64
|
+
DD_belatedPNG.applyVML(el);
|
65
|
+
}
|
66
|
+
if (event.propertyName == 'style.display') {
|
67
|
+
display = (el.currentStyle.display == 'none') ? 'none' : 'block';
|
68
|
+
for (v in el.vml) {
|
69
|
+
if (el.vml.hasOwnProperty(v)) {
|
70
|
+
el.vml[v].shape.style.display = display;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
if (event.propertyName.search('filter') != -1) {
|
75
|
+
DD_belatedPNG.vmlOpacity(el);
|
76
|
+
}
|
77
|
+
},
|
78
|
+
vmlOpacity: function (el) {
|
79
|
+
if (el.currentStyle.filter.search('lpha') != -1) {
|
80
|
+
var trans = el.currentStyle.filter;
|
81
|
+
trans = parseInt(trans.substring(trans.lastIndexOf('=')+1, trans.lastIndexOf(')')), 10)/100;
|
82
|
+
el.vml.color.shape.style.filter = el.currentStyle.filter; /* complete guesswork */
|
83
|
+
el.vml.image.fill.opacity = trans; /* complete guesswork */
|
84
|
+
}
|
85
|
+
},
|
86
|
+
handlePseudoHover: function (el) {
|
87
|
+
setTimeout(function () { /* wouldn't work as intended without setTimeout */
|
88
|
+
DD_belatedPNG.applyVML(el);
|
89
|
+
}, 1);
|
90
|
+
},
|
91
|
+
/**
|
92
|
+
* This is the method to use in a document.
|
93
|
+
* @param {String} selector - REQUIRED - a CSS selector, such as '#doc .container'
|
94
|
+
**/
|
95
|
+
fix: function (selector) {
|
96
|
+
if (this.screenStyleSheet) {
|
97
|
+
var selectors, i;
|
98
|
+
selectors = selector.split(','); /* multiple selectors supported, no need for multiple calls to this anymore */
|
99
|
+
for (i=0; i<selectors.length; i++) {
|
100
|
+
this.screenStyleSheet.addRule(selectors[i], 'behavior:expression(DD_belatedPNG.fixPng(this))'); /* seems to execute the function without adding it to the stylesheet - interesting... */
|
101
|
+
}
|
102
|
+
}
|
103
|
+
},
|
104
|
+
applyVML: function (el) {
|
105
|
+
el.runtimeStyle.cssText = '';
|
106
|
+
this.vmlFill(el);
|
107
|
+
this.vmlOffsets(el);
|
108
|
+
this.vmlOpacity(el);
|
109
|
+
if (el.isImg) {
|
110
|
+
this.copyImageBorders(el);
|
111
|
+
}
|
112
|
+
},
|
113
|
+
attachHandlers: function (el) {
|
114
|
+
var self, handlers, handler, moreForAs, a, h;
|
115
|
+
self = this;
|
116
|
+
handlers = {resize: 'vmlOffsets', move: 'vmlOffsets'};
|
117
|
+
if (el.nodeName == 'A') {
|
118
|
+
moreForAs = {mouseleave: 'handlePseudoHover', mouseenter: 'handlePseudoHover', focus: 'handlePseudoHover', blur: 'handlePseudoHover'};
|
119
|
+
for (a in moreForAs) {
|
120
|
+
if (moreForAs.hasOwnProperty(a)) {
|
121
|
+
handlers[a] = moreForAs[a];
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
for (h in handlers) {
|
126
|
+
if (handlers.hasOwnProperty(h)) {
|
127
|
+
handler = function () {
|
128
|
+
self[handlers[h]](el);
|
129
|
+
};
|
130
|
+
el.attachEvent('on' + h, handler);
|
131
|
+
}
|
132
|
+
}
|
133
|
+
el.attachEvent('onpropertychange', this.readPropertyChange);
|
134
|
+
},
|
135
|
+
giveLayout: function (el) {
|
136
|
+
el.style.zoom = 1;
|
137
|
+
if (el.currentStyle.position == 'static') {
|
138
|
+
el.style.position = 'relative';
|
139
|
+
}
|
140
|
+
},
|
141
|
+
copyImageBorders: function (el) {
|
142
|
+
var styles, s;
|
143
|
+
styles = {'borderStyle':true, 'borderWidth':true, 'borderColor':true};
|
144
|
+
for (s in styles) {
|
145
|
+
if (styles.hasOwnProperty(s)) {
|
146
|
+
el.vml.color.shape.style[s] = el.currentStyle[s];
|
147
|
+
}
|
148
|
+
}
|
149
|
+
},
|
150
|
+
vmlFill: function (el) {
|
151
|
+
if (!el.currentStyle) {
|
152
|
+
return;
|
153
|
+
} else {
|
154
|
+
var elStyle, noImg, lib, v, img, imgLoaded;
|
155
|
+
elStyle = el.currentStyle;
|
156
|
+
}
|
157
|
+
for (v in el.vml) {
|
158
|
+
if (el.vml.hasOwnProperty(v)) {
|
159
|
+
el.vml[v].shape.style.zIndex = elStyle.zIndex;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
el.runtimeStyle.backgroundColor = '';
|
163
|
+
el.runtimeStyle.backgroundImage = '';
|
164
|
+
noImg = true;
|
165
|
+
if (elStyle.backgroundImage != 'none' || el.isImg) {
|
166
|
+
if (!el.isImg) {
|
167
|
+
el.vmlBg = elStyle.backgroundImage;
|
168
|
+
el.vmlBg = el.vmlBg.substr(5, el.vmlBg.lastIndexOf('")')-5);
|
169
|
+
}
|
170
|
+
else {
|
171
|
+
el.vmlBg = el.src;
|
172
|
+
}
|
173
|
+
lib = this;
|
174
|
+
if (!lib.imgSize[el.vmlBg]) { /* determine size of loaded image */
|
175
|
+
img = document.createElement('img');
|
176
|
+
lib.imgSize[el.vmlBg] = img;
|
177
|
+
img.className = lib.ns + '_sizeFinder';
|
178
|
+
img.runtimeStyle.cssText = 'behavior:none; position:absolute; left:-10000px; top:-10000px; border:none; margin:0; padding:0;'; /* make sure to set behavior to none to prevent accidental matching of the helper elements! */
|
179
|
+
imgLoaded = function () {
|
180
|
+
this.width = this.offsetWidth; /* weird cache-busting requirement! */
|
181
|
+
this.height = this.offsetHeight;
|
182
|
+
lib.vmlOffsets(el);
|
183
|
+
};
|
184
|
+
img.attachEvent('onload', imgLoaded);
|
185
|
+
img.src = el.vmlBg;
|
186
|
+
img.removeAttribute('width');
|
187
|
+
img.removeAttribute('height');
|
188
|
+
document.body.insertBefore(img, document.body.firstChild);
|
189
|
+
}
|
190
|
+
el.vml.image.fill.src = el.vmlBg;
|
191
|
+
noImg = false;
|
192
|
+
}
|
193
|
+
el.vml.image.fill.on = !noImg;
|
194
|
+
el.vml.image.fill.color = 'none';
|
195
|
+
el.vml.color.shape.style.backgroundColor = elStyle.backgroundColor;
|
196
|
+
el.runtimeStyle.backgroundImage = 'none';
|
197
|
+
el.runtimeStyle.backgroundColor = 'transparent';
|
198
|
+
},
|
199
|
+
/* IE can't figure out what do when the offsetLeft and the clientLeft add up to 1, and the VML ends up getting fuzzy... so we have to push/enlarge things by 1 pixel and then clip off the excess */
|
200
|
+
vmlOffsets: function (el) {
|
201
|
+
var thisStyle, size, fudge, makeVisible, bg, bgR, dC, altC, b, c, v;
|
202
|
+
thisStyle = el.currentStyle;
|
203
|
+
size = {'W':el.clientWidth+1, 'H':el.clientHeight+1, 'w':this.imgSize[el.vmlBg].width, 'h':this.imgSize[el.vmlBg].height, 'L':el.offsetLeft, 'T':el.offsetTop, 'bLW':el.clientLeft, 'bTW':el.clientTop};
|
204
|
+
fudge = (size.L + size.bLW == 1) ? 1 : 0;
|
205
|
+
/* vml shape, left, top, width, height, origin */
|
206
|
+
makeVisible = function (vml, l, t, w, h, o) {
|
207
|
+
vml.coordsize = w+','+h;
|
208
|
+
vml.coordorigin = o+','+o;
|
209
|
+
vml.path = 'm0,0l'+w+',0l'+w+','+h+'l0,'+h+' xe';
|
210
|
+
vml.style.width = w + 'px';
|
211
|
+
vml.style.height = h + 'px';
|
212
|
+
vml.style.left = l + 'px';
|
213
|
+
vml.style.top = t + 'px';
|
214
|
+
};
|
215
|
+
makeVisible(el.vml.color.shape, (size.L + (el.isImg ? 0 : size.bLW)), (size.T + (el.isImg ? 0 : size.bTW)), (size.W-1), (size.H-1), 0);
|
216
|
+
makeVisible(el.vml.image.shape, (size.L + size.bLW), (size.T + size.bTW), (size.W), (size.H), 1 );
|
217
|
+
bg = {'X':0, 'Y':0};
|
218
|
+
if (el.isImg) {
|
219
|
+
bg.X = parseInt(thisStyle.paddingLeft, 10) + 1;
|
220
|
+
bg.Y = parseInt(thisStyle.paddingTop, 10) + 1;
|
221
|
+
}
|
222
|
+
else {
|
223
|
+
for (b in bg) {
|
224
|
+
if (bg.hasOwnProperty(b)) {
|
225
|
+
this.figurePercentage(bg, size, b, thisStyle['backgroundPosition'+b]);
|
226
|
+
}
|
227
|
+
}
|
228
|
+
}
|
229
|
+
el.vml.image.fill.position = (bg.X/size.W) + ',' + (bg.Y/size.H);
|
230
|
+
bgR = thisStyle.backgroundRepeat;
|
231
|
+
dC = {'T':1, 'R':size.W+fudge, 'B':size.H, 'L':1+fudge}; /* these are defaults for repeat of any kind */
|
232
|
+
altC = { 'X': {'b1': 'L', 'b2': 'R', 'd': 'W'}, 'Y': {'b1': 'T', 'b2': 'B', 'd': 'H'} };
|
233
|
+
if (bgR != 'repeat' || el.isImg) {
|
234
|
+
c = {'T':(bg.Y), 'R':(bg.X+size.w), 'B':(bg.Y+size.h), 'L':(bg.X)}; /* these are defaults for no-repeat - clips down to the image location */
|
235
|
+
if (bgR.search('repeat-') != -1) { /* now let's revert to dC for repeat-x or repeat-y */
|
236
|
+
v = bgR.split('repeat-')[1].toUpperCase();
|
237
|
+
c[altC[v].b1] = 1;
|
238
|
+
c[altC[v].b2] = size[altC[v].d];
|
239
|
+
}
|
240
|
+
if (c.B > size.H) {
|
241
|
+
c.B = size.H;
|
242
|
+
}
|
243
|
+
el.vml.image.shape.style.clip = 'rect('+c.T+'px '+(c.R+fudge)+'px '+c.B+'px '+(c.L+fudge)+'px)';
|
244
|
+
}
|
245
|
+
else {
|
246
|
+
el.vml.image.shape.style.clip = 'rect('+dC.T+'px '+dC.R+'px '+dC.B+'px '+dC.L+'px)';
|
247
|
+
}
|
248
|
+
},
|
249
|
+
figurePercentage: function (bg, size, axis, position) {
|
250
|
+
var horizontal, fraction;
|
251
|
+
fraction = true;
|
252
|
+
horizontal = (axis == 'X');
|
253
|
+
switch(position) {
|
254
|
+
case 'left':
|
255
|
+
case 'top':
|
256
|
+
bg[axis] = 0;
|
257
|
+
break;
|
258
|
+
case 'center':
|
259
|
+
bg[axis] = 0.5;
|
260
|
+
break;
|
261
|
+
case 'right':
|
262
|
+
case 'bottom':
|
263
|
+
bg[axis] = 1;
|
264
|
+
break;
|
265
|
+
default:
|
266
|
+
if (position.search('%') != -1) {
|
267
|
+
bg[axis] = parseInt(position, 10) / 100;
|
268
|
+
}
|
269
|
+
else {
|
270
|
+
fraction = false;
|
271
|
+
}
|
272
|
+
}
|
273
|
+
bg[axis] = Math.ceil( fraction ? ( (size[horizontal?'W': 'H'] * bg[axis]) - (size[horizontal?'w': 'h'] * bg[axis]) ) : parseInt(position, 10) );
|
274
|
+
if (bg[axis] % 2 === 0) {
|
275
|
+
bg[axis]++;
|
276
|
+
}
|
277
|
+
return bg[axis];
|
278
|
+
},
|
279
|
+
fixPng: function (el) {
|
280
|
+
el.style.behavior = 'none';
|
281
|
+
var lib, els, nodeStr, v, e;
|
282
|
+
if (el.nodeName == 'BODY' || el.nodeName == 'TD' || el.nodeName == 'TR') { /* elements not supported yet */
|
283
|
+
return;
|
284
|
+
}
|
285
|
+
el.isImg = false;
|
286
|
+
if (el.nodeName == 'IMG') {
|
287
|
+
if(el.src.toLowerCase().search(/\.png$/) != -1) {
|
288
|
+
el.isImg = true;
|
289
|
+
el.style.visibility = 'hidden';
|
290
|
+
}
|
291
|
+
else {
|
292
|
+
return;
|
293
|
+
}
|
294
|
+
}
|
295
|
+
else if (el.currentStyle.backgroundImage.toLowerCase().search('.png') == -1) {
|
296
|
+
return;
|
297
|
+
}
|
298
|
+
lib = DD_belatedPNG;
|
299
|
+
el.vml = {color: {}, image: {}};
|
300
|
+
els = {shape: {}, fill: {}};
|
301
|
+
for (v in el.vml) {
|
302
|
+
if (el.vml.hasOwnProperty(v)) {
|
303
|
+
for (e in els) {
|
304
|
+
if (els.hasOwnProperty(e)) {
|
305
|
+
nodeStr = lib.ns + ':' + e;
|
306
|
+
el.vml[v][e] = document.createElement(nodeStr);
|
307
|
+
}
|
308
|
+
}
|
309
|
+
el.vml[v].shape.stroked = false;
|
310
|
+
el.vml[v].shape.appendChild(el.vml[v].fill);
|
311
|
+
el.parentNode.insertBefore(el.vml[v].shape, el);
|
312
|
+
}
|
313
|
+
}
|
314
|
+
el.vml.image.shape.fillcolor = 'none'; /* Don't show blank white shapeangle when waiting for image to load. */
|
315
|
+
el.vml.image.fill.type = 'tile'; /* Makes image show up. */
|
316
|
+
el.vml.color.fill.on = false; /* Actually going to apply vml element's style.backgroundColor, so hide the whiteness. */
|
317
|
+
lib.attachHandlers(el);
|
318
|
+
lib.giveLayout(el);
|
319
|
+
lib.giveLayout(el.offsetParent);
|
320
|
+
el.vmlInitiated = true;
|
321
|
+
lib.applyVML(el); /* Render! */
|
322
|
+
}
|
323
|
+
};
|
324
|
+
try {
|
325
|
+
document.execCommand("BackgroundImageCache", false, true); /* TredoSoft Multiple IE doesn't like this, so try{} it */
|
326
|
+
} catch(r) {}
|
327
|
+
DD_belatedPNG.createVmlNameSpace();
|
328
|
+
DD_belatedPNG.createVmlStyleSheet();
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/*!
|
2
|
+
* Modernizr JavaScript library 1.5
|
3
|
+
* http://www.modernizr.com/
|
4
|
+
*
|
5
|
+
* Copyright (c) 2009-2010 Faruk Ates - http://farukat.es/
|
6
|
+
* Dual-licensed under the BSD and MIT licenses.
|
7
|
+
* http://www.modernizr.com/license/
|
8
|
+
*
|
9
|
+
* Featuring major contributions by
|
10
|
+
* Paul Irish - http://paulirish.com
|
11
|
+
*/
|
12
|
+
window.Modernizr=function(i,e,I){function C(a,b){for(var c in a)if(m[a[c]]!==I&&(!b||b(a[c],D)))return true}function r(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1);return!!C([a,"Webkit"+c,"Moz"+c,"O"+c,"ms"+c,"Khtml"+c],b)}function P(){j[E]=function(a){for(var b=0,c=a.length;b<c;b++)J[a[b]]=!!(a[b]in n);return J}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));j[Q]=function(a){for(var b=0,c,h=a.length;b<h;b++){n.setAttribute("type",a[b]);if(c=n.type!==
|
13
|
+
"text"){n.value=K;/tel|search/.test(n.type)||(c=/url|email/.test(n.type)?n.checkValidity&&n.checkValidity()===false:n.value!=K)}L[a[b]]=!!c}return L}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var j={},s=e.documentElement,D=e.createElement("modernizr"),m=D.style,n=e.createElement("input"),E="input",Q=E+"types",K=":)",M=Object.prototype.toString,y=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d={},L={},J={},N=[],u=function(){var a={select:"input",
|
14
|
+
change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},b={};return function(c,h){var t=arguments.length==1;if(t&&b[c])return b[c];h=h||document.createElement(a[c]||"div");c="on"+c;var g=c in h;if(!g&&h.setAttribute){h.setAttribute(c,"return;");g=typeof h[c]=="function"}h=null;return t?(b[c]=g):g}}(),F={}.hasOwnProperty,O;O=typeof F!=="undefined"&&typeof F.call!=="undefined"?function(a,b){return F.call(a,b)}:function(a,b){return b in a&&typeof a.constructor.prototype[b]==="undefined"};
|
15
|
+
d.canvas=function(){return!!e.createElement("canvas").getContext};d.canvastext=function(){return!!(d.canvas()&&typeof e.createElement("canvas").getContext("2d").fillText=="function")};d.geolocation=function(){return!!navigator.geolocation};d.crosswindowmessaging=function(){return!!i.postMessage};d.websqldatabase=function(){var a=!!i.openDatabase;if(a)try{a=!!openDatabase("testdb","1.0","html5 test db",2E5)}catch(b){a=false}return a};d.indexedDB=function(){return!!i.indexedDB};d.hashchange=function(){return u("hashchange",
|
16
|
+
i)&&(document.documentMode===I||document.documentMode>7)};d.historymanagement=function(){return!!(i.history&&history.pushState)};d.draganddrop=function(){return u("drag")&&u("dragstart")&&u("dragenter")&&u("dragover")&&u("dragleave")&&u("dragend")&&u("drop")};d.websockets=function(){return"WebSocket"in i};d.rgba=function(){m.cssText="background-color:rgba(150,255,150,.5)";return(""+m.backgroundColor).indexOf("rgba")!==-1};d.hsla=function(){m.cssText="background-color:hsla(120,40%,100%,.5)";return(""+
|
17
|
+
m.backgroundColor).indexOf("rgba")!==-1};d.multiplebgs=function(){m.cssText="background:url(//:),url(//:),red url(//:)";return/(url\s*\(.*?){3}/.test(m.background)};d.backgroundsize=function(){return r("backgroundSize")};d.borderimage=function(){return r("borderImage")};d.borderradius=function(){return r("borderRadius","",function(a){return(""+a).indexOf("orderRadius")!==-1})};d.boxshadow=function(){return r("boxShadow")};d.opacity=function(){var a=y.join("opacity:.5;")+"";m.cssText=a;return(""+m.opacity).indexOf("0.5")!==
|
18
|
+
-1};d.cssanimations=function(){return r("animationName")};d.csscolumns=function(){return r("columnCount")};d.cssgradients=function(){var a=("background-image:"+y.join("gradient(linear,left top,right bottom,from(#9f9),to(white));background-image:")+y.join("linear-gradient(left top,#9f9, white);background-image:")).slice(0,-17);m.cssText=a;return(""+m.backgroundImage).indexOf("gradient")!==-1};d.cssreflections=function(){return r("boxReflect")};d.csstransforms=function(){return!!C(["transformProperty",
|
19
|
+
"WebkitTransform","MozTransform","OTransform","msTransform"])};d.csstransforms3d=function(){var a=!!C(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);if(a){var b=document.createElement("style"),c=e.createElement("div");b.textContent="@media ("+y.join("transform-3d),(")+"modernizr){#modernizr{height:3px}}";e.getElementsByTagName("head")[0].appendChild(b);c.id="modernizr";s.appendChild(c);a=c.offsetHeight===3;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}return a};
|
20
|
+
d.csstransitions=function(){return r("transitionProperty")};d.fontface=function(){var a;if(/*@cc_on@if(@_jscript_version>=5)!@end@*/0)a=true;else{var b=e.createElement("style"),c=e.createElement("span"),h,t=false,g=e.body,o,w;b.textContent="@font-face{font-family:testfont;src:url('data:font/ttf;base64,AAEAAAAMAIAAAwBAT1MvMliohmwAAADMAAAAVmNtYXCp5qrBAAABJAAAANhjdnQgACICiAAAAfwAAAAEZ2FzcP//AAMAAAIAAAAACGdseWYv5OZoAAACCAAAANxoZWFk69bnvwAAAuQAAAA2aGhlYQUJAt8AAAMcAAAAJGhtdHgGDgC4AAADQAAAABRsb2NhAIQAwgAAA1QAAAAMbWF4cABVANgAAANgAAAAIG5hbWUgXduAAAADgAAABPVwb3N03NkzmgAACHgAAAA4AAECBAEsAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAACAAMDAAAAAAAAgAACbwAAAAoAAAAAAAAAAFBmRWQAAAAgqS8DM/8zAFwDMwDNAAAABQAAAAAAAAAAAAMAAAADAAAAHAABAAAAAABGAAMAAQAAAK4ABAAqAAAABgAEAAEAAgAuqQD//wAAAC6pAP///9ZXAwAAAAAAAAACAAAABgBoAAAAAAAvAAEAAAAAAAAAAAAAAAAAAAABAAIAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEACoAAAAGAAQAAQACAC6pAP//AAAALqkA////1lcDAAAAAAAAAAIAAAAiAogAAAAB//8AAgACACIAAAEyAqoAAwAHAC6xAQAvPLIHBADtMrEGBdw8sgMCAO0yALEDAC88sgUEAO0ysgcGAfw8sgECAO0yMxEhESczESMiARDuzMwCqv1WIgJmAAACAFUAAAIRAc0ADwAfAAATFRQWOwEyNj0BNCYrASIGARQGKwEiJj0BNDY7ATIWFX8aIvAiGhoi8CIaAZIoN/43KCg3/jcoAWD0JB4eJPQkHh7++EY2NkbVRjY2RgAAAAABAEH/+QCdAEEACQAANjQ2MzIWFAYjIkEeEA8fHw8QDxwWFhwWAAAAAQAAAAIAAIuYbWpfDzz1AAsEAAAAAADFn9IuAAAAAMWf0i797/8zA4gDMwAAAAgAAgAAAAAAAAABAAADM/8zAFwDx/3v/98DiAABAAAAAAAAAAAAAAAAAAAABQF2ACIAAAAAAVUAAAJmAFUA3QBBAAAAKgAqACoAWgBuAAEAAAAFAFAABwBUAAQAAgAAAAEAAQAAAEAALgADAAMAAAAQAMYAAQAAAAAAAACLAAAAAQAAAAAAAQAhAIsAAQAAAAAAAgAFAKwAAQAAAAAAAwBDALEAAQAAAAAABAAnAPQAAQAAAAAABQAKARsAAQAAAAAABgAmASUAAQAAAAAADgAaAUsAAwABBAkAAAEWAWUAAwABBAkAAQBCAnsAAwABBAkAAgAKAr0AAwABBAkAAwCGAscAAwABBAkABABOA00AAwABBAkABQAUA5sAAwABBAkABgBMA68AAwABBAkADgA0A/tDb3B5cmlnaHQgMjAwOSBieSBEYW5pZWwgSm9obnNvbi4gIFJlbGVhc2VkIHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgT3BlbiBGb250IExpY2Vuc2UuIEtheWFoIExpIGdseXBocyBhcmUgcmVsZWFzZWQgdW5kZXIgdGhlIEdQTCB2ZXJzaW9uIDMuYmFlYzJhOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhTGlnaHRiYWVjMmE5MmJmZmU1MDMyIC0gc3Vic2V0IG9mIEZvbnRGb3JnZSAyLjAgOiBKdXJhIExpZ2h0IDogMjMtMS0yMDA5YmFlYzJhOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhIExpZ2h0VmVyc2lvbiAyIGJhZWMyYTkyYmZmZTUwMzIgLSBzdWJzZXQgb2YgSnVyYUxpZ2h0aHR0cDovL3NjcmlwdHMuc2lsLm9yZy9PRkwAQwBvAHAAeQByAGkAZwBoAHQAIAAyADAAMAA5ACAAYgB5ACAARABhAG4AaQBlAGwAIABKAG8AaABuAHMAbwBuAC4AIAAgAFIAZQBsAGUAYQBzAGUAZAAgAHUAbgBkAGUAcgAgAHQAaABlACAAdABlAHIAbQBzACAAbwBmACAAdABoAGUAIABPAHAAZQBuACAARgBvAG4AdAAgAEwAaQBjAGUAbgBzAGUALgAgAEsAYQB5AGEAaAAgAEwAaQAgAGcAbAB5AHAAaABzACAAYQByAGUAIAByAGUAbABlAGEAcwBlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQAgAEcAUABMACAAdgBlAHIAcwBpAG8AbgAgADMALgBiAGEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQBMAGkAZwBoAHQAYgBhAGUAYwAyAGEAOQAyAGIAZgBmAGUANQAwADMAMgAgAC0AIABzAHUAYgBzAGUAdAAgAG8AZgAgAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAA6ACAASgB1AHIAYQAgAEwAaQBnAGgAdAAgADoAIAAyADMALQAxAC0AMgAwADAAOQBiAGEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQAgAEwAaQBnAGgAdABWAGUAcgBzAGkAbwBuACAAMgAgAGIAYQBlAGMAMgBhADkAMgBiAGYAZgBlADUAMAAzADIAIAAtACAAcwB1AGIAcwBlAHQAIABvAGYAIABKAHUAcgBhAEwAaQBnAGgAdABoAHQAdABwADoALwAvAHMAYwByAGkAcAB0AHMALgBzAGkAbAAuAG8AcgBnAC8ATwBGAEwAAAAAAgAAAAAAAP+BADMAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQACAQIAEQt6ZXJva2F5YWhsaQ==')}";
|
21
|
+
e.getElementsByTagName("head")[0].appendChild(b);c.setAttribute("style","font:99px _,arial,helvetica;position:absolute;visibility:hidden");if(!g){g=s.appendChild(e.createElement("fontface"));t=true}c.innerHTML="........";c.id="fonttest";g.appendChild(c);h=c.offsetWidth*c.offsetHeight;c.style.font="99px testfont,_,arial,helvetica";a=h!==c.offsetWidth*c.offsetHeight;var v=function(){if(g.parentNode){a=j.fontface=h!==c.offsetWidth*c.offsetHeight;s.className=s.className.replace(/(no-)?fontface\b/,"")+
|
22
|
+
(a?" ":" no-")+"fontface"}};setTimeout(v,75);setTimeout(v,150);addEventListener("load",function(){v();(w=true)&&o&&o(a);setTimeout(function(){t||(g=c);g.parentNode.removeChild(g);b.parentNode.removeChild(b)},50)},false)}j._fontfaceready=function(p){w||a?p(a):(o=p)};return a||h!==c.offsetWidth};d.video=function(){var a=e.createElement("video"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('video/ogg; codecs="theora"');b.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"');b.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return b};
|
23
|
+
d.audio=function(){var a=e.createElement("audio"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('audio/ogg; codecs="vorbis"');b.mp3=a.canPlayType("audio/mpeg;");b.wav=a.canPlayType('audio/wav; codecs="1"');b.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}return b};d.localStorage=function(){return"localStorage"in i&&i.localStorage!==null};d.sessionStorage=function(){try{return"sessionStorage"in i&&i.sessionStorage!==null}catch(a){return false}};d.webworkers=function(){return!!i.Worker};
|
24
|
+
d.applicationCache=function(){var a=i.applicationCache;return!!(a&&typeof a.status!="undefined"&&typeof a.update=="function"&&typeof a.swapCache=="function")};d.svg=function(){return!!e.createElementNS&&!!e.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect};d.smil=function(){return!!e.createElementNS&&/SVG/.test(M.call(e.createElementNS("http://www.w3.org/2000/svg","animate")))};d.svgclippaths=function(){return!!e.createElementNS&&/SVG/.test(M.call(e.createElementNS("http://www.w3.org/2000/svg",
|
25
|
+
"clipPath")))};for(var z in d)if(O(d,z))N.push(((j[z.toLowerCase()]=d[z]())?"":"no-")+z.toLowerCase());j[E]||P();j.addTest=function(a,b){a=a.toLowerCase();if(!j[a]){b=!!b();s.className+=" "+(b?"":"no-")+a;j[a]=b;return j}};m.cssText="";D=n=null;(function(){var a=e.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1})()&&function(a,b){function c(f,k){if(o[f])o[f].styleSheet.cssText+=k;else{var l=t[G],q=b[A]("style");q.media=f;l.insertBefore(q,l[G]);o[f]=q;c(f,k)}}function h(f,
|
26
|
+
k){for(var l=new RegExp("\\b("+w+")\\b(?!.*[;}])","gi"),q=function(B){return".iepp_"+B},x=-1;++x<f.length;){k=f[x].media||k;h(f[x].imports,k);c(k,f[x].cssText.replace(l,q))}}for(var t=b.documentElement,g=b.createDocumentFragment(),o={},w="abbr|article|aside|audio|canvas|command|datalist|details|figure|figcaption|footer|header|hgroup|keygen|mark|meter|nav|output|progress|section|source|summary|time|video",v=w.split("|"),p=[],H=-1,G="firstChild",A="createElement";++H<v.length;){b[A](v[H]);g[A](v[H])}g=
|
27
|
+
g.appendChild(b[A]("div"));a.attachEvent("onbeforeprint",function(){for(var f,k=b.getElementsByTagName("*"),l,q,x=new RegExp("^"+w+"$","i"),B=-1;++B<k.length;)if((f=k[B])&&(q=f.nodeName.match(x))){l=new RegExp("^\\s*<"+q+"(.*)\\/"+q+">\\s*$","i");g.innerHTML=f.outerHTML.replace(/\r|\n/g," ").replace(l,f.currentStyle.display=="block"?"<div$1/div>":"<span$1/span>");l=g.childNodes[0];l.className+=" iepp_"+q;l=p[p.length]=[f,l];f.parentNode.replaceChild(l[1],l[0])}h(b.styleSheets,"all")});a.attachEvent("onafterprint",
|
28
|
+
function(){for(var f=-1,k;++f<p.length;)p[f][1].parentNode.replaceChild(p[f][0],p[f][1]);for(k in o)t[G].removeChild(o[k]);o={};p=[]})}(this,e);j._enableHTML5=true;j._version="1.5";s.className=s.className.replace(/\bno-js\b/,"")+" js";s.className+=" "+N.join(" ");return j}(this,this.document);
|
data/lib/app_themer.rb
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
module AppThemer
|
2
|
+
class LayoutGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
4
|
+
|
5
|
+
argument :layout_name, :type => :string, :default => 'application'
|
6
|
+
|
7
|
+
class_option :theme, :type => :string, :default => :default, :desc => 'Specify the layout theme'
|
8
|
+
class_option :app_name, :type => :string, :default => 'Web App', :desc => 'Specify the application name'
|
9
|
+
class_option :engine, :type => :string, :default => 'erb', :desc => 'Specify the template engine'
|
10
|
+
class_option :no_layout, :type => :boolean, :default => false, :desc => 'Use this option if you want to generate only stylesheets'
|
11
|
+
class_option :layout_type, :type => :string, :default => 'admin', :desc => 'Layout type, admin or login'
|
12
|
+
|
13
|
+
def copy_layout
|
14
|
+
return if options.no_layout
|
15
|
+
layout_template = options.layout_type == 'login' ? "login.html.erb" : "admin.html.erb"
|
16
|
+
case options.engine
|
17
|
+
when 'erb'
|
18
|
+
template layout_template, "app/views/layouts/#{layout_name.underscore}.html.erb"
|
19
|
+
when 'haml'
|
20
|
+
generate_haml_layout(layout_template)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def copy_base_stylesheets
|
25
|
+
copy_file "#{stylesheets_path}/base.css", "public/stylesheets/web-app-theme/base.css"
|
26
|
+
copy_file "#{stylesheets_path}/handheld.css", "public/stylesheets/web-app-theme/handheld.css"
|
27
|
+
copy_file "#{stylesheets_path}/override.css", "public/stylesheets/web-app-theme/override.css"
|
28
|
+
end
|
29
|
+
|
30
|
+
def copy_theme_stylesheets
|
31
|
+
directory "#{stylesheets_path}/themes/#{options.theme}", "public/stylesheets/web-app-theme/themes/#{options.theme}"
|
32
|
+
end
|
33
|
+
|
34
|
+
def copy_images
|
35
|
+
directory "#{images_path}", "public/images/web-app-theme"
|
36
|
+
end
|
37
|
+
|
38
|
+
def copy_javascripts
|
39
|
+
copy_file "#{javascripts_path}/dd_belatedpng.js", "public/javascripts/web-app-theme/dd_belatedpng.js"
|
40
|
+
copy_file "#{javascripts_path}/modernizr-1.5.min.js", "public/javascripts/web-app-theme/modernizr-1.5.min.js"
|
41
|
+
end
|
42
|
+
|
43
|
+
protected
|
44
|
+
|
45
|
+
def stylesheets_path
|
46
|
+
"../../../../../stylesheets"
|
47
|
+
end
|
48
|
+
|
49
|
+
def images_path
|
50
|
+
"../../../../../images"
|
51
|
+
end
|
52
|
+
|
53
|
+
def javascripts_path
|
54
|
+
"../../../../../javascripts"
|
55
|
+
end
|
56
|
+
|
57
|
+
def generate_haml_layout(layout_template)
|
58
|
+
require 'haml'
|
59
|
+
Dir.mktmpdir('web-app-theme-haml') do |haml_root|
|
60
|
+
tmp_html_path = "#{haml_root}/#{layout_template}"
|
61
|
+
tmp_haml_path = "#{haml_root}/#{layout_template}.haml"
|
62
|
+
template layout_template, tmp_html_path, :verbose => false
|
63
|
+
`html2haml --erb --xhtml #{tmp_html_path} #{tmp_haml_path}`
|
64
|
+
copy_file tmp_haml_path, "app/views/layouts/#{layout_name.underscore}.html.haml"
|
65
|
+
end
|
66
|
+
rescue LoadError
|
67
|
+
say "HAML is not installed, or it is not specified in your Gemfile."
|
68
|
+
exit
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<!--[if IE]><![endif]-->
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
7
|
+
|
8
|
+
<title><%= options.app_name %></title>
|
9
|
+
<%%= stylesheet_link_tag "web-app-theme/base", "web-app-theme/handheld", "web-app-theme/themes/<%= options.theme %>/style", "web-app-theme/override", :cache => true %>
|
10
|
+
<%%= javascript_include_tag "web-app-theme/modernizr-1.5.min.js" %>
|
11
|
+
<%%= csrf_meta_tag %>
|
12
|
+
</head>
|
13
|
+
<!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
|
14
|
+
<!--[if IE 7 ]> <body class="ie7"> <![endif]-->
|
15
|
+
<!--[if IE 8 ]> <body class="ie8"> <![endif]-->
|
16
|
+
<!--[if IE 9 ]> <body class="ie9"> <![endif]-->
|
17
|
+
<!--[if (gt IE 9)|!(IE)]><!--> <body> <!--<![endif]-->
|
18
|
+
|
19
|
+
<div id="container">
|
20
|
+
<header>
|
21
|
+
<h1><a href="/"><%= options.app_name %></a></h1>
|
22
|
+
<nav id="main-navigation">
|
23
|
+
<ul class="clearfix">
|
24
|
+
<li class="right"><a href="/logout" class="logout"><%%= t("web-app-theme.logout", :default => "Logout") %></a></li>
|
25
|
+
<li class="right"><a href="#"><%%= t("web-app-theme.settings", :default => "Settings") %></a></li>
|
26
|
+
<li class="right"><a href="#"><%%= t("web-app-theme.profile", :default => "Profile") %></a></li>
|
27
|
+
</ul>
|
28
|
+
</nav>
|
29
|
+
</header>
|
30
|
+
|
31
|
+
<div id="wrapper" class="clearfix">
|
32
|
+
<div class="flash">
|
33
|
+
<%% flash.each do |type, message| -%>
|
34
|
+
<div class="message <%%= type %>">
|
35
|
+
<p><%%= message %></p>
|
36
|
+
</div>
|
37
|
+
<%% end -%>
|
38
|
+
</div>
|
39
|
+
<div id="main">
|
40
|
+
<%%= yield %>
|
41
|
+
<footer>
|
42
|
+
<p>Copyright © <%%= Time.now.year %> <%= options.app_name %>.</p>
|
43
|
+
</footer>
|
44
|
+
</div>
|
45
|
+
<div id="sidebar">
|
46
|
+
<aside>
|
47
|
+
<%%= yield :sidebar %>
|
48
|
+
</aside>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
<%%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" %>
|
53
|
+
|
54
|
+
<!--[if lt IE 7 ]>
|
55
|
+
<%%= javascript_include_tag "web-app-theme/dd_belatedpng.js" %>
|
56
|
+
<script>DD_belatedPNG.fix('.button img, #sidebar ul li');</script>
|
57
|
+
<![endif]-->
|
58
|
+
</body>
|
59
|
+
</html>
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% columns.each do |column| %>
|
2
|
+
<div class="group">
|
3
|
+
<%%= f.label :<%= column.name %>, t("activerecord.attributes.<%= model_name.underscore %>.<%= column.name %>", :default => "<%= column.name.humanize %>"), :class => :label %>
|
4
|
+
<%%= f.<%= column.field_type %> :<%= column.name %>, :class => '<%= column.field_type %>' %>
|
5
|
+
<span class="description">Ex: a simple text</span>
|
6
|
+
</div>
|
7
|
+
<%- end -%>
|
8
|
+
<div class="clearfix">
|
9
|
+
<button class="button" type="submit">
|
10
|
+
<%%= image_tag("web-app-theme/icons/tick.png", :alt => "#{t("web-app-theme.save", :default => "Save")}") %> <%%= t("web-app-theme.save", :default => "Save") %>
|
11
|
+
</button>
|
12
|
+
<%%= link_to image_tag("web-app-theme/icons/cross.png", :alt => "#{t("web-app-theme.cancel", :default => "Cancel")}") + " " + t("web-app-theme.cancel", :default => "Cancel"), <%= controller_routing_path %>_path, :class => "button" %>
|
13
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="module notice">
|
2
|
+
<h2>Simple Block</h2>
|
3
|
+
<div class="content">
|
4
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
<div class="module">
|
8
|
+
<h2>Links</h2>
|
9
|
+
<ul class="navigation">
|
10
|
+
<li><a href="#">Link 1</a></li>
|
11
|
+
<li><a href="#">Link 2</a></li>
|
12
|
+
</ul>
|
13
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<section>
|
2
|
+
<nav class="secondary">
|
3
|
+
<ul class="clearfix">
|
4
|
+
<li class="first"><%%= link_to "#{t("web-app-theme.list", :default => "List")}", <%= controller_routing_path %>_path %></li>
|
5
|
+
<li><%%= link_to "#{t("web-app-theme.new", :default => "New")}", new_<%= singular_controller_routing_path %>_path %></li>
|
6
|
+
<li class="active"><%%= link_to "#{t("web-app-theme.edit", :default => "Edit")}", edit_<%= singular_controller_routing_path %>_path %></li>
|
7
|
+
</ul>
|
8
|
+
</nav>
|
9
|
+
<div class="content">
|
10
|
+
<h2><%%= t("web-app-theme.edit", :default => "Edit") %> <%= model_name %></h2>
|
11
|
+
|
12
|
+
<%%= form_for @<%= model_name.underscore %>, :url => <%= singular_controller_routing_path %>_path(@<%= resource_name %>), :html => { :class => :form } do |f| -%>
|
13
|
+
<%%= render :partial => "form", :locals => {:f => f} %>
|
14
|
+
<%% end -%>
|
15
|
+
</div>
|
16
|
+
</section>
|
17
|
+
|
18
|
+
<%% content_for :sidebar, render(:partial => 'sidebar') -%>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<section>
|
2
|
+
<nav class="secondary">
|
3
|
+
<ul class="clearfix">
|
4
|
+
<li class="first"><%%= link_to "#{t("web-app-theme.list", :default => "List")}", <%= controller_routing_path %>_path %></li>
|
5
|
+
<li class="active"><%%= link_to "#{t("web-app-theme.new", :default => "New")}", new_<%= singular_controller_routing_path %>_path %></li>
|
6
|
+
</ul>
|
7
|
+
</nav>
|
8
|
+
<div class="content">
|
9
|
+
<h2><%%= t("web-app-theme.new", :default => "New")%> <%= model_name %></h2>
|
10
|
+
<%%= form_for :<%= model_name.underscore %>, :url => <%= controller_routing_path %>_path, :html => { :class => :form } do |f| -%>
|
11
|
+
<%%= render :partial => "form", :locals => {:f => f} %>
|
12
|
+
<%% end -%>
|
13
|
+
</div>
|
14
|
+
</section>
|
15
|
+
|
16
|
+
<%% content_for :sidebar, render(:partial => 'sidebar') -%>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<section>
|
2
|
+
<nav class="secondary">
|
3
|
+
<ul class="clearfix">
|
4
|
+
<li class="first"><%%= link_to "#{t("web-app-theme.list", :default => "List")}", <%= controller_routing_path %>_path %></li>
|
5
|
+
<li><%%= link_to "#{t("web-app-theme.new", :default => "New")}", new_<%= singular_controller_routing_path %>_path %></li>
|
6
|
+
<li class="active"><%%= link_to "#{t("web-app-theme.show", :default => "Show")}", <%= singular_controller_routing_path %>_path %></li>
|
7
|
+
</ul>
|
8
|
+
</nav>
|
9
|
+
<div class="content">
|
10
|
+
<% columns.each do |column| %>
|
11
|
+
<p>
|
12
|
+
<b><%%= t("activerecord.attributes.<%= singular_controller_routing_path %>.<%= column.name %>", :default => t("activerecord.labels.<%= column.name %>", :default => "<%= column.name.humanize %>")) %>:</b>
|
13
|
+
<%%= @<%= resource_name %>.<%= column.name %> %>
|
14
|
+
</p>
|
15
|
+
<%- end -%>
|
16
|
+
<div class="clearfix">
|
17
|
+
<%%= link_to image_tag("web-app-theme/icons/application_edit.png", :alt => "#{t("web-app-theme.edit", :default=> "Edit")}") + " " + t("web-app-theme.edit", :default=> "Edit"), edit_<%= singular_controller_routing_path %>_path(@<%= resource_name %>), :class => "button" %>
|
18
|
+
<%%= link_to image_tag("web-app-theme/icons/cross.png", :alt => "#{t("web-app-theme.delete", :default=> "Delete")}") + " " + t("web-app-theme.delete", :default => "Delete"), <%= singular_controller_routing_path %>_path(@<%= resource_name %>), :method => "delete", :class => "button", :confirm => "#{t("web-app-theme.confirm", :default => "Are you sure?")}" %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</section>
|
22
|
+
|
23
|
+
<%% content_for :sidebar, render(:partial => 'sidebar') -%>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<section>
|
2
|
+
<nav class="secondary">
|
3
|
+
<ul class="clearfix">
|
4
|
+
<li class="first active"><%%= link_to "#{t("web-app-theme.list", :default => "List")}", <%= controller_routing_path %>_path %></li>
|
5
|
+
<li><%%= link_to "#{t("web-app-theme.new", :default => "New")}", new_<%= singular_controller_routing_path %>_path %></li>
|
6
|
+
</ul>
|
7
|
+
</nav>
|
8
|
+
<div class="content">
|
9
|
+
<h2><%%= t("web-app-theme.all", :default => "All") %> <%= plural_model_name %></h2>
|
10
|
+
<table class="table">
|
11
|
+
<tr>
|
12
|
+
<th class="first">ID</th>
|
13
|
+
<% unless columns.empty? -%>
|
14
|
+
<th>
|
15
|
+
<%%= t("activerecord.attributes.<%= singular_controller_routing_path %>.<%= columns.first.name %>", :default => t("activerecord.labels.<%= columns.first.name %>", :default => "<%= columns.first.name.capitalize %>")) %>
|
16
|
+
</th>
|
17
|
+
<% end -%>
|
18
|
+
<th><%%= t("web-app-theme.created_at", :default => "Created at") %></th>
|
19
|
+
<th class="last"> </th>
|
20
|
+
</tr>
|
21
|
+
<%% @<%= plural_resource_name %>.each do |<%= resource_name %>| -%>
|
22
|
+
<tr class="<%%= cycle("odd", "even") %>">
|
23
|
+
<td>
|
24
|
+
<%%= <%= resource_name %>.id %>
|
25
|
+
</td>
|
26
|
+
<% unless columns.empty? -%>
|
27
|
+
<td>
|
28
|
+
<%%= link_to <%= resource_name %>.<%= columns.first.name %>, <%= singular_controller_routing_path %>_path(<%= resource_name %>) %>
|
29
|
+
</td>
|
30
|
+
<% end -%>
|
31
|
+
<td>
|
32
|
+
<%%= <%= resource_name %>.created_at %>
|
33
|
+
</td>
|
34
|
+
<td class="last">
|
35
|
+
<%%= link_to "#{t("web-app-theme.show", :default => "Show")}", <%= singular_controller_routing_path %>_path(<%= resource_name %>) %> |
|
36
|
+
<%%= link_to "#{t("web-app-theme.edit", :default => "Edit")}", edit_<%= singular_controller_routing_path %>_path(<%= resource_name %>) %> |
|
37
|
+
<%%= link_to "#{t("web-app-theme.delete", :default => "Delete")}", <%= singular_controller_routing_path %>_path(<%= resource_name %>), :method => :delete, :confirm => "#{t("web-app-theme.confirm", :default => "Are you sure?")}" %>
|
38
|
+
</td>
|
39
|
+
</tr>
|
40
|
+
<%% end -%>
|
41
|
+
</table>
|
42
|
+
<div class="clearfix">
|
43
|
+
<% if options.will_paginate %>
|
44
|
+
<%%= will_paginate @<%= plural_resource_name %> %>
|
45
|
+
<% end %>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</section>
|
49
|
+
|
50
|
+
<%% content_for :sidebar, render(:partial => 'sidebar') -%>
|