55@using RandomSiteControlsMVC .Helpers ;
66@using Telerik .Sitefinity ;
77
8- @Html.StyleSheet( "/Mvc/Views/Twitter/Resources/twitter.min.css", "head")
8+ @* @Html.StyleSheet("/Mvc/Views/Twitter/Resources/twitter.min.css", "head")*@
9+ @Html.StyleSheet(Url.EmbeddedResource( "RandomSiteControlsMVC.Reference", "RandomSiteControlsMVC.MVC.Views.Twitter.Resources.twitter.min.css"), "head")
910
1011@if (Model .Tweets .Count > 0 )
1112{
12- <div class =" twitter-feed @Model.CssClass" >
13- @foreach ( var t in Model .Tweets )
14- {
15- var isRetweet = t .RetweetedStatus == null ? false : true ;
16- var author = t .RetweetedStatus == null ? t .Author : t .RetweetedStatus .Author ;
17- var user = t .RetweetedStatus == null ? t .User : t .RetweetedStatus .User ;
13+ <div class =" twitter-feed @Model.CssClass" >
14+ @foreach ( var t in Model .Tweets )
15+ {
16+ var isRetweet = t .RetweetedStatus == null ? false : true ;
17+ var author = t .RetweetedStatus == null ? t .Author : t .RetweetedStatus .Author ;
18+ var user = t .RetweetedStatus == null ? t .User : t .RetweetedStatus .User ;
19+ var media = t .Entities .Where (x => x .EntityType == TweetSharp .TwitterEntityType .Media );
1820
19- <div class =" tweet" >
20- @if (t .RetweetedStatus != null )
21- {
22- <div class =" context retweetedby" >
23- <a class =" profile-link" href =" https://www.twitter.com/@t.Author.ScreenName" rel =" noopener" >
24- @t.Author.ScreenName Retweeted
25- </a >
26- </div >
27- }
28- <div class =" content" >
29- <div class =" stream-item-header" >
30- @* User Title*@
31- <a class =" account-group" href =" https://www.twitter.com/@(author.ScreenName)" >
32- <img alt =" @author.ScreenName" class =" avatar rounded-circle" src =" @author.ProfileImageUrl.Replace(" http: " ," https: " ).Replace(" _normal " ," _bigger " )" >
33- <span class =" FullNameGroup" >
34- <strong class =" fullname u-textTruncate" >@user.Name </strong >
35- @if (user .IsVerified .HasValue && user .IsVerified .Value )
36- {
37- <span class =" UserBadges" >
38- <span class =" Icon" >
39- <img src =" https://upload.wikimedia.org/wikipedia/commons/e/e4/Twitter_Verified_Badge.svg" alt =" Verified" />
40- </span >
41- </span >
42- }
43- <span class =" UserNameBreak" >  ; </span >
44- </span >
45- <span class =" username u-dir u-textTruncate" dir =" ltr" data-aria-label-part =" " >@@@( user .ScreenName ) </span >
46- </a >
47- </div >
48- @* Tweet body*@
49- <div class =" TweetTextSize" >
50- @Html.Raw(t.TextAsHtml)
51- </div >
52- @if (t .IsQuoteStatus && t .QuotedStatus != null )
21+ <div class =" tweet" >
22+ @if (t .RetweetedStatus != null )
5323 {
54- <div class =" QuoteTweet" >
55- <div class =" tweet-content" >
56- <div class =" QuoteTweet-authorAndText" >
57- <div class =" QuoteTweet-originalAuthor" >
24+ <div class =" context retweetedby" >
25+ <a class =" profile-link" href =" https://www.twitter.com/@t.Author.ScreenName" rel =" noopener" >
26+ @t.Author.ScreenName Retweeted
27+ </a >
28+ </div >
29+ }
30+ <div class =" content" >
31+ <div class =" stream-item-header" >
32+ @* User Title*@
33+ <a class =" account-group" href =" https://www.twitter.com/@(author.ScreenName)" >
34+ <img alt =" @author.ScreenName" class =" avatar rounded-circle" src =" @author.ProfileImageUrl.Replace(" http: " ," https: " ).Replace(" _normal " ," _bigger " )" >
35+ <span class =" FullNameGroup" >
36+ <strong class =" fullname u-textTruncate" >@user.Name </strong >
37+ @if (user .IsVerified .HasValue && user .IsVerified .Value )
38+ {
39+ <span class =" UserBadges" >
40+ <span class =" Icon" >
41+ <img src =" https://upload.wikimedia.org/wikipedia/commons/e/e4/Twitter_Verified_Badge.svg" alt =" Verified" />
42+ </span >
43+ </span >
44+ }
45+ <span class =" UserNameBreak" >  ; </span >
46+ </span >
47+ <span class =" username u-dir u-textTruncate" dir =" ltr" data-aria-label-part =" " >@@@( user .ScreenName ) </span >
48+ </a >
49+ </div >
50+ @* Tweet body*@
51+ <div class =" TweetTextSize" >
52+ @Html.Raw(t.TextAsHtml)
53+ </div >
54+ @if (t .IsQuoteStatus && t .QuotedStatus != null )
55+ {
56+ <div class =" QuoteTweet" >
57+ <div class =" tweet-content" >
58+ <div class =" QuoteTweet-authorAndText" >
59+ <div class =" QuoteTweet-originalAuthor" >
5860
59- </div >
60- <div class =" QuoteTweet-text" >
61- @Html.Raw(t.QuotedStatus.Text)
61+ </div >
62+ <div class =" QuoteTweet-text" >
63+ @Html.Raw(t.QuotedStatus.Text)
64+ </div >
6265 </div >
6366 </div >
6467 </div >
65- </div >
66- }
67- <div class =" stream-item-footer" >
68- <div class =" ProfileTweet-actionList" >
69- <div class =" ProfileTweet-actionCount " >
70- @t.RetweetCount
71- </div >
72- <div class =" ProfileTweet-actionCount " >
73- @t.FavoriteCount
74- </div >
75- </div >
68+ }
69+ @if (media .Count () > 0 )
70+ {
71+ foreach (TweetSharp .TwitterMedia m in media )
72+ {
73+ if (m .MediaType == TweetSharp .TwitterMediaType .Photo )
74+ {
75+ < div class = " AdaptiveMediaOuterContainer" >
76+ < div class = " AdaptiveMedia is-square" >
77+ < div class = " AdaptiveMedia-container" >
78+ < div class = " AdaptiveMedia-singlePhoto" style = " padding-top: calc(0.5409153952843273 * 100% - 0.5px);" >
79+ < div class = " AdaptiveMedia-photoContainer js-adaptive-photo " style = " background-color:rgba(64,64,10,1.0);" >
80+ < img src = " @m.MediaUrlHttps" alt = " " style = " width: 100%; top: -0px;" >
81+ < / div >
82+ < / div >
83+ < / div >
84+ < / div >
85+ < / div >
86+ }
87+ }
88+ }
89+ @* To impliment later... missing images*@
90+ @* <div class="stream-item-footer">
91+ <div class="ProfileTweet-actionList">
92+ <div class="ProfileTweet-action">
93+ <div class="ProfileTweet-actionCount ">
94+ @(t.RetweetCount > 0 ? t.RetweetCount.ToString() : "")
95+ </div>
96+ </div>
97+ <div class="ProfileTweet-action">
98+ <div class="ProfileTweet-actionCount ">
99+ @(t.FavoriteCount > 0 ? t.FavoriteCount.ToString() : "")
100+ </div>
101+ </div>
102+ </div>
103+ </div>*@
76104 </div >
77105 </div >
78- </div >
79- }
80- </div >
106+ }
107+ </div >
81108}
0 commit comments