weaver 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/weaver/version.rb +1 -1
- data/lib/weaver.rb +72 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5253d8bb1fcbc5aaf1810d3dcbfd9189cb6219c
|
4
|
+
data.tar.gz: ccf4de6c8995d1fb0bdd9f53b46658b5d308d872
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e798de127630dd28c00df60c4728f0716a84e38e7495898f49cbb02afec76240aa121326a7b77cb121c158706490c17379af6f4f456b5c9388dabf89396c0fc
|
7
|
+
data.tar.gz: 5099c7aec76e95dc91eaf31b5fcd4e904f3bea8a6ec67a8454ec42bb5ac873ccc106a487fb95c5a64bb93df44ea6730626c5acc46ef0a852d4eb085d35a9b2e5
|
data/lib/weaver/version.rb
CHANGED
data/lib/weaver.rb
CHANGED
@@ -64,7 +64,16 @@ module Weaver
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def image(name, options={})
|
67
|
-
|
67
|
+
|
68
|
+
style = ""
|
69
|
+
if options[:rounded_corners] == true
|
70
|
+
style += " border-radius: 8px"
|
71
|
+
else
|
72
|
+
style += " border-radius: #{options[:rounded_corners]}px"
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
img class: "img-responsive #{options[:class]}", src: "/images/#{name}", style: style
|
68
77
|
end
|
69
78
|
|
70
79
|
def crossfade_image(image_normal, image_hover)
|
@@ -137,8 +146,27 @@ module Weaver
|
|
137
146
|
ENDROW
|
138
147
|
end
|
139
148
|
|
140
|
-
def jumbotron(&block)
|
141
|
-
|
149
|
+
def jumbotron(options={}, &block)
|
150
|
+
|
151
|
+
additional_style = ""
|
152
|
+
|
153
|
+
if options[:background]
|
154
|
+
additional_style += " background-image: url('/images/#{options[:background]}'); background-position: center center; background-size: cover;"
|
155
|
+
end
|
156
|
+
|
157
|
+
if options[:height]
|
158
|
+
additional_style += " height: #{options[:height]}px;"
|
159
|
+
end
|
160
|
+
|
161
|
+
if options[:min_height]
|
162
|
+
additional_style += " min-height: #{options[:min_height]}px;"
|
163
|
+
end
|
164
|
+
|
165
|
+
if options[:max_height]
|
166
|
+
additional_style += " max-height: #{options[:max_height]}px;"
|
167
|
+
end
|
168
|
+
|
169
|
+
div :class => "jumbotron", style: additional_style, &block
|
142
170
|
end
|
143
171
|
|
144
172
|
def _button(options={})
|
@@ -771,6 +799,11 @@ ENDROW
|
|
771
799
|
row(class: "wrapper border-bottom white-bg page-heading", &block)
|
772
800
|
end
|
773
801
|
|
802
|
+
def brand(text, link="/")
|
803
|
+
@brand = text
|
804
|
+
@brand_link = link
|
805
|
+
end
|
806
|
+
|
774
807
|
def row(options={}, &block)
|
775
808
|
r = Row.new(@anchors, options)
|
776
809
|
r.instance_eval(&block)
|
@@ -832,6 +865,17 @@ ENDROW
|
|
832
865
|
|
833
866
|
end
|
834
867
|
|
868
|
+
brand_content = ""
|
869
|
+
|
870
|
+
if @brand
|
871
|
+
brand_content = <<-BRAND_CONTENT
|
872
|
+
|
873
|
+
<li>
|
874
|
+
<a href="#"><i class="fa fa-home"></i> <span class="nav-label">X</span> <span class="label label-primary pull-right"></span></a>
|
875
|
+
</li>
|
876
|
+
BRAND_CONTENT
|
877
|
+
end
|
878
|
+
|
835
879
|
@loading_bar_visible = true
|
836
880
|
@content =
|
837
881
|
<<-ENDBODY
|
@@ -841,11 +885,9 @@ ENDROW
|
|
841
885
|
<div class="sidebar-collapse">
|
842
886
|
<ul class="nav" id="side-menu">
|
843
887
|
|
844
|
-
|
845
|
-
|
846
|
-
</li>
|
888
|
+
#{brand_content}
|
889
|
+
#{navigation.generate}
|
847
890
|
|
848
|
-
#{navigation.generate}
|
849
891
|
</ul>
|
850
892
|
</div>
|
851
893
|
</nav>
|
@@ -875,13 +917,15 @@ ENDROW
|
|
875
917
|
super
|
876
918
|
end
|
877
919
|
|
878
|
-
def nav(&block)
|
879
|
-
end
|
880
|
-
|
881
920
|
def header(&block)
|
882
921
|
row(class: "wrapper border-bottom white-bg page-heading", &block)
|
883
922
|
end
|
884
923
|
|
924
|
+
def brand(text, link="/")
|
925
|
+
@brand = text
|
926
|
+
@brand_link = link
|
927
|
+
end
|
928
|
+
|
885
929
|
def row(options={}, &block)
|
886
930
|
r = Row.new(@anchors, options)
|
887
931
|
r.instance_eval(&block)
|
@@ -938,7 +982,7 @@ ENDROW
|
|
938
982
|
end
|
939
983
|
end
|
940
984
|
elsif
|
941
|
-
a href: "#" do
|
985
|
+
a href: "#{item[:link]}" do
|
942
986
|
span :class => "nav-label" do
|
943
987
|
icon item[:icon]
|
944
988
|
text item[:name]
|
@@ -950,6 +994,18 @@ ENDROW
|
|
950
994
|
|
951
995
|
end
|
952
996
|
|
997
|
+
brand_content = ""
|
998
|
+
|
999
|
+
if @brand
|
1000
|
+
brand_content = <<-BRAND_CONTENT
|
1001
|
+
|
1002
|
+
<div class="navbar-header">
|
1003
|
+
|
1004
|
+
<a href="#" class="navbar-brand">X</a>
|
1005
|
+
</div>
|
1006
|
+
BRAND_CONTENT
|
1007
|
+
end
|
1008
|
+
|
953
1009
|
@content =
|
954
1010
|
<<-ENDBODY
|
955
1011
|
<div id="wrapper">
|
@@ -958,12 +1014,11 @@ ENDROW
|
|
958
1014
|
<div class="row border-bottom white-bg">
|
959
1015
|
|
960
1016
|
<nav class="navbar navbar-static-top" role="navigation">
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
</div>
|
1017
|
+
<button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
|
1018
|
+
<i class="fa fa-reorder"></i>
|
1019
|
+
</button>
|
1020
|
+
#{brand_content}
|
1021
|
+
|
967
1022
|
<div class="navbar-collapse collapse" id="navbar">
|
968
1023
|
<ul class="nav navbar-nav">
|
969
1024
|
#{navigation.generate}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weaver
|
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
|
- David Siaw
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|