Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 49.11 KB | None | 0 0
  1. @using EventCyborgEvent.Infrastructure.Enums
  2. @using EventCyborgEvent.Utils
  3. @using EventCybortEvent.WebApp.Areas.Home.Models
  4. @using EventCybortEvent.WebApp.Areas.Home.Resources
  5. @model  IEnumerable<ActivityWallModel.UserPosted>
  6.  
  7.  
  8. @foreach (var row in Model)
  9. {
  10.     var sharedClass = @"posted";
  11.     var activityTypeTextResource = "";
  12.     var sharedTextResource = "";
  13.     var activityWalltype = ActivityWallTypeEnum.UserPosted;
  14.     var mediaEnum = MediaActivityTypeEnumerator.View;
  15.     var IsTagged = false;
  16.     var onActivity = false;
  17.     var activityTaggedList = new List<ConferencesModels.AttendeeModel>(row.TaggedList);
  18.     var hasMoreText = row.Post.Content.Length > 280;
  19.     string uploadTypeTag = "post";
  20.     if (row.MediaUploaded.Any() && row.MediaUploaded[0].MediaType == "Pictures")
  21.    {
  22.        uploadTypeTag = row.MediaUploaded.Count() == 1 ? Aigenda.PictureUserProfile : Aigenda.Pictures;
  23.     }
  24.  
  25.     var margin = "284px";
  26.     <div class="activity-item" data-id="@row.Post.OriginalId" data-type="Post" data-isshared="@row.IsShared">
  27.         <!-- start USER ACTIVITY -->
  28.         @if (!row.BlockUsers)
  29.         {
  30.             var linkUsername = "<a href=\"{0}\">{1}</a>";
  31.             var owner = string.Format(linkUsername, Url.Action("Profile", "Users", new { id = row.OwnerOfPost.UserName }), row.OwnerOfPost.FullName);
  32.             var firstUserLink = row.GroupAttendees.Any() ?
  33.                                         row.GroupAttendees[0].ItIsMe && !row.IsUserProfile ?
  34.                                        Aigenda.You : string.Format(linkUsername, Url.Action("Profile", "Users", new { id = row.GroupAttendees[0].Username }), row.GroupAttendees[0].FullName) :
  35.                                         ((row.AutenticatedUserId != null && row.UserPost.UserId == Guid.Parse(row.AutenticatedUserId) && !row.UserPost.ViewedOnUserProfile) ? Aigenda.You : string.Format(linkUsername, Url.Action("Profile", "Users", new { id = row.UserPost.UserName }), row.UserPost.FullName));
  36.             var secondUserLink = row.GroupAttendees.Count() > 1 ? string.Format(linkUsername, Url.Action("Profile", "Users", new { id = row.GroupAttendees[1].Username }), row.GroupAttendees[1].FullName) : "";
  37.             var thirdUserLink = row.GroupAttendees.Count() > 2 ? string.Format(linkUsername, Url.Action("Profile", "Users", new { id = row.GroupAttendees[2].Username }), row.GroupAttendees[2].FullName) : "";
  38.             var linkOthers1 = "<a onclick=\"ConferenceCard.displayTaggedInPostDialog('{0}')\">{1}</a>";
  39.             var userstoEx = "";
  40.             foreach (var attendeeModel in activityTaggedList.Take(2))
  41.             {
  42.                 userstoEx += attendeeModel.UserId.ToString() + ",";
  43.             }
  44.  
  45.             var othersLink1 = Url.Action("GetUsersTaggedInPost", "ActivityWall", new { usersToExclude = userstoEx, mediaId = row.ParentMediaId });
  46.             var othersBetter = string.Format(linkOthers1, othersLink1, (activityTaggedList.Count - 2) + " others");
  47.  
  48.  
  49.             switch (row.MediaActivityType)
  50.             {
  51.                 case MediaActivityTypeEnumerator.Upload:
  52.                     activityTypeTextResource = ActivityWall.UserPosted;
  53.  
  54.                     break;
  55.                 case MediaActivityTypeEnumerator.Tag:
  56.  
  57.  
  58.                     if (activityTaggedList.Count() > 2)
  59.                     {
  60.                         activityTypeTextResource = "{2}, {3} and {4} were tagged in {0}'s {1}:";
  61.                     }
  62.                     else if (activityTaggedList.Count() == 2)
  63.                     {
  64.                         activityTypeTextResource = "{2} and {3} were tagged in {0}'s {1}:";
  65.                     }
  66.                     else
  67.                     {
  68.                         activityTypeTextResource = "{2} were tagged in {0}'s {1}:";
  69.                     }
  70.  
  71.                     break;
  72.                 case MediaActivityTypeEnumerator.Share:
  73.  
  74.                     if (row.ShareOwnerOfPost != null)
  75.                     {
  76.                         if (HttpContext.Current.Request.Url.AbsolutePath.Contains("Users/Profile/"))
  77.                         {
  78.                             activityTypeTextResource = ActivityWall.UserSharedPostWithOwnerAsYouUserProfile;
  79.                         }
  80.                         else
  81.                         {
  82.                             if (row.AutenticatedUserId != null && row.ShareOwnerOfPost.UserId.ToString().ToLower() == row.AutenticatedUserId.ToLower())
  83.                            {
  84.                                activityTypeTextResource = ActivityWall.UserSharedPostWithOwnerAsYou;
  85.                             }
  86.                             else
  87.                             {
  88.                                 activityTypeTextResource = ActivityWall.UserSharedPostWithOwner;
  89.                             }
  90.                         }
  91.                     }
  92.                     else
  93.                     {
  94.                         activityTypeTextResource = ActivityWall.UserSharedPostWithOwner;
  95.                     }
  96.                     mediaEnum = MediaActivityTypeEnumerator.Share;
  97.                     break;
  98.                 case MediaActivityTypeEnumerator.Comment:
  99.                     if (!row.IsShared)
  100.                     {
  101.                         switch (row.GroupAttendees.Count())
  102.                         {
  103.                             case 0:
  104.                             case 1:
  105.                                 if (row.OwnerOfPost.UserId.ToString() == row.AutenticatedUserId)
  106.                                 {
  107.                                     if (HttpContext.Current.Request.Url.AbsolutePath.Contains("Users/Profile/"))
  108.                                     {
  109.                                         activityTypeTextResource = ActivityWall.UserCommentedOnPostWithOwnerAsYouUserProfile;
  110.                                     }
  111.                                     else
  112.                                     {
  113.                                         activityTypeTextResource = ActivityWall.UserCommentedOnPostWithOwnerAsYou;
  114.                                     }
  115.                                 }
  116.                                 else
  117.                                 {
  118.                                     activityTypeTextResource = ActivityWall.UserCommentedOnPostWithOwner;
  119.                                 }
  120.                                 break;
  121.                             case 2:
  122.                                 activityTypeTextResource = row.OwnerOfPost.UserId.ToString() == row.AutenticatedUserId ?
  123.                                     ActivityWall.TwoUsersCommentedOnPostWithOwnerAsYou
  124.                                     : ActivityWall.TwoUsersCommentedOnPostWithOwner;
  125.                                 break;
  126.                             case 3:
  127.                                 activityTypeTextResource = row.OwnerOfPost.UserId.ToString() == row.AutenticatedUserId ?
  128.                                     ActivityWall.ThreeUsersCommentedOnPostWithOwnerAsYou
  129.                                     : ActivityWall.ThreeUsersCommentedOnPostWithOwner;
  130.                                 break;
  131.                             default:
  132.                                 if (row.GroupAttendees.Count() > 3)
  133.                                 {
  134.                                     activityTypeTextResource = row.OwnerOfPost.UserId.ToString() == row.AutenticatedUserId ?
  135.                                         ActivityWall.MoreThanThreeUsersCommentedOnPostWithOwnerAsYou
  136.                                         : ActivityWall.MoreThanThreeUsersCommentedOnPostWithOwner;
  137.                                 }
  138.                                 break;
  139.                         }
  140.                     }
  141.                     else
  142.                     {
  143.                         switch (row.GroupAttendees.Count())
  144.                         {
  145.                             case 0:
  146.                             case 1:
  147.                                 activityTypeTextResource = ActivityWall.UserCommentedOnSharedPost;
  148.                                 break;
  149.                             case 2:
  150.                                 activityTypeTextResource = ActivityWall.TwoUsersCommentedOnSharedPost;
  151.                                 break;
  152.                             case 3:
  153.                                 activityTypeTextResource = ActivityWall.ThreeUsersCommentedOnSharedPost;
  154.                                 break;
  155.                             default:
  156.                                 if (row.GroupAttendees.Count() > 3)
  157.                                 {
  158.                                     activityTypeTextResource = ActivityWall.MoreThanThreeUsersCommentedOnSharedPost;
  159.                                 }
  160.                                 break;
  161.                         }
  162.                         sharedTextResource = ActivityWall.UserSharedPostWithOwner;
  163.                     }
  164.                     mediaEnum = MediaActivityTypeEnumerator.Comment;
  165.                     break;
  166.  
  167.                 case MediaActivityTypeEnumerator.Like:
  168.                     if (!row.IsShared)
  169.                     {
  170.                         switch (row.GroupAttendees.Count())
  171.                         {
  172.                             case 0:
  173.                             case 1:
  174.                                 if (row.OwnerOfPost.UserId.ToString() == row.AutenticatedUserId)
  175.                                 {
  176.                                     if (HttpContext.Current.Request.Url.AbsolutePath.Contains("Users/Profile/"))
  177.                                     {
  178.                                         activityTypeTextResource = ActivityWall.UserLikedPostWithOwnerAsYouUserProfile;
  179.                                     }
  180.                                     else
  181.                                     {
  182.                                         activityTypeTextResource = ActivityWall.UserLikedPostWithOwnerAsYou;
  183.                                     }
  184.                                 }
  185.                                 else
  186.                                 {
  187.                                     activityTypeTextResource = ActivityWall.UserLikedPostWithOwner;
  188.                                 }
  189.                                 break;
  190.                             case 2:
  191.                                 activityTypeTextResource = row.OwnerOfPost.UserId.ToString() == row.AutenticatedUserId ?
  192.                                     ActivityWall.TwoUsersLikedPostWithOwnerAsYou
  193.                                     : ActivityWall.TwoUsersLikedPostWithOwner;
  194.                                 break;
  195.                             case 3:
  196.                                 activityTypeTextResource = row.OwnerOfPost.UserId.ToString() == row.AutenticatedUserId ?
  197.                                     ActivityWall.ThreeUsersLikedPostWithOwnerAsYou
  198.                                     : ActivityWall.ThreeUsersLikedPostWithOwner;
  199.                                 break;
  200.                             default:
  201.                                 if (row.GroupAttendees.Count() > 3)
  202.                                 {
  203.                                     activityTypeTextResource = row.OwnerOfPost.UserId.ToString() == row.AutenticatedUserId ?
  204.                                         ActivityWall.MoreThanThreeUsersLikedPostWithOwnerAsYou
  205.                                         : ActivityWall.MoreThanThreeUsersLikedPostWithOwner;
  206.                                 }
  207.                                 break;
  208.                         }
  209.                     }
  210.                     else
  211.                     {
  212.                         sharedTextResource = ActivityWall.UserSharedPostWithOwner;
  213.  
  214.                         switch (row.GroupAttendees.Count())
  215.                         {
  216.                             case 0:
  217.                             case 1:
  218.                                 activityTypeTextResource = ActivityWall.UserLikedSharedPost;
  219.                                 break;
  220.                             case 2:
  221.                                 activityTypeTextResource = ActivityWall.TwoUsersLikedSharedPost;
  222.                                 break;
  223.                             case 3:
  224.                                 activityTypeTextResource = ActivityWall.ThreeUsersLikedSharedPost;
  225.                                 break;
  226.                             default:
  227.                                 if (row.GroupAttendees.Count() > 3)
  228.                                 {
  229.                                     activityTypeTextResource = ActivityWall.MoreThanThreeUsersLikedSharedPost;
  230.                                 }
  231.                                 break;
  232.                         }
  233.                     }
  234.                     mediaEnum = MediaActivityTypeEnumerator.Like;
  235.                     break;
  236.             }
  237.  
  238.  
  239.            
  240.  
  241.             <div class="user-activity cl">
  242.                 <div class="image">
  243.  
  244.  
  245.                     @{
  246.                         var urlProfile1 = "";
  247.                         if (!row.IsUserProfile && HttpContext.Current.Request.Url.AbsolutePath.Contains("Home/ActivityWall"))
  248.                        {
  249.                            if (row.UserAutenticated)
  250.                            {
  251.                                if (row.TaggedList.Any(x => String.Equals(x.UserId, row.AutenticatedUserId, StringComparison.CurrentCultureIgnoreCase)))
  252.                                {
  253.                                    //IsTagged = true;
  254.                                     onActivity = true;
  255.                                 }
  256.                             }
  257.                         }
  258.  
  259.  
  260.                         ////If owner of post is watching Wall
  261.                         //if (row.UserAutenticated)
  262.                         //{
  263.                         //    if (row.TaggedList.Any(x => String.Equals(x.UserId, row.AutenticatedUserId, StringComparison.CurrentCultureIgnoreCase)))
  264.                         //    {
  265.                         //        IsTagged = true;
  266.                         //    }
  267.                         //}
  268.                        
  269.                     }
  270.                     @if (onActivity)
  271.                     {
  272.                         if (activityTaggedList.Count > 0 && !string.IsNullOrEmpty(row.AutenticatedUserId) && activityTaggedList.Any(x => x.UserId.ToLower() == row.AutenticatedUserId))
  273.                        {
  274.                            var temp = activityTaggedList.FirstOrDefault(x => x.UserId.ToLower() == row.AutenticatedUserId.ToLower());
  275.                             if (temp != null)
  276.                             {
  277.                                 activityTaggedList.Remove(temp);
  278.                                 activityTaggedList.Insert(0, temp);
  279.                             }
  280.                         }
  281.                         <a href="@Url.Action("Profile", "Users", new { id = activityTaggedList.FirstOrDefault().Username })" title="@activityTaggedList.FirstOrDefault().FullName" data-tooltip="tooltip" data-original-title="@activityTaggedList.FirstOrDefault().FullName" data-placement="left">
  282.                             <img src="@activityTaggedList.FirstOrDefault().ImagePath" onerror="this.src = '/Content/img/empty-user-photo.png' " />
  283.                             @if (activityTaggedList.FirstOrDefault().IsSpeaker)
  284.                             {
  285.                                 <span class="is-speaker"></span>
  286.                             }
  287.  
  288.                         </a>
  289.                     }
  290.                     else if (row.GroupAttendees.Any())
  291.                     {
  292.                         <a href="@Url.Action("Profile", "Users", new {id = row.GroupAttendees.FirstOrDefault().Username})" title="@row.GroupAttendees.FirstOrDefault().FullName" data-tooltip="tooltip" data-original-title="@row.GroupAttendees.FirstOrDefault().FullName" data-placement="left">
  293.                             <img src="@row.GroupAttendees.FirstOrDefault().ImagePath" onerror="this.src = '/Content/img/empty-user-photo.png' " />
  294.                             @if (@row.GroupAttendees.FirstOrDefault().IsSpeaker)
  295.                             {
  296.                                 <span class="is-speaker"></span>
  297.                             }
  298.                         </a>
  299.                     }
  300.                     else
  301.                     {
  302.                         <a href="@Url.Action("Profile", "Users", new {id = row.UserPost.UserName})" title="@row.UserPost.FullName" data-tooltip="tooltip" data-original-title="@row.UserPost.FullName" data-placement="bottom">
  303.                             <img src="@row.UserPost.ImagePath" onerror=" this.src='/Content/img/empty-user-photo.png' " />
  304.  
  305.                             @if (@row.UserPost.IsSpeaker)
  306.                             {
  307.                                 <span class="is-speaker"></span>
  308.                             }
  309.                         </a>
  310.                     }
  311.  
  312.                 </div>
  313.                 <div class="info">
  314.                     <h3>
  315.                      
  316.                         @{
  317.                             if (row.IsUserProfile)
  318.                             {
  319.                                 firstUserLink = activityTaggedList.Any() ?
  320.                                     activityTaggedList[0].ItIsMe && !row.IsUserProfile ?
  321.                                        Aigenda.You : string.Format(linkUsername, Url.Action("Profile", "Users", new { id = activityTaggedList[0].Username }), activityTaggedList[0].FullName) :
  322.                                    string.Format(linkUsername, Url.Action("Profile", "Users", new { id = row.UserPost.UserName }), row.UserPost.FullName);
  323.                                 secondUserLink = activityTaggedList.Count() > 1 ? string.Format(linkUsername, Url.Action("Profile", "Users", new { id = activityTaggedList[1].Username }), activityTaggedList[1].FullName) : "";
  324.                                 thirdUserLink = activityTaggedList.Count() > 2 ? string.Format(linkUsername, Url.Action("Profile", "Users", new { id = activityTaggedList[2].Username }), activityTaggedList[2].FullName) : "";
  325.                                 linkOthers1 = "<a onclick=\"ConferenceCard.displayTaggedInPostDialog('{0}')\">{1}</a>";
  326.                                 userstoEx = "";
  327.                                 foreach (var attendeeModel in activityTaggedList.Take(2))
  328.                                 {
  329.                                     userstoEx += attendeeModel.UserId.ToString() + ",";
  330.                                 }
  331.  
  332.                                 othersLink1 = Url.Action("GetUsersTaggedInPost", "ActivityWall", new { usersToExclude = userstoEx, mediaId = row.ParentMediaId });
  333.                                 othersBetter = string.Format(linkOthers1, othersLink1, (activityTaggedList.Count - 2) + " others");
  334.  
  335.                                 if (activityTaggedList.Count() == 1)
  336.                                 {
  337.                                     @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink))
  338.                                 }
  339.                                 else if (activityTaggedList.Count() == 2)
  340.                                 {
  341.                                     @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink, secondUserLink))
  342.                                 }
  343.                                 else if (activityTaggedList.Count() == 3)
  344.                                 {
  345.                                     @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink, secondUserLink, thirdUserLink))
  346.                                 }
  347.                                 else if (activityTaggedList.Count() > 3)
  348.                                 {
  349.                                     @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink, secondUserLink, othersBetter))
  350.                                 }
  351.                                 else
  352.                                 {
  353.                                     @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink))
  354.                                 }
  355.                             }
  356.                             else if (row.GroupAttendees.Any() && HttpContext.Current.Request.Url.AbsolutePath.Contains("Home/ActivityWall"))
  357.                            {
  358.                                linkUsername = "<a href=\"{0}\">{1}</a>";
  359.                                
  360.                                 firstUserLink = row.GroupAttendees.Any() ?
  361.                                                             row.GroupAttendees[0].ItIsMe && !row.IsUserProfile ?
  362.                                                            Aigenda.You : string.Format(linkUsername, Url.Action("Profile", "Users", new { id = row.GroupAttendees[0].Username }), row.GroupAttendees[0].FullName) :
  363.                                                             ((row.AutenticatedUserId != null && row.UserPost.UserId == Guid.Parse(row.AutenticatedUserId) && !row.UserPost.ViewedOnUserProfile) ? Aigenda.You : string.Format(linkUsername, Url.Action("Profile", "Users", new { id = row.UserPost.UserName }), row.UserPost.FullName));
  364.                                 secondUserLink = row.GroupAttendees.Count() > 1 ? string.Format(linkUsername, Url.Action("Profile", "Users", new { id = row.GroupAttendees[1].Username }), row.GroupAttendees[1].FullName) : "";
  365.                                 thirdUserLink = row.GroupAttendees.Count() > 2 ? string.Format(linkUsername, Url.Action("Profile", "Users", new { id = row.GroupAttendees[2].Username }), row.GroupAttendees[2].FullName) : "";
  366.                                 linkOthers1 = "<a onclick=\"ConferenceCard.displayTaggedInPostDialog('{0}')\">{1}</a>";
  367.                                 userstoEx = "";
  368.                                 foreach (var attendeeModel in activityTaggedList.Take(2))
  369.                                 {
  370.                                     userstoEx += attendeeModel.UserId.ToString() + ",";
  371.                                 }
  372.  
  373.                                 othersLink1 = Url.Action("GetUsersTaggedInPost", "ActivityWall", new { usersToExclude = userstoEx, mediaId = row.ParentMediaId });
  374.                                 othersBetter = string.Format(linkOthers1, othersLink1, (activityTaggedList.Count - 2) + " others");
  375.                                
  376.                                 if (row.IsShared && row.MediaActivityType == MediaActivityTypeEnumerator.Share)
  377.                                {
  378.                                    owner = string.Format(linkUsername, Url.Action("Profile", "Users", new { id = row.ShareOwnerOfPost.UserName }), row.ShareOwnerOfPost.FullName);
  379.                                     @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink))
  380.                                 }
  381.                                 else
  382.                                 {
  383.                                     if (row.GroupAttendees.Count() == 1)
  384.                                     {
  385.                                         @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink))
  386.                                     }
  387.                                     else if (row.GroupAttendees.Count() == 2)
  388.                                     {
  389.                                         @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink, secondUserLink))
  390.                                     }
  391.                                     else if (row.GroupAttendees.Count() == 3)
  392.                                     {
  393.                                         @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink, secondUserLink, thirdUserLink))
  394.                                     }
  395.                                     else if (row.GroupAttendees.Count() > 3)
  396.                                     {
  397.                                         @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink, secondUserLink, othersBetter))
  398.                                     }
  399.                                     else
  400.                                     {
  401.                                         @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink))
  402.                                     }
  403.                                 }
  404.                             }
  405.                             else
  406.                             {
  407.                                 if (row.IsShared && row.ActivityType == ActivityWallTypeEnum.UserSharedPost)
  408.                                {
  409.                                    @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink))
  410.                                }
  411.                                else
  412.                                {
  413.                                    @*@Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink))*@
  414.  
  415.                                     if (row.GroupAttendees.Count() == 1)
  416.                                    {
  417.                                        @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink))
  418.                                    }
  419.                                    else if (row.GroupAttendees.Count() == 2)
  420.                                    {
  421.                                        @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink, secondUserLink))
  422.                                    }
  423.                                    else if (row.GroupAttendees.Count() == 3)
  424.                                    {
  425.                                        @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink, secondUserLink, thirdUserLink))
  426.                                    }
  427.                                    else if (row.GroupAttendees.Count() > 3)
  428.                                    {
  429.                                        @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink, secondUserLink, othersBetter))
  430.                                    }
  431.                                    else
  432.                                    {
  433.                                        @Html.Raw(string.Format(activityTypeTextResource, owner, uploadTypeTag, firstUserLink))
  434.                                    }
  435.                                }
  436.  
  437.                            }
  438.                        }
  439.  
  440.  
  441.  
  442.                    </h3>
  443.                </div>
  444.                <div class="time">
  445.                    <p title="@String.Format("{0:f}",row.PostedOn)">@row.PostedOnFormatted</p>
  446.                </div>
  447.            </div>
  448.  
  449.             <!-- end USER ACTIVITY -->
  450.    <div class="conference-card clearfix">
  451.        <div class="conference-card-wrapper">
  452.            <span class="conference-type">@uploadTypeTag</span>
  453.  
  454.            @if (row.IsShared &&
  455.                        (row.MediaActivityType == MediaActivityTypeEnumerator.Comment
  456.                        || row.MediaActivityType == MediaActivityTypeEnumerator.Like))
  457.            {
  458.                <br />
  459.                <div class="person-image">
  460.                    <a href="@Url.Action("Profile", "Users", new { id = row.OwnerOfPost.UserName })" title="@row.OwnerOfPost.FullName" data-tooltip="tooltip" data-placement="bottom">
  461.                        <img src="@row.OwnerOfPost.ImagePath" onerror="this.src='/Content/img/empty-user-photo.png' " />
  462.                        @if (row.OwnerOfPost.IsSpeaker)
  463.                        {
  464.                            <span class="is-speaker-small"></span>
  465.                        }
  466.                    </a>
  467.                </div>
  468.                <div class="post-persons">
  469.                    @{
  470.                        @Html.Raw(string.Format(sharedTextResource, owner, uploadTypeTag, firstUserLink))
  471.                    }
  472.                </div>
  473.  
  474.            }
  475.            <div class="media media-@(row.MediaUploaded.Count > 4 ? "4" : row.MediaUploaded.Count.ToString()) clearfix">
  476.                @{ long _mediaID = 0;}
  477.  
  478.                 @if (row.MediaUploaded != null && row.MediaUploaded.Count > 0)
  479.                {
  480.                    _mediaID = row.MediaUploaded[0].Media.MediaId;
  481.                     <div class="media-info" style="margin-left: @margin">
  482.                         @if (row.MediaActivityType == MediaActivityTypeEnumerator.Upload
  483.                                  || row.MediaActivityType == MediaActivityTypeEnumerator.Comment
  484.                                  || row.MediaActivityType == MediaActivityTypeEnumerator.Like)
  485.                         {
  486.                             sharedClass = "posted";
  487.                         }
  488.                         @if (row.IsShared)
  489.                         {
  490.                             sharedClass = "shared-border";
  491.                         }
  492.  
  493.  
  494.                         @if (!string.IsNullOrEmpty(row.SharedText))
  495.                         {
  496.                             @*<p class="share-description-post-img">@Html.Raw(row.SharedText)</p>*@
  497.  
  498.  
  499.                             var hasMoreTextt = row.SharedText.Length > 280 && !row.SharedText.Contains("href");
  500.                             <p class="contentshort share-description-post-img" style="@(hasMoreTextt ? "display:inline;" : "display:none;")">
  501.                                 @*@HttpUtility.HtmlDecode(row.SharedText.TruncateAtWord(280))...*@
  502.                                 @Html.Raw(EventCybortEvent.WebApp.Areas.Home.Classes.TopicsHelper.TruncateAtWordCustom(row.SharedText.Trim(), row.SharedText.Trim().Length, 280))....
  503.  
  504.                             </p>
  505.                             <p class="description share-description-post-img" style="@(!hasMoreTextt ? "display:inline;" : "display:none;")">
  506.                                 @*@HttpUtility.HtmlDecode(row.SharedText)*@
  507.                                 @Html.Raw(row.SharedText)
  508.                             </p>
  509.                             <a href="javascript:void(0)" class="content-more" data-text-swap="@Aigenda.ShowLess" data-text-original="@Aigenda.ShowMore" style="@(hasMoreTextt ? "display:inline-block;" : "display: none;")">@Aigenda.ShowMore</a>
  510.                         }
  511.                         <div class="@sharedClass">
  512.                             @if (!string.IsNullOrEmpty(row.Post.Name))
  513.                             {
  514.                                 <h2><a data-toggle="modal" data-target="#mediaOpen" data-mediaid="@_mediaID" data-typeofmedia="Pictures">@HttpUtility.HtmlDecode(row.Post.Name)</a></h2>
  515.                             }
  516.                             <p class="description-post">
  517.                                 @if (!string.IsNullOrEmpty(row.Post.Content))
  518.                                 {
  519.  
  520.                                 <p class="contentshort" style="@(hasMoreText ? "display:inline;" : "display:none;")">
  521.                                     @Html.Raw(EventCybortEvent.WebApp.Areas.Home.Classes.TopicsHelper.TruncateAtWordCustom(row.Post.Content, row.Post.Content.Length, 280))....
  522.                                 </p>
  523.                                     <p class="description" style="@(!hasMoreText ? "display:inline;" : "display:none;")">
  524.                                         @Html.Raw(HttpUtility.HtmlDecode(row.Post.Content))
  525.                                     </p>
  526.                                     <a href="javascript:void(0)" class="content-more" data-text-swap="@Aigenda.ShowLess" data-text-original="@Aigenda.ShowMore" style="@(hasMoreText ? "display:inline-block;" : "display: none;")">@Aigenda.ShowMore</a>
  527.  
  528.                                 }
  529.                                 @if (!string.IsNullOrEmpty(row.Event.EventName))
  530.                                 {
  531.                                     <span class="at">@Aigenda.At</span> <a href="@Url.Action("EventDetails", "Conferences", new {id = row.Event.UniqueName})">@row.Event.EventName</a>
  532.                                 }
  533.                                 </p>
  534.  
  535.                                 @if (!string.IsNullOrEmpty(row.Event.EventLocation))
  536.                                 {
  537.                                     <p class="icn-location">@row.Event.EventLocation.Trim()</p>
  538.                                 }
  539.  
  540.                                 <div class="flag-location clearfix">
  541.                                     @if (!string.IsNullOrEmpty(row.Event.CountryCode))
  542.                                     {
  543.                                         <div class="country-flag flag-@row.Event.CountryCode.ToLower()"></div>
  544.                                     }
  545.                                     @if (!string.IsNullOrEmpty(row.Event.EventCity))
  546.                                     {
  547.                                         <a class="location-link" href="@Url.Action("Index", "Conferences", new { city = row.Event.EventCity.Trim() })">@row.Event.EventCity.Trim()</a>
  548.                                     }
  549.                                     @if (!string.IsNullOrEmpty(row.Event.EventCountry))
  550.                                     {
  551.                                         if (!string.IsNullOrEmpty(row.Event.EventCity))
  552.                                         {
  553.                                             <span></span>
  554.                                         }
  555.                                         <a class="location-link" href="@Url.Action("Index", "Conferences", new { country = row.Event.EventCountry.Trim() })">@row.Event.EventCountry.Trim()</a>
  556.                                     }
  557.                                 </div>
  558.                                 @if (row.Post.PostSource == 1)
  559.                                 {
  560.                                     <span class="t-source">@Aigenda.SourceTwitter</span>
  561.                                 }
  562.  
  563.                                 @if (row.Event.Topics != null && row.Event.Topics.Any())
  564.                                {
  565.  
  566.                                        <div class="relevance-media clearfix mediaMargin">
  567.                                            <p>@Aigenda.TopicsIn</p>
  568.                                            <div class="media-topics">
  569.  
  570.                                                @{
  571.                                        var i = 6;
  572.                                         <ul>
  573.                                             @foreach (var tag in row.Event.Topics)
  574.                                             {
  575.                                                 if (i == 0)
  576.                                                 {
  577.                                                     break;
  578.                                                 }
  579.                                                 <li class="topicCards">
  580.                                                     <a href="@Url.Action("TopicDetail", "Topics" , new { id=tag.TopicValue })">@HttpUtility.HtmlDecode(tag.TopicValue)</a>
  581.  
  582.                                             </li>
  583.                                             i--;
  584.                                         }
  585.                                     </ul>
  586.                                             }
  587.  
  588.                                         </div>
  589.                                     </div>
  590.                                 }
  591.                                 @if (row.Event.Keywords != null && row.Event.Keywords.Any())
  592.                                {
  593.  
  594.                                        <div class="relevance-media clearfix mediaMargin">
  595.                                            <p>@Aigenda.Keywords</p>
  596.                                            <div class="media-topics">
  597.                                                @{
  598.                                        var j = 6;
  599.                                         <ul>
  600.                                             @foreach (var keywordModel in row.Event.Keywords)
  601.                                             {
  602.                                                 if (j == 0)
  603.                                                 {
  604.                                                     break;
  605.                                                 }
  606.                                                 <li class="keywordsCards">
  607.                                                     <a href="@Url.Action("KeywordDetail", "Topics", new { id = keywordModel.KeywordId })">@HttpUtility.HtmlDecode(keywordModel.KeywordValue)</a>
  608.                                                 </li>
  609.                                                 j--;
  610.                                             }
  611.                                         </ul>
  612.                                                 }
  613.                                             </div>
  614.                                         </div>
  615.                                     }
  616.  
  617.  
  618.  
  619.                                 @if (row.TaggedList.Any())
  620.                                 {
  621.                                     <div class="media-people clearfix">
  622.                                         @{
  623.                                     var peopleString = @"People on this picture";
  624.                                     if (@row.MediaUploaded.Count > 1)
  625.                                     {
  626.                                         peopleString = @"People on this pictures";
  627.                                     }
  628.                                         }
  629.                                         <p>@peopleString</p>
  630.                                         <ul class="people">
  631.                                             @foreach (var taggedUser in row.TaggedList)
  632.                                             {
  633.                                                 <li>
  634.                                                     <a href="@Url.Action("Profile", "Users", new {id = taggedUser.Username})" data-tooltip="tooltip" data-placement="top" title="@taggedUser.FullName" data-original-title="@taggedUser.FullName">
  635.                                                         @if (taggedUser.IsSpeaker)
  636.                                                         {
  637.                                                             <div class="icnSpeaker post-is-speaker">
  638.                                                                 <span class="is-speaker"></span>
  639.                                                             </div>
  640.                                                         }
  641.                                                         <img src="@taggedUser.ImagePath" onerror="this.src='/Content/img/empty-user-photo.png' " />
  642.                                                     </a>
  643.                                                 </li>
  644.                                             }
  645.                                         </ul>
  646.                                         <div class="clearfix"></div>
  647.                                         @if (row.HasMoreTaggedList)
  648.                                         {
  649.                                             <a class="all" href="javascript:void(0)" data-toggle="modal" onclick="ConferenceCard.displayTaggedDialog('@row.Post.Id') " data-target="#showAllAttendees">@Aigenda.ViewAll</a>
  650.                                         }
  651.                                     </div>
  652.                                 }
  653.                             </div>
  654.  
  655.  
  656.  
  657.                         </div>
  658.  
  659.                 }
  660.                 else if (row.MediaUploaded != null && row.MediaUploaded.Count == 0)
  661.                {
  662.  
  663.                    if ((row.MediaActivityType == MediaActivityTypeEnumerator.Upload
  664.                             || row.MediaActivityType == MediaActivityTypeEnumerator.Tag
  665.                             || row.MediaActivityType == MediaActivityTypeEnumerator.Comment
  666.                             || row.MediaActivityType == MediaActivityTypeEnumerator.Like) && !row.IsShared)
  667.                    {
  668.                        sharedClass = "posted";
  669.  
  670.                         <div class="media-info" style="margin-left: @margin">
  671.                             <div class="@sharedClass">
  672.                                 <p class="description-post fff">
  673.                                     @if (!string.IsNullOrEmpty(row.Post.Content))
  674.                                     {
  675.                                         var hasMoreTextt = row.Post.Content.Length > 280 && !row.Post.Content.Contains("href");
  676.                                     <p class="contentshort" style="@(hasMoreText ? "display:inline;" : "display:none;")">
  677.                                         @Html.Raw(HttpUtility.HtmlDecode(row.Post.Content.TruncateAtWord(280)))...
  678.                                     </p>
  679.                                         <p class="description" style="@(!hasMoreText ? "display:inline;" : "display:none;")">
  680.                                             @Html.Raw(HttpUtility.HtmlDecode(row.Post.Content))
  681.                                         </p>
  682.                                         <a href="javascript:void(0)" class="content-more" data-text-swap="@Aigenda.ShowLess" data-text-original="@Aigenda.ShowMore" style="@(hasMoreText ? "display:inline-block;" : "display: none;")">@Aigenda.ShowMore</a>
  683.                                     }
  684.                                     @if (!string.IsNullOrEmpty(row.Event.EventName))
  685.                                     {
  686.                                         <span class="at">@Aigenda.At</span> <a href="@Url.Action("EventDetails", "Conferences", new {id = row.Event.UniqueName})">@row.Event.EventName</a>
  687.                                     }
  688.  
  689.                                     </p>
  690.                                     @if (row.Post.PostSource == 1)
  691.                                     {
  692.                                         <span class="t-source">@Aigenda.SourceTwitter</span>
  693.                                     }
  694.                                 </div>
  695.                             </div>
  696.                     }
  697.                     if (row.IsShared)
  698.                     {
  699.                         sharedClass = "shared-border";
  700.  
  701.                         if (!string.IsNullOrEmpty(row.SharedText))
  702.                         {
  703.                             @*<p class="share-description-post">@Html.Raw(row.SharedText)</p>*@
  704.  
  705.  
  706.                             var hasMoreTextt = row.SharedText.Length > 280 && !row.SharedText.Contains("href");
  707.                             <p class="contentshort share-description-post" style="@(hasMoreTextt ? "display:inline;" : "display:none;")">
  708.                                 @HttpUtility.HtmlDecode(row.SharedText.TruncateAtWord(280))...
  709.                             </p>
  710.                             <p class="description share-description-post" style="@(!hasMoreTextt ? "display:inline;" : "display:none;")">
  711.                                 @HttpUtility.HtmlDecode(row.SharedText)
  712.                             </p>
  713.                             <a href="javascript:void(0)" class="content-more" data-text-swap="@Aigenda.ShowLess" data-text-original="@Aigenda.ShowMore" style="@(hasMoreTextt ? "display:inline-block;" : "display: none;")">@Aigenda.ShowMore</a>
  714.                         }
  715.                         <div class="media-info" style="margin-left: @margin">
  716.                             <div class="@sharedClass">
  717.  
  718.                                 <p class="description-post">
  719.                                     @if (!string.IsNullOrEmpty(row.Post.Content))
  720.                                     {
  721.  
  722.                                     <p class="contentshort" style="@(hasMoreText ? "display:inline;" : "display:none;")">
  723.                                         @Html.Raw(HttpUtility.HtmlDecode(row.Post.Content.TruncateAtWord(280)))...
  724.                                     </p>
  725.                                         <p class="description" style="@(!hasMoreText ? "display:inline;" : "display:none;")">
  726.                                             @Html.Raw(HttpUtility.HtmlDecode(row.Post.Content))
  727.                                         </p>
  728.                                         <a href="javascript:void(0)" class="content-more" data-text-swap="@Aigenda.ShowLess" data-text-original="@Aigenda.ShowMore" style="@(hasMoreText ? "display:inline-block;" : "display: none;")">@Aigenda.ShowMore</a>
  729.                                     }
  730.                                     @if (!string.IsNullOrEmpty(row.Event.EventName))
  731.                                     {
  732.                                         <span class="at">@Aigenda.At</span> <a href="@Url.Action("EventDetails", "Conferences", new {id = row.Event.UniqueName})">@row.Event.EventName</a>
  733.                                     }
  734.                                     </p>
  735.  
  736.                                     @if (row.TaggedList.Any())
  737.                                     {
  738.                                         <div class="media-people clearfix">
  739.                                             @{
  740.                                         var peopleString = @"People on this picture";
  741.                                         if (@row.MediaUploaded.Count > 1)
  742.                                         {
  743.                                             peopleString = @"People on this pictures";
  744.                                         }
  745.                                             }
  746.                                             <p>@peopleString</p>
  747.                                             <ul class="people">
  748.                                                 @foreach (var taggedUser in row.TaggedList)
  749.                                                 {
  750.                                                     <li>
  751.                                                         <a href="@Url.Action("Profile", "Users", new {id = taggedUser.Username})" data-tooltip="tooltip" data-placement="top" title="@taggedUser.FullName" data-original-title="@taggedUser.FullName">
  752.                                                             @if (taggedUser.IsSpeaker)
  753.                                                             {
  754.                                                                 <div class="icnSpeaker">
  755.                                                                     <span class="is-speaker"></span>
  756.                                                                 </div>
  757.                                                             }
  758.                                                             <img src="@taggedUser.ImagePath" onerror=" this.src='/Content/img/empty-user-photo.png' " />
  759.                                                         </a>
  760.                                                     </li>
  761.                                                 }
  762.                                             </ul>
  763.                                             <div class="clearfix"></div>
  764.                                             @if (row.HasMoreTaggedList)
  765.                                             {
  766.                                                 <a class="all" href="javascript:void(0)" data-toggle="modal" onclick="ConferenceCard.displayTaggedDialog('@row.Post.Id') " data-target="#showAllAttendees">@Aigenda.ViewAll</a>
  767.                                             }
  768.                                         </div>
  769.  
  770.                                     }
  771.                                     @if (row.Post.PostSource == 1)
  772.                                     {
  773.                                         <span class="t-source">@Aigenda.SourceTwitter</span>
  774.                                     }
  775.                                 </div>
  776.                             </div>
  777.                     }
  778.  
  779.                 }
  780.  
  781.  
  782.                 @if (row.MediaUploaded != null && row.MediaUploaded.Count > 0)
  783.                {
  784.                    margin = "0px";
  785.                     <div class="media-img">
  786.  
  787.                         @{
  788.                     var j = 0;
  789.                     var linkText = "";
  790.                     foreach (var me in row.MediaUploaded)
  791.                     {
  792.                         if (j > 3)
  793.                         {
  794.                             break;
  795.                         }
  796.                         if (me.MediaSourcePath != null)
  797.                         {
  798.                             _mediaID = me.Media.MediaId;
  799.                             string strArr = me.MediaSourcePath.Substring(0, me.MediaSourcePath.LastIndexOf('.'));
  800.                             string strArrLast = me.MediaSourcePath.Split('.').Last();
  801.                             string pathToThumb = strArr + "_mediumthumb." + strArrLast;
  802.  
  803.                             linkText += "<a data-toggle='modal' data-ArrowsShow='True' data-target='#mediaOpen' data-mediaid='" + me.Media.MediaId + "' data-typeofmedia='Pictures'" + "style='background-image: url(" + Uri.EscapeUriString(pathToThumb) + ")'>";
  804.  
  805.                             if (j == 3 && row.MediaUploaded.Count > 4)
  806.                            {
  807.                                linkText += "<div class='rest-of-pic'><h3>+ " + (row.MediaUploaded.Count - 4) + "</h3></div>";
  808.                             }
  809.  
  810.  
  811.                             linkText += "</a>";
  812.                         }
  813.                         j++;
  814.                     }
  815.                         }
  816.                         @Html.Raw(linkText)
  817.                     </div>
  818.                 }
  819.             </div>
  820.  
  821.         </div>
  822.         <!-- start CONFERENCE ACTIONS -->
  823.         <div class="conference-actions clearfix js-MediaContent">
  824.             @Html.Partial("_BottomActionSection", row)
  825.             <div class="jsCommentSection">
  826.                 @Html.Partial("../Shared/CommentsSection", row.Event)
  827.             </div>
  828.         </div>
  829.  
  830.         <!-- end CONFERENCE ACTIONS -->
  831.     </div>
  832.  
  833.         }
  834.        
  835.     </div>
  836. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement