public HomeView() : base("Home SpotiChelas", H1(Text("Home")), Ul( Li(A(ResolveUri.ForPlaylist(), "Playlists")), Li(A(ResolveUri.ForSearch(), "Search")) ) ) { }
public PlaylistNewView(ViewPlaylist p) : base("New Playlist", H1(Text("Create a new playlist")), Form("post", ResolveUri.ForPlaylist(), Label("name", "Name: "), InputText("name", p == null ? "" : p.Name), Label("desc", "Description: "), InputText("desc", p == null ? "" : p.Description), P(InputSubmit("Submit")) ) ) { }
public ArtistView(ViewArtist artist) : base(artist.Name, H1(Text(string.Format("Artist : {0}", artist.Name))), P(Label("name", "Name"), Text(artist.Name)), H2(Text("Albuns")), Ul( artist.Albuns.Select(alb => Li(A(ResolveUri.ForAlbum(alb.Key), alb.Value))).ToArray() ), Ul( Li(A(ResolveUri.ForPlaylist(), "Playlists")), Li(A(ResolveUri.ForSearch(), "Search")) ) ) { }
public SearchView(List <ViewArtist> artists, SearchInfo info) : base("Search Results", H1(Text("Results")), H2(Text("Artists")), artists.Count > 0 ? Ul(artists.Select(art => Li(Text(art.Name), A(ResolveUri.For(art), "View"))).ToArray()) : Text("No results found"), //SearchFrame(info), Ul( Li(A(ResolveUri.ForHome(), "Home")), Li(A(ResolveUri.ForPlaylist(), "Playlists")) ) ) { }
public SearchView(List <ViewTrack> tracks, SearchInfo info) : base("Search Results", H1(Text("Results")), H2(Text("Tracks")), tracks.Count > 0 ? Ul( tracks.Select(trc => Li(Text(trc.Name), A(ResolveUri.For(trc), trc.Name))).ToArray() ) : Text("No results found"), //SearchFrame(info), Ul( Li(A(ResolveUri.ForHome(), "Home")), Li(A(ResolveUri.ForPlaylist(), "Playlists")) ) ) { }
public SearchView() : base("Search Form", H1(Text("Search")), Form("POST", "/search", InputText("search", "Search Query"), InputBox("type", Option("artists", "Artists"), Option("albuns", "Albuns"), Option("tracks", "Tracks") ), InputSubmit("Search") ), Ul( Li(A(ResolveUri.ForHome(), "Home")), Li(A(ResolveUri.ForPlaylist(), "Playlists")) ) ) { }
public TrackView(ViewTrack track) : base(track.Name, H1(Text(string.Format("Track : {0}", track.Name))), P(Label("name", "Name"), Text(track.Name)), P(Label("duration", "Duration"), Text(track.Duration)), P(Label("album", "Album"), Text(track.Album.Value), A(ResolveUri.ForAlbum(track.Album.Key), "View")), H2(Text("Artists")), Ul( track.Artists.Select(art => Li(A(ResolveUri.ForArtist(art.Key), art.Value))).ToArray() ), TrackPlayer(track.Href), Ul( Li(A(ResolveUri.ForAddTrack(track.Href), "Adicionar")), Li(A(ResolveUri.ForPlaylist(), "Playlists")), Li(A(ResolveUri.ForSearch(), "Search")) ) ) { }
public AlbumView(ViewAlbum album) : base(album.Name, H1(Text(string.Format("Album : {0}", album.Name))), P(Label("name", "Name"), Text(album.Name)), P(Label("year", "Release"), Text(album.Year)), H2(Text("Artists")), Ul( album.Artist.Select(a => Li(A(ResolveUri.ForArtist(a.Key), a.Value))).ToArray() ), H2(Text("Tracks")), Ul( album.Tracks.Select(trc => Li(A(ResolveUri.ForTrack(trc.Key), trc.Value))).ToArray() ), PlaylistPlayer(album.Name, album.Tracks.Select(track => track.Key).ToArray()), Ul( Li(A(ResolveUri.ForPlaylist(), "Playlists")), Li(A(ResolveUri.ForSearch(), "Search")) ) ) { }
public HttpResponseMessage Delete(int id) { var p = Rules.Remove.Playlist(id); if (p == null) { return(new HttpResponseMessage(HttpStatusCode.BadRequest)); } var response = new HttpResponseMessage(HttpStatusCode.SeeOther); response.Headers.Location = new Uri(string.Format("http://localhost:8080{0}", ResolveUri.ForPlaylist())); return(response); }