DG IZ; moved some buttons around, added album edit page

This commit is contained in:
ilya 2010-07-28 14:00:02 -07:00
parent 9e3c6a0936
commit 5723d91dae
8 changed files with 52 additions and 21 deletions

View file

@ -33,4 +33,18 @@ class AlbumsController < ApplicationController
@album = Album.first(:id => params[:id]) @album = Album.first(:id => params[:id])
@album_photos = @album.photos @album_photos = @album.photos
end end
def edit
@album = Album.first(:id => params[:id])
end
def update
@album = Album.first(:id => params[:id])
if @album.update_attributes(params[:album])
flash[:notice] = "Successfully updated album."
redirect_to @album
else
render :action => 'edit'
end
end
end end

View file

@ -29,7 +29,7 @@ class PhotosController < ApplicationController
@photo = Photo.where(:id => params[:id]).first @photo = Photo.where(:id => params[:id]).first
@photo.destroy @photo.destroy
flash[:notice] = "Successfully deleted photo." flash[:notice] = "Successfully deleted photo."
redirect_to root_url redirect_to @photo.album
end end
def show def show

View file

@ -17,7 +17,6 @@
-unless mine? @album -unless mine? @album
%h4= "by #{@album.person.real_name}" %h4= "by #{@album.person.real_name}"
- for photo in @album_photos - for photo in @album_photos
= link_to (image_tag photo.image.url(:thumb_medium)), object_path(photo) = link_to (image_tag photo.image.url(:thumb_medium)), object_path(photo)
@ -26,4 +25,4 @@
= link_to "⇧ albums", albums_path = link_to "⇧ albums", albums_path
-if mine? @album -if mine? @album
.button.right .button.right
= link_to 'Delete Album', @album, :confirm => 'Are you sure?', :method => :delete = link_to 'Edit Album', edit_album_path(@album)

View file

@ -2,8 +2,6 @@
.back .back
= link_to '⇧ ostatus', ostatus_path = link_to '⇧ ostatus', ostatus_path
= "#{@author.username}'s stream" = "#{@author.username}'s stream"
.button.right
= link_to 'Unsubscribe', @author, :confirm => 'Are you sure?', :method => :delete
- if @author_ostatus_posts - if @author_ostatus_posts
%ul#stream %ul#stream
@ -16,3 +14,5 @@
#content_bottom #content_bottom
.back .back
= link_to "⇧ ostatus", ostatus_path = link_to "⇧ ostatus", ostatus_path
.button.right
= link_to 'Unsubscribe', @author, :confirm => 'Are you sure?', :method => :delete

View file

@ -4,7 +4,7 @@
= @photo.image = @photo.image
.button.right .button.right
= link_to 'Edit', '#' = link_to 'Edit Photo', edit_photo_path(@photo)
.sub_header .sub_header
= link_to "full size", @photo.image.url = link_to "full size", @photo.image.url
@ -12,8 +12,11 @@
%div{:id => @photo.id} %div{:id => @photo.id}
#show_photo #show_photo
= link_to_prev @photo, @album
= linked_scaled_photo @photo, @album = linked_scaled_photo @photo, @album
#next_prev_links
= link_to_prev @photo, @album
|
= link_to_next @photo, @album = link_to_next @photo, @album
#content_bottom #content_bottom

View file

@ -1,6 +1,12 @@
%h1 Editing Profile
= form_for @user do |f| = form_for @user do |f|
%h1.big_text
.back
= link_to "⇧ home", root_path
Editing your profile
= f.error_messages = f.error_messages
= f.fields_for :profile do |p| = f.fields_for :profile do |p|
@ -35,8 +41,12 @@
%p %p
= f.label :url = f.label :url
= f.text_field :url = f.text_field :url
%p
= f.submit
%p #submit_block
= link_to "Show", user_path(@user) = link_to "Cancel", root_path
or
= f.submit "Update Profile"
#content_bottom
.back
= link_to "⇧ home", root_path

View file

@ -272,9 +272,9 @@ input[type='text'], textarea {
border-radius: 3px; border-radius: 3px;
-moz-border-radius: 3px; } -moz-border-radius: 3px; }
input[type='submit'] { #submit_block {
display: block; text-align: right;
float: right; } font-size: 12px; }
form p { form p {
position: relative; position: relative;
@ -390,3 +390,6 @@ h1.big_text {
margin-top: -5px; margin-top: -5px;
margin-bottom: 20px; margin-bottom: 20px;
color: #999999; } color: #999999; }
#next_prev_links {
text-align: center; }

View file

@ -327,10 +327,11 @@ input[type='text'], textarea
:border-radius 3px :border-radius 3px
:-moz-border-radius 3px :-moz-border-radius 3px
#submit_block
input[type='submit'] :text
:display block :align right
:float right :font
:size 12px
form p form p
:position relative :position relative
@ -483,4 +484,5 @@ h1.big_text
:bottom 20px :bottom 20px
:color #999 :color #999
#next_prev_links
:text-align center