gallery all bugs fixed..

This commit is contained in:
Harry Bomrah 2013-11-06 15:23:28 +08:00 committed by rulingcom
parent 93b7018a4a
commit 410fa0392a
9 changed files with 38 additions and 26 deletions

View File

@ -239,7 +239,7 @@ $(function() {
} }
}); });
var fetchNewImages = 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(); albumid = $("#fileupload_aid").val();
$.ajax({ $.ajax({

View File

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

View File

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

View File

@ -557,8 +557,8 @@
} }
#loading{ #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; height: 16px;
margin: auto; margin: auto;
width: 32px; width: 220px;
} }

View File

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

View File

@ -8,9 +8,10 @@
<p class="albumname"><%= album.name %></p> <p class="albumname"><%= album.name %></p>
</a> </a>
<ul class="gallery_info clearfix"> <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><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>
<ul class="albumtag"> <ul class="albumtag">
<% album.tagged_ids.each do |tag| %> <% album.tagged_ids.each do |tag| %>

View File

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

View File

@ -4,6 +4,12 @@
values: @tags, values: @tags,
translation: 'tags', translation: 'tags',
object_field: 'name' object_field: 'name'
filter_field type: 'objects',
values: @categories,
translation: 'category',
object_field: 'title'
footer link: 'new_panel_gallery_back_end_album_path', footer link: 'new_panel_gallery_back_end_album_path',
paginate: false paginate: false
end %> 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="#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> <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> <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> <a href="#" class="add-imgs btn btn-small btn-primary"><i class="icons-plus"></i> Add Image</a>
</div> </div>
<form action="<%= panel_gallery_back_end_upload_image_path %>", id='fileupload'> <form action="<%= panel_gallery_back_end_upload_image_path %>", id='fileupload'>