vyapari 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +49 -0
- data/Rakefile +37 -0
- data/app/assets/config/vyapari_manifest.js +2 -0
- data/app/assets/javascripts/vyapari/application.js +13 -0
- data/app/assets/stylesheets/vyapari/application.css +15 -0
- data/app/controllers/vyapari/admin/base_controller.rb +17 -0
- data/app/controllers/vyapari/admin/countries_controller.rb +64 -0
- data/app/controllers/vyapari/admin/dashboard_controller.rb +26 -0
- data/app/controllers/vyapari/admin/exchange_rates_controller.rb +70 -0
- data/app/controllers/vyapari/admin/regions_controller.rb +67 -0
- data/app/controllers/vyapari/admin/resource_controller.rb +15 -0
- data/app/controllers/vyapari/admin/users_controller.rb +130 -0
- data/app/controllers/vyapari/application_controller.rb +13 -0
- data/app/helpers/vyapari/application_helper.rb +4 -0
- data/app/jobs/vyapari/application_job.rb +4 -0
- data/app/mailers/vyapari/application_mailer.rb +6 -0
- data/app/models/brand.rb +114 -0
- data/app/models/category.rb +116 -0
- data/app/models/country.rb +45 -0
- data/app/models/exchange_rate.rb +38 -0
- data/app/models/product.rb +139 -0
- data/app/models/region.rb +58 -0
- data/app/models/vyapari/application_record.rb +6 -0
- data/app/views/layouts/kuppayam/_footer.html.erb +25 -0
- data/app/views/layouts/kuppayam/_header.html.erb +43 -0
- data/app/views/layouts/kuppayam/_navbar.html.erb +55 -0
- data/app/views/layouts/kuppayam/_sidebar.html.erb +136 -0
- data/app/views/vyapari/admin/countries/_form.html.erb +24 -0
- data/app/views/vyapari/admin/countries/_index.html.erb +51 -0
- data/app/views/vyapari/admin/countries/_row.html.erb +26 -0
- data/app/views/vyapari/admin/countries/_show.html.erb +73 -0
- data/app/views/vyapari/admin/countries/index.html.erb +32 -0
- data/app/views/vyapari/admin/dashboard/index.html.erb +52 -0
- data/app/views/vyapari/admin/exchange_rates/_form.html.erb +28 -0
- data/app/views/vyapari/admin/exchange_rates/_index.html.erb +57 -0
- data/app/views/vyapari/admin/exchange_rates/_row.html.erb +30 -0
- data/app/views/vyapari/admin/exchange_rates/_show.html.erb +72 -0
- data/app/views/vyapari/admin/exchange_rates/index.html.erb +32 -0
- data/app/views/vyapari/admin/regions/_form.html.erb +28 -0
- data/app/views/vyapari/admin/regions/_index.html.erb +54 -0
- data/app/views/vyapari/admin/regions/_row.html.erb +28 -0
- data/app/views/vyapari/admin/regions/_show.html.erb +74 -0
- data/app/views/vyapari/admin/regions/index.html.erb +32 -0
- data/app/views/vyapari/admin/users/_form.html.erb +39 -0
- data/app/views/vyapari/admin/users/_index.html.erb +101 -0
- data/app/views/vyapari/admin/users/_row.html.erb +72 -0
- data/app/views/vyapari/admin/users/_show.html.erb +199 -0
- data/app/views/vyapari/admin/users/index.html.erb +64 -0
- data/config/routes.rb +28 -0
- data/db/migrate/20170000000200_create_exchange_rates.rb +16 -0
- data/db/migrate/20170000000201_create_countries.rb +12 -0
- data/db/migrate/20170000000202_create_regions.rb +16 -0
- data/lib/tasks/vyapari_tasks.rake +4 -0
- data/lib/vyapari/engine.rb +20 -0
- data/lib/vyapari/version.rb +3 -0
- data/lib/vyapari.rb +5 -0
- metadata +401 -0
@@ -0,0 +1,116 @@
|
|
1
|
+
class Category < Vyapari::ApplicationRecord
|
2
|
+
|
3
|
+
# Constants
|
4
|
+
PUBLISHED = "published"
|
5
|
+
UNPUBLISHED = "unpublished"
|
6
|
+
REMOVED = "removed"
|
7
|
+
|
8
|
+
STATUS_HASH = {"Published" => PUBLISHED, "Unpublished" => UNPUBLISHED, "Removed" => REMOVED}
|
9
|
+
STATUS_HASH_REVERSE = {PUBLISHED => "Published", UNPUBLISHED => "Unpublished", REMOVED => "Removed"}
|
10
|
+
|
11
|
+
FEATURED_HASH = {"Featured" => true, "Non Featured" => false}
|
12
|
+
FEATURED_HASH_REVERSE = {true => "Featured", false => "Non Featured"}
|
13
|
+
|
14
|
+
# Callbacks
|
15
|
+
before_validation :update_permalink
|
16
|
+
|
17
|
+
# Validations
|
18
|
+
extend PoodleValidators
|
19
|
+
validates :name, presence: true
|
20
|
+
validates :one_liner, presence: false
|
21
|
+
validates :status, :presence=> true, :inclusion => {:in => STATUS_HASH_REVERSE.keys, :presence_of => :status, :message => "%{value} is not a valid status" }
|
22
|
+
|
23
|
+
# Associations
|
24
|
+
has_many :products
|
25
|
+
belongs_to :parent, :class_name => 'Category', optional: true
|
26
|
+
has_many :sub_categories, :foreign_key => "parent_id", :class_name => "Category"
|
27
|
+
has_one :category_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::CategoryImage"
|
28
|
+
|
29
|
+
# return an active record relation object with the search query in its where clause
|
30
|
+
# Return the ActiveRecord::Relation object
|
31
|
+
# == Examples
|
32
|
+
# >>> object.search(query)
|
33
|
+
# => ActiveRecord::Relation object
|
34
|
+
scope :search, lambda {|query| where("LOWER(name) LIKE LOWER('%#{query}%') OR\
|
35
|
+
LOWER(permalink) LIKE LOWER('%#{query}%') OR\
|
36
|
+
LOWER(one_liner) LIKE LOWER('%#{query}%') OR\
|
37
|
+
LOWER(description) LIKE LOWER('%#{query}%')")
|
38
|
+
}
|
39
|
+
|
40
|
+
scope :status, lambda { |status| where("LOWER(status)='#{status}'") }
|
41
|
+
scope :featured, lambda { |val| where(featured: val) }
|
42
|
+
|
43
|
+
scope :published, -> { where(status: PUBLISHED) }
|
44
|
+
scope :unpublished, -> { where(status: UNPUBLISHED) }
|
45
|
+
scope :removed, -> { where(status: REMOVED) }
|
46
|
+
|
47
|
+
# ------------------
|
48
|
+
# Instance variables
|
49
|
+
# ------------------
|
50
|
+
|
51
|
+
# * Return true if the category is published, else false.
|
52
|
+
# == Examples
|
53
|
+
# >>> category.published?
|
54
|
+
# => true
|
55
|
+
def published?
|
56
|
+
(status == PUBLISHED)
|
57
|
+
end
|
58
|
+
|
59
|
+
# change the status to :published
|
60
|
+
# Return the status
|
61
|
+
# == Examples
|
62
|
+
# >>> category.publish!
|
63
|
+
# => "published"
|
64
|
+
def publish!
|
65
|
+
self.update_attribute(:status, PUBLISHED)
|
66
|
+
end
|
67
|
+
|
68
|
+
# * Return true if the category is unpublished, else false.
|
69
|
+
# == Examples
|
70
|
+
# >>> category.unpublished?
|
71
|
+
# => true
|
72
|
+
def unpublished?
|
73
|
+
(status == UNPUBLISHED)
|
74
|
+
end
|
75
|
+
|
76
|
+
# change the status to :unpublished
|
77
|
+
# Return the status
|
78
|
+
# == Examples
|
79
|
+
# >>> category.unpublish!
|
80
|
+
# => "unpublished"
|
81
|
+
def unpublish!
|
82
|
+
self.update_attribute(:status, UNPUBLISHED)
|
83
|
+
end
|
84
|
+
|
85
|
+
# * Return true if the category is removed, else false.
|
86
|
+
# == Examples
|
87
|
+
# >>> category.removed?
|
88
|
+
# => true
|
89
|
+
def removed?
|
90
|
+
(status == REMOVED)
|
91
|
+
end
|
92
|
+
|
93
|
+
# change the status to :removed
|
94
|
+
# Return the status
|
95
|
+
# == Examples
|
96
|
+
# >>> category.remove!
|
97
|
+
# => "removed"
|
98
|
+
def remove!
|
99
|
+
self.update_attribute(:status, REMOVED)
|
100
|
+
end
|
101
|
+
|
102
|
+
def default_image_url(size="medium")
|
103
|
+
"/assets/defaults/category-#{size}.png"
|
104
|
+
end
|
105
|
+
|
106
|
+
def display_name
|
107
|
+
self.name
|
108
|
+
end
|
109
|
+
|
110
|
+
protected
|
111
|
+
|
112
|
+
def update_permalink
|
113
|
+
self.permalink = "#{self.id}-#{name.parameterize}"
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
class Country < Vyapari::ApplicationRecord
|
2
|
+
|
3
|
+
DELETE_MESSAGE = "Cannot delete the country. You should first remove all the cities and exchange rates associated with this country."
|
4
|
+
|
5
|
+
# Validations
|
6
|
+
validates :name, presence: true, length: {minimum: 2, maximum: 250}, allow_blank: false
|
7
|
+
validates :code, presence: true, uniqueness: true, length: {minimum: 2, maximum: 32}, allow_blank: false
|
8
|
+
|
9
|
+
# Associations
|
10
|
+
has_many :regions
|
11
|
+
has_many :exchange_rates
|
12
|
+
|
13
|
+
# ------------------
|
14
|
+
# Class Methods
|
15
|
+
# ------------------
|
16
|
+
|
17
|
+
# return an active record relation object with the search query in its where clause
|
18
|
+
# Return the ActiveRecord::Relation object
|
19
|
+
# == Examples
|
20
|
+
# >>> obj.search(query)
|
21
|
+
# => ActiveRecord::Relation object
|
22
|
+
scope :search, lambda {|query| where("LOWER(countries.name) LIKE LOWER('%#{query}%')")}
|
23
|
+
|
24
|
+
# ------------------
|
25
|
+
# Instance Methods
|
26
|
+
# ------------------
|
27
|
+
|
28
|
+
def display_name
|
29
|
+
self.name_was
|
30
|
+
end
|
31
|
+
|
32
|
+
def can_be_edited?
|
33
|
+
true
|
34
|
+
end
|
35
|
+
|
36
|
+
def can_be_deleted?
|
37
|
+
if self.regions.any? || self.exchange_rates.any?
|
38
|
+
self.errors.add(:base, DELETE_MESSAGE)
|
39
|
+
return false
|
40
|
+
else
|
41
|
+
return true
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
class ExchangeRate < Vyapari::ApplicationRecord
|
2
|
+
|
3
|
+
# Validations
|
4
|
+
validates :currency_name, presence: true, length: {minimum: 2, maximum: 4}, allow_blank: false
|
5
|
+
validates :value, presence: true
|
6
|
+
validates :effective_date, presence: true
|
7
|
+
|
8
|
+
# Associations
|
9
|
+
belongs_to :country
|
10
|
+
|
11
|
+
# ------------------
|
12
|
+
# Class Methods
|
13
|
+
# ------------------
|
14
|
+
|
15
|
+
# return an active record relation object with the search query in its where clause
|
16
|
+
# Return the ActiveRecord::Relation object
|
17
|
+
# == Examples
|
18
|
+
# >>> obj.search(query)
|
19
|
+
# => ActiveRecord::Relation object
|
20
|
+
scope :search, lambda {|query| joins(:country).where("LOWER(exchange_rates.currency_name) LIKE LOWER('%#{query}%') OR LOWER(countries.name) LIKE LOWER('%#{query}%')")}
|
21
|
+
|
22
|
+
# ------------------
|
23
|
+
# Instance Methods
|
24
|
+
# ------------------
|
25
|
+
|
26
|
+
def display_name
|
27
|
+
"#{self.currency_name_was}, #{self.country.try(:name)}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def can_be_edited?
|
31
|
+
return true
|
32
|
+
end
|
33
|
+
|
34
|
+
def can_be_deleted?
|
35
|
+
return true
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
class Product < Vyapari::ApplicationRecord
|
2
|
+
|
3
|
+
# Constants
|
4
|
+
PUBLISHED = "published"
|
5
|
+
UNPUBLISHED = "unpublished"
|
6
|
+
REMOVED = "removed"
|
7
|
+
STATUS_HASH = {"Published" => PUBLISHED, "Unpublished" => UNPUBLISHED, "Removed" => REMOVED}
|
8
|
+
STATUS_HASH_REVERSE = {PUBLISHED => "Published", UNPUBLISHED => "Unpublished", REMOVED => "Removed"}
|
9
|
+
|
10
|
+
FEATURED_HASH = {"Featured" => true, "Non Featured" => false}
|
11
|
+
FEATURED_HASH_REVERSE = {true => "Featured", false => "Non Featured"}
|
12
|
+
|
13
|
+
# Callbacks
|
14
|
+
before_validation :update_permalink
|
15
|
+
before_validation :update_top_category
|
16
|
+
|
17
|
+
# Validations
|
18
|
+
validates :name, presence: true
|
19
|
+
#validates :description, presence: true
|
20
|
+
validates :permalink, presence: true, uniqueness: true
|
21
|
+
validates :status, :presence=> true, :inclusion => {:in => STATUS_HASH_REVERSE.keys, :presence_of => :status, :message => "%{value} is not a valid status" }
|
22
|
+
|
23
|
+
# Associations
|
24
|
+
has_one :product_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::ProductImage"
|
25
|
+
has_one :brochure, :as => :documentable, :dependent => :destroy, :class_name => "Document::Brochure"
|
26
|
+
|
27
|
+
belongs_to :brand
|
28
|
+
belongs_to :category
|
29
|
+
belongs_to :top_category, class_name: "Category"
|
30
|
+
|
31
|
+
# return an active record relation object with the search query in its where clause
|
32
|
+
# Return the ActiveRecord::Relation object
|
33
|
+
# == Examples
|
34
|
+
# >>> object.search(query)
|
35
|
+
# => ActiveRecord::Relation object
|
36
|
+
scope :search, lambda {|query| joins("INNER JOIN categories on categories.id = products.category_id").
|
37
|
+
where("LOWER(products.name) LIKE LOWER('%#{query}%') OR\
|
38
|
+
LOWER(products.permalink) LIKE LOWER('%#{query}%') OR\
|
39
|
+
LOWER(products.one_liner) LIKE LOWER('%#{query}%') OR\
|
40
|
+
LOWER(products.description) LIKE LOWER('%#{query}%') OR\
|
41
|
+
LOWER(categories.name) LIKE LOWER('%#{query}%') OR\
|
42
|
+
LOWER(categories.one_liner) LIKE LOWER('%#{query}%') OR\
|
43
|
+
LOWER(categories.description) LIKE LOWER('%#{query}%')")
|
44
|
+
}
|
45
|
+
|
46
|
+
scope :status, lambda { |status| where("LOWER(status)='#{status}'") }
|
47
|
+
scope :featured, lambda { |val| where(featured: val) }
|
48
|
+
|
49
|
+
scope :published, -> { where(status: PUBLISHED) }
|
50
|
+
scope :unpublished, -> { where(status: UNPUBLISHED) }
|
51
|
+
scope :removed, -> { where(status: REMOVED) }
|
52
|
+
|
53
|
+
# ------------------
|
54
|
+
# Instance variables
|
55
|
+
# ------------------
|
56
|
+
|
57
|
+
# * Return true if the brand is published, else false.
|
58
|
+
# == Examples
|
59
|
+
# >>> brand.published?
|
60
|
+
# => true
|
61
|
+
def published?
|
62
|
+
(status == PUBLISHED)
|
63
|
+
end
|
64
|
+
|
65
|
+
# change the status to :published
|
66
|
+
# Return the status
|
67
|
+
# == Examples
|
68
|
+
# >>> brand.publish!
|
69
|
+
# => "published"
|
70
|
+
def publish!
|
71
|
+
self.update_attribute(:status, PUBLISHED)
|
72
|
+
end
|
73
|
+
|
74
|
+
# * Return true if the brand is unpublished, else false.
|
75
|
+
# == Examples
|
76
|
+
# >>> brand.unpublished?
|
77
|
+
# => true
|
78
|
+
def unpublished?
|
79
|
+
(status == UNPUBLISHED)
|
80
|
+
end
|
81
|
+
|
82
|
+
# change the status to :unpublished
|
83
|
+
# Return the status
|
84
|
+
# == Examples
|
85
|
+
# >>> brand.unpublish!
|
86
|
+
# => "unpublished"
|
87
|
+
def unpublish!
|
88
|
+
self.update_attributes(status: UNPUBLISHED, featured: false)
|
89
|
+
end
|
90
|
+
|
91
|
+
# * Return true if the brand is removed, else false.
|
92
|
+
# == Examples
|
93
|
+
# >>> brand.removed?
|
94
|
+
# => true
|
95
|
+
def removed?
|
96
|
+
(status == REMOVED)
|
97
|
+
end
|
98
|
+
|
99
|
+
# change the status to :removed
|
100
|
+
# Return the status
|
101
|
+
# == Examples
|
102
|
+
# >>> brand.remove!
|
103
|
+
# => "removed"
|
104
|
+
def remove!
|
105
|
+
self.update_attributes(status: REMOVED, featured: false)
|
106
|
+
end
|
107
|
+
|
108
|
+
# TODO
|
109
|
+
def can_be_deleted?
|
110
|
+
#if self.jobs.any?
|
111
|
+
# self.errors.add(:base, DELETE_MESSAGE)
|
112
|
+
# return false
|
113
|
+
#else
|
114
|
+
# return true
|
115
|
+
#end
|
116
|
+
return true
|
117
|
+
end
|
118
|
+
|
119
|
+
def default_image_url(size="medium")
|
120
|
+
"/assets/defaults/product-#{size}.png"
|
121
|
+
end
|
122
|
+
|
123
|
+
protected
|
124
|
+
|
125
|
+
def update_top_category
|
126
|
+
if self.category
|
127
|
+
if self.category.parent
|
128
|
+
self.top_category = self.category.parent
|
129
|
+
else
|
130
|
+
self.top_category = self.category
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def update_permalink
|
136
|
+
self.permalink = "#{id}-#{name.parameterize}" if self.permalink.blank?
|
137
|
+
end
|
138
|
+
|
139
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
class Region < Vyapari::ApplicationRecord
|
2
|
+
|
3
|
+
DELETE_MESSAGE = "Cannot delete this Region. You should first delete all the dependant data like Company Cities, Jobs, Budgets etc tagged with this Region"
|
4
|
+
|
5
|
+
# Validations
|
6
|
+
validates :name, presence: true, length: {minimum: 2, maximum: 250}, allow_blank: false
|
7
|
+
validates :code, presence: true, uniqueness: true, length: {minimum: 2, maximum: 32}, allow_blank: false
|
8
|
+
validates :country, presence: true
|
9
|
+
|
10
|
+
# Associations
|
11
|
+
belongs_to :country
|
12
|
+
# has_many :stores
|
13
|
+
|
14
|
+
# ------------------
|
15
|
+
# Class Methods
|
16
|
+
# ------------------
|
17
|
+
|
18
|
+
# return an active record relation object with the search query in its where clause
|
19
|
+
# Return the ActiveRecord::Relation object
|
20
|
+
# == Examples
|
21
|
+
# >>> obj.search(query)
|
22
|
+
# => ActiveRecord::Relation object
|
23
|
+
scope :search, lambda {|query| joins(:country).where("LOWER(cities.name) LIKE LOWER('%#{query}%') OR LOWER(countries.name) LIKE LOWER('%#{query}%')")}
|
24
|
+
|
25
|
+
# ------------------
|
26
|
+
# Instance Methods
|
27
|
+
# ------------------
|
28
|
+
|
29
|
+
def display_name
|
30
|
+
if self.country
|
31
|
+
"#{self.name_was}, #{self.country.name}"
|
32
|
+
else
|
33
|
+
self.name
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def can_be_edited?
|
38
|
+
true
|
39
|
+
end
|
40
|
+
|
41
|
+
def can_be_deleted?
|
42
|
+
# if self.stores.any?
|
43
|
+
# self.errors.add(:base, DELETE_MESSAGE)
|
44
|
+
# return false
|
45
|
+
# else
|
46
|
+
# return true
|
47
|
+
# end
|
48
|
+
return true
|
49
|
+
end
|
50
|
+
|
51
|
+
def report_heading
|
52
|
+
rh = []
|
53
|
+
rh << self.company.try(:name) if self.company.name
|
54
|
+
rh << self.display_name
|
55
|
+
rh.join(", ")
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<footer class="main-footer sticky footer-type-1">
|
2
|
+
|
3
|
+
<div class="footer-inner">
|
4
|
+
|
5
|
+
<!-- Add your copyright text here -->
|
6
|
+
<div class="footer-text">
|
7
|
+
© 2017
|
8
|
+
<strong>Kuppayam</strong>
|
9
|
+
|
10
|
+
All rights reserved. <br>developed, maintained and hosted by <a href="http://rightsolutions.io" target="_blank" style="color:red">Right Solutions</a>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
|
14
|
+
<!-- Go to Top Link, just add rel="go-top" to any link to add this functionality -->
|
15
|
+
<div class="go-up">
|
16
|
+
|
17
|
+
<a href="#" rel="go-top">
|
18
|
+
<i class="fa-angle-up"></i>
|
19
|
+
</a>
|
20
|
+
|
21
|
+
</div>
|
22
|
+
|
23
|
+
</div>
|
24
|
+
|
25
|
+
</footer>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<div class="top-bar">
|
2
|
+
<div class="top-bar-left">
|
3
|
+
<ul class="dropdown menu" data-dropdown-menu>
|
4
|
+
<li class="menu-text">Site Title</li>
|
5
|
+
<li>
|
6
|
+
<a href="#">One</a>
|
7
|
+
<ul class="menu vertical">
|
8
|
+
<li><a href="#">One</a></li>
|
9
|
+
<li><a href="#">Two</a></li>
|
10
|
+
<li><a href="#">Three</a></li>
|
11
|
+
</ul>
|
12
|
+
</li>
|
13
|
+
<li><a href="#">Two</a></li>
|
14
|
+
<li><a href="#">Three</a></li>
|
15
|
+
</ul>
|
16
|
+
</div>
|
17
|
+
<div class="top-bar-right">
|
18
|
+
<ul class="menu">
|
19
|
+
<li><input type="search" placeholder="Search"></li>
|
20
|
+
<li><button type="button" class="button">Search</button></li>
|
21
|
+
</ul>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="header mb-40">
|
26
|
+
|
27
|
+
<div class="visible-xs pull-left mt-10">
|
28
|
+
<a href="#menu-toggle" class="btn btn-default" id="menu-toggle"><i class="fa fa-list"></i></a>
|
29
|
+
<%#= theme_button('', 'list', "#menu-toggle", btn_type: "default", id: "menu-toggle", classes: "") %>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="pull-right mt-10">
|
33
|
+
<% if @current_user %>
|
34
|
+
<span style="color:#898989;">Welcome</span> <span style="color:#4b4b4b;"><%= @current_user.name %></span>
|
35
|
+
|
|
36
|
+
<%= link_to raw("Sign Out"), usman.sign_out_path, method: :delete %>
|
37
|
+
<% else %>
|
38
|
+
<%= link_to raw("Sign In"), "#" %>
|
39
|
+
<% end %>
|
40
|
+
</div>
|
41
|
+
<div class="cl-10"></div>
|
42
|
+
</div>
|
43
|
+
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<nav class="navbar user-info-navbar" role="navigation"><!-- User Info, Notifications and Menu Bar -->
|
2
|
+
|
3
|
+
<!-- Left links for user info navbar -->
|
4
|
+
<ul class="user-info-menu left-links list-inline list-unstyled">
|
5
|
+
|
6
|
+
<li class="hidden-sm hidden-xs">
|
7
|
+
<a href="#" data-toggle="sidebar">
|
8
|
+
<i class="fa-bars"></i>
|
9
|
+
</a>
|
10
|
+
</li>
|
11
|
+
|
12
|
+
</ul>
|
13
|
+
|
14
|
+
<!-- Right links for user info navbar -->
|
15
|
+
<ul class="user-info-menu right-links list-inline list-unstyled">
|
16
|
+
<li class="dropdown user-profile">
|
17
|
+
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
18
|
+
|
19
|
+
<%= display_image(@current_user, "profile_picture.image.small.url", width: "32", height: "auto", class: "img-circle img-inline userpic-32", alt: @current_user.display_name) %>
|
20
|
+
|
21
|
+
<span>
|
22
|
+
<%= @current_user.display_name %>
|
23
|
+
<i class="fa-angle-down"></i>
|
24
|
+
</span>
|
25
|
+
|
26
|
+
</a>
|
27
|
+
|
28
|
+
<ul class="dropdown-menu user-profile-menu list-unstyled">
|
29
|
+
<li>
|
30
|
+
<a href="#settings">
|
31
|
+
<i class="fa-wrench"></i>
|
32
|
+
Settings
|
33
|
+
</a>
|
34
|
+
</li>
|
35
|
+
<li>
|
36
|
+
<a href="#profile">
|
37
|
+
<i class="fa-user"></i>
|
38
|
+
Profile
|
39
|
+
</a>
|
40
|
+
</li>
|
41
|
+
<li>
|
42
|
+
<a href="#help">
|
43
|
+
<i class="fa-info"></i>
|
44
|
+
Help
|
45
|
+
</a>
|
46
|
+
</li>
|
47
|
+
<li class="last">
|
48
|
+
<%= link_to raw("<i class='fa-lock'></i>Sign Out"), usman.sign_out_path, method: :delete %>
|
49
|
+
</li>
|
50
|
+
</ul>
|
51
|
+
</li>
|
52
|
+
|
53
|
+
</ul>
|
54
|
+
|
55
|
+
</nav>
|
@@ -0,0 +1,136 @@
|
|
1
|
+
<div class="sidebar-menu toggle-others fixed collapsed">
|
2
|
+
|
3
|
+
<div class="sidebar-menu-inner">
|
4
|
+
|
5
|
+
<header class="logo-env">
|
6
|
+
|
7
|
+
<!-- logo -->
|
8
|
+
<div class="logo">
|
9
|
+
<a href="/" class="logo-expanded">
|
10
|
+
<img src="/assets/kuppayam/logo.png" width="180" alt="" />
|
11
|
+
</a>
|
12
|
+
|
13
|
+
<a href="/" class="logo-collapsed">
|
14
|
+
<img src="/assets/kuppayam/logo.png" width="40" alt="" />
|
15
|
+
</a>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<!-- This will toggle the mobile menu and will be visible only on mobile devices -->
|
19
|
+
<div class="mobile-menu-toggle visible-xs">
|
20
|
+
<a href="#" data-toggle="user-info-menu">
|
21
|
+
<i class="fa-bell-o"></i>
|
22
|
+
<span class="badge badge-success">7</span>
|
23
|
+
</a>
|
24
|
+
|
25
|
+
<a href="#" data-toggle="mobile-menu">
|
26
|
+
<i class="fa-bars"></i>
|
27
|
+
</a>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
</header>
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
<ul id="main-menu" class="main-menu">
|
35
|
+
|
36
|
+
<!-- add class "multiple-expanded" to allow multiple submenus to open -->
|
37
|
+
|
38
|
+
<!-- class "auto-inherit-active-class" will automatically add "active" class for parent elements who are marked already with class "active" -->
|
39
|
+
|
40
|
+
<li class="<%= nav_active?('admin/dashboard') ? 'active' : '' %>">
|
41
|
+
<%= link_to raw("<i class=\"linecons-desktop\"></i> <span class='title'>Dashboard</span>"), vyapari.admin_dashboard_url %>
|
42
|
+
</li>
|
43
|
+
|
44
|
+
<li class="">
|
45
|
+
<a href="/xenon/xenon-files/html/dashboard-1.html">
|
46
|
+
<i class="linecons-database"></i>
|
47
|
+
<span class="title">Configurations</span>
|
48
|
+
</a>
|
49
|
+
<ul>
|
50
|
+
|
51
|
+
<li class="<%= nav_class("admin/users") %>">
|
52
|
+
<%= link_to raw("<i class=\"linecons-user\"></i> <span class='title'>Manage Users</span>"), usman.admin_users_url %>
|
53
|
+
</li>
|
54
|
+
|
55
|
+
<li class="<%= nav_class("admin/users") %>">
|
56
|
+
<%= link_to raw("<i class=\"linecons-lock\"></i> <span class='title'>Manage Permissions</span>"), usman.admin_permissions_url %>
|
57
|
+
</li>
|
58
|
+
|
59
|
+
<li class="">
|
60
|
+
<%= link_to raw("<i class=\"linecons-diamond\"></i> <span class='title'>Features</span>"), usman.admin_features_url %>
|
61
|
+
</li>
|
62
|
+
|
63
|
+
<li class="">
|
64
|
+
<%= link_to raw("<i class=\"linecons-diamond\"></i> <span class='title'>Roles</span>"), usman.admin_roles_url %>
|
65
|
+
</li>
|
66
|
+
|
67
|
+
<li class="">
|
68
|
+
<%= link_to raw("<i class=\"linecons-database\"></i> <span class='title'>Countries</span>"), vyapari.admin_countries_url %>
|
69
|
+
</li>
|
70
|
+
|
71
|
+
<li class="">
|
72
|
+
<%= link_to raw("<i class=\"linecons-database\"></i> <span class='title'>Regions</span>"), vyapari.admin_regions_url %>
|
73
|
+
</li>
|
74
|
+
|
75
|
+
<li class="">
|
76
|
+
<%= link_to raw("<i class=\"linecons-database\"></i> <span class='title'>Exchange Rates</span>"), vyapari.admin_exchange_rates_url %>
|
77
|
+
</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
</li>
|
81
|
+
|
82
|
+
<li class="">
|
83
|
+
<a href="/xenon/xenon-files/html/dashboard-1.html">
|
84
|
+
<i class="linecons-database"></i>
|
85
|
+
<span class="title">Stock Management</span>
|
86
|
+
</a>
|
87
|
+
<ul>
|
88
|
+
<li class="">
|
89
|
+
<%= link_to raw("<i class=\"linecons-database\"></i> <span class='title'>Manage Suppliers</span>"), vyapari.admin_suppliers_url %>
|
90
|
+
</li>
|
91
|
+
|
92
|
+
<li class="">
|
93
|
+
<%= link_to raw("<i class=\"linecons-diamond\"></i> <span class='title'>Manage Stores</span>"), vyapari.admin_stores_url %>
|
94
|
+
</li>
|
95
|
+
|
96
|
+
<li class="">
|
97
|
+
<%= link_to raw("<i class=\"linecons-database\"></i> <span class='title'>Manage Brands</span>"), vyapari.admin_brands_url %>
|
98
|
+
</li>
|
99
|
+
|
100
|
+
<li class="">
|
101
|
+
<%= link_to raw("<i class=\"linecons-database\"></i> <span class='title'>Manage Categories</span>"), vyapari.admin_categories_url %>
|
102
|
+
</li>
|
103
|
+
|
104
|
+
</ul>
|
105
|
+
</li>
|
106
|
+
|
107
|
+
<li class="">
|
108
|
+
<a href="/xenon/xenon-files/html/dashboard-1.html">
|
109
|
+
<i class="linecons-database"></i>
|
110
|
+
<span class="title">POS</span>
|
111
|
+
</a>
|
112
|
+
<ul>
|
113
|
+
<li class="">
|
114
|
+
<%= link_to raw("<i class=\"linecons-database\"></i> <span class='title'>Manage Suppliers</span>"), vyapari.admin_suppliers_url %>
|
115
|
+
</li>
|
116
|
+
|
117
|
+
<li class="">
|
118
|
+
<%= link_to raw("<i class=\"linecons-diamond\"></i> <span class='title'>Manage Stores</span>"), vyapari.admin_stores_url %>
|
119
|
+
</li>
|
120
|
+
|
121
|
+
<li class="">
|
122
|
+
<%= link_to raw("<i class=\"linecons-database\"></i> <span class='title'>Manage Brands</span>"), vyapari.admin_brands_url %>
|
123
|
+
</li>
|
124
|
+
|
125
|
+
<li class="">
|
126
|
+
<%= link_to raw("<i class=\"linecons-database\"></i> <span class='title'>Manage Categories</span>"), vyapari.admin_categories_url %>
|
127
|
+
</li>
|
128
|
+
|
129
|
+
</ul>
|
130
|
+
</li>
|
131
|
+
|
132
|
+
</ul>
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
</div>
|