Albums are now created within a context
This commit is contained in:
parent
5ecbb28dc7
commit
aa5447f553
5 changed files with 5 additions and 41 deletions
|
|
@ -24,6 +24,7 @@ class AlbumsController < ApplicationController
|
|||
respond_to :json, :only => [:index, :show]
|
||||
|
||||
def index
|
||||
@aspect = current_user.aspect_by_id( params[:aspect] ) unless params[:aspect] == 'all'
|
||||
@albums = current_user.albums_by_aspect(@aspect).paginate
|
||||
respond_with @albums
|
||||
end
|
||||
|
|
|
|||
|
|
@ -24,5 +24,5 @@
|
|||
%p
|
||||
= f.label :name
|
||||
= f.text_field :name
|
||||
= f.hidden_field :to, :value => :all
|
||||
= f.hidden_field :to, :value => aspect
|
||||
= f.submit 'create', :class => 'button'
|
||||
|
|
|
|||
|
|
@ -30,16 +30,12 @@
|
|||
= render "shared/aspect_friends"
|
||||
|
||||
- content_for :publish do
|
||||
%br
|
||||
= link_to 'New Album', '#new_album_pane', {:class => "button", :id => "add_album_button"}
|
||||
|
||||
.yo{:style => "display:none;" }
|
||||
#new_album_pane
|
||||
= render "albums/new_album"
|
||||
|
||||
.sub_header
|
||||
%ul.button_set
|
||||
%li{:class => ("selected" if params[:friends])}= friends_albums_link
|
||||
%li{:class => ("selected" if not params[:friends])}= your_albums_link
|
||||
= render "albums/new_album", :aspect => params[:aspect]
|
||||
|
||||
%div
|
||||
- for album in @albums
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
-# Copyright 2010 Diaspora Inc.
|
||||
-#
|
||||
-# This file is part of Diaspora.
|
||||
-#
|
||||
-# Diaspora is free software: you can redistribute it and/or modify
|
||||
-# it under the terms of the GNU Affero General Public License as published by
|
||||
-# the Free Software Foundation, either version 3 of the License, or
|
||||
-# (at your option) any later version.
|
||||
-#
|
||||
-# Diaspora is distributed in the hope that it will be useful,
|
||||
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-# GNU Affero General Public License for more details.
|
||||
-#
|
||||
-# You should have received a copy of the GNU Affero General Public License
|
||||
-# along with Diaspora. If not, see <http://www.gnu.org/licenses/>.
|
||||
-#
|
||||
|
||||
|
||||
%h1.big_text
|
||||
=link_to 'aspects', aspects_path
|
||||
>>
|
||||
new aspect
|
||||
|
||||
= form_for @aspect do |f|
|
||||
= f.error_messages
|
||||
%p
|
||||
= f.label :name
|
||||
= f.text_field :name
|
||||
%p
|
||||
= f.submit
|
||||
|
||||
%p= link_to "Back to List", aspects_path
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
|
||||
- content_for :page_title do
|
||||
= link_to "photos", albums_path
|
||||
= link_to "photos", albums_path(:aspect => @aspect)
|
||||
|
||||
- content_for :left_pane do
|
||||
= render "shared/aspect_friends"
|
||||
|
|
|
|||
Loading…
Reference in a new issue