Browse files

style tweaks

  • Loading branch information...
1 parent fef643e commit 35d0d29632b51b63478bac632534f4b6d915c06e @gregawoods committed Apr 9, 2012
View
22 app/assets/javascripts/spud/admin/photos.js
@@ -10,24 +10,32 @@ Spud.Admin.Photos = new function(){
$('.spud_admin_photo_ui_thumbs_sortable').sortable({
connectWith:'.spud_admin_photo_ui_thumbs_sortable'
});
- $('body').on('submit', '#spud_admin_photo_album_form', self.submittedPhotoAlbumForm)
+ $('body').on('submit', '#spud_admin_photo_album_form', self.submittedPhotoAlbumForm);
+ $('body').on('submit', '#spud_admin_photo_gallery_form', self.submittedPhotoGalleryForm);
$('body').on('submit', '#spud_admin_photo_form', self.submittedPhotoForm);
$('body').on('click', '.spud_admin_photos_btn_remove', self.clickedPhotoRemoveFromLibrary)
$('body').on('click', '.spud_admin_photo_ui_thumbs_selectable .spud_admin_photo_ui_thumb', self.selectedPhotoUiThumb);
$('body').on('click', '#spud_admin_photo_album_action_library', self.clickedPhotoLibrary);
// html5 drag and drop file
- var droparea = document.getElementById('spud_admin_photos_selected');
- droparea.addEventListener('dragenter', self.stopDndPropagation, false);
- droparea.addEventListener('dragexit', self.stopDndPropagation, false);
- droparea.addEventListener('dragover', self.stopDndPropagation, false);
- droparea.addEventListener('drop', self.droppedFile, false);
+ if(FormData){
+ $('#spud_admin_photo_upload_queue').show();
+ var droparea = document.getElementById('spud_admin_photo_upload_queue');
+ droparea.addEventListener('dragenter', self.stopDndPropagation, false);
+ droparea.addEventListener('dragexit', self.stopDndPropagation, false);
+ droparea.addEventListener('dragover', self.stopDndPropagation, false);
+ droparea.addEventListener('drop', self.droppedFile, false);
+ }
};
- this.submittedPhotoAlbumForm = function(){
+ this.submittedPhotoAlbumForm = function(e){
};
+ this.submittedPhotoGalleryForm = function(e){
+ $('#spud_admin_photo_albums_available .spud_admin_photo_ui_thumb').remove();
+ }
+
this.clickedPhotoRemoveFromLibrary = function(e){
$(this).parents('.spud_admin_photo_ui_thumb').fadeOut(200, function(){
$(this).remove();
View
54 app/assets/stylesheets/spud/admin/photos.css
@@ -1,16 +1,5 @@
-.spud_admin_photos_selection_left{
- width: 520px;
- margin-right: 18px;
- float: left;
-}
-.spud_admin_photos_selection_right{
- width: 400px;
- float: left;
-}
-.spud_admin_photos_selection_left h4, .spud_admin_photos_selection_right h4{
- font-weight: normal;
- margin: 15px 0;
-}
+/* Thumbnails
+---------------------------- */
.spud_admin_photo_ui_thumbs{
height: 300px;
padding: 0;
@@ -75,11 +64,6 @@
overflow: hidden;
text-overflow: ellipsis;
}
-.spud_admin_photo_ui_thumb input[type=checkbox]{
- position: absolute;
- top: 4px;
- left: 4px;
-}
.spud_admin_photo_ui_thumb_controls{
position: absolute;
bottom: 0;
@@ -105,24 +89,9 @@
display: inline-block;
margin: 0 4px;
}
-.spud_admin_photos_album_fieldset{
- position: relative;
-}
-.spud_admin_photos_album_fieldset .spud_admin_photo_create{
- position: absolute;
- top: 0;
- right: 0;
-}
-
-#spud_admin_photo_album_actions{
-
-}
/* Upload Queue
---------------------------- */
-#spud_admin_photo_album_form{
-
-}
.spud_admin_photo_progress{
margin: 10px 0;
}
@@ -136,4 +105,23 @@
float: right;
border: 1px solid #cacaca;
overflow-y: scroll;
+}
+
+/* Gallery Form
+---------------------------- */
+.spud_admin_photos_selection_left{
+ width: 520px;
+ margin-right: 18px;
+ float: left;
+}
+.spud_admin_photos_selection_right{
+ width: 400px;
+ float: left;
+}
+.spud_admin_photos_selection_left h4, .spud_admin_photos_selection_right h4{
+ font-weight: normal;
+ margin: 15px 0;
+}
+#spud_admin_photo_gallery_form .spud_admin_photo_ui_thumb_controls{
+ display: none;
}
View
1 app/controllers/spud/admin/photo_albums_controller.rb
@@ -1,6 +1,7 @@
class Spud::Admin::PhotoAlbumsController < Spud::Admin::ApplicationController
before_filter :get_album, :only => [:show, :edit, :update, :destroy, :library]
+ add_breadcrumb 'Photo Albums', :spud_admin_photo_albums_path
respond_to :html, :json, :xml
layout 'spud/admin/spud_photos'
View
1 app/controllers/spud/admin/photo_galleries_controller.rb
@@ -2,6 +2,7 @@ class Spud::Admin::PhotoGalleriesController < Spud::Admin::ApplicationController
before_filter :get_gallery, :only => [:show, :edit, :update, :destroy]
before_filter :get_albums, :only => [:new, :create, :edit, :update]
+ add_breadcrumb 'Photo Galleries', :spud_admin_photo_galleries_path
respond_to :html, :json, :xml
layout 'spud/admin/spud_photos'
View
2 app/views/spud/admin/photo_albums/_album.html.erb
@@ -1,7 +1,7 @@
<div id="spud_admin_photo_album_<%= album.id %>" class="spud_admin_photo_ui_thumb" style="background-image:url('<%= album.top_photo_url(:spud_admin_small) %>')">
<h5><%= album.title %></h5>
<div style="display:none;">
- <%= check_box_tag 'spud_photo_gallery[album_ids][]', album.id, (@photo_gallery && @photo_gallery.album_ids.include?(album.id)) %>
+ <%= hidden_field_tag 'spud_photo_gallery[album_ids][]', album.id %>
</div>
<div class="spud_admin_photo_ui_thumb_controls">
<%= link_to 'Edit', edit_spud_admin_photo_album_path(album), :class => 'spud_admin_photos_btn_edit' %>
View
1 app/views/spud/admin/photo_albums/_form.html.erb
@@ -19,6 +19,7 @@
<%= link_to "Upload Photo", new_spud_admin_photo_path, :class => "ajax btn btn-success", :title => "New Photo" %>
</div>
<div id="spud_admin_photo_upload_queue">
+ <p>Drag and drop photos here to upload</p>
<h5 id="spud_admin_photo_upload_queue_label">Queued Uploads: <span>0</span></h5>
<div id="spud_admin_photo_upload_queue_bars"></div>
</div>
View
5 app/views/spud/admin/photo_galleries/_form.html.erb
@@ -1,6 +1,6 @@
<%= form_for @photo_gallery, :url => path, :html => {:class => 'form-horizontal', :id => 'spud_admin_photo_gallery_form'} do |f| %>
- <%=error_messages_for(f.object)%>
+ <%= error_messages_for(f.object) %>
<fieldset>
<legend>Gallery Info</legend>
@@ -31,10 +31,9 @@
</div>
</fieldset>
-
<div class="form-actions">
<%= f.submit "Save Photo Gallery", :class=>"btn btn-primary form-btn", "data-loading-text" => "Saving..." %>
- or <%=link_to "cancel", request.referer, :class => "btn" %>
+ or <%= link_to "cancel", request.referer, :class => "btn" %>
</div>
<% end %>
View
4 roadmap.md
@@ -2,10 +2,8 @@
## In Progress
-- Complete drag-and-drop uploading and queueing
-
## Not Started
-- Support for ordering of photos
+- Static page and action caching
- Javascript and CSS for frontend slideshows with varying styles
- Crop a photo after it has been uploaded

0 comments on commit 35d0d29

Please sign in to comment.