Merge branch 'gallery_orbit' of github.com:Rulingcom/orbit into gallery_orbit
Conflicts: vendor/built_in_modules/gallery/config/routes.rb
This commit is contained in:
commit
747b0d4620
File diff suppressed because it is too large
Load Diff
66
vendor/built_in_modules/gallery/app/assets/stylesheets/widget_gallery.css
vendored
Executable file
66
vendor/built_in_modules/gallery/app/assets/stylesheets/widget_gallery.css
vendored
Executable file
|
@ -0,0 +1,66 @@
|
||||||
|
.widget_gallery {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.widget_gallery:after {
|
||||||
|
display: table;
|
||||||
|
width: 100%;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
.widget_gallery ul {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.widget_gallery li a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.widget_gallery li a img {
|
||||||
|
height: auto;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* widget 1 */
|
||||||
|
.w1 ul {
|
||||||
|
margin: 0 -1%;
|
||||||
|
}
|
||||||
|
.w1 li {
|
||||||
|
float: left;
|
||||||
|
margin: 1%;
|
||||||
|
}
|
||||||
|
.w1.c2 li { width: 48%; }
|
||||||
|
.w1.c3 li { width: 31.3333%; }
|
||||||
|
.w1.c4 li { width: 23%; }
|
||||||
|
.w1.c5 li { width: 18%; }
|
||||||
|
.w1.c6 li { width: 14.6666%; }
|
||||||
|
.w1 li a:hover {
|
||||||
|
box-shadow: 0 0 20px rgba(0,0,0,0.9);
|
||||||
|
outline: solid 4px #429DFF;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.w1 li a img {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* widget 2 */
|
||||||
|
.w2 li {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.w2 li a img {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
.w2 li a {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
color: #fff;
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
.w2 li a .desc {
|
||||||
|
position: absolute;
|
||||||
|
bottom: -60px;
|
||||||
|
opacity: 0;
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
padding: 5%;
|
||||||
|
background-color: rgba(8, 166, 255, 0.8);
|
||||||
|
}
|
23
vendor/built_in_modules/gallery/app/controllers/panel/gallery/widget/albums_controller.rb
vendored
Normal file
23
vendor/built_in_modules/gallery/app/controllers/panel/gallery/widget/albums_controller.rb
vendored
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController
|
||||||
|
|
||||||
|
def widget1
|
||||||
|
@settings = {"vertical"=>2,"horizontal"=>6}
|
||||||
|
@class = "c" + @settings["horizontal"].to_s
|
||||||
|
@total = @settings["vertical"] * @settings["horizontal"]
|
||||||
|
@rnd = Random.new
|
||||||
|
@images = []
|
||||||
|
for i in 0..@total-1
|
||||||
|
@sn = @rnd.rand(0...GalleryImage.count)
|
||||||
|
if @sn < 0
|
||||||
|
@sn = @sn * -1
|
||||||
|
end
|
||||||
|
image = GalleryImage.skip(@sn).limit(1).first
|
||||||
|
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||||
|
@images << values
|
||||||
|
end
|
||||||
|
end
|
||||||
|
def widget2
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
20
vendor/built_in_modules/gallery/app/views/panel/gallery/widget/albums/widget1.html.erb
vendored
Normal file
20
vendor/built_in_modules/gallery/app/views/panel/gallery/widget/albums/widget1.html.erb
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<%= stylesheet_link_tag "widget_gallery" %>
|
||||||
|
<%# content_for :page_specific_javascript do %>
|
||||||
|
<%#= javascript_include_tag "cycle" %>
|
||||||
|
<%# end %>
|
||||||
|
<div class="four columns">
|
||||||
|
<h4>Gallery Widget</h4>
|
||||||
|
<p>WIDGET 1</p>
|
||||||
|
<div class="widget_gallery w1 <%= @class %>">
|
||||||
|
<ul>
|
||||||
|
<% @images.each do |image| %>
|
||||||
|
<li><a href="<%= image['show_link'] %>" title="photo description 1"><img src="<%= image['thumb'] %>" alt=""/></a></li>
|
||||||
|
<% end %>
|
||||||
|
<!-- <li><a href="" title="photo description 2"><img src="images/assets/2.jpg" alt=""/></a></li>
|
||||||
|
<li><a href="" title="photo description 3"><img src="images/assets/3.jpg" alt=""/></a></li>
|
||||||
|
<li><a href="" title="photo description 4"><img src="images/assets/4.jpg" alt=""/></a></li>
|
||||||
|
<li><a href="" title="photo description 5"><img src="images/assets/5.jpg" alt=""/></a></li>
|
||||||
|
<li><a href="" title="photo description 6"><img src="images/assets/6.jpg" alt=""/></a></li> -->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -1,54 +1,57 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
namespace :panel do
|
|
||||||
namespace :gallery do
|
|
||||||
namespace :back_end do
|
|
||||||
match "get_albums" => "albums#get_albums"
|
|
||||||
match "upload_image" => "albums#upload_image"
|
|
||||||
match "save_tags" => "tags#save_tags"
|
|
||||||
match "albums/save_tags" => "tags#save_tags"
|
|
||||||
resources :albums do
|
|
||||||
match "set_cover" => "albums#set_cover"
|
|
||||||
match "imgs" => "albums#imgs"
|
|
||||||
match "upload_panel" => "albums#upload_panel"
|
|
||||||
match "images_tags" => "albums#images_tags"
|
|
||||||
collection do
|
|
||||||
get "get_album_json"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
match "album_images/#!/:id" => "album_images#show"
|
namespace :panel do
|
||||||
|
namespace :gallery do
|
||||||
|
namespace :back_end do
|
||||||
|
match "get_albums" => "albums#get_albums"
|
||||||
|
match "upload_image" => "albums#upload_image"
|
||||||
|
match "save_tags" => "tags#save_tags"
|
||||||
|
match "albums/save_tags" => "tags#save_tags"
|
||||||
|
resources :albums do
|
||||||
|
match "set_cover" => "albums#set_cover"
|
||||||
|
match "imgs" => "albums#imgs"
|
||||||
|
match "upload_panel" => "albums#upload_panel"
|
||||||
|
match "images_tags" => "albums#images_tags"
|
||||||
|
end
|
||||||
|
|
||||||
resources :album_images
|
match "album_images/#!/:id" => "album_images#show"
|
||||||
resources :gallery_categories
|
|
||||||
resources :tags
|
resources :album_images
|
||||||
end
|
resources :gallery_categories
|
||||||
namespace :front_end do
|
resources :tags
|
||||||
match "get_albums" => "albums#get_albums"
|
end
|
||||||
match "orbit_galleries" => "orbit_galleries#index"
|
|
||||||
# match "gallery_category_save" => "orbit_galleries#new_category"
|
namespace :front_end do
|
||||||
# match "categorylist" => "orbit_galleries#categorylist"
|
match "orbit_galleries" => "orbit_galleries#index"
|
||||||
# match "gallery_category_delete" => "orbit_galleries#gallery_category_delete"
|
match "get_albums" => "albums#get_albums"
|
||||||
# match "add_album" => "orbit_galleries#add_album"
|
# match "orbit_galleries" => "orbit_galleries#index"
|
||||||
# match "create_album" => "orbit_galleries#create_album"
|
# match "gallery_category_save" => "orbit_galleries#new_category"
|
||||||
# match "get_albums" => "orbit_galleries#get_albums"
|
# match "categorylist" => "orbit_galleries#categorylist"
|
||||||
# match "upload_image" => "orbit_galleries#upload_image"
|
# match "gallery_category_delete" => "orbit_galleries#gallery_category_delete"
|
||||||
# match "upload_panel" => "orbit_galleries#upload_panel"
|
# match "add_album" => "orbit_galleries#add_album"
|
||||||
# match "get_images" => "orbit_galleries#get_images"
|
# match "create_album" => "orbit_galleries#create_album"
|
||||||
# match "theater" => "orbit_galleries#theater"
|
# match "get_albums" => "orbit_galleries#get_albums"
|
||||||
# match "delete_album" => "orbit_galleries#delete_album"
|
# match "upload_image" => "orbit_galleries#upload_image"
|
||||||
# match "edit_album" => "orbit_galleries#edit_album"
|
# match "upload_panel" => "orbit_galleries#upload_panel"
|
||||||
# match "set_cover" => "orbit_galleries#set_cover"
|
# match "get_images" => "orbit_galleries#get_images"
|
||||||
# match "delete_images" => "orbit_galleries#delete_images"
|
# match "theater" => "orbit_galleries#theater"
|
||||||
# match "update_album" => "orbit_galleries#update_album"
|
# match "delete_album" => "orbit_galleries#delete_album"
|
||||||
# match "save_tags" => "orbit_galleries#save_tags"
|
# match "edit_album" => "orbit_galleries#edit_album"
|
||||||
resources :albums do
|
# match "set_cover" => "orbit_galleries#set_cover"
|
||||||
member do
|
# match "delete_images" => "orbit_galleries#delete_images"
|
||||||
get "imgs"
|
# match "update_album" => "orbit_galleries#update_album"
|
||||||
get "theater"
|
# match "save_tags" => "orbit_galleries#save_tags"
|
||||||
end
|
resources :albums do
|
||||||
end
|
member do
|
||||||
resources :album_images
|
get "imgs"
|
||||||
end
|
get "theater"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
resources :album_images
|
||||||
|
end
|
||||||
|
namespace :widget do
|
||||||
|
match "widget1" => "albums#widget1"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue