This repository has been archived by the owner on Aug 15, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added the ability to choose different render modes for the photo albu…
…m. Currently only works in the isotope11 theme.
- Loading branch information
Josh Adams
committed
Dec 18, 2008
1 parent
c918468
commit c94291a
Showing
17 changed files
with
212 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
<% if page.page_plugins.any? -%> | ||
<% page.page_plugins.each do |plugin| -%> | ||
<%= render :partial => plugin.module_class.view_partial, :locals => { :plugin_module => plugin.module } -%> | ||
<% if logged_in? && get_setting('show_inline_edit_links') %> | ||
<% if current_user.can_author_content? %> | ||
<%= link_to "[Edit]", edit_admin_page_path(:id => page.id, :anchor => "page-plugin-#{plugin.id}") %> | ||
<% elsif current_user.can_approve_content? %> | ||
<%= link_to "[Manage Content]", edit_admin_page_path(:id => page.id, :anchor => "page-plugin-#{plugin.id}") %> | ||
<% page.page_plugins.each_with_index do |plugin, i| -%> | ||
<%# render :partial => plugin.module_class.view_partial, :locals => { :plugin_module => plugin.module } -%> | ||
<div class='page-plugin page-plugin-<%= i -%>'> | ||
<%= render :partial => plugin.module.view_partial, :locals => { :plugin_module => plugin.module } -%> | ||
<% if logged_in? && get_setting('show_inline_edit_links') %> | ||
<div class='clear'></div> | ||
<% if current_user.can_author_content? %> | ||
<%= link_to "[Edit]", edit_admin_page_path(:id => page.id, :anchor => "page-plugin-#{plugin.id}") %> | ||
<% elsif current_user.can_approve_content? %> | ||
<%= link_to "[Manage Content]", edit_admin_page_path(:id => page.id, :anchor => "page-plugin-#{plugin.id}") %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
<% end -%> | ||
<% end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Object # :nodoc: | ||
def self.path2class(klassname) | ||
klassname.split('::').inject(Object) { |k,n| k.const_get n } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// Galeria v1.3 | ||
// Autor: Oscar Linares | ||
// http://www.innovacionweb.com/galeria-accesible-jquery.php | ||
// http://code.google.com/p/galeria-jquery-jsgal/ | ||
// | ||
// Gracias a: | ||
// Ariel Flesler por su plugin jQuery.Preload, aunque al final no lo uso (muy potente, demasiado | ||
// para lo que necesito aquí). | ||
// http://flesler.blogspot.com/2008/01/jquerypreload.html | ||
// Para la precarga me inspire en (muchas gracias) | ||
// http://www.noth.es/2007/11/25/actualizacion-del-jquery-gallery-v-0-2/ | ||
// | ||
(function($) { | ||
// | ||
// plugin | ||
// | ||
$.fn.galimg = function() { | ||
// trabaja con cada elemento | ||
return this.each(function() { | ||
var idCapaGaleria = $(this).attr("id"); | ||
|
||
$("a", this).click(function() { | ||
// otra posibilidad para mostrar el aviso de cargando. | ||
//$("#" + idCapaGaleria + " .imgprin").append("<div class='jsgalpre'>Cargando...</div>"); | ||
|
||
var rutaImagen = $(this).attr("href"); | ||
var altImagen = $(this).children("img").attr("alt"); | ||
|
||
$("#" + idCapaGaleria + " .imgprin img").fadeOut("normal").remove(); | ||
|
||
var objImagen = new Image(); | ||
|
||
$(objImagen).load(function() { | ||
$(this).hide(); | ||
|
||
$("#" + idCapaGaleria + " .imgprin").append(this); | ||
|
||
$(this).fadeIn("slow"); | ||
}); | ||
|
||
$(objImagen).attr("src", rutaImagen); | ||
|
||
//$("#" + idCapaGaleria + " .imgprin .jsgalpre").remove(); | ||
|
||
return false; | ||
}); | ||
}); | ||
}; | ||
// | ||
// fin del plugin | ||
// | ||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
div.galimg, div.imgprin, .galimg a, .galimg img, .galimg ul, .galimg li { | ||
margin: 0; | ||
padding: 0; | ||
border: 0; | ||
outline: 0; | ||
font-weight: inherit; | ||
font-style: inherit; | ||
font-size: 100%; | ||
font-family: inherit; | ||
vertical-align: baseline; | ||
} | ||
|
||
/* fin del reset */ | ||
|
||
.galimg { | ||
position: relative; | ||
background: #fff url(jsgal/loading.gif) no-repeat 50% 50%; | ||
width: 710px; | ||
} | ||
|
||
.imgprin { | ||
/* es necesario para evitar un parpadero al quitar la imagen */ | ||
width: 710px; | ||
height: 510px; | ||
} | ||
|
||
.imgprin img { | ||
background-color: #fff; | ||
border: solid 1px #ccc; | ||
padding: 5px; | ||
} | ||
|
||
.galimg ul { | ||
position: absolute; | ||
top: 420px; | ||
width: 710px; | ||
list-style: none; | ||
text-align: center; | ||
} | ||
|
||
.galimg ul li { | ||
display: inline; | ||
padding-left: 3px; | ||
} | ||
|
||
.galimg ul li a img { | ||
background-color: #fff; | ||
border: solid 1px #ccc; | ||
padding: 3px; | ||
} | ||
|
||
.jsgalpre { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
background-color: #f00; | ||
color: #fff; | ||
padding: 3px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
vendor/plugins/ansuz_photo_album/app/views/admin/photo_albums/edit.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%= title "Edit Photo Album" -%> | ||
<% content_for :sidebar do -%> | ||
<%= link_to "Back", admin_photo_album_path(@photo_album), :class => 'button icon back' %> | ||
<% end -%> | ||
<% form_for :photo_album, :url => admin_photo_album_path(@photo_album), :html => { :method => :put } do |f| %> | ||
<div class='fullwidth'> | ||
<table class='form-table'> | ||
<%= form_row "Display Type", f.select(:display_type, Ansuz::JAdams::PhotoAlbum.display_types) -%> | ||
</table> | ||
</div> | ||
<br /> | ||
<%= submit_tag "Update Photo Album" %> or <%= link_to "Cancel", admin_photo_album_path(@photo_album) %> | ||
<% end %> |
3 changes: 2 additions & 1 deletion
3
vendor/plugins/ansuz_photo_album/app/views/admin/photo_albums/show.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
vendor/plugins/ansuz_photo_album/app/views/photo_albums/_photo_album_gallery.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<% if plugin_module.photos.any? %> | ||
<div id='<%= dom_id(plugin_module) %>' class='galimg'> | ||
<div class='imgprin'> | ||
<%= image_tag plugin_module.photos.first.photo_album_photo_image.url(:large) %> | ||
</div> | ||
<ul> | ||
<% plugin_module.photos.each do |photo| %> | ||
<li><%= link_to image_tag(photo.photo_album_photo_image.url(:thumb)), photo.photo_album_photo_image.url(:large), :title => photo.caption -%></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
<%= javascript_tag "jQuery('##{dom_id(plugin_module)}').galimg();" %> |
9 changes: 9 additions & 0 deletions
9
vendor/plugins/ansuz_photo_album/db/migrate/001_add_display_type_to_photo_albums.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class AddDisplayTypeToPhotoAlbums < ActiveRecord::Migration | ||
def self.up | ||
add_column :photo_albums, :display_type, :string | ||
end | ||
|
||
def self.down | ||
remove_column :photo_albums, :display_type | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters