seminar2_old/custom_gallery/app/views/admin/custom_galleries/show.html.erb

276 lines
13 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%= stylesheet_link_tag "custom_gallery" %>
<%= stylesheet_link_tag "lib/tags-groups" %>
<!-- <div class="topnav clearfix">
<ul class="breadcrumb text-info pull-left">
<li><a href="/orbit_4.0.1/admin/dashboards/dashboards.shtml"><%= t('custom_gallery.dashboard') %></a> <span class="divider">/</span></li>
<li><a href="<%#= panel_custom_gallery_back_end_custom_albums_path %>"><%= t('custom_gallery.custom_gallery') %></a> <span class="divider">/</span></li>
<li class="active"><%#= @custom_album.name %></li>
</ul>
</div> -->
<!-- Bottom Nav -->
<input name='all_upload_length' type="hidden">
<div class="order-edit-notification">Images re-ordering enabled.</div>
<div class="bottomnav clearfix">
<div class="action pull-left">
<a href="<%= admin_custom_galleries_path %>" class="btn btn-small"><i class="icons-back"></i> <%= t('custom_gallery.back') %></a>
<a href="javascript:select_all()" class='btn btn-small'> <%= t('custom_gallery.checked') %></a>
</div>
<div class="action pull-right">
<div id="crop_div" style="text-align: center;">
<%= t('custom_gallery.crop_div').html_safe %>
<br>
<span id="show_degree">0</span>°
<br>
<button onclick="change_degree(90)"><%= t('custom_gallery.add_degree') %></button>
<button onclick="change_degree(-90)"><%= t('custom_gallery.reduce_degree') %></button>
</div>
<a href="javascript:rotate()" class="btn btn-small hide crop"><%= t('custom_gallery.rotate_images') %></a>
<a href="javascript:batch_crop()" class="btn btn-small hide crop"><%= t('custom_gallery.batch_crop') %></a>
<a href="#" class="btn btn-inverse btn-small deselect hide"><%= t('custom_gallery.deselect') %></a>
<% if can_edit_or_delete?(@custom_album) %>
<a href="#dialog" data-toggle="modal" class="btn btn-warning btn-small deletephoto hide"><i class="icons-cross-3"></i><%= t('custom_gallery.delete_photo') %></a>
<a href="#view-photo-tags" class="btn btn-primary btn-small addtags open hide" for="batch"><i class="icons-tag"></i><%= t('custom_gallery.add_tags') %></a>
<a href="<%= import_admin_custom_gallery_path(@custom_album.id) %>" class="btn btn-small btn-info"><i class="icons-download"></i><%= t('custom_gallery.import') %></a>
<b class="divider"></b>
<a href="<%= edit_admin_custom_gallery_path(@custom_album.id) %>" class="btn btn-small btn-success"><i class="icon-edit"></i> <%= t('custom_gallery.edit') %></a>
<a href="#" class="btn btn-small btn-info order-btn-class" id="edit-order-btn"><%= t('custom_gallery.edit_order') %></a>
<b class="divider"></b>
<a href="#" class="add-imgs btn btn-small btn-primary"><i class="icons-plus"></i><%= t('custom_gallery.add_image') %></a>
<% end %>
</div>
<form action="<%= admin_custom_galleries_upload_image_path %>", id='fileupload'>
<!-- Redirect browsers with JavaScript disabled to the origin page -->
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="fileupload-buttonbar">
<div class="navbar">
<div class="navbar-inner">
<ul class="nav">
<li>
<div class="fileinput-button add-photo">
<i class="icon-plus icon-white"></i>
<span><%= t('custom_gallery.add_files') %>...</span>
<input type="file" name="files[]" multiple>
</div>
<input type="hidden" value="<%= @custom_album.id.to_s %>" name="custom_album_id" id="fileupload_aid" />
</li>
<li>
<button type="submit" class="start add-photo" onclick="form_submit()">
<i class="icon-upload icon-white"></i>
<span><%= t('custom_gallery.start_upload') %></span>
</button>
</li>
<li>
<button type="reset" class="cancel add-photo">
<i class="icon-ban-circle icon-white"></i>
<span><%= t('custom_gallery.cancel_upload') %></span>
</button>
</li>
<!-- <li>
<button type="button" class="delete">
<i class="icons-trash icon-white"></i>
<span><%= t('custom_gallery.delete') %></span>
</button>
</li> -->
</ul>
</div>
</div>
<!-- The global progress information -->
<div class="fileupload-progress">
<!-- The global progress bar -->
<div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
<div class="bar" style="width:0%;"></div>
</div>
<!-- The extended global progress information -->
<div class="progress-extended"></div>
</div>
</div>
<!-- Drop Zone -->
<div id="dropzone" class="drop">
<div data-icons="&#xe0a3;"></div>
<%= t('custom_gallery.drop_files_here') %>
</div>
<!-- The loading indicator is shown during file processing -->
<div class="fileupload-loading"></div>
<!-- The table listing the files available for upload/download -->
<div id="file-list" class="nano">
<div class="content">
<ul role="presentation" class="files clearfix">
</ul>
</div>
</div>
</form>
</div>
<div class="rgbody">
<div class="custom_gallery-info">
<h3><%= @custom_album.name %></h3>
<p class="muted"><%= @custom_album.description.html_safe %></p>
</div>
<ul id="imgholder" class="custom_gallery clearfix" data-custom_gallery-id="<%= @custom_album.id.to_s %>">
<% @images.each do |image| %>
<%= render :partial=>"image", :object=>image %>
<% end %>
</ul>
</div>
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Delete Photo?</h3>
</div>
<div class="modal-body">
<span class="text-warning text-center">This action can not be restored, are you sure you want to delete?</span>
<div class="spinning">
<i class="icon-spinner icon-spin icon-4x"></i>
</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="delete-item btn btn-danger" id="delete_selected_photos_btn">Delete</button>
</div>
</div>
<div id="view-photo-tags" class="nano" style="display:none">
<div class="content">
<form>
<fieldset style="display: contents;">
<legend>Tags</legend>
<ul class="tags-groups">
<% @tags.each do |tag| %>
<li class="filter-item">
<p class="card pull-left">
<input type="checkbox" value="<%= tag.id.to_s %>">
</p>
<a>
<% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tag"><%= tag.name_translations[locale] %></span>
<% if @site_in_use_locales.count-1 != i %>
/
<% end %>
<% end %>
</a>
</li>
<% end %>
</ul>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t('custom_gallery.cancel') %></a>
<input type="submit" value="Save" class="btn btn-primary" />
</div>
</fieldset>
</form>
</div>
</div>
<div id="view-photo-depiction" class="nano" style="display:none">
<div class="content">
<form for="description" method="post" data-remote="true" action="/admin/custom_galleries/update_image">
<fieldset>
<div class="btn-group">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn<%= ' active in' if i == 0 %>" id="btn-<%= locale %>-fake" data-toggle="tab" href="#form-<%= locale %>"><%= t(locale) %></a>
<% end %>
</div>
<div class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div id="form-<%= locale %>-fake" role="tabpanel" aria-labelledby="btn-<%= locale %>" class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<legend><%= I18n.t('description') %></legend>
<textarea class="ckeditor_reduce description-editor" rows="10" name="custom_album_image[description_translations][<%= locale %>]" for="<%= locale %>"></textarea>
<legend><%= I18n.t('custom_gallery.short-description') %></legend>
<textarea class="ckeditor_reduce title-editor" rows="10" name="custom_album_image[title_translations][<%= locale %>]" for="<%= locale %>"></textarea>
</div>
<% end %>
</div>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t('custom_gallery.cancel') %></a>
<input type="submit" value="Save" class="btn btn-primary" />
<input type="hidden" value="" name="image_id" />
</div>
</fieldset>
</form>
</div>
</div>
<script type="text/javascript">
var photosData = <%= @photos_data.html_safe %>;
</script>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "jquery.masonry.min.js" %>
<%= javascript_include_tag "jquery.lite.image.resize.js" %>
<%= javascript_include_tag "lib/checkbox.card" %>
<%= javascript_include_tag "file-upload/vendor/jquery.ui.widget.js" %>
<%= javascript_include_tag "file-upload/tmpl.min.js" %>
<%= javascript_include_tag "file-upload/load-image.min.js" %>
<%= javascript_include_tag "file-upload/canvas-to-blob.min.js" %>
<%= javascript_include_tag "file-upload/jquery.iframe-transport.js" %>
<%= javascript_include_tag "file-upload/jquery.fileupload.js" %>
<%= javascript_include_tag "file-upload/jquery.fileupload-fp.js" %>
<%= javascript_include_tag "file-upload/jquery.fileupload-ui.js" %>
<%= javascript_include_tag "file-upload/drop-zone.js" %>
<%= javascript_include_tag "custom_gallery" %>
<% end %>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<li class="template-upload fade">
<ul class="clearfix">
<li class="action-bnt">
{% if (o.files.valid && !i) { %}
<div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
<div class="bar" style="width:0%;"></div>
</div>
{% if (!o.options.autoUpload) { %}
<button class="btn btn-primary start" onclick="form_only_one_submit()">
<i class="icon-upload icon-white"></i>
</button>
{% } %}
{% } %}
{% if (!i) { %}
<button class="btn btn-warning cancel">
<i class="icon-ban-circle icon-white"></i>
</button>
{% } %}
</li>
<li class="preview pull-left"><span class="fade"></span></li>
<li class="name-size">
<p>{%=file.name%}</p>
{% if (file.error) { %}
<p class="error"><span class="label label-important">Error</span> {%=file.error%}</p>
{% } else if (o.files.valid && !i) { %}
<p class="label label-info">{%=o.formatFileSize(file.size)%}</p>
{% } %}
</li>
</ul>
</li>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<li class="template-download fade">
<ul class="clearfix">
{% if (file.error) { %}
<li class="name-size">
<p>{%=file.name%}</p>
<p class="error"><span class="label label-important">Error</span> {%=file.error%}</p>
</li>
{% } else { %}
<li class="preview">
{% if (file.thumbnail_url) { %}
<a href="{%=file.url%}" title="{%=file.name%}" data-custom_gallery="custom_gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
{% } %}
</li>
<li class="name-size">
<p><a href="{%=file.url%}" title="{%=file.name%}" data-custom_gallery="{%=file.thumbnail_url&&'custom_gallery'%}" download="{%=file.name%}">{%=file.name%}</a></p>
<p ><span class="label label-success"><%= t('custom_gallery.success') %></span><%= t('custom_gallery.file_uploaded_successfully') %>!</p>
<p class="label label-info">{%=o.formatFileSize(file.size)%}</p>
</li>
{% } %}
</ul>
</li>
{% } %}
</script>