gallery/app/views/admin/galleries/index.html.erb

84 lines
3.2 KiB
Plaintext

<% if @show_script %>
<%= stylesheet_link_tag "gallery" %>
<%= stylesheet_link_tag "lib/tags-groups" %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/jquery-ui-1.10.0.custom.min" %>
<%= javascript_include_tag "jquery.masonry.min.js" %>
<%= javascript_include_tag "jquery.lite.image.resize.js" %>
<%= javascript_include_tag "gallery" %>
<script type="text/javascript">
var page_no = 2
var catch_flag = true
var max_page = <%= (@fiter_albums.length/@limit_count).ceil rescue 1 %>
if( max_page > 1){
$("#edit-order-btn").hide();
}
$('.bottomnav').ready(function(){
function load_html_func(){
$('#load_html').text("<%= t('gallery.wait_time') %>")
if (catch_flag){
catch_flag = true;
$.ajax({
type : "get",
url : "<%= @url %>",
dataType : "text",
data:{page_no: page_no},
global:false,
success: function(data)
{
$('#orbit_gallery').append(data)
page_no++
catch_flag = true
if (max_page < page_no){
$("#edit-order-btn").show();
$('#load_html').hide();
}
$('#load_html').text("<%= t('gallery.load_html') %>")
},
error : function(data){
catch_flag = true
alert('please try again later.')
}
});
}
}
$('#load_html').click(load_html_func)
})
</script>
<% end %>
<%= render_filter @filter_fields, "orbit_gallery" %>
<div class="order-edit-notification">Albums re-ordering enabled.</div>
<%= render 'recreate_thumb' %>
<script type="text/javascript">
$(document).ready(function(){
$('form.update_album_setting_form').submit(function(){
window.setTimeout(function(){alert('success')},500)
})
})
</script>
<%= form_tag '/admin/galleries/update_album_setting',remote: true,:class=>'update_album_setting_form' do %>
<%= t('gallery.album_limit_for_one_page') %>:
<%= text_field_tag :album_setting_limit, AlbumSetting.first.limit,:placeholder => t('gallery.blank_for_nil') %>
<input type="submit" value="<%= t('submit') %>">
<% end %>
<div class="rgbody" style='float: left;'>
<ul id="orbit_gallery" class="gallery clearfix" data-gallery-id="gallery"
style='display: inline-flex;flex-wrap: wrap;'>
<%= render :partial => "albums"%>
</ul>
</div>
<div class="bottomnav clearfix">
<div class="action pull-right">
<% if can_edit_or_delete?(nil) %>
<a href="#" class="btn btn-small btn-info order-btn-class" id="edit-order-btn"><%= t('gallery.edit_order') %></a>
<% end %>
<% if @fiter_albums.length > @limit_count %>
<button class="btn btn-small btn-info" id="load_html"><%= t('gallery.load_html') %></button>
<% end %>
<a class="btn btn-small btn-primary" href="<%= new_admin_gallery_path %>" title="<%=t(:new_)%>"><%=t(:new_)%></a>
</div>
</div>
<% else %>
<%= render :partial => "albums" %>
<% end %>