pyk 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/app/assets/javascripts/pyk.js +1 -0
- data/app/assets/javascripts/vendor/bootstrap.min.js +6 -0
- data/app/assets/javascripts/vendor/jquery.sparkline.min.js +5 -0
- data/app/assets/javascripts/vendor/pyk_master.js +83 -0
- data/app/assets/stylesheets/pyk.css.scss +2 -3
- data/app/assets/stylesheets/pyk/bootstrap.min.css +9 -0
- data/app/assets/stylesheets/pyk/helpers.css.scss +3 -7
- data/app/assets/stylesheets/pyk/pyk_master.css +257 -0
- data/lib/pyk.rb +2 -14
- data/lib/pyk/helpers.rb +159 -0
- data/lib/pyk/highcharts.rb +33 -6
- data/lib/pyk/user.rb +1 -1
- metadata +93 -116
- data/app/assets/stylesheets/pyk/bootstrap.css.scss +0 -49
- data/app/assets/stylesheets/pyk/global.css.scss +0 -31
- data/app/assets/stylesheets/pyk/navbar.css.scss +0 -60
- data/lib/pyk/address_helpers.rb +0 -15
- data/lib/pyk/app_helpers.rb +0 -15
- data/lib/pyk/date_helpers.rb +0 -31
- data/lib/pyk/devise_helpers.rb +0 -45
- data/lib/pyk/float.rb +0 -3
- data/lib/pyk/number.rb +0 -3
- data/lib/pyk/number_helpers.rb +0 -41
- data/lib/pyk/string.rb +0 -3
@@ -1,49 +0,0 @@
|
|
1
|
-
|
2
|
-
/* BOOTSTRAP CUSTOMIZATIONS */
|
3
|
-
|
4
|
-
|
5
|
-
ul.nav.nav-pills{
|
6
|
-
li.active{
|
7
|
-
a {background-color: #08C; color: white; text-shadow: #08C 2px 2px;}}
|
8
|
-
}
|
9
|
-
|
10
|
-
.table-borderless td,
|
11
|
-
.table-borderless th{ border: 0 !important }
|
12
|
-
|
13
|
-
.page.current{color: white;}
|
14
|
-
.label-info{background-color: #3A87AD;}
|
15
|
-
.alert-footer{background-color: #E3E2DE; border: none;}
|
16
|
-
.alert.alert-success{background-color: #FCFDDD; border: 1px solid #BDBDBD; color: #2E2E2E;}
|
17
|
-
.well{background-color: #EFEFEF;border: none; }
|
18
|
-
ul.breadcrumb{border: none; background: none; margin: 0px; padding: 0xp; a{color: gray;} color: lightgray; li{padding: 0px 6px 0px 0px;}}
|
19
|
-
|
20
|
-
.help-block{font-size: 11px; color: #A4967D;}
|
21
|
-
.simple_form_search_bar{background-color: white; border: 1px lightgray solid;}
|
22
|
-
|
23
|
-
|
24
|
-
.help-inline{color: red; font-weight: bold; letter-spacing: -1px;}
|
25
|
-
.form-actions{background: none;border: none;}
|
26
|
-
.form-horizontal .form-actions{padding-left: 160px;}
|
27
|
-
.form-left{width: 140px; text-align: right; font-size: 11px;}
|
28
|
-
.form-right{padding: 0px 0px 5px 20px;}
|
29
|
-
|
30
|
-
/*http://tablesorter.com/docs/*/
|
31
|
-
|
32
|
-
th.header {
|
33
|
-
background: url('sort-bg.gif') no-repeat center left white;
|
34
|
-
cursor: pointer;
|
35
|
-
font-weight: bold;
|
36
|
-
padding-left: 20px;
|
37
|
-
margin-left: -1px;
|
38
|
-
}
|
39
|
-
|
40
|
-
th.headerSortDown { background: url('desc.gif') no-repeat center left white; }
|
41
|
-
th.headerSortUp { background: url('asc.gif') no-repeat center left white; }
|
42
|
-
|
43
|
-
ul.ui-autocomplete {position: absolute;list-style: none;margin: 0;padding: 0;border: solid 1px #999;cursor: default;
|
44
|
-
li {background-color: #FFF;border-top: solid 1px #DDD;margin: 0;padding: 0;
|
45
|
-
a {color: #000;display: block;padding: 3px;}
|
46
|
-
a.ui-state-hover, a.ui-state-active {background-color: #FFFCB2;}}}
|
47
|
-
|
48
|
-
.ui-helper-hidden-accessible{ display: none;}
|
49
|
-
|
@@ -1,31 +0,0 @@
|
|
1
|
-
body{background-color: white; font-family: ProximaNova, 'Helvetica Neue', helvetica, arial, sans-serif; margin: 0px; padding: 0px; width: 100%; font-size: 12px;}
|
2
|
-
|
3
|
-
.footer{width: 100%;bottom: 0px; display: block; position: absolute; left: 0px; margin: 0px; padding: 10px 0px; background-color: #DEDCD6; text-align: center; font-size: 11px; color: black;}
|
4
|
-
|
5
|
-
label{font-size:11px;}
|
6
|
-
|
7
|
-
input, textarea{color: black;}
|
8
|
-
|
9
|
-
strike{color: red;}
|
10
|
-
|
11
|
-
/* MAILTO */
|
12
|
-
|
13
|
-
a[href^="mailto"] {color: #228822;}
|
14
|
-
a[href^="mailto"]:hover {background-color: #228822; color: white;}
|
15
|
-
|
16
|
-
/* DELETE LINKS */
|
17
|
-
|
18
|
-
a[data-method="delete"]{color: gray; font-size: 15px;}
|
19
|
-
|
20
|
-
/* LINKS */
|
21
|
-
|
22
|
-
a{color: #000; text-decoration: none; }
|
23
|
-
a:hover{color: #08C; text-decoration: none;}
|
24
|
-
a:active{color: black;}
|
25
|
-
|
26
|
-
.h{
|
27
|
-
padding-top: 20px;
|
28
|
-
margin-bottom: 0px;
|
29
|
-
h2, h3{font-weight: 800; padding: 0px 0px 10px 0px; color: #2986C4; font-size: 33px; letter-spacing: -2px; text-shadow: #F7F7F7 2px 2px; }
|
30
|
-
a{color: #08C;}
|
31
|
-
}
|
@@ -1,60 +0,0 @@
|
|
1
|
-
/*--http://thegeekyme.com/creating-a-google-like-redblack-navigation-bar-without-any-imagejavascript--*/
|
2
|
-
#navwrapper{
|
3
|
-
background-color: #2D2D2D;
|
4
|
-
width: 100%;
|
5
|
-
height: 31px;
|
6
|
-
font-family: Arial, Helvetica, sans-serif;
|
7
|
-
font-size: 11px;
|
8
|
-
|
9
|
-
ul{
|
10
|
-
padding: 0; margin: 0; list-style: none;
|
11
|
-
|
12
|
-
a{display:block; padding:5px 0px; color:#ccc; text-decoration:none; margin: 0px 10px;}
|
13
|
-
|
14
|
-
a.dmenu:hover{color:#3366CC !important; background-color: #fff !important;}
|
15
|
-
|
16
|
-
a:hover { background-color: #606060 !important; color: #FFFFFF !important; }
|
17
|
-
|
18
|
-
/*--the selected, current item in the navigation menu--*/
|
19
|
-
|
20
|
-
a.current{color:#fff;font-weight:bold;background:#2D2D2D;text-decoration:none;border-top:2px solid #2986C4;padding-top:3px; margin: 0px 10px;}
|
21
|
-
|
22
|
-
a.current:hover{padding-top: 3px;}
|
23
|
-
|
24
|
-
li:hover a, a:focus, a:active {padding: 5px 0px; margin: 0px 10px; color:#fff; background:#444; text-decoration:none; }
|
25
|
-
|
26
|
-
li ul, ul li {width: 10em;}
|
27
|
-
|
28
|
-
/*--drop down menu styling is different from main nav, strict rule--*/
|
29
|
-
ul li a {color: #3366CC !important;border-right: 0; }
|
30
|
-
|
31
|
-
li {position: relative; position: static; width: auto;}
|
32
|
-
|
33
|
-
ul li a:hover {color:#3366CC !important;background-color: #eef3fb !important;border-right: 0;}
|
34
|
-
|
35
|
-
li:hover ul {display: block;}
|
36
|
-
|
37
|
-
li:hover ul a{color: #000000;background-color: transparent;}
|
38
|
-
|
39
|
-
li {float: left;
|
40
|
-
|
41
|
-
ul{ position: absolute; display: none; margin-left:-1px; padding-bottom:10px; background-color: #FFFFFF; border: 1px solid #bbb; border-top:none; -moz-box-shadow: 0 0 5px #ddd; -webkit-box-shadow: 0 0 5px #ddd; box-shadow: 0 0 5px #ddd; z-index:5000;
|
42
|
-
}
|
43
|
-
}
|
44
|
-
|
45
|
-
}
|
46
|
-
}
|
47
|
-
|
48
|
-
/*--used in drop down menu items--*/
|
49
|
-
.menuseprator{border-bottom:1px solid #ddd; margin:10px 0 10px 0;}
|
50
|
-
|
51
|
-
/*--for showing down arrow in drop down menu item--*/
|
52
|
-
.arrowdown{color: #eee; font-size:0.5em;}
|
53
|
-
|
54
|
-
/*--for the left navigation menu--*/
|
55
|
-
.floatleft{float:left;}
|
56
|
-
|
57
|
-
/*--for the right options navigation menu--*/
|
58
|
-
.floatright{float:right;}
|
59
|
-
|
60
|
-
.clear{clear:both;}
|
data/lib/pyk/address_helpers.rb
DELETED
data/lib/pyk/app_helpers.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
module Pyk::AppHelpers
|
2
|
-
|
3
|
-
def title(page_title)
|
4
|
-
content_for(:title) { page_title }
|
5
|
-
end
|
6
|
-
|
7
|
-
def d
|
8
|
-
"<span style='font-size:13px'><i class='icon-trash'></i></span>".html_safe
|
9
|
-
end
|
10
|
-
|
11
|
-
def r
|
12
|
-
"<i class='icon-repeat'></i>".html_safe
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
data/lib/pyk/date_helpers.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
module Pyk::DateHelpers
|
2
|
-
|
3
|
-
def smart_date(i, mode="date")
|
4
|
-
if i.blank?
|
5
|
-
return ""
|
6
|
-
elsif (i.class.to_s == "Time" or i.class.to_s == "ActiveSupport::TimeWithZone") and mode == "time"
|
7
|
-
return i.year == Time.now.year ? i.strftime("%d-%b %H:%M") : i.strftime("%d-%b-%Y %H:%M")
|
8
|
-
else
|
9
|
-
return i.year == Time.now.year ? i.strftime("%d-%b") : i.strftime("%d-%b-%Y")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def smart_due_date(i)
|
14
|
-
if i == nil
|
15
|
-
return ""
|
16
|
-
elsif i.class.to_s == "Time" or i.class.to_s == "ActiveSupport::TimeWithZone"
|
17
|
-
i = i.to_date
|
18
|
-
end
|
19
|
-
if Date.today == i
|
20
|
-
return "<span style=\"background-color:#F7FAB9;padding:0px 2px 0px 2px;\">Today</span>"
|
21
|
-
elsif i - Date.today == 1
|
22
|
-
return "<span style=\"background-color:#F7FAB9;padding:0px 2px 0px 2px;\">Tomorrow</span>"
|
23
|
-
elsif Date.today - i > 0.9
|
24
|
-
return "<span style=\"background-color:#FFC7C7;padding:0px 2px 0px 2px;\">" + smart_date(i) + "</span>"
|
25
|
-
elsif Date.today - i < 1
|
26
|
-
return "<span style=\"background-color:#D2FFCC;padding:0px 2px 0px 2px;\">" + smart_date(i) + "</span>"
|
27
|
-
end
|
28
|
-
return smart_date(i, "date")
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
data/lib/pyk/devise_helpers.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
module Pyk::DeviseHelpers
|
2
|
-
|
3
|
-
def resource_name
|
4
|
-
:user
|
5
|
-
end
|
6
|
-
|
7
|
-
def resource
|
8
|
-
@resource ||= User.new
|
9
|
-
end
|
10
|
-
|
11
|
-
def devise_mapping
|
12
|
-
@devise_mapping ||= Devise.mappings[:user]
|
13
|
-
end
|
14
|
-
|
15
|
-
#DEVISE end
|
16
|
-
|
17
|
-
def devise_error_messages!
|
18
|
-
flash_alerts = []
|
19
|
-
error_key = 'errors.messages.not_saved'
|
20
|
-
|
21
|
-
if !flash.empty?
|
22
|
-
flash_alerts.push(flash[:error]) if flash[:error]
|
23
|
-
flash_alerts.push(flash[:alert]) if flash[:alert]
|
24
|
-
flash_alerts.push(flash[:notice]) if flash[:notice]
|
25
|
-
error_key = 'devise.failure.invalid'
|
26
|
-
end
|
27
|
-
|
28
|
-
return "" if resource.errors.empty? && flash_alerts.empty?
|
29
|
-
errors = resource.errors.empty? ? flash_alerts : resource.errors.full_messages
|
30
|
-
|
31
|
-
messages = errors.map { |msg| content_tag(:li, msg) }.join
|
32
|
-
sentence = I18n.t(error_key, :count => errors.count,
|
33
|
-
:resource => resource.class.model_name.human.downcase)
|
34
|
-
|
35
|
-
html = <<-HTML
|
36
|
-
<div id="error_explanation">
|
37
|
-
<h2>#{sentence}</h2>
|
38
|
-
<ul>#{messages}</ul>
|
39
|
-
</div>
|
40
|
-
HTML
|
41
|
-
|
42
|
-
html.html_safe
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
data/lib/pyk/float.rb
DELETED
data/lib/pyk/number.rb
DELETED
data/lib/pyk/number_helpers.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
module Pyk::NumberHelpers
|
2
|
-
|
3
|
-
def two_decimal_points(ff)
|
4
|
-
sprintf("%0.02f", ff)
|
5
|
-
end
|
6
|
-
|
7
|
-
def remove_decimal(str)
|
8
|
-
str = str.to_s
|
9
|
-
if str.index(".").present?
|
10
|
-
str = str[0..(str.index(".") - 1)]
|
11
|
-
end
|
12
|
-
str
|
13
|
-
end
|
14
|
-
|
15
|
-
def n2h(d)
|
16
|
-
begin
|
17
|
-
return number_to_human(d, significant: false, precision: 1)
|
18
|
-
rescue
|
19
|
-
return d
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def stock_market(d)
|
24
|
-
if d < 0
|
25
|
-
return "<span style='color: red;'><i class='icon-arrow-down'></i></span> #{d}%".html_safe
|
26
|
-
elsif d > 0
|
27
|
-
return "<span style='color: green;'><i class='icon-arrow-up'></i></span> #{d}%".html_safe
|
28
|
-
else
|
29
|
-
return d
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def color_amount(d)
|
34
|
-
if d < 0
|
35
|
-
"<span class='red'>(#{number_to_currency(d, unit: '')})</span>".html_safe
|
36
|
-
else
|
37
|
-
number_to_currency(d, unit: '')
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
data/lib/pyk/string.rb
DELETED