Skip to content

Commit

Permalink
Merge pull request #88 from Swetugg/show-speaker-links-on-speaker-pag…
Browse files Browse the repository at this point in the history
…e-#29

add links on speaker page #29
  • Loading branch information
StacyCash authored Oct 19, 2024
2 parents ded789e + c4eca3f commit d413c27
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 20 deletions.
38 changes: 20 additions & 18 deletions DbModels/Speaker.cs
Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@
using System;
using System.Collections.Generic;


namespace swetugg_public.DbModels;

public partial class Speaker
{
public int Id { get; set; }


public int ConferenceId { get; set; }


public string Name { get; set; } = null!;


public string? Company { get; set; }


public string Slug { get; set; } = null!;


public string? Bio { get; set; }


public string? Web { get; set; }


public string? Twitter { get; set; }


public string? GitHub { get; set; }


public string? LinkedIn { get; set; }

public bool Published { get; set; }


public int Priority { get; set; }


public Guid? SessionizeId { get; set; }


public string FirstName { get; set; } = null!;


public string? SessionizeImageUrl { get; set; }


public virtual Conference Conference { get; set; } = null!;


public virtual ICollection<SpeakerImage> SpeakerImages { get; } = new List<SpeakerImage>();


public virtual ICollection<Session> Sessions { get; } = new List<Session>();


public virtual ICollection<Tag> Tags { get; } = new List<Tag>();
}
27 changes: 26 additions & 1 deletion Pages/gbg-2024/Speakers.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
{
speakerImageUrl = firstThumb.ImageUrl;
}

var tagClasses = speaker.Tags.Select(t => "tag-" + t.Slug).ToArray();
var socialLinks = new Dictionary<string, string>
{
{ "Twitter", speaker.Twitter },
{ "GitHub", speaker.GitHub },
{ "LinkedIn", speaker.LinkedIn },
{ "Website", speaker.Web }
};
}

<section id="info" class="content-section text-center speaker">
Expand All @@ -30,9 +38,26 @@
</div>
<h1 style="margin-top: 20px;">@speaker.Name</h1>
<h2>@speaker.Company</h2>
<div class="social-links speakerLinkGroup">
@foreach (var link in socialLinks)
{
if (!string.IsNullOrEmpty(link.Value))
{
<a href="@link.Value" target="_blank" class="social-link">@link.Key</a>
}
}
</div>
<style>
.social-link {
margin-right: 10px;
}
.social-link:not(:last-child)::after {
content: '|';
margin-left: 10px;
}
</style>
</div>
</div>

</div>
</div>
</section>
Expand Down
26 changes: 25 additions & 1 deletion Pages/sthlm-2025/Speakers.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
speakerImageUrl = firstThumb.ImageUrl;
}
var tagClasses = speaker.Tags.Select(t => "tag-" + t.Slug).ToArray();
var socialLinks = new Dictionary<string, string>
{
{ "Twitter", speaker.Twitter },
{ "GitHub", speaker.GitHub },
{ "LinkedIn", speaker.LinkedIn },
{ "Website", speaker.Web }
};
}

<section id="info" class="content-section text-center speaker">
Expand All @@ -30,9 +37,26 @@
</div>
<h1 style="margin-top: 20px;">@speaker.Name</h1>
<h2>@speaker.Company</h2>
<div class="social-links speakerLinkGroup">
@foreach (var link in socialLinks)
{
if (!string.IsNullOrEmpty(link.Value))
{
<a href="@link.Value" target="_blank" class="social-link">@link.Key</a>
}
}
</div>
<style>
.social-link {
margin-right: 10px;
}
.social-link:not(:last-child)::after {
content: '|';
margin-left: 10px;
}
</style>
</div>
</div>

</div>
</div>
</section>
Expand Down

0 comments on commit d413c27

Please sign in to comment.