public
Description: A Web-2.0 style, AJAX powered lyrics database using Ruby on Rails
Homepage: http://shanesveller.com/projects/
Clone URL: git://github.com/shanesveller/rails-lyrics.git
Album layouts and sidebar tools
shanesveller (author)
Thu Jul 17 08:33:57 -0700 2008
commit  ec091af176efeb74d57f4111fa6800a6749e145f
tree    6f585e6d47bffdc4c2909767b383bdd58a2ef8fb
parent  d439351de686a79f00b57f7bbf978c138377a82c
...
2
3
4
 
 
 
 
5
...
2
3
4
5
6
7
8
9
0
@@ -2,4 +2,8 @@ class AlbumsController < ApplicationController
0
   make_resourceful do
0
     actions :all
0
   end
0
+
0
+ def current_objects
0
+ @current_objects = Album.paginate :page => params[:page], :order => "title ASC"
0
+ end
0
 end
...
4
5
6
7
 
8
9
10
...
4
5
6
 
7
8
9
10
0
@@ -4,7 +4,7 @@ class ArtistsController < ApplicationController
0
   end
0
   
0
   def current_objects
0
- @current_objects = Artist.paginate :page => params[:page], :order => "genre, name ASC"
0
+ @current_objects = Artist.paginate :page => params[:page], :order => "name ASC"
0
   end
0
   
0
 end
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
 
 
 
17
...
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
3
4
5
6
0
@@ -1,16 +1,5 @@
0
 %div[album]
0
- %p.title
0
- %strong Title
0
- = h album.title
0
- %p.year
0
- %strong Year
0
- = h album.year
0
- %p.artist
0
- %strong Artist
0
- = h album.artist
0
-
0
- = link_to 'Show', object_path(album)
0
- |
0
- = link_to 'Edit', edit_object_path(album)
0
- |
0
- = link_to 'Destroy', object_path(album), :confirm => 'Really destroy album?', :method => :delete
0
+ %p
0
+ %span.name= link_to h(album.title), object_path(album)
0
+ \-
0
+ %span.artist= link_to h(album.artist.name), artist_path(album.artist)
0
\ No newline at end of file
...
1
2
3
4
5
 
 
 
 
 
...
 
 
1
2
 
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
-%h1 Listing albums
0
-
0
 = render :partial => 'album', :collection => current_objects
0
 
0
-= link_to 'New album', new_object_path
0
+= will_paginate(@current_objects)
0
+
0
+- content_for :sidebar do
0
+ %h1 Tools:
0
+ = link_to 'New album', new_object_path
...
4
5
6
 
 
 
 
 
 
7
8
9
...
4
5
6
7
8
9
10
11
12
13
14
15
0
@@ -4,6 +4,12 @@
0
     - if current_object.year
0
       = "(#{h current_object.year})"
0
   %h2.artist= link_to h(current_object.artist.name), artist_path(current_object.artist)
0
+
0
+ #listing
0
+ %h2= "Songs from #{h current_object.title}:"
0
+ %ul
0
+ - for song in current_object.lyrics.sort_by { |song| song.track }
0
+ %li= link_to h(song.title), lyric_path(song)
0
 
0
 #toolbar
0
   - if @user
...
1
2
3
4
5
6
7
 
 
 
 
 
...
 
 
 
1
2
 
3
4
5
6
7
8
0
@@ -1,6 +1,7 @@
0
-- content_for :navigation do
0
- = link_to 'New artist', new_object_path
0
-
0
 = render :partial => 'artist', :collection => current_objects
0
 
0
-= will_paginate(@current_objects)
0
\ No newline at end of file
0
+= will_paginate(@current_objects)
0
+
0
+- content_for :sidebar do
0
+ %h1 Tools:
0
+ = link_to 'New artist', new_object_path
...
4
5
6
 
 
 
 
 
 
 
 
7
8
 
 
9
10
11
...
4
5
6
7
8
9
10
11
12
13
14
15
 
16
17
18
19
20
0
@@ -4,8 +4,17 @@
0
     = h current_object.genre
0
 
0
   #listing
0
+ %h2= "Albums by #{h current_object.name}:"
0
+ %ul
0
+ - for album in current_object.albums.sort_by { |album| album.year }
0
+ %li
0
+ = link_to h(album.title), album_path(album)
0
+ = "(#{h album.year})"
0
+
0
+ %br/
0
     %h2= "Songs by #{h current_object.name}:"
0
- - for song in current_object.lyrics
0
+ %ul
0
+ - for song in current_object.lyrics.sort_by { |song| song.album.year }
0
       %li= link_to h(song.title), lyric_path(song)
0
 
0
 #toolbar
...
20
21
22
23
 
 
 
 
 
 
 
24
25
26
...
20
21
22
 
23
24
25
26
27
28
29
30
31
32
0
@@ -20,7 +20,13 @@
0
                 = yield
0
           
0
               .yui-u
0
- = yield :sidebar
0
+ %h1 Browse By:
0
+ %ul
0
+ %li= link_to "Artists", :controller => 'artists', :action => 'index'
0
+ %li= link_to "Albums", :controller => 'albums', :action => 'index'
0
+ %li= link_to "Songs", :controller => 'lyrics', :action => 'index'
0
+ %li= link_to "Tags", "/"
0
+ #sidebar= yield :sidebar
0
           
0
         .yui-b
0
           #user= render :partial => 'application/user'
...
19
20
21
22
23
24
25
26
 
27
28
29
...
48
49
50
51
 
 
52
53
54
...
19
20
21
 
22
23
24
 
25
26
27
28
...
47
48
49
 
50
51
52
53
54
0
@@ -19,11 +19,10 @@ a visited {
0
   #hd h4 {
0
     font-style: italic; }
0
 
0
-
0
 #search {
0
   margin: 1em 0 1em 0; }
0
 
0
-#admin {
0
+#admin, #user, #sidebar {
0
   margin-top: 2em; }
0
 
0
 #bd p .body {
0
@@ -48,7 +47,8 @@ a visited {
0
 .artist h1 {
0
   font-size: 150%;
0
   font-weight: bold; }
0
-.artist #listing {
0
+
0
+.artist #listing, .album #listing {
0
   margin-top: 1em;
0
   background: #99B;
0
   border: 1px solid black;
...
21
22
23
24
25
26
27
28
29
30
 
31
32
33
...
59
60
61
 
62
63
64
...
21
22
23
 
 
 
24
25
26
 
27
28
29
30
...
56
57
58
59
60
61
62
0
@@ -21,13 +21,10 @@ a visited
0
   h4
0
     font-style: italic
0
 
0
-#user
0
-
0
-
0
 #search
0
   margin: 1em 0 1em 0
0
 
0
-#admin
0
+#admin, #user, #sidebar
0
   margin-top: 2em
0
 
0
     
0
@@ -59,6 +56,7 @@ a visited
0
     font-size: 150%
0
     font-weight: bold
0
 
0
+.artist, .album
0
   #listing
0
     margin-top: 1em
0
     background: #99B

Comments

    No one has commented yet.