private void GetMetaSuccess(AdminMangaMetaGetResponse response) { Show(); jQuery.Select("#admin-manga-meta-title").Value(response.meta.title).Focus(); jQuery.Select("#admin-manga-meta-volume").Value(response.meta.volume < 0 ? "" : response.meta.volume.ToString()); jQuery.Select("#admin-manga-meta-year").Value(response.meta.year < 0 ? "" : response.meta.year.ToString()); jQuery.Select("#admin-manga-meta-tags").Value(response.meta.tags.Join(", ")); ((BootstrapTypeahead)((jQueryBootstrap)jQuery.Select("#admin-manga-meta-author").Value(response.meta.author)).Typeahead().GetDataValue("typeahead")).Source = response.authors; ((BootstrapTypeahead)((jQueryBootstrap)jQuery.Select("#admin-manga-meta-series").Value(response.meta.series)).Typeahead().GetDataValue("typeahead")).Source = response.series; ((BootstrapTypeahead)((jQueryBootstrap)jQuery.Select("#admin-manga-meta-publisher").Value(response.meta.publisher)).Typeahead().GetDataValue("typeahead")).Source = response.publishers; }
public override void HandleRequest(string jsonString, AjaxBase ajax) { if (!User.IsAdminLoggedIn(ajax)) { ajax.Unauthorized(); return; } AdminMangaMetaGetRequest request = Utility.ParseJson<AdminMangaMetaGetRequest>(jsonString); Manga manga = Manga.GetById(request.id); if (manga == null) { ajax.BadRequest(); return; } AdminMangaMetaGetResponse response = new AdminMangaMetaGetResponse(); response.meta = manga.GetMetaJson(); response.authors = MangaMeta.GetAuthors(); response.series = MangaMeta.GetSeries(); response.publishers = MangaMeta.GetPublishers(); ajax.ReturnJson(response); }