gallery all bugs fixed..
This commit is contained in:
		
							parent
							
								
									9760100b69
								
							
						
					
					
						commit
						c158108576
					
				| 
						 | 
				
			
			@ -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({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -156,9 +156,14 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
 | 
			
		|||
  end
 | 
			
		||||
 | 
			
		||||
  def new_images 
 | 
			
		||||
    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,11 +189,13 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
 | 
			
		|||
        tagsToDestroy << tag
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    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)
 | 
			
		||||
    @album.update_attributes(params[:gallery_album])
 | 
			
		||||
    redirect_to panel_gallery_back_end_album_path(@album)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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| %>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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") %>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 %>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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'>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue