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_photos = @album.photos
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

View file

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

View file

@ -17,7 +17,6 @@
-unless mine? @album
%h4= "by #{@album.person.real_name}"
- for photo in @album_photos
= link_to (image_tag photo.image.url(:thumb_medium)), object_path(photo)
@ -26,4 +25,4 @@
= link_to "⇧ albums", albums_path
-if mine? @album
.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
= link_to '⇧ ostatus', ostatus_path
= "#{@author.username}'s stream"
.button.right
= link_to 'Unsubscribe', @author, :confirm => 'Are you sure?', :method => :delete
- if @author_ostatus_posts
%ul#stream
@ -16,3 +14,5 @@
#content_bottom
.back
= 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
.button.right
= link_to 'Edit', '#'
= link_to 'Edit Photo', edit_photo_path(@photo)
.sub_header
= link_to "full size", @photo.image.url
@ -12,8 +12,11 @@
%div{:id => @photo.id}
#show_photo
= link_to_prev @photo, @album
= linked_scaled_photo @photo, @album
#next_prev_links
= link_to_prev @photo, @album
|
= link_to_next @photo, @album
#content_bottom

View file

@ -1,6 +1,12 @@
%h1 Editing Profile
= form_for @user do |f|
%h1.big_text
.back
= link_to "⇧ home", root_path
Editing your profile
= f.error_messages
= f.fields_for :profile do |p|
@ -35,8 +41,12 @@
%p
= f.label :url
= f.text_field :url
%p
= f.submit
%p
= link_to "Show", user_path(@user)
#submit_block
= 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;
-moz-border-radius: 3px; }
input[type='submit'] {
display: block;
float: right; }
#submit_block {
text-align: right;
font-size: 12px; }
form p {
position: relative;
@ -390,3 +390,6 @@ h1.big_text {
margin-top: -5px;
margin-bottom: 20px;
color: #999999; }
#next_prev_links {
text-align: center; }

View file

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