From 1f8f58e93016a54f380457770f8251a3185ace0d Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 21 Nov 2012 17:52:25 +0800 Subject: [PATCH] album and gallery is now opened --- .../app/assets/javascripts/calendarAPI.js.erb | 2 -- .../panel/gallery/back_end/albums_controller.rb | 7 ++++++- .../panel/gallery/widget/albums_controller.rb | 2 +- .../gallery/app/models/gallery_album.rb | 2 +- .../gallery/back_end/album_images/show.html.erb | 12 ++++++------ .../panel/gallery/back_end/albums/index.html.erb | 8 +++++--- .../panel/gallery/back_end/albums/show.html.erb | 12 ++++++------ .../gallery/front_end/orbit_galleries/index.html.erb | 4 ++-- 8 files changed, 27 insertions(+), 22 deletions(-) diff --git a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb index a1ab3b6cd..5f36c760e 100644 --- a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb +++ b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb @@ -320,8 +320,6 @@ var calendarAPI = function(){ var recordcurdate = true; if(allow){ - if(evnt.title=="Navratri") - //console.log(pos); if(pos == 1){ var colspan = 0; if(evnt.total_days>7){ diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb index 2499d08fe..a81b536b2 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb @@ -1,8 +1,13 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController include AdminHelper - before_filter :force_order_for_user, :except => [:index,:get_album_json,:get_imgs_json] + # before_filter :force_order_for_user, :except => [:index,:get_album_json,:get_imgs_json] + before_filter :force_order_for_visitor,:only=>[:index,:get_album_json,:get_imgs_json,:get_albums] + before_filter :force_order_for_user,:except => [:index,:get_album_json,:get_imgs_json,:get_albums] + before_filter :for_app_sub_manager,:except => [:index,:get_album_json,:get_imgs_json,:get_albums] + # before_filter lambda + def index if is_manager? || is_admin? || is_sub_manager? @authenticated = true #turn this value to false for view only diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/widget/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/widget/albums_controller.rb index 5126a16d4..99956d41f 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/widget/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/widget/albums_controller.rb @@ -1,7 +1,7 @@ class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController def widget1 - @settings = {"vertical"=>2,"horizontal"=>6} + @settings = {"vertical"=>2,"horizontal"=>6} #[note] horizontal has it's limitation from 2 to 6 @class = "c" + @settings["horizontal"].to_s @total = @settings["vertical"] * @settings["horizontal"] @rnd = Random.new diff --git a/vendor/built_in_modules/gallery/app/models/gallery_album.rb b/vendor/built_in_modules/gallery/app/models/gallery_album.rb index 03daa383b..0a7f6b9c0 100644 --- a/vendor/built_in_modules/gallery/app/models/gallery_album.rb +++ b/vendor/built_in_modules/gallery/app/models/gallery_album.rb @@ -5,7 +5,7 @@ class GalleryAlbum field :name, localize: true field :description, localize: true field :cover, default: "default" - field :cover_path + field :cover_path #can refact field :tag_names belongs_to :gallery_category diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb index 398aee351..4e939cad9 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb @@ -48,17 +48,17 @@
- <% if @authenticated %> + <%# if @authenticated %> - <% end %> + <%# end %> @@ -83,9 +83,9 @@
diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb index afedbbc4a..32273335c 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb @@ -1,4 +1,3 @@ - <%= stylesheet_link_tag "gallery" %> + + <% if is_sub_manager? %>
+<%end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "galleryAPI" %> diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb index 434bf704b..c5775bac3 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb @@ -25,17 +25,17 @@
- <% if @authenticated %> + <% #if @authenticated %> - <% end %> + <%# end %> @@ -61,11 +61,11 @@
" href="<%= panel_gallery_back_end_albums_path %>"><%= I18n.t("gallery.back_to_albums") %> " href="" ><%= I18n.t("gallery.album_tag") %> - <% if @authenticated %> + <%# if @authenticated %> " href="images" onclick="return false;"><%= I18n.t("gallery.add_images") %> " href="delete" onclick="return false;"><%= I18n.t("gallery.del_album") %> " href="<%= edit_panel_gallery_back_end_album_path(@album) %>" ><%= I18n.t("gallery.edit") %> - <% end %> + <%# end %>
diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/orbit_galleries/index.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/orbit_galleries/index.html.erb index 5d8f5a493..9a7aa973b 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/orbit_galleries/index.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/orbit_galleries/index.html.erb @@ -14,7 +14,7 @@ - <% if @authenticated %> + <%# if @authenticated %>
@@ -41,7 +41,7 @@
- <% end %> + <%# end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "jquery.tinyscrollbar" %> <% end %>