album and gallery is now opened

This commit is contained in:
Matthew K. Fu JuYuan 2012-11-21 17:52:25 +08:00
parent fda7c43efc
commit 1f8f58e930
8 changed files with 27 additions and 22 deletions

View File

@ -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){

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -48,17 +48,17 @@
<div class="viewport">
<div class="overview">
<ul class="tag_list" id="gallery_tag_list">
<% if @authenticated %>
<%# if @authenticated %>
<% @tags.each do |tag| %>
<li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag[I18n.locale] %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li>
<% end %>
<% end %>
<%# end %>
</ul>
</div>
</div>
<% if @authenticated %>
<%# if @authenticated %>
<div class="tag_search"><div class="icon-search"></div><input type="text" value="<%= t('gallery.search_tags') %>" onblur="if(this.value=='')this.value='<%= t('gallery.search_tags') %>';" onfocus="if(this.value=='<%= t("gallery.search_tags") %>')this.value='';" id="tag_search_box"> <div class="tag_save"><a class="btn bt-save"><i class="icon-ok"></i><%= I18n.t("gallery.save") %></a></div></div>
<% end %>
<%# end %>
</div>
@ -83,9 +83,9 @@
<div class="form-actions form-fixed pagination-right rghead">
<div class="rgfn">
<a href="" class="bt-back btn pull-left" title="<%= I18n.t("gallery.back_to_photos") %>"><i class="icon-arrow-left icon-black"></i><%= I18n.t("gallery.back_to_photos") %></a>
<% if @authenticated %>
<%# if @authenticated %>
<a class="bt-edit btn btn-primary pull-right" title="<%= I18n.t("gallery.edit") %>" href="<%= edit_panel_gallery_back_end_album_path(@album) %>" ><i class="icon-pencil icon-white"></i><%= I18n.t("gallery.edit") %></a>
<% end %>
<% #end %>
<a class="bt-tag btn btn-primary pull-right" title="<%= I18n.t("gallery.photo_tag") %>" href="#tags" ><i class="icon-tag icon-white"></i><%= I18n.t("gallery.photo_tag") %></a>
</div>
</div>

View File

@ -1,4 +1,3 @@
<%= stylesheet_link_tag "gallery" %>
<div id="filter" class="subnav">
@ -44,13 +43,16 @@
</div>
</div>
<% if is_sub_manager? %>
<div class="form-actions form-fixed pagination-right rghead">
<div class="rgfn">
<% if @authenticated %>
<a class="btn btn-primary pull-right" title="<%= I18n.t("gallery.add_album") %>" href="<%= new_panel_gallery_back_end_album_path %>" onclick="return false;"><i class="icon-plus icon-white"></i><%= I18n.t("gallery.add_album") %></a>
<% end %>
</div>
</div>
<%end %>
</div>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "galleryAPI" %>

View File

@ -25,17 +25,17 @@
<div class="viewport">
<div class="overview">
<ul class="tag_list" id="gallery_tag_list">
<% if @authenticated %>
<%# if @authenticated %>
<% @tags.each do |tag| %>
<li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag[I18n.locale] %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li>
<% end %>
<% end %>
<%# end %>
</ul>
</div>
</div>
<% if @authenticated %>
<% #if @authenticated %>
<div class="tag_search"><div class="icon-search"></div><input type="text" value="<%= t('gallery.search_tags') %>" onblur="if(this.value=='')this.value='<%= t('gallery.search_tags') %>';" onfocus="if(this.value=='<%= t("gallery.search_tags") %>')this.value='';" id="tag_search_box"> <div class="tag_save"><a class="btn bt-save"><i class="icon-ok"></i><%= I18n.t("gallery.save") %></a></div></div>
<% end %>
<%# end %>
</div>
@ -61,11 +61,11 @@
<div class="rgfn">
<a class="bt-back btn btn-primary pull-left" title="<%= I18n.t("gallery.back_to_albums") %>" href="<%= panel_gallery_back_end_albums_path %>"><i class="icon-arrow-left icon-white"></i><%= I18n.t("gallery.back_to_albums") %></a>
<a class="bt-tag btn btn-primary pull-right" title="<%= I18n.t("gallery.album_tag") %>" href="" ><i class="icon-tag icon-white"></i><%= I18n.t("gallery.album_tag") %></ a>
<% if @authenticated %>
<%# if @authenticated %>
<a class="bt-add btn btn-primary pull-right" title="<%= I18n.t("gallery.add_images") %>" href="images" onclick="return false;"><i class="icon-plus icon-white"></i><%= I18n.t("gallery.add_images") %></a>
<a class="bt-del btn btn-primary pull-right" title="<%= I18n.t("gallery.del_album") %>" href="delete" onclick="return false;"><i class="icon-trash icon-white"></i><%= I18n.t("gallery.del_album") %></a>
<a class="bt-edit btn btn-primary pull-right" title="<%= I18n.t("gallery.edit") %>" href="<%= edit_panel_gallery_back_end_album_path(@album) %>" ><i class="icon-pencil icon-white"></i><%= I18n.t("gallery.edit") %></a>
<% end %>
<%# end %>
</div>
</div>
</div>

View File

@ -14,7 +14,7 @@
</div>
</div>
<!-- tag part -->
<% if @authenticated %>
<%# if @authenticated %>
<div id="tag_panel" class="my_scroll">
<div class="scrollbar">
<div class="track">
@ -41,7 +41,7 @@
<div class="tag_search"><div class="icon-search"></div><input type="text" value="<%= t('gallery.search_tags') %>" onblur="if(this.value=='')this.value='<%= t('gallery.search_tags') %>';" onfocus="if(this.value=='<%= t("gallery.search_tags") %>')this.value='';" id="tag_search_box"><div class="tag_save"><a class="btn bt-save"><i class="icon-ok"></i><%= I18n.t("gallery.save") %></a></div></div>
</div>
<% end %>
<%# end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "jquery.tinyscrollbar" %>
<% end %>