startups 0.0.2 → 0.0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +3 -0
- data/Rakefile +1 -1
- data/rails_generators/startup_layout/templates/public/stylesheets/startup_layout.css +4 -14
- data/rails_generators/startup_nav/templates/_nav.html.erb +6 -7
- data/rails_generators/startup_nav/templates/nav.css +5 -3
- data/rails_generators/startup_nav/templates/nav_helper.rb +39 -4
- data/startups.gemspec +2 -2
- metadata +2 -2
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('startups', '0.0.2') do |p|
|
5
|
+
Echoe.new('startups', '0.0.2.1') do |p|
|
6
6
|
p.project = "startups"
|
7
7
|
p.description = "A collection of Rails \"startups\" for features such as a standard layout, navigation and forms with customizable error handling."
|
8
8
|
p.url = "http://rubyforge.org/projects/startups"
|
@@ -4,11 +4,8 @@ h1 {font-size: 18px; margin: 10px 0;}
|
|
4
4
|
h2 {font-size: 14px; font-weight: bold;}
|
5
5
|
h3 {font-size: 12px; font-weight: bold;}
|
6
6
|
|
7
|
-
a
|
8
|
-
a:
|
9
|
-
a:active,
|
10
|
-
a:hover {color:#5d5e5e; text-decoration: underline;}
|
11
|
-
a:visited {color:#5d5e5e;}
|
7
|
+
a {color:#5d5e5e;text-decoration: none;}
|
8
|
+
a:hover, a:active {color:#5d5e5e; text-decoration: underline;}
|
12
9
|
|
13
10
|
#all {background-color:white;color:#5d5e5e;min-height:100%;position:relative;}
|
14
11
|
|
@@ -17,17 +14,10 @@ a:visited {color:#5d5e5e;}
|
|
17
14
|
.crumbs span {font-size:12px;margin-left:5px;margin-right:5px;}
|
18
15
|
|
19
16
|
#content {overflow:auto;padding:10px 20px 0px 55px;padding-bottom:30px;width:950px;} /* bottom padding needs to match footer height */
|
20
|
-
#content_link {color:#5d5e5e;text-decoration:none;}
|
21
|
-
#content_link_underline {color:#5d5e5e;text-decoration:underline;}
|
22
17
|
|
23
18
|
#masthead {color:#a0a1a2;height:40px;padding-top:15px;width:100%;border-bottom:1px solid #e0e1e2;}
|
24
|
-
#masthead a {}
|
25
|
-
#masthead a:
|
26
|
-
#masthead a:hover {color:#5d5e5e;text-decoration:underline;}
|
27
|
-
#masthead a:link {color:#a0a1a2;text-decoration:none;}
|
28
|
-
#masthead a:visited {color:#a0a1a2;text-decoration:none;}
|
29
|
-
#masthead_link {color:#a0a1a2;text-decoration:none;}
|
30
|
-
#masthead_link_underline {color:#5d5e5e;text-decoration:underline;}
|
19
|
+
#masthead a:active, #masthead a:hover {color:#5d5e5e;text-decoration:underline;}
|
20
|
+
#masthead a:link, #masthead a:visited {color:#a0a1a2;text-decoration:none;}
|
31
21
|
|
32
22
|
#footer {bottom:0px;color:#a0a1a2;height:30px;position:absolute;width:100%;border-top:1px solid #e0e1e2;font-size:10px;}
|
33
23
|
#footer_content {padding:5px 20px;padding-bottom:0px;width:950px;overflow:auto;}
|
@@ -1,8 +1,7 @@
|
|
1
|
-
|
2
|
-
<ul
|
3
|
-
<%% layout_nav_items.each do |nav_item|
|
4
|
-
|
5
|
-
%>
|
6
|
-
<li><%%= link_to(nav_item[:label], nav_item[:url], :id => "<%= css_id %>_#{nav_item[:id]}") %></li>
|
1
|
+
<div id="<%= (name.to_s == 'top') ? 'nav' : "#{name}_nav" %>">
|
2
|
+
<ul>
|
3
|
+
<%% layout_nav_items(:<%= name %>).each do |nav_item| %>
|
4
|
+
<li><%= link_to_nav_item(nav_item) %></li>
|
7
5
|
<%% end %>
|
8
|
-
</ul>
|
6
|
+
</ul>
|
7
|
+
</div>
|
@@ -7,7 +7,8 @@
|
|
7
7
|
<%= css_id.upcase %> STYLES
|
8
8
|
************/
|
9
9
|
<% if name.to_s == 'footer' %>
|
10
|
-
#footer_nav {
|
10
|
+
#footer_nav {float:right;}
|
11
|
+
#footer_nav ul {list-style-type:none;}
|
11
12
|
#footer_nav li {float:left;margin-right:20px;}
|
12
13
|
#footer_nav a {display:block;position:relative;text-decoration:none;text-transform:uppercase;}
|
13
14
|
#footer_nav a:visited {color:#a0a1a2;text-decoration:none;}
|
@@ -15,13 +16,14 @@
|
|
15
16
|
#footer_nav a:hover {color:#5d5e5e;text-decoration:underline;}
|
16
17
|
#footer_nav a:active {color:#5d5e5e;text-decoration:underline;}
|
17
18
|
<% else %>
|
19
|
+
#<%= css_id %> {margin-left:22px;}
|
20
|
+
#<%= css_id %> ul {list-style-type:none;overflow:auto;}
|
21
|
+
#<%= css_id %> li {float:left;}
|
18
22
|
#<%= css_id %> a {display:block;height:20px;padding:5px 10px;position:relative;text-decoration:none;text-transform:uppercase;}
|
19
23
|
#<%= css_id %> a:visited {color:#a0a1a2;text-decoration:none;}
|
20
24
|
#<%= css_id %> a:link {color:#a0a1a2;text-decoration:none;}
|
21
25
|
#<%= css_id %> a:hover {color:#5d5e5e;text-decoration:none;}
|
22
26
|
#<%= css_id %> a:active {color:#5d5e5e;text-decoration:none;}
|
23
|
-
#<%= css_id %> li {float:left;}
|
24
|
-
#<%= css_id %> {list-style-type:none;margin-left:22px;overflow:auto;}
|
25
27
|
<% end %>
|
26
28
|
|
27
29
|
/* any additional menu items need to be added here for them to be styled correctly when selected. */
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module NavHelper
|
2
2
|
|
3
3
|
#change the hash below to include the actual items you need in your navs. Use the :placement option to specify which nav an item goes in if there are multiple navs.
|
4
|
-
def
|
5
|
-
|
4
|
+
def configure_nav_items
|
5
|
+
[
|
6
6
|
<%- names.each do |name| -%>
|
7
7
|
#nav items for :<%= name %>
|
8
8
|
<%- unless name.to_s == 'footer' %>
|
@@ -14,6 +14,34 @@ module NavHelper
|
|
14
14
|
]
|
15
15
|
end
|
16
16
|
|
17
|
+
def layout_nav_items(placement=nil)
|
18
|
+
init_layout_nav_items
|
19
|
+
if placement.nil?
|
20
|
+
@layout_nav_items
|
21
|
+
else
|
22
|
+
layout_nav_items_by_placement(placement)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def init_layout_nav_items
|
27
|
+
unless @layout_nav_items
|
28
|
+
@layout_nav_items = configure_nav_items
|
29
|
+
@layout_nav_items.each do |nav_item|
|
30
|
+
nav_item[:label] ||= nav_item[:id].to_s.titleize
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def layout_nav_items_by_placement(placement)
|
36
|
+
@layout_nav_items_by_placement ||= {}
|
37
|
+
unless @layout_nav_items_by_placement[placement]
|
38
|
+
@layout_nav_items_by_placement[placement] = []
|
39
|
+
@layout_nav_items.each do |nav_item|
|
40
|
+
@layout_nav_items_by_placement[placement] << nav_item if nav_item[:placement] == placement
|
41
|
+
end
|
42
|
+
end
|
43
|
+
@layout_nav_items_by_placement[placement]
|
44
|
+
end
|
17
45
|
|
18
46
|
attr_accessor :layout_nav
|
19
47
|
|
@@ -21,11 +49,11 @@ module NavHelper
|
|
21
49
|
@layout_nav = value
|
22
50
|
@selected_nav_title = (selected_nav_item ? selected_nav_item[:title] : nil)
|
23
51
|
end
|
24
|
-
|
52
|
+
|
25
53
|
def layout_nav_ids
|
26
54
|
@layout_nav_ids ||= layout_nav_items.collect{|nav_item|nav_item[:id]}
|
27
55
|
end
|
28
|
-
|
56
|
+
|
29
57
|
def selected_nav_item
|
30
58
|
@selected_nav_item ||= layout_nav_item(layout_nav)
|
31
59
|
end
|
@@ -38,4 +66,11 @@ module NavHelper
|
|
38
66
|
nil
|
39
67
|
end
|
40
68
|
|
69
|
+
def link_to_nav_item(nav_item)
|
70
|
+
items = layout_nav_items(nav_item[:placement])
|
71
|
+
css_id = "#{nav_item[:placement]}_#{nav_item[:id]}"
|
72
|
+
css_class = (items.index(nav_item) == items.size-1) ? :last : nil
|
73
|
+
link_to(nav_item[:label], nav_item[:url], :id => css_id, :class => css_class )
|
74
|
+
end
|
75
|
+
|
41
76
|
end
|
data/startups.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{startups}
|
5
|
-
s.version = "0.0.2"
|
5
|
+
s.version = "0.0.2.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Ryan Owens"]
|
9
|
-
s.date = %q{2009-10-
|
9
|
+
s.date = %q{2009-10-19}
|
10
10
|
s.description = %q{A collection of Rails "startups" for features such as a standard layout, navigation and forms with customizable error handling.}
|
11
11
|
s.email = %q{ryan (at) infoether (dot) com}
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "lib/startups.rb", "LICENSE", "README", "TODO"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: startups
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.2
|
4
|
+
version: 0.0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Owens
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-19 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|