v1.0.9.0
This commit is contained in:
@@ -47,7 +47,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
/// <summary>Article activity info. </summary>
|
||||
public class ActivityResponseData_Article
|
||||
{
|
||||
public ActivityResponseData_Article(SaxModel_Online model, SaxJournalistArticle article)
|
||||
public ActivityResponseData_Article(SaxController_Online controller, SaxModel_Online model, SaxJournalistArticle article)
|
||||
{
|
||||
Headline = article.Headline;
|
||||
Summary = article.Summary;
|
||||
@@ -56,7 +56,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
PublishedOnFmt = model.Localiser.FormatDate(article.PublishedAt);
|
||||
SaxJournalistArticle.ContentData content = SaxJournalistArticle.ExtractContent(article.BodyData);
|
||||
foreach (SaxJournalistArticle.ContentData.SegmentData segment in content.Segments)
|
||||
Content.Segments.Add(new ContentData.SegmentData(segment));
|
||||
Content.Segments.Add(new ContentData.SegmentData(controller, segment));
|
||||
}
|
||||
public String Headline { get; set; }
|
||||
public String Summary { get; set; }
|
||||
@@ -67,15 +67,29 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
{
|
||||
public class SegmentData
|
||||
{
|
||||
public SegmentData(SaxJournalistArticle.ContentData.SegmentData segment)
|
||||
public SegmentData(SaxController_Online controller, SaxJournalistArticle.ContentData.SegmentData segment)
|
||||
{
|
||||
Body.Html = segment.Body.Html;
|
||||
if (segment.Body.IsValid())
|
||||
{
|
||||
Body = new BodyData();
|
||||
Body.Html = segment.Body.Html;
|
||||
}
|
||||
else if (segment.Image.IsValid())
|
||||
{
|
||||
Image = new ImageData();
|
||||
Image.Link = JournalistController.GetArticleImageLink(controller, segment.Image.ItemImageId);
|
||||
}
|
||||
}
|
||||
public class BodyData
|
||||
{
|
||||
public String Html { get; set; }
|
||||
}
|
||||
public BodyData Body { get; } = new BodyData();
|
||||
public BodyData Body { get; }
|
||||
public class ImageData
|
||||
{
|
||||
public String Link { get; set; }
|
||||
}
|
||||
public ImageData Image { get; }
|
||||
}
|
||||
public List<SegmentData> Segments { get; } = new List<SegmentData>();
|
||||
}
|
||||
@@ -214,7 +228,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
SaLogger.Warn(fn + " Article not found for Activity Id: " + itemId.ToString() + "." + getLogSuffix());
|
||||
return Json(responseData);
|
||||
}
|
||||
responseData.Article = new ActivityResponseData_Article(model, article);
|
||||
responseData.Article = new ActivityResponseData_Article(this, model, article);
|
||||
}
|
||||
else if (itemType == Sax.DataItemType.OrganisationOpportunity)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user