justinfrench-formtastic 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
data/README.textile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
h1. Formtastic 0.1.
|
1
|
+
h1. Formtastic 0.1.4
|
2
2
|
|
3
3
|
Formtastic is a Rails FormBuilder DSL (with some other goodies) to make it far easier to create beautiful, semantically rich, syntactically awesome, readily stylable and wonderfully accessible HTML forms in your Rails applications.
|
4
4
|
|
@@ -86,7 +86,7 @@ And then add it as a dependency in your environment.rb file:
|
|
86
86
|
config.gem "justinfrench-formtastic",
|
87
87
|
:lib => 'formtastic',
|
88
88
|
:source => 'http://gems.github.com',
|
89
|
-
:version => '0.1.
|
89
|
+
:version => '0.1.4'
|
90
90
|
</pre>
|
91
91
|
|
92
92
|
If you're a little more old school, install it as a plugin:
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ begin
|
|
20
20
|
|
21
21
|
s.require_path = 'lib'
|
22
22
|
s.autorequire = GEM
|
23
|
-
s.files = %w(MIT-LICENSE README.textile Rakefile) + Dir.glob("{rails,lib,spec}/**/*")
|
23
|
+
s.files = %w(MIT-LICENSE README.textile Rakefile) + Dir.glob("{rails,lib,generators,spec}/**/*")
|
24
24
|
end
|
25
25
|
rescue LoadError
|
26
26
|
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class FormtasticStylesheetsGenerator < Rails::Generator::Base
|
2
|
+
|
3
|
+
def initialize(*runtime_args)
|
4
|
+
super
|
5
|
+
end
|
6
|
+
|
7
|
+
def manifest
|
8
|
+
record do |m|
|
9
|
+
m.directory File.join('public', 'stylesheets')
|
10
|
+
m.template 'formtastic.css', File.join('public', 'stylesheets', 'formtastic.css')
|
11
|
+
m.template 'formtastic_changes.css', File.join('public', 'stylesheets', 'formtastic_changes.css')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
protected
|
16
|
+
|
17
|
+
def banner
|
18
|
+
%{Usage: #{$0} #{spec.name}\nCopies formtastic.css and formtastic_changes.css to public/}
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
/* -------------------------------------------------------------------------------------------------
|
2
|
+
|
3
|
+
It's *strongly* suggested that you don't modify this file. Instead, load a new stylesheet after
|
4
|
+
this one in your layouts (eg formtastic_changes.css) and override the styles to suit your needs.
|
5
|
+
This will allow you to update formtastic.css with new releases without clobbering your own changes.
|
6
|
+
|
7
|
+
This stylesheet forms part of the Formtastic Rails Plugin
|
8
|
+
(c) 2008 Justin French
|
9
|
+
|
10
|
+
--------------------------------------------------------------------------------------------------*/
|
11
|
+
|
12
|
+
|
13
|
+
/* NORMALIZE AND RESET - obviously inspired by Yahoo's reset.css, but scoped to just form.formtastic
|
14
|
+
--------------------------------------------------------------------------------------------------*/
|
15
|
+
form.formtastic, form.formtastic ul, form.formtastic ol, form.formtastic li, form.formtastic fieldset, form.formtastic legend, form.formtastic input, form.formtastic textarea, form.formtastic select, form.formtastic p { margin:0; padding:0; }
|
16
|
+
form.formtastic fieldset { border:0; }
|
17
|
+
form.formtastic em, form.formtastic strong { font-style:normal; font-weight:normal; }
|
18
|
+
form.formtastic ol, form.formtastic ul { list-style:none; }
|
19
|
+
form.formtastic abbr, form.formtastic acronym { border:0; font-variant:normal; }
|
20
|
+
form.formtastic input, form.formtastic textarea, form.formtastic select { font-family:inherit; font-size:inherit; font-weight:inherit; }
|
21
|
+
form.formtastic input, form.formtastic textarea, form.formtastic select { font-size:100%; }
|
22
|
+
form.formtastic legend { color:#000; }
|
23
|
+
|
24
|
+
|
25
|
+
/* FIELDSETS & LISTS
|
26
|
+
--------------------------------------------------------------------------------------------------*/
|
27
|
+
form.formtastic fieldset { }
|
28
|
+
form.formtastic fieldset.inputs { }
|
29
|
+
form.formtastic fieldset.buttons { padding-left:25%; }
|
30
|
+
form.formtastic fieldset ol { }
|
31
|
+
|
32
|
+
/* clearfixing the fieldsets */
|
33
|
+
form.formtastic fieldset { display: inline-block; }
|
34
|
+
form.formtastic fieldset:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
|
35
|
+
html[xmlns] form.formtastic fieldset { display: block; }
|
36
|
+
* html form.formtastic fieldset { height: 1%; }
|
37
|
+
|
38
|
+
|
39
|
+
/* INPUT LIs
|
40
|
+
--------------------------------------------------------------------------------------------------*/
|
41
|
+
form.formtastic fieldset ol li { margin-bottom:1.5em; }
|
42
|
+
|
43
|
+
/* clearfixing the li's */
|
44
|
+
form.formtastic fieldset ol li { display: inline-block; }
|
45
|
+
form.formtastic fieldset ol li:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
|
46
|
+
html[xmlns] form.formtastic fieldset ol li { display: block; }
|
47
|
+
* html form.formtastic fieldset ol li { height: 1%; }
|
48
|
+
|
49
|
+
form.formtastic fieldset ol li.required { }
|
50
|
+
form.formtastic fieldset ol li.optional { }
|
51
|
+
form.formtastic fieldset ol li.error { }
|
52
|
+
|
53
|
+
|
54
|
+
/* LABELS
|
55
|
+
--------------------------------------------------------------------------------------------------*/
|
56
|
+
form.formtastic fieldset ol li label { display:block; width:25%; float:left; padding-top:.2em; }
|
57
|
+
form.formtastic fieldset ol li li label { line-height:100%; padding-top:0; }
|
58
|
+
form.formtastic fieldset ol li li label input { line-height:100%; vertical-align:middle; margin-top:-0.1em;}
|
59
|
+
|
60
|
+
|
61
|
+
/* NESTED FIELDSETS AND LEGENDS (radio and date/time inputs use nested fieldsets)
|
62
|
+
--------------------------------------------------------------------------------------------------*/
|
63
|
+
form.formtastic fieldset ol li fieldset { position:relative; }
|
64
|
+
form.formtastic fieldset ol li fieldset legend { position:absolute; width:25%; padding-top:0.1em; }
|
65
|
+
form.formtastic fieldset ol li fieldset legend span { position:absolute; }
|
66
|
+
form.formtastic fieldset ol li fieldset ol { float:left; width:74%; margin:0; padding:0 0 0 25%; }
|
67
|
+
form.formtastic fieldset ol li fieldset ol li { padding:0; border:0; }
|
68
|
+
|
69
|
+
|
70
|
+
/* INLINE HINTS
|
71
|
+
--------------------------------------------------------------------------------------------------*/
|
72
|
+
form.formtastic fieldset ol li p.inline-hints { color:#666; margin:0.5em 0 0 25%; }
|
73
|
+
|
74
|
+
|
75
|
+
/* INLINE ERRORS
|
76
|
+
--------------------------------------------------------------------------------------------------*/
|
77
|
+
form.formtastic fieldset ol li p.inline-errors { color:#cc0000; margin:0.5em 0 0 25%; }
|
78
|
+
form.formtastic fieldset ol li ul.errors { color:#cc0000; margin:0.5em 0 0 25%; list-style:square; }
|
79
|
+
form.formtastic fieldset ol li ul.errors li { padding:0; border:none; display:list-item; }
|
80
|
+
|
81
|
+
|
82
|
+
/* STRING & NUMERIC OVERRIDES
|
83
|
+
--------------------------------------------------------------------------------------------------*/
|
84
|
+
form.formtastic fieldset ol li.string input { width:74%; }
|
85
|
+
form.formtastic fieldset ol li.numeric input { width:74%; }
|
86
|
+
|
87
|
+
|
88
|
+
/* TEXTAREA OVERRIDES
|
89
|
+
--------------------------------------------------------------------------------------------------*/
|
90
|
+
form.formtastic fieldset ol li.text textarea { width:74%; }
|
91
|
+
|
92
|
+
|
93
|
+
/* CHECKBOX OVERRIDES
|
94
|
+
--------------------------------------------------------------------------------------------------*/
|
95
|
+
form.formtastic fieldset ol li.boolean label { padding-left:25%; width:auto; }
|
96
|
+
form.formtastic fieldset ol li.boolean label input { margin:0 0.5em 0 0.2em; }
|
97
|
+
|
98
|
+
|
99
|
+
/* RADIO OVERRIDES
|
100
|
+
--------------------------------------------------------------------------------------------------*/
|
101
|
+
form.formtastic fieldset ol li.radio { }
|
102
|
+
form.formtastic fieldset ol li.radio fieldset ol { margin-bottom:-0.6em; }
|
103
|
+
form.formtastic fieldset ol li.radio fieldset ol li { margin:0.1em 0 0.5em 0; }
|
104
|
+
form.formtastic fieldset ol li.radio fieldset ol li label { float:none; width:100%; }
|
105
|
+
form.formtastic fieldset ol li.radio fieldset ol li label input { margin-right:0.2em; }
|
106
|
+
|
107
|
+
|
108
|
+
/* DATE & TIME OVERRIDES
|
109
|
+
--------------------------------------------------------------------------------------------------*/
|
110
|
+
form.formtastic fieldset ol li.date fieldset ol li,
|
111
|
+
form.formtastic fieldset ol li.time fieldset ol li,
|
112
|
+
form.formtastic fieldset ol li.datetime fieldset ol li { float:left; width:auto; margin:0 .3em 0 0; }
|
113
|
+
|
114
|
+
form.formtastic fieldset ol li.date fieldset ol li label,
|
115
|
+
form.formtastic fieldset ol li.time fieldset ol li label,
|
116
|
+
form.formtastic fieldset ol li.datetime fieldset ol li label { display:none; }
|
117
|
+
|
118
|
+
form.formtastic fieldset ol li.date fieldset ol li label input,
|
119
|
+
form.formtastic fieldset ol li.time fieldset ol li label input,
|
120
|
+
form.formtastic fieldset ol li.datetime fieldset ol li label input { display:inline; margin:0; padding:0; }
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/* -------------------------------------------------------------------------------------------------
|
2
|
+
|
3
|
+
Load this stylesheet after formtastic.css in your layouts to override the CSS to suit your needs.
|
4
|
+
This will allow you to update formtastic.css with new releases without clobbering your own changes.
|
5
|
+
|
6
|
+
For example, to make the inline hint paragraphs a little darker in color than the standard #666:
|
7
|
+
|
8
|
+
form.formtastic fieldset ol li p.inline-hints { color:#333; }
|
9
|
+
|
10
|
+
--------------------------------------------------------------------------------------------------*/
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: justinfrench-formtastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin French
|
@@ -9,7 +9,7 @@ autorequire: formtastic
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-10 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -31,6 +31,11 @@ files:
|
|
31
31
|
- lib/justin_french/formtastic.rb
|
32
32
|
- lib/locale
|
33
33
|
- lib/locale/en.yml
|
34
|
+
- generators/formtastic_stylesheets
|
35
|
+
- generators/formtastic_stylesheets/formtastic_stylesheets_generator.rb
|
36
|
+
- generators/formtastic_stylesheets/templates
|
37
|
+
- generators/formtastic_stylesheets/templates/formtastic.css
|
38
|
+
- generators/formtastic_stylesheets/templates/formtastic_changes.css
|
34
39
|
- spec/formtastic_spec.rb
|
35
40
|
- spec/test_helper.rb
|
36
41
|
has_rdoc: true
|