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

83 lines
3.0 KiB
Plaintext
Raw Normal View History

2020-02-04 08:18:36 +00:00
<% 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
2020-03-24 06:04:41 +00:00
var max_page = <%= (@fiter_albums.length/@limit_count).ceil rescue 1 %>
2020-10-16 06:44:08 +00:00
if( max_page > 1){
$("#edit-order-btn").hide();
}
2020-02-04 08:18:36 +00:00
$('.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){
2020-10-16 06:44:08 +00:00
$("#edit-order-btn").show();
$('#load_html').hide();
2020-02-04 08:18:36 +00:00
}
$('#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 %>
2020-02-04 08:18:36 +00:00
<%= 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 %>
2020-02-04 08:18:36 +00:00
<div class="rgbody" style='float: left;'>
<ul id="orbit_gallery" class="gallery clearfix" data-gallery-id="gallery"
style='display: inline-flex;flex-wrap: wrap;'>
2020-10-16 06:44:08 +00:00
<%= render :partial => "albums"%>
2020-02-04 08:18:36 +00:00
</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 %>
2020-02-04 08:18:36 +00:00
<button class="btn btn-small btn-info" id="load_html"><%= t('gallery.load_html') %></button>
<% end %>
</div>
</div>
<% else %>
2020-10-16 06:44:08 +00:00
<%= render :partial => "albums" %>
2020-02-04 08:18:36 +00:00
<% end %>