Пример #1
0
 public HomeView()
     : base("Home SpotiChelas",
            H1(Text("Home")),
            Ul(
                Li(A(ResolveUri.ForPlaylist(), "Playlists")),
                Li(A(ResolveUri.ForSearch(), "Search"))
                )
            )
 {
 }
Пример #2
0
 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"))
                 )
            )
 {
 }
Пример #3
0
 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"))
                )
            )
 {
 }
Пример #4
0
 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"))
                )
            )
 {
 }
Пример #5
0
 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"))
                )
            )
 {
 }
Пример #6
0
 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"))
                )
            )
 {
 }
Пример #7
0
 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"))
                )
            )
 {
 }
Пример #8
0
 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"))
                )
            )
 {
 }
Пример #9
0
        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);
        }