tienda 1.1.2 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/tienda/application.coffee +114 -84
- data/app/assets/javascripts/tienda/custom-scripts.js +182 -0
- data/app/assets/javascripts/tienda/custom.js +200 -0
- data/app/assets/javascripts/tienda/jquery.metisMenu.js +45 -0
- data/app/assets/javascripts/tienda/morris.js +1913 -0
- data/app/assets/javascripts/tienda/raphael-2.1.0.min.js +10 -0
- data/app/assets/stylesheets/tienda/application.scss +2 -577
- data/app/assets/stylesheets/tienda/custom-styles.scss +518 -0
- data/app/assets/stylesheets/tienda/morris-0.4.3.min.css +2 -0
- data/app/controllers/tienda/dashboard_controller.rb +11 -1
- data/app/controllers/tienda/products_controller.rb +7 -3
- data/app/controllers/tienda/sessions_controller.rb +1 -1
- data/app/controllers/tienda/stock_level_adjustments_controller.rb +1 -5
- data/app/helpers/tienda/application_helper.rb +10 -4
- data/app/models/tienda/country.rb +3 -5
- data/app/models/tienda/delivery_service.rb +5 -7
- data/app/models/tienda/order/actions.rb +3 -3
- data/app/models/tienda/order/delivery.rb +1 -1
- data/app/models/tienda/order.rb +8 -8
- data/app/models/tienda/order_item.rb +11 -11
- data/app/models/tienda/product.rb +38 -54
- data/app/models/tienda/stock_level_adjustment.rb +9 -7
- data/app/models/tienda/tax_rate.rb +5 -7
- data/app/models/tienda/user.rb +4 -4
- data/app/validators/permalink_validator.rb +1 -1
- data/app/views/layouts/tienda/application.html.haml +29 -22
- data/app/views/layouts/tienda/sub.html.haml +44 -6
- data/app/views/tienda/application/_navbar.html.haml +164 -0
- data/app/views/tienda/application/_sidebar.html.haml +6 -0
- data/app/views/tienda/countries/_form.html.haml +40 -34
- data/app/views/tienda/countries/edit.html.haml +12 -3
- data/app/views/tienda/countries/index.html.haml +31 -21
- data/app/views/tienda/countries/new.html.haml +11 -3
- data/app/views/tienda/dashboard/home.html.haml +156 -0
- data/app/views/tienda/delivery_service_prices/_form.html.haml +53 -39
- data/app/views/tienda/delivery_service_prices/edit.html.haml +12 -3
- data/app/views/tienda/delivery_service_prices/index.html.haml +28 -19
- data/app/views/tienda/delivery_service_prices/new.html.haml +12 -3
- data/app/views/tienda/delivery_services/_form.html.haml +48 -35
- data/app/views/tienda/delivery_services/edit.html.haml +11 -5
- data/app/views/tienda/delivery_services/index.html.haml +34 -24
- data/app/views/tienda/delivery_services/new.html.haml +12 -3
- data/app/views/tienda/orders/_form.html.haml +78 -53
- data/app/views/tienda/orders/_order_details.html.haml +57 -54
- data/app/views/tienda/orders/_order_items.html.haml +5 -3
- data/app/views/tienda/orders/_payments_form.html.haml +18 -14
- data/app/views/tienda/orders/_payments_table.html.haml +6 -5
- data/app/views/tienda/orders/_search_form.html.haml +40 -24
- data/app/views/tienda/orders/_status_bar.html.haml +36 -32
- data/app/views/tienda/orders/index.html.haml +41 -34
- data/app/views/tienda/orders/new.html.haml +22 -11
- data/app/views/tienda/orders/show.html.haml +24 -18
- data/app/views/tienda/product_categories/_form.html.haml +34 -22
- data/app/views/tienda/product_categories/edit.html.haml +12 -4
- data/app/views/tienda/product_categories/index.html.haml +26 -16
- data/app/views/tienda/product_categories/new.html.haml +11 -3
- data/app/views/tienda/products/_form.html.haml +163 -126
- data/app/views/tienda/products/_table.html.haml +49 -40
- data/app/views/tienda/products/edit.html.haml +14 -6
- data/app/views/tienda/products/index.html.haml +35 -7
- data/app/views/tienda/sessions/new.html.haml +8 -6
- data/app/views/tienda/sessions/reset.html.haml +5 -5
- data/app/views/tienda/settings/edit.html.haml +20 -14
- data/app/views/tienda/stock_level_adjustments/_table.html.haml +33 -0
- data/app/views/tienda/stock_level_adjustments/index.html.haml +20 -39
- data/app/views/tienda/tax_rates/form.html.haml +41 -25
- data/app/views/tienda/tax_rates/index.html.haml +23 -13
- data/app/views/tienda/users/_form.html.haml +36 -24
- data/app/views/tienda/users/edit.html.haml +12 -3
- data/app/views/tienda/users/index.html.haml +23 -13
- data/app/views/tienda/users/new.html.haml +10 -3
- data/app/views/tienda/variants/form.html.haml +98 -57
- data/app/views/tienda/variants/index.html.haml +47 -29
- data/config/initializers/assets.rb +9 -0
- data/config/locales/en.yml +3 -2
- data/config/routes.rb +1 -1
- data/db/migrate/20150517191600_add_stock_counter_cache.rb +5 -0
- data/db/migrate/20150517195800_remove_stock_level_item_polymorphism.rb +6 -0
- data/db/migrate/20150517212100_update_stock_counter_cache.rb +5 -0
- data/db/migrate/20150603235417_add_document_to_orders.rb +5 -0
- data/lib/tienda/default_navigation.rb +9 -8
- data/lib/tienda/navigation_manager.rb +2 -5
- data/lib/tienda/version.rb +1 -1
- data/lib/tienda.rb +2 -6
- metadata +54 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 869f733fb0cbb73c7cb3bbbc89f0b5b3d9434937
|
4
|
+
data.tar.gz: 42789f8109b671efb78b8dea797aff4d31158386
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68386024a0cbd7e311b75bbac5ff6242cb1b99193e9a00aef5180f7ed34a837f78f2ea9d3b44f5e0ee38f7f7a37a55f533373c1e20648bc691ecb5b074daf2ec
|
7
|
+
data.tar.gz: eea936572ee550b284c7540dc12ad71c6d3a37d0809dbc2099f98116b8cbc7088013fc63a3782b737e02b93cd977bab2a168e5d1a6e7a9522b2d86d322d91630
|
@@ -1,19 +1,44 @@
|
|
1
1
|
#= require jquery
|
2
2
|
#= require jquery_ujs
|
3
|
-
#= require tienda/mousetrap
|
4
3
|
#= require tienda/jquery_ui
|
5
|
-
#= require tienda/chosen.jquery
|
6
|
-
#= require nifty/dialog
|
7
|
-
#= require_tree .
|
8
4
|
|
9
5
|
$ ->
|
10
|
-
#
|
11
|
-
$('
|
12
|
-
|
6
|
+
# Clear modal div after closing them
|
7
|
+
$('body').on 'hidden.bs.modal', '.modal', ->
|
8
|
+
$(this).removeData 'bs.modal'
|
9
|
+
return
|
10
|
+
|
11
|
+
# New Stock Level AJAX Callback function
|
12
|
+
$('.tienda_products_index, .tienda_variants_index').on('ajax:success', '#new_stock_level_adjustment', (e, data, status, xhr) ->
|
13
|
+
quantity = parseInt($(this).find('#stock_level_adjustment_adjustment').val())
|
14
|
+
product = $(this).find('#item_id').val()
|
15
|
+
stock_label = $('a.btn-sm[href*=' + product + ']').closest('td').find('b');
|
16
|
+
old_quantity = parseInt(stock_label.text())
|
17
|
+
$('#stockModal').modal('hide')
|
18
|
+
if isNaN(old_quantity)
|
19
|
+
stock_label.text quantity
|
20
|
+
else
|
21
|
+
stock_label.text quantity + old_quantity
|
22
|
+
|
23
|
+
return
|
24
|
+
).on 'ajax:error', (e, xhr, status, error) ->
|
25
|
+
console.log(xhr)
|
26
|
+
$(this).find('#stockModal .alert-danger').removeClass('hidden').text(xhr.responseText)
|
27
|
+
return
|
28
|
+
|
29
|
+
$('#main-menu').metisMenu()
|
30
|
+
|
31
|
+
$(window).bind 'load resize', ->
|
32
|
+
if $(this).width() < 768
|
33
|
+
$('div.sidebar-collapse').addClass 'collapse'
|
34
|
+
else
|
35
|
+
$('div.sidebar-collapse').removeClass 'collapse'
|
36
|
+
return
|
37
|
+
|
13
38
|
# When clicking the order search button, toggle the form
|
14
39
|
$('a[rel=searchOrders]').on 'click', ->
|
15
|
-
$('div.
|
16
|
-
|
40
|
+
$('div.search-orders').toggleClass('hide')
|
41
|
+
|
17
42
|
# Add a new attribute to a table
|
18
43
|
$('a[data-behavior=addAttributeToAttributesTable]').on 'click', ->
|
19
44
|
table = $('table.productAttributes')
|
@@ -21,99 +46,104 @@ $ ->
|
|
21
46
|
template = $('tr.template', table).html()
|
22
47
|
table.append("<tr>#{template}</tr>")
|
23
48
|
false
|
24
|
-
|
49
|
+
|
25
50
|
# Remove an attribute from a table
|
26
|
-
$('table.productAttributes tbody').on 'click', 'tr td.remove a', ->
|
51
|
+
$('table.productAttributes tbody').on 'click', 'tr td.remove a', ->
|
27
52
|
$(this).parents('tr').remove()
|
28
53
|
false
|
29
|
-
|
54
|
+
|
30
55
|
# Sorting on the product attribtues table
|
31
56
|
$('table.productAttributes tbody').sortable
|
32
57
|
axis: 'y'
|
33
58
|
handle: '.handle'
|
34
59
|
cursor: 'move',
|
35
|
-
helper: (e,tr)->
|
60
|
+
helper: (e,tr) ->
|
36
61
|
originals = tr.children()
|
37
62
|
helper = tr.clone()
|
38
|
-
helper.children().each (index)->
|
63
|
+
helper.children().each (index) ->
|
39
64
|
$(this).width(originals.eq(index).width())
|
40
65
|
helper
|
41
|
-
|
42
|
-
# Chosen
|
43
|
-
$('select.chosen').chosen()
|
44
|
-
$('select.chosen-with-deselect').chosen({allow_single_deselect: true})
|
45
|
-
$('select.chosen-basic').chosen({disable_search_threshold:100})
|
46
|
-
|
47
|
-
# Printables
|
48
|
-
$('a[rel=print]').on 'click', ->
|
49
|
-
window.open($(this).attr('href'), 'despatchnote', 'width=700,height=800')
|
50
|
-
false
|
51
|
-
|
52
|
-
# Close dialog
|
53
|
-
$('body').on 'click', 'a[rel=closeDialog]', Nifty.Dialog.closeTopDialog
|
54
|
-
|
55
|
-
# Open AJAX dialogs
|
56
|
-
$('a[rel=dialog]').on 'click', ->
|
57
|
-
element = $(this)
|
58
|
-
options = {}
|
59
|
-
options.width = element.data('dialog-width') if element.data('dialog-width')
|
60
|
-
options.offset = element.data('dialog-offset') if element.data('dialog-offset')
|
61
|
-
options.behavior = element.data('dialog-behavior') if element.data('dialog-behavior')
|
62
|
-
options.id = 'ajax'
|
63
|
-
options.url = element.attr('href')
|
64
|
-
Nifty.Dialog.open(options)
|
65
|
-
false
|
66
|
-
|
67
|
-
# Format money values to 2 decimal places
|
68
|
-
$('div.moneyInput input').each formatMoneyField
|
69
|
-
$('body').on('blur', 'div.moneyInput input', formatMoneyField)
|
70
66
|
|
67
|
+
return
|
68
|
+
# $ ->
|
71
69
|
#
|
72
|
-
#
|
70
|
+
# # Automatically focus all fields with the 'focus' class
|
71
|
+
# $('input.focus').focus()
|
73
72
|
#
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
73
|
+
# # Chosen
|
74
|
+
# $('select.chosen').chosen()
|
75
|
+
# $('select.chosen-with-deselect').chosen({allow_single_deselect: true})
|
76
|
+
# $('select.chosen-basic').chosen({disable_search_threshold:100})
|
78
77
|
#
|
79
|
-
#
|
78
|
+
# # Printables
|
79
|
+
# $('a[rel=print]').on 'click', ->
|
80
|
+
# window.open($(this).attr('href'), 'despatchnote', 'width=700,height=800')
|
81
|
+
# false
|
80
82
|
#
|
81
|
-
|
82
|
-
|
83
|
-
onLoad: (dialog,options)->
|
84
|
-
$('input[type=text]:first', dialog).focus()
|
85
|
-
$(dialog).on 'submit', 'form', ->
|
86
|
-
form = $(this)
|
87
|
-
$.ajax
|
88
|
-
url: form.attr('action')
|
89
|
-
method: 'POST'
|
90
|
-
data: form.serialize()
|
91
|
-
dataType: 'text'
|
92
|
-
success: (data)->
|
93
|
-
$('div.table', dialog).replaceWith(data)
|
94
|
-
$('input[type=text]:first', dialog).focus()
|
95
|
-
error: (xhr)->
|
96
|
-
if xhr.status == 422
|
97
|
-
alert xhr.responseText
|
98
|
-
else
|
99
|
-
alert 'An error occurred while saving the stock level.'
|
100
|
-
false
|
101
|
-
$(dialog).on 'click', 'nav.pagination a', ->
|
102
|
-
$.ajax
|
103
|
-
url: $(this).attr('href')
|
104
|
-
success: (data)->
|
105
|
-
$('div.table', dialog).replaceWith(data)
|
106
|
-
false
|
107
|
-
|
83
|
+
# # Close dialog
|
84
|
+
# $('body').on 'click', 'a[rel=closeDialog]', Nifty.Dialog.closeTopDialog
|
108
85
|
#
|
109
|
-
#
|
86
|
+
# # Open AJAX dialogs
|
87
|
+
# $('a[rel=dialog]').on 'click', ->
|
88
|
+
# element = $(this)
|
89
|
+
# options = {}
|
90
|
+
# options.width = element.data('dialog-width') if element.data('dialog-width')
|
91
|
+
# options.offset = element.data('dialog-offset') if element.data('dialog-offset')
|
92
|
+
# options.behavior = element.data('dialog-behavior') if element.data('dialog-behavior')
|
93
|
+
# options.id = 'ajax'
|
94
|
+
# options.url = element.attr('href')
|
95
|
+
# Nifty.Dialog.open(options)
|
96
|
+
# false
|
110
97
|
#
|
111
|
-
|
112
|
-
|
98
|
+
# # Format money values to 2 decimal places
|
99
|
+
# $('div.moneyInput input').each formatMoneyField
|
100
|
+
# $('body').on('blur', 'div.moneyInput input', formatMoneyField)
|
101
|
+
#
|
102
|
+
# #
|
103
|
+
# # Format money values to 2 decimal places
|
104
|
+
# #
|
105
|
+
# window.formatMoneyField = ->
|
106
|
+
# value = $(this).val().replace /,/, ""
|
107
|
+
# $(this).val(parseFloat(value).toFixed(2)) if value.length
|
108
|
+
#
|
109
|
+
# #
|
110
|
+
# # Stock Level Adjustment dialog beavior
|
111
|
+
# #
|
112
|
+
# Nifty.Dialog.addBehavior
|
113
|
+
# name: 'stockLevelAdjustments'
|
114
|
+
# onLoad: (dialog,options)->
|
115
|
+
# $('input[type=text]:first', dialog).focus()
|
116
|
+
# $(dialog).on 'submit', 'form', ->
|
117
|
+
# form = $(this)
|
118
|
+
# $.ajax
|
119
|
+
# url: form.attr('action')
|
120
|
+
# method: 'POST'
|
121
|
+
# data: form.serialize()
|
122
|
+
# dataType: 'text'
|
123
|
+
# success: (data)->
|
124
|
+
# $('div.table', dialog).replaceWith(data)
|
125
|
+
# $('input[type=text]:first', dialog).focus()
|
126
|
+
# error: (xhr)->
|
127
|
+
# if xhr.status == 422
|
128
|
+
# alert xhr.responseText
|
129
|
+
# else
|
130
|
+
# alert 'An error occurred while saving the stock level.'
|
131
|
+
# false
|
132
|
+
# $(dialog).on 'click', 'nav.pagination a', ->
|
133
|
+
# $.ajax
|
134
|
+
# url: $(this).attr('href')
|
135
|
+
# success: (data)->
|
136
|
+
# $('div.table', dialog).replaceWith(data)
|
137
|
+
# false
|
113
138
|
#
|
114
|
-
#
|
139
|
+
# #
|
140
|
+
# # Always fire keyboard shortcuts when focused on fields
|
141
|
+
# #
|
142
|
+
# Mousetrap.stopCallback = -> false
|
115
143
|
#
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
144
|
+
# #
|
145
|
+
# # Close dialogs on escape
|
146
|
+
# #
|
147
|
+
# Mousetrap.bind 'escape', ->
|
148
|
+
# Nifty.Dialog.closeTopDialog()
|
149
|
+
# false
|
@@ -0,0 +1,182 @@
|
|
1
|
+
/*------------------------------------------------------
|
2
|
+
Author : www.webthemez.com
|
3
|
+
License: Commons Attribution 3.0
|
4
|
+
http://creativecommons.org/licenses/by/3.0/
|
5
|
+
--------------------------------------------------------- */
|
6
|
+
|
7
|
+
(function ($) {
|
8
|
+
"use strict";
|
9
|
+
var mainApp = {
|
10
|
+
|
11
|
+
initFunction: function () {
|
12
|
+
|
13
|
+
/* MORRIS BAR CHART
|
14
|
+
-----------------------------------------*/
|
15
|
+
Morris.Bar({
|
16
|
+
element: 'morris-bar-chart',
|
17
|
+
data: [{
|
18
|
+
y: '2006',
|
19
|
+
a: 100
|
20
|
+
}, {
|
21
|
+
y: '2007',
|
22
|
+
a: 75
|
23
|
+
}, {
|
24
|
+
y: '2008',
|
25
|
+
a: 50
|
26
|
+
}, {
|
27
|
+
y: '2009',
|
28
|
+
a: 75
|
29
|
+
}, {
|
30
|
+
y: '2010',
|
31
|
+
a: 50
|
32
|
+
}, {
|
33
|
+
y: '2011',
|
34
|
+
a: 75
|
35
|
+
}, {
|
36
|
+
y: '2012',
|
37
|
+
a: 100
|
38
|
+
}],
|
39
|
+
xkey: 'y',
|
40
|
+
ykeys: ['a'],
|
41
|
+
labels: ['Orders'],
|
42
|
+
hideHover: 'auto',
|
43
|
+
resize: true
|
44
|
+
});
|
45
|
+
|
46
|
+
/* MORRIS DONUT CHART
|
47
|
+
----------------------------------------*/
|
48
|
+
Morris.Donut({
|
49
|
+
element: 'morris-donut-chart',
|
50
|
+
data: [{
|
51
|
+
label: "Download Sales",
|
52
|
+
value: 12
|
53
|
+
}, {
|
54
|
+
label: "In-Store Sales",
|
55
|
+
value: 30
|
56
|
+
}, {
|
57
|
+
label: "Mail-Order Sales",
|
58
|
+
value: 20
|
59
|
+
}],
|
60
|
+
resize: true
|
61
|
+
});
|
62
|
+
|
63
|
+
/* MORRIS AREA CHART
|
64
|
+
----------------------------------------*/
|
65
|
+
|
66
|
+
// Morris.Area({
|
67
|
+
// element: 'morris-area-chart',
|
68
|
+
// data: [{
|
69
|
+
// period: '2010 Q1',
|
70
|
+
// iphone: 2666,
|
71
|
+
// ipad: null,
|
72
|
+
// itouch: 2647
|
73
|
+
// }, {
|
74
|
+
// period: '2010 Q2',
|
75
|
+
// iphone: 2778,
|
76
|
+
// ipad: 2294,
|
77
|
+
// itouch: 2441
|
78
|
+
// }, {
|
79
|
+
// period: '2010 Q3',
|
80
|
+
// iphone: 4912,
|
81
|
+
// ipad: 1969,
|
82
|
+
// itouch: 2501
|
83
|
+
// }, {
|
84
|
+
// period: '2010 Q4',
|
85
|
+
// iphone: 3767,
|
86
|
+
// ipad: 3597,
|
87
|
+
// itouch: 5689
|
88
|
+
// }, {
|
89
|
+
// period: '2011 Q1',
|
90
|
+
// iphone: 6810,
|
91
|
+
// ipad: 1914,
|
92
|
+
// itouch: 2293
|
93
|
+
// }, {
|
94
|
+
// period: '2011 Q2',
|
95
|
+
// iphone: 5670,
|
96
|
+
// ipad: 4293,
|
97
|
+
// itouch: 1881
|
98
|
+
// }, {
|
99
|
+
// period: '2011 Q3',
|
100
|
+
// iphone: 4820,
|
101
|
+
// ipad: 3795,
|
102
|
+
// itouch: 1588
|
103
|
+
// }, {
|
104
|
+
// period: '2011 Q4',
|
105
|
+
// iphone: 15073,
|
106
|
+
// ipad: 5967,
|
107
|
+
// itouch: 5175
|
108
|
+
// }, {
|
109
|
+
// period: '2012 Q1',
|
110
|
+
// iphone: 10687,
|
111
|
+
// ipad: 4460,
|
112
|
+
// itouch: 2028
|
113
|
+
// }, {
|
114
|
+
// period: '2012 Q2',
|
115
|
+
// iphone: 8432,
|
116
|
+
// ipad: 5713,
|
117
|
+
// itouch: 1791
|
118
|
+
// }],
|
119
|
+
// xkey: 'period',
|
120
|
+
// ykeys: ['iphone', 'ipad', 'itouch'],
|
121
|
+
// labels: ['iPhone', 'iPad', 'iPod Touch'],
|
122
|
+
// pointSize: 2,
|
123
|
+
// hideHover: 'auto',
|
124
|
+
// resize: true
|
125
|
+
// });
|
126
|
+
//
|
127
|
+
// /* MORRIS LINE CHART
|
128
|
+
// ----------------------------------------*/
|
129
|
+
// Morris.Line({
|
130
|
+
// element: 'morris-line-chart',
|
131
|
+
// data: [{
|
132
|
+
// y: '2006',
|
133
|
+
// a: 100,
|
134
|
+
// b: 90
|
135
|
+
// }, {
|
136
|
+
// y: '2007',
|
137
|
+
// a: 75,
|
138
|
+
// b: 65
|
139
|
+
// }, {
|
140
|
+
// y: '2008',
|
141
|
+
// a: 50,
|
142
|
+
// b: 40
|
143
|
+
// }, {
|
144
|
+
// y: '2009',
|
145
|
+
// a: 75,
|
146
|
+
// b: 65
|
147
|
+
// }, {
|
148
|
+
// y: '2010',
|
149
|
+
// a: 50,
|
150
|
+
// b: 40
|
151
|
+
// }, {
|
152
|
+
// y: '2011',
|
153
|
+
// a: 75,
|
154
|
+
// b: 65
|
155
|
+
// }, {
|
156
|
+
// y: '2012',
|
157
|
+
// a: 100,
|
158
|
+
// b: 90
|
159
|
+
// }],
|
160
|
+
// xkey: 'y',
|
161
|
+
// ykeys: ['a', 'b'],
|
162
|
+
// labels: ['Series A', 'Series B'],
|
163
|
+
// hideHover: 'auto',
|
164
|
+
// resize: true
|
165
|
+
// });
|
166
|
+
|
167
|
+
|
168
|
+
},
|
169
|
+
|
170
|
+
initialization: function () {
|
171
|
+
mainApp.initFunction();
|
172
|
+
|
173
|
+
}
|
174
|
+
|
175
|
+
};
|
176
|
+
// Initializing ///
|
177
|
+
|
178
|
+
$(document).ready(function () {
|
179
|
+
mainApp.initFunction();
|
180
|
+
});
|
181
|
+
|
182
|
+
}(jQuery));
|
@@ -0,0 +1,200 @@
|
|
1
|
+
/*------------------------------------------------------
|
2
|
+
Author : www.webthemez.com
|
3
|
+
License: Commons Attribution 3.0
|
4
|
+
http://creativecommons.org/licenses/by/3.0/
|
5
|
+
--------------------------------------------------------- */
|
6
|
+
|
7
|
+
(function ($) {
|
8
|
+
"use strict";
|
9
|
+
var mainApp = {
|
10
|
+
|
11
|
+
initFunction: function () {
|
12
|
+
/*MENU
|
13
|
+
------------------------------------*/
|
14
|
+
$('#main-menu').metisMenu();
|
15
|
+
|
16
|
+
$(window).bind("load resize", function () {
|
17
|
+
if ($(this).width() < 768) {
|
18
|
+
$('div.sidebar-collapse').addClass('collapse')
|
19
|
+
} else {
|
20
|
+
$('div.sidebar-collapse').removeClass('collapse')
|
21
|
+
}
|
22
|
+
});
|
23
|
+
|
24
|
+
/* MORRIS BAR CHART
|
25
|
+
-----------------------------------------*/
|
26
|
+
Morris.Bar({
|
27
|
+
element: 'morris-bar-chart',
|
28
|
+
data: [{
|
29
|
+
y: '2006',
|
30
|
+
a: 100,
|
31
|
+
b: 90
|
32
|
+
}, {
|
33
|
+
y: '2007',
|
34
|
+
a: 75,
|
35
|
+
b: 65
|
36
|
+
}, {
|
37
|
+
y: '2008',
|
38
|
+
a: 50,
|
39
|
+
b: 40
|
40
|
+
}, {
|
41
|
+
y: '2009',
|
42
|
+
a: 75,
|
43
|
+
b: 65
|
44
|
+
}, {
|
45
|
+
y: '2010',
|
46
|
+
a: 50,
|
47
|
+
b: 40
|
48
|
+
}, {
|
49
|
+
y: '2011',
|
50
|
+
a: 75,
|
51
|
+
b: 65
|
52
|
+
}, {
|
53
|
+
y: '2012',
|
54
|
+
a: 100,
|
55
|
+
b: 90
|
56
|
+
}],
|
57
|
+
xkey: 'y',
|
58
|
+
ykeys: ['a', 'b'],
|
59
|
+
labels: ['Series A', 'Series B'],
|
60
|
+
hideHover: 'auto',
|
61
|
+
resize: true
|
62
|
+
});
|
63
|
+
|
64
|
+
/* MORRIS DONUT CHART
|
65
|
+
----------------------------------------*/
|
66
|
+
Morris.Donut({
|
67
|
+
element: 'morris-donut-chart',
|
68
|
+
data: [{
|
69
|
+
label: "Download Sales",
|
70
|
+
value: 12
|
71
|
+
}, {
|
72
|
+
label: "In-Store Sales",
|
73
|
+
value: 30
|
74
|
+
}, {
|
75
|
+
label: "Mail-Order Sales",
|
76
|
+
value: 20
|
77
|
+
}],
|
78
|
+
resize: true
|
79
|
+
});
|
80
|
+
|
81
|
+
/* MORRIS AREA CHART
|
82
|
+
----------------------------------------*/
|
83
|
+
|
84
|
+
Morris.Area({
|
85
|
+
element: 'morris-area-chart',
|
86
|
+
data: [{
|
87
|
+
period: '2010 Q1',
|
88
|
+
iphone: 2666,
|
89
|
+
ipad: null,
|
90
|
+
itouch: 2647
|
91
|
+
}, {
|
92
|
+
period: '2010 Q2',
|
93
|
+
iphone: 2778,
|
94
|
+
ipad: 2294,
|
95
|
+
itouch: 2441
|
96
|
+
}, {
|
97
|
+
period: '2010 Q3',
|
98
|
+
iphone: 4912,
|
99
|
+
ipad: 1969,
|
100
|
+
itouch: 2501
|
101
|
+
}, {
|
102
|
+
period: '2010 Q4',
|
103
|
+
iphone: 3767,
|
104
|
+
ipad: 3597,
|
105
|
+
itouch: 5689
|
106
|
+
}, {
|
107
|
+
period: '2011 Q1',
|
108
|
+
iphone: 6810,
|
109
|
+
ipad: 1914,
|
110
|
+
itouch: 2293
|
111
|
+
}, {
|
112
|
+
period: '2011 Q2',
|
113
|
+
iphone: 5670,
|
114
|
+
ipad: 4293,
|
115
|
+
itouch: 1881
|
116
|
+
}, {
|
117
|
+
period: '2011 Q3',
|
118
|
+
iphone: 4820,
|
119
|
+
ipad: 3795,
|
120
|
+
itouch: 1588
|
121
|
+
}, {
|
122
|
+
period: '2011 Q4',
|
123
|
+
iphone: 15073,
|
124
|
+
ipad: 5967,
|
125
|
+
itouch: 5175
|
126
|
+
}, {
|
127
|
+
period: '2012 Q1',
|
128
|
+
iphone: 10687,
|
129
|
+
ipad: 4460,
|
130
|
+
itouch: 2028
|
131
|
+
}, {
|
132
|
+
period: '2012 Q2',
|
133
|
+
iphone: 8432,
|
134
|
+
ipad: 5713,
|
135
|
+
itouch: 1791
|
136
|
+
}],
|
137
|
+
xkey: 'period',
|
138
|
+
ykeys: ['iphone', 'ipad', 'itouch'],
|
139
|
+
labels: ['iPhone', 'iPad', 'iPod Touch'],
|
140
|
+
pointSize: 2,
|
141
|
+
hideHover: 'auto',
|
142
|
+
resize: true
|
143
|
+
});
|
144
|
+
|
145
|
+
/* MORRIS LINE CHART
|
146
|
+
----------------------------------------*/
|
147
|
+
Morris.Line({
|
148
|
+
element: 'morris-line-chart',
|
149
|
+
data: [{
|
150
|
+
y: '2006',
|
151
|
+
a: 100,
|
152
|
+
b: 90
|
153
|
+
}, {
|
154
|
+
y: '2007',
|
155
|
+
a: 75,
|
156
|
+
b: 65
|
157
|
+
}, {
|
158
|
+
y: '2008',
|
159
|
+
a: 50,
|
160
|
+
b: 40
|
161
|
+
}, {
|
162
|
+
y: '2009',
|
163
|
+
a: 75,
|
164
|
+
b: 65
|
165
|
+
}, {
|
166
|
+
y: '2010',
|
167
|
+
a: 50,
|
168
|
+
b: 40
|
169
|
+
}, {
|
170
|
+
y: '2011',
|
171
|
+
a: 75,
|
172
|
+
b: 65
|
173
|
+
}, {
|
174
|
+
y: '2012',
|
175
|
+
a: 100,
|
176
|
+
b: 90
|
177
|
+
}],
|
178
|
+
xkey: 'y',
|
179
|
+
ykeys: ['a', 'b'],
|
180
|
+
labels: ['Series A', 'Series B'],
|
181
|
+
hideHover: 'auto',
|
182
|
+
resize: true
|
183
|
+
});
|
184
|
+
|
185
|
+
|
186
|
+
},
|
187
|
+
|
188
|
+
initialization: function () {
|
189
|
+
mainApp.initFunction();
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
}
|
194
|
+
// Initializing ///
|
195
|
+
|
196
|
+
$(document).ready(function () {
|
197
|
+
mainApp.initFunction();
|
198
|
+
});
|
199
|
+
|
200
|
+
}(jQuery));
|
@@ -0,0 +1,45 @@
|
|
1
|
+
;(function ($, window, document, undefined) {
|
2
|
+
|
3
|
+
var pluginName = "metisMenu",
|
4
|
+
defaults = {
|
5
|
+
toggle: true
|
6
|
+
};
|
7
|
+
|
8
|
+
function Plugin(element, options) {
|
9
|
+
this.element = element;
|
10
|
+
this.settings = $.extend({}, defaults, options);
|
11
|
+
this._defaults = defaults;
|
12
|
+
this._name = pluginName;
|
13
|
+
this.init();
|
14
|
+
}
|
15
|
+
|
16
|
+
Plugin.prototype = {
|
17
|
+
init: function () {
|
18
|
+
|
19
|
+
var $this = $(this.element),
|
20
|
+
$toggle = this.settings.toggle;
|
21
|
+
|
22
|
+
$this.find('li.active').has('ul').children('ul').addClass('collapse in');
|
23
|
+
$this.find('li').not('.active').has('ul').children('ul').addClass('collapse');
|
24
|
+
|
25
|
+
$this.find('li').has('ul').children('a').on('click', function (e) {
|
26
|
+
e.preventDefault();
|
27
|
+
|
28
|
+
$(this).parent('li').toggleClass('active').children('ul').collapse('toggle');
|
29
|
+
|
30
|
+
if ($toggle) {
|
31
|
+
$(this).parent('li').siblings().removeClass('active').children('ul.in').collapse('hide');
|
32
|
+
}
|
33
|
+
});
|
34
|
+
}
|
35
|
+
};
|
36
|
+
|
37
|
+
$.fn[ pluginName ] = function (options) {
|
38
|
+
return this.each(function () {
|
39
|
+
if (!$.data(this, "plugin_" + pluginName)) {
|
40
|
+
$.data(this, "plugin_" + pluginName, new Plugin(this, options));
|
41
|
+
}
|
42
|
+
});
|
43
|
+
};
|
44
|
+
|
45
|
+
})(jQuery, window, document);
|