simple-page-compoents 0.0.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.
- checksums.yaml +7 -0
- data/README.md +4 -0
- data/lib/simple-page-compoents.rb +76 -0
- data/vendor/assets/stylesheets/form.scss +98 -0
- data/vendor/assets/stylesheets/mixins.scss +26 -0
- data/vendor/assets/stylesheets/navbar.scss +90 -0
- data/vendor/assets/stylesheets/simple-page-compoents.scss +3 -0
- metadata +49 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 511a8915f04c49db9f1b60b494c5a1cc4a8bfc55
|
4
|
+
data.tar.gz: 36068bb4d7860503d4c8436c3f12ba77a6c2fa99
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9dea5bfbebc1290b24527194154a7767a7e240e8a50aaf7c8cb8353d7773fbf4db0bc78b23ebd0da17398166c8f8b7b7c1b53da869ec3ed8245a10ae2116f255
|
7
|
+
data.tar.gz: 2b8868801cd9128397a5ac2be5f6ffb14575f57ed76f31f8bcb562735e9a31d06c597b755982b82a8c44d5436b257546c14e56a8b20b58910b24ee75e964beed
|
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
module SimplePageCompoents
|
2
|
+
class NavbarRender
|
3
|
+
class NavItem
|
4
|
+
attr_accessor :text, :url
|
5
|
+
def initialize(text, url)
|
6
|
+
@text = text
|
7
|
+
@url = url
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(view, *args)
|
12
|
+
@view = view
|
13
|
+
@items = []
|
14
|
+
@prepends = []
|
15
|
+
|
16
|
+
@fixed_top = args.include? :fixed_top
|
17
|
+
@fixed_bottom = args.include? :fixed_bottom
|
18
|
+
@color_inverse = args.include? :color_inverse
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_item(text, url)
|
22
|
+
@items << NavItem.new(text, url)
|
23
|
+
self
|
24
|
+
end
|
25
|
+
|
26
|
+
def prepend(str)
|
27
|
+
@prepends << str
|
28
|
+
end
|
29
|
+
|
30
|
+
def css_class
|
31
|
+
c = ['page-navbar']
|
32
|
+
c << 'navbar-fixed-top' if @fixed_top
|
33
|
+
c << 'navbar-fixed-bottom' if @fixed_buttom
|
34
|
+
c << 'color-inverse' if @color_inverse
|
35
|
+
|
36
|
+
c.join(' ')
|
37
|
+
end
|
38
|
+
|
39
|
+
def render
|
40
|
+
@view.haml_tag :div, :class => self.css_class do
|
41
|
+
@view.haml_tag :div, :class => 'navbar-inner' do
|
42
|
+
@view.haml_tag :div, :class => 'nav-prepend' do
|
43
|
+
@prepends.each do |p|
|
44
|
+
@view.haml_concat p
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
@view.haml_tag :ul, :class => 'nav' do
|
49
|
+
@items.each do |item|
|
50
|
+
@view.haml_tag :li do
|
51
|
+
@view.haml_tag :a, item.text,:href => item.url
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
module Helper
|
61
|
+
def page_navbar(*args)
|
62
|
+
NavbarRender.new(self, *args)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
module Rails
|
67
|
+
class Railtie < ::Rails::Railtie
|
68
|
+
initializer 'SimplePageLayout.helper' do |app|
|
69
|
+
ActionView::Base.send :include, Helper
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
class Engine < ::Rails::Engine
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
textarea,
|
2
|
+
input[type="text"],
|
3
|
+
input[type="password"],
|
4
|
+
input[type="datetime"],
|
5
|
+
input[type="datetime-local"],
|
6
|
+
input[type="date"],
|
7
|
+
input[type="month"],
|
8
|
+
input[type="time"],
|
9
|
+
input[type="week"],
|
10
|
+
input[type="number"],
|
11
|
+
input[type="email"],
|
12
|
+
input[type="url"],
|
13
|
+
input[type="search"],
|
14
|
+
input[type="tel"],
|
15
|
+
input[type="color"] {
|
16
|
+
background-color:#fff;
|
17
|
+
border:solid 1px #ccc;
|
18
|
+
@include box-shadow(0 1px 1px rgba(black, 0.075) inset);
|
19
|
+
|
20
|
+
|
21
|
+
@include border-radius(3px);
|
22
|
+
color:#555;
|
23
|
+
font-size:14px;
|
24
|
+
height:20px;line-height:20px;
|
25
|
+
margin-bottom:10px;
|
26
|
+
padding:4px 6px;
|
27
|
+
vertical-align:middle;
|
28
|
+
}
|
29
|
+
|
30
|
+
label{
|
31
|
+
display:block;
|
32
|
+
margin-bottom:5px;
|
33
|
+
}
|
34
|
+
|
35
|
+
label.radio, label.checkbox {
|
36
|
+
padding-left:20px;
|
37
|
+
min-height:20px;
|
38
|
+
}
|
39
|
+
|
40
|
+
.radio input[type="radio"],
|
41
|
+
.checkbox input[type="checkbox"] {
|
42
|
+
float:left;
|
43
|
+
margin-left:-20px;
|
44
|
+
}
|
45
|
+
|
46
|
+
input[type="file"],
|
47
|
+
input[type="image"],
|
48
|
+
input[type="submit"],
|
49
|
+
input[type="reset"],
|
50
|
+
input[type="button"],
|
51
|
+
input[type="radio"],
|
52
|
+
input[type="checkbox"] {
|
53
|
+
width:auto;
|
54
|
+
}
|
55
|
+
|
56
|
+
input[type="radio"],
|
57
|
+
input[type="checkbox"] {
|
58
|
+
line-height:normal;
|
59
|
+
margin-top:4px;
|
60
|
+
}
|
61
|
+
|
62
|
+
.btn{
|
63
|
+
background-color:#f5f5f5;
|
64
|
+
@include gradient(#fff, #e6e6e6);
|
65
|
+
border-color:rgba(black, 0.1) rgba(black, 0.1) #b3b3b3;
|
66
|
+
border-image:none;
|
67
|
+
@include border-radius(3px);
|
68
|
+
border-style:solid;
|
69
|
+
border-width:1px;
|
70
|
+
@include box-shadow(
|
71
|
+
(0 1px 0 rgba(white, 0.2) inset, 0 1px 2px rgba(black, 0.05))
|
72
|
+
);
|
73
|
+
color:#333;
|
74
|
+
cursor:pointer;
|
75
|
+
display:inline-block;
|
76
|
+
font-size:14px;
|
77
|
+
line-height:20px;
|
78
|
+
margin-bottom:0;
|
79
|
+
padding:4px 12px;
|
80
|
+
text-align:center;
|
81
|
+
text-shadow:0 1px 1px rgba(white, 0.75);
|
82
|
+
vertical-align:middle;
|
83
|
+
&:hover, &:focus{
|
84
|
+
background-position:0 -15px;
|
85
|
+
color:#333;
|
86
|
+
text-decoration:none;
|
87
|
+
@include transition(background-position 0.1s linear 0s);
|
88
|
+
}
|
89
|
+
&:hover, &:focus, &:active, &.active, &.disabled, &[disabled] {
|
90
|
+
background-color:#e6e6e6;
|
91
|
+
}
|
92
|
+
&.disabled, &[disabled] {
|
93
|
+
background-image:none;
|
94
|
+
@include box-shadow(none);
|
95
|
+
cursor:default;
|
96
|
+
opacity:0.65;
|
97
|
+
}
|
98
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
@mixin border-radius($radius) {
|
2
|
+
-moz-border-radius : $radius;
|
3
|
+
-webkit-border-radius : $radius;
|
4
|
+
border-radius : $radius;
|
5
|
+
}
|
6
|
+
|
7
|
+
@mixin box-shadow($bs) {
|
8
|
+
-moz-box-shadow : $bs;
|
9
|
+
-webkit-box-shadow : $bs;
|
10
|
+
box-shadow : $bs;
|
11
|
+
}
|
12
|
+
|
13
|
+
@mixin gradient($from, $to){
|
14
|
+
background-color : mix($from, $to);
|
15
|
+
background-image : -moz-linear-gradient(top, $from, $to);
|
16
|
+
background-image : -webkit-linear-gradient(top, from($from), to($to));
|
17
|
+
background-image : -webkit-gradient(linear, 0 0, 0 100%, from($from), to($to));
|
18
|
+
background-image : linear-gradient(to bottom, $from, $to);
|
19
|
+
background-repeat: repeat-x;
|
20
|
+
}
|
21
|
+
|
22
|
+
@mixin transition($params){
|
23
|
+
-moz-transition : $params;
|
24
|
+
-webkit-transition : $params;
|
25
|
+
transition : $params;
|
26
|
+
}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
body > .page-navbar {
|
2
|
+
font-size:13px;
|
3
|
+
}
|
4
|
+
|
5
|
+
.navbar-fixed-top {
|
6
|
+
top:0;
|
7
|
+
}
|
8
|
+
|
9
|
+
.navbar-fixed-bottom {
|
10
|
+
bottom:0;
|
11
|
+
}
|
12
|
+
|
13
|
+
.navbar-fixed-top,
|
14
|
+
.navbar-fixed-bottom {
|
15
|
+
left: 0;
|
16
|
+
margin-bottom: 0;
|
17
|
+
position: fixed;
|
18
|
+
right: 0;
|
19
|
+
z-index: 1000;
|
20
|
+
.navbar-inner{
|
21
|
+
padding-left:0;
|
22
|
+
padding-right:0;
|
23
|
+
@include border-radius(0);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
.page-navbar{
|
28
|
+
overflow:visible;
|
29
|
+
.nav{
|
30
|
+
display:block;
|
31
|
+
float:left;
|
32
|
+
left:0;
|
33
|
+
margin:0 10px 0 0;
|
34
|
+
position:relative;
|
35
|
+
list-style:none outside none;
|
36
|
+
&>li{
|
37
|
+
float:left;
|
38
|
+
line-height:20px;
|
39
|
+
&>a{
|
40
|
+
color:#777;
|
41
|
+
float:none;
|
42
|
+
padding:10px 15px;
|
43
|
+
text-decoration:none;
|
44
|
+
text-shadow:0 1px 0 #fff;
|
45
|
+
display:block;
|
46
|
+
&:hover{
|
47
|
+
color:#333;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
&.color-inverse{
|
54
|
+
.navbar-inner {
|
55
|
+
@include gradient(#222, #111);
|
56
|
+
border-color:#252525;
|
57
|
+
.nav > li > a {
|
58
|
+
color:#999;
|
59
|
+
text-shadow:0 -1px 0 rgba(black, 0.25);
|
60
|
+
&:hover{
|
61
|
+
color:white;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
.navbar-inner{
|
69
|
+
&:after{
|
70
|
+
clear:both;
|
71
|
+
}
|
72
|
+
&:before, &:after{
|
73
|
+
content:"";
|
74
|
+
display:table;
|
75
|
+
line-height:0;
|
76
|
+
}
|
77
|
+
@include gradient(#fff, #f2f2f2);
|
78
|
+
border:solid 1px #d4d4d4;
|
79
|
+
@include border-radius(3px);
|
80
|
+
@include box-shadow(0 1px 3px rgba(black, 0.067));
|
81
|
+
min-height:40px;
|
82
|
+
padding-left:20px;
|
83
|
+
padding-right:20px;
|
84
|
+
}
|
85
|
+
|
86
|
+
.navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner {
|
87
|
+
@include box-shadow(0 1px 10px rgba(0, 0, 0, 0.1));
|
88
|
+
border-width:0 0 1px;
|
89
|
+
}
|
90
|
+
|
metadata
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: simple-page-compoents
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ben7th
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-03-11 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: to add some ui compoents for rails3.
|
14
|
+
email: ben7th@sina.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/simple-page-compoents.rb
|
20
|
+
- vendor/assets/stylesheets/navbar.scss
|
21
|
+
- vendor/assets/stylesheets/form.scss
|
22
|
+
- vendor/assets/stylesheets/simple-page-compoents.scss
|
23
|
+
- vendor/assets/stylesheets/mixins.scss
|
24
|
+
- README.md
|
25
|
+
homepage: https://github.com/mindpin/simple-images
|
26
|
+
licenses:
|
27
|
+
- MIT
|
28
|
+
metadata: {}
|
29
|
+
post_install_message:
|
30
|
+
rdoc_options: []
|
31
|
+
require_paths:
|
32
|
+
- lib
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
requirements: []
|
44
|
+
rubyforge_project:
|
45
|
+
rubygems_version: 2.0.0
|
46
|
+
signing_key:
|
47
|
+
specification_version: 4
|
48
|
+
summary: simple page compoents
|
49
|
+
test_files: []
|