gallery all bugs fixed..

This commit is contained in:
Harry Bomrah 2013-11-06 15:23:28 +08:00 committed by saurabhbhatia
parent 9760100b69
commit c158108576
9 changed files with 38 additions and 26 deletions

View File

@ -239,7 +239,7 @@ $(function() {
}
});
var fetchNewImages = function(){
var lastid = $("li.rgalbum:last").data("image-id"),
var lastid = ( $("li.rgalbum:last").length ? $("li.rgalbum:last").data("image-id") : null),
albumid = $("#fileupload_aid").val();
$.ajax({

View File

@ -13,6 +13,7 @@ var galleryAPI = function(){
this.loading = $("#loading");
this.loadTheater = function(id){
$( ".breadcrumb li:eq(1) a" ).attr("href","/panel/gallery/back_end/albums");
g.loadstart();
var imageArray;
var imagecount = 0;

View File

@ -230,6 +230,12 @@
#imgholder .rgalbum a img {
max-width: none;
}
.gallery_info.clearfix a {
max-height: 20px;
max-width: 15px;
}
#imgholder .rgalbum .check {
position: absolute;
top: 0;

View File

@ -557,8 +557,8 @@
}
#loading{
background: #fff 0 center url("../../../assets/gallery/ajax-loader.gif") no-repeat;
background: #fff 0 center url("../../../assets/loading.gif") no-repeat;
height: 16px;
margin: auto;
width: 32px;
width: 220px;
}

View File

@ -156,9 +156,14 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
end
def new_images
@lastimage = GalleryImage.find(params[:last_image_id])
@album = GalleryAlbum.find(params[:album_id])
@newimages = @album.gallery_images.where(:created_at.gt => @lastimage.created_at)
if params[:last_image_id] != ""
@lastimage = GalleryImage.find(params[:last_image_id])
@album = GalleryAlbum.find(params[:album_id])
@newimages = @album.gallery_images.where(:created_at.gt => @lastimage.created_at)
else
@album = GalleryAlbum.find(params[:album_id])
@newimages = @album.gallery_images
end
render :layout=>false
end
@ -184,9 +189,11 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
tagsToDestroy << tag
end
end
new_tags.each do |tag|
if !old_tags.include?(tag)
tagsToAdd << tag
if new_tags != nil
new_tags.each do |tag|
if !old_tags.include?(tag)
tagsToAdd << tag
end
end
end
update_children_image_tag(tagsToDestroy,tagsToAdd)

View File

@ -8,9 +8,10 @@
<p class="albumname"><%= album.name %></p>
</a>
<ul class="gallery_info clearfix">
<li class="view"><i class="icons-eye"></i> 321</li>
<!-- <li class="view"><i class="icons-eye"></i> 321</li> -->
<li><i class="icons-tag"></i></li>
<li class="albumcateg"></li>
<li><%= link_to (content_tag(:i,"",:class=>"icon-trash danger")), panel_gallery_back_end_album_path(album), :confirm => "Are you sure?", :method=>:delete %></li>
<li class="albumcateg"><%= Category.find(album.category_id).title %></li>
</ul>
<ul class="albumtag">
<% album.tagged_ids.each do |tag| %>

View File

@ -63,15 +63,9 @@
<div class="nav-name"><strong>Language</strong></div>
<ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% if i == 0 %>
<li class="active">
<a href=".en" data-toggle="tab">English</a>
<li <%= (i == 0 ? 'class=active' : '') %>>
<a href=".<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
</li>
<% else %>
<li>
<a href=".tw_zh" data-toggle="tab">Chinese</a>
</li>
<% end %>
<% end %>
</ul>
<div class="tab-content language-area">
@ -79,11 +73,8 @@
<% @site_valid_locales.each_with_index do |locale, i| %>
<% if i == 0 %>
<div class="tab-pane fade in active en">
<% else %>
<div class="tab-pane fade tw_zh">
<% end %>
<div class="tab-pane fade in <%= (i == 0 ? 'active' : '') %> <%= locale %>">
<div class="control-group input-title">
<%= f.fields_for :name_translations do |name| %>
<%= label_tag(locale, t("gallery.album_name"),:class=>"control-label muted") %>

View File

@ -4,6 +4,12 @@
values: @tags,
translation: 'tags',
object_field: 'name'
filter_field type: 'objects',
values: @categories,
translation: 'category',
object_field: 'title'
footer link: 'new_panel_gallery_back_end_album_path',
paginate: false
end %>

View File

@ -19,7 +19,7 @@
<a href="#view-photo-tags" class="btn btn-primary btn-small addtags open hide" for="batch"><i class="icons-tag"></i> Add Tags</a>
<a href="<%= edit_panel_gallery_back_end_album_path(@album) %>" class="btn btn-small btn-success"><i class="icon-edit"></i> Edit</a>
<b class="divider"></b>
<%= link_to (content_tag(:i,"",:class=>"icon-trash")), panel_gallery_back_end_album_path(@album), :class=>"btn btn-small btn-danger", :confirm => "Are you sure?", :method=>:delete %>
<a href="#" class="add-imgs btn btn-small btn-primary"><i class="icons-plus"></i> Add Image</a>
</div>
<form action="<%= panel_gallery_back_end_upload_image_path %>", id='fileupload'>