forked from saurabh/orbit4-5
Web Resource module
This commit is contained in:
parent
a4e2dc4f94
commit
c48ecd093e
|
@ -8,7 +8,8 @@ module OrbitBackendHelper
|
|||
active = params[:sort].eql? field.to_s
|
||||
order = active ? (["asc", "desc"]-[params[:order]]).first : "asc"
|
||||
arrow = (order.eql? "desc") ? "<b class='icons-arrow-up-3'></b>" : "<b class='icons-arrow-down-4'></b>"
|
||||
"<th class='#{active ? "active" : ""}'><a href='?sort=#{field}&order=#{order}''>#{t(field.to_sym)} #{active ? arrow : ""}</a></th>".html_safe
|
||||
klass = field.eql?(:title) ? "span5" : "span2"
|
||||
"<th class='#{klass} #{active ? "active" : ""}'><a href='?sort=#{field}&order=#{order}''>#{t(field.to_sym)} #{active ? arrow : ""}</a></th>".html_safe
|
||||
end
|
||||
|
||||
def datetime_picker(object_name, method, options = {})
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
<div class="index" module="link">
|
||||
<h2 class="widget-title">{{widget-title}}</h2>
|
||||
<!-- <div class="link-list" module="link" data-repeat="4" data-module="link"> -->
|
||||
<ul class="link-list" module="link">
|
||||
<li class="item">
|
||||
<span class="title"><a href="{{link_to_show}}">{{title}}</a></span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span class="title"><a href="{{link_to_show}}">{{title}}</a></span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span class="title"><a href="{{link_to_show}}">{{title}}</a></span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span class="title"><a href="{{link_to_show}}">{{title}}</a></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
|
@ -0,0 +1,10 @@
|
|||
<div class="index" module="web_link">
|
||||
<h2 class="widget-title">{{widget-title}}</h2>
|
||||
<div class="link-list" module="web_link" data-repeat="4" data-module="web_link">
|
||||
<ul class="link-list" module="web_link">
|
||||
<li class="item">
|
||||
<span class="title"><a href="{{link_to_show}}">{{title}}</a></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -1,3 +1,4 @@
|
|||
gem 'announcement', git: 'git@gitlab.tp.rulingcom.com:saurabh/announcement-test.git'
|
||||
gem 'ad_banner', git: 'git@gitlab.tp.rulingcom.com:saurabh/adbanner-test.git'
|
||||
gem 'gallery', git: 'git@gitlab.tp.rulingcom.com:saurabh/gallery.git'
|
||||
gem 'gallery', git: 'git@gitlab.tp.rulingcom.com:saurabh/gallery.git'
|
||||
gem 'links', git: 'git@gitlab.tp.rulingcom.com:saurabh/links.git'
|
|
@ -2,6 +2,7 @@ module OrbitModel
|
|||
module Status
|
||||
|
||||
def self.included(base)
|
||||
base.extend ClassMethods
|
||||
base.field :is_top, :type => Boolean, :default => false
|
||||
base.field :is_hot, :type => Boolean, :default => false
|
||||
base.field :is_hidden, :type => Boolean, :default => false
|
||||
|
@ -27,6 +28,13 @@ module OrbitModel
|
|||
end
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
def with_status(status)
|
||||
status = [status].flatten
|
||||
self.any_of(status.map{|s| {s.to_sym=>true}})
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue