Skip to content

Commit

Permalink
Sessionize Inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnwildermuth committed Apr 2, 2020
1 parent 436ed8b commit 3623e34
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 146 deletions.
25 changes: 22 additions & 3 deletions src/CoreCodeCamp/Data/CodeCampRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@
using CoreCodeCamp.Models;
using CoreCodeCamp.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;

namespace CoreCodeCamp.Data
{
public class CodeCampRepository : ICodeCampRepository
{
private CodeCampContext _ctx;
private readonly IConfiguration _config;
private readonly IMapper _mapper;

public CodeCampRepository(CodeCampContext ctx, IMapper mapper)
public CodeCampRepository(CodeCampContext ctx, IConfiguration config, IMapper mapper)
{
_ctx = ctx;
_config = config;
_mapper = mapper;
}

Expand Down Expand Up @@ -57,18 +60,34 @@ public async Task<IEnumerable<EventInfo>> GetAllEventInfoAsync()

public async Task<EventInfo> GetCurrentEventAsync()
{
return await _ctx.CodeCampEvents
var camp = await _ctx.CodeCampEvents
.Include(e => e.Location)
.OrderByDescending(e => e.EventDate)
.FirstOrDefaultAsync();

if (_config["Data:ShowTestSessionize"] == "true")
{
camp.SessionizeId = "testconf-2020";
camp.SessionizeEmbedId = "ncg7gdmg";
}

return camp;

}

public async Task<EventInfo> GetEventInfoAsync(string moniker)
{
return await _ctx.CodeCampEvents
var camp = await _ctx.CodeCampEvents
.Include(e => e.Location)
.Where(e => e.Moniker == moniker)
.FirstOrDefaultAsync();

if (_config.GetValue<bool>("Data:ShowTestSessionize") == true) {
camp.SessionizeId = "testconf-2020";
camp.SessionizeEmbedId = "ncg7gdmg";
}

return camp;
}

public async Task<Speaker> GetSpeakerForCurrentUserAsync(string moniker, string userName)
Expand Down
142 changes: 1 addition & 141 deletions src/CoreCodeCamp/Views/Root/Schedule.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,145 +20,5 @@
</script>
}
<div class="row">
@if (favs.Count() > 0)
{
<div class="col-2">
<div class="row">
<h3>Your Favorites</h3>
<div class="text-left">
@foreach (var fav in favs)
{
<div class="card text-sm col-md-5 col-md-offset-1 col-12 favorite-box">
<span class="delete-star pull-right" data-id="@fav.Id" title="Remove Favorite"><i class="fa fa-close"></i></span>
<div>
<strong>
<a href="Speakers/@fav.Speaker.Slug">
@fav.Title
</a>
</strong>
</div>
<div> @fav.Speaker.Name </div>
@if (fav.Room != null)
{
<div class="text-sm">Room: @fav.Room.Name</div>
}
@if (fav.TimeSlot != null)
{
<div class="text-sm">
Time: @fav.TimeSlot.Time
</div>
}
</div>
}
</div>
</div>
</div>
}
<div class="col-md-12 col-@(favs.Count() > 0 ? "10" : "12")">
@if ((slots != null && slots[0].Count() > 0 && slots[1].Count() > 0) || isAdmin)
{
<div class="row">
<div class="col-11 offset-1 col-md-12"><h3>Schedule</h3></div>
<div class="col-1">
<p>7:45am-<span class="visible-lg visible-xl"> </span>8:30am</p>
</div>
<div class="panel col-11 col-md-12 panel-info">
<h4>Registration and Breakfast</h4>
<div><a href="/img/@(this.GetEventInfo().Moniker)/maps/campus.jpg" target="_blank">Building 840</a></div>
</div>
<div class="col-1">
<p>8:30am-<span class="visible-lg visible-xl"> </span>9:30am</p>
</div>
<div class="panel col-11 col-md-12 panel-success">
<h4>Introduction and Keynote</h4>
<p>
<img src="/img/2019/keynote-speaker.jpg" style="max-width: 150px; margin-bottom: 20px;" class="img-thumbnail img-circle img-responsive pull-right" /><strong>Rie Shewbart Irish</strong>(Sr Program Manager at Microsoft)
<br /><strong>Coding for Diversity & Inclusion</strong>
</p>
<p>Computers can't be biased right? It's simply ones and zeros, just lines of code.People can be biased and they're putting that bias into their code. Learn how to identify bias when it seeps in. </p>
<div><a href="/img/@(this.GetEventInfo().Moniker)/maps/campus.jpg" target="_blank"> Room 202 (Auditorium)</a></div>
</div>

@foreach (var slot in slots[0])
{
<div class="col-1 @(slot.Time.TimeOfDay == pickedTime.TimeOfDay ? "current-time" : "")">
<p>@slot.Time.ToString("hh:mmtt").ToLower()-<span class="visible-lg visible-xl"> </span>@slot.Time.AddHours(1).ToString("hh:mmtt").ToLower()</p>
</div>
<div class="col-11 col-md-12 ">
<div class="row">
@foreach (var talk in slot.Talks)
{
@await Html.PartialAsync("_ScheduleItem", talk)
}
</div>
</div>
}

<div class="col-1">
<p>12:00pm-<span class="visible-lg visible-xl"> </span>1:00pm</p>
</div>
<div class="panel col-11 panel-success">
<h4>Lunch</h4>
<div><a href="/img/@(this.GetEventInfo().Moniker)/maps/campus.jpg" target="_blank">Building 840</a></div>
</div>

@foreach (var slot in slots[1])
{
<div class="col-1 @(slot.Time.TimeOfDay == pickedTime.TimeOfDay ? "current-time" : "")">
<p>@slot.Time.ToString("hh:mmtt").ToLower()-<span class="visible-lg visible-xl"> </span>@slot.Time.AddHours(1).ToString("hh:mmtt").ToLower()</p>
</div>
<div class="col-11">
<div class="row">
@foreach (var talk in slot.Talks)
{
@await Html.PartialAsync("_ScheduleItem", talk)
}
</div>
</div>
}

<div class="col-1">
<p>5:00pm-<span class="visible-lg visible-xl"> </span>5:30pm</p>
</div>
<div class="panel col-11 panel-success">
<h4>Wrap-up and Giveaways</h4>
<div><a href="/img/@(this.GetEventInfo().Moniker)/maps/campus.jpg" target="_blank">202 (Auditorium)</a></div>
</div>

@*<div class="col-1">
<p>5:30pm-<span class="visible-lg visible-xl"> </span>8:30pm</p>
</div>
<div class="panel col-11 panel-success">
<h4>Attendee Party</h4>
<p>
<a href="https://magenic.com/"><img src="~/img/2017/sponsors/magenic.png" alt="Magenic" class="img-responsive img-thumbnail pull-right" /></a>Don't forget
to come to our after party at <a href="http://www.daveandbusters.com/marietta">Dave and Busters in Marietta</a>! Come eat, play pool, beat a video game, and maybe even some bowling. Thank our sponsor, Magenic for this great event!
</p>
<address class="text-left">
<a href="http://www.daveandbusters.com/marietta">Dave and Busters</a><br/>
2215 D&B Drive<br />
Marietta, GA 30067<br />
<a href="https://www.google.com/maps?q=from++to+2215%20D&B%20Drive,%20Marietta,%20Georgia,%2030067">Directions</a>
</address>
</div>*@
</div>
<div class="row">
<div class="schedule-item-legend col-md-4 col-md-offset-4">
<div class="text-center">Category Legend</div>
<div class="row">
@foreach (var cat in Model.Item4)
{
<div class="legend schedule-item-@(cat.Replace(" ", "-").ToLower()) ">
@cat
</div>
}
</div>
</div>
</div>
}
else
{
<p class="lead">Full Schedule Coming Soon</p>
}
</div>
<script type="text/javascript" src="https://sessionize.com/api/v2/@(this.GetEventInfo().SessionizeEmbedId)/view/GridSmart"></script>
</div>
10 changes: 9 additions & 1 deletion src/CoreCodeCamp/Views/Root/Sessions.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
<div class="row">
@if (Model == null || Model.Count() == 0)
{
<p class="lead">Once the sessions are finalized, they will appear here!</p>
var info = this.GetEventInfo();
@if (info.CallForSpeakersOpened <= DateTime.Today && info.CallForSpeakersClosed >= DateTime.Today)
{
<p class="lead">Once the sessions are finalized, they will appear here!</p>
}
else
{
<script type="text/javascript" src="https://sessionize.com/api/v2/@(info.SessionizeEmbedId)/view/Sessions"></script>
}
}
else
{
Expand Down
Binary file modified src/CoreCodeCamp/Views/Root/Speakers.cshtml
Binary file not shown.
3 changes: 2 additions & 1 deletion src/CoreCodeCamp/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"DockerDbCodeCamp": "Data Source=host.docker.internal\\SQLExpress;Initial Catalog=AtlantaCodeCamp;User ID=theapp;Password=P@ssw0rd!;Connect Timeout=5;MultipleActiveResultSets=True;",
"DbCodeCamp": "Data Source=WILDEREDIT\\SQLExpress;Initial Catalog=AtlantaCodeCamp;User ID=theapp;Password=P@ssw0rd!;Connect Timeout=5;MultipleActiveResultSets=True;",
"IterateDatabase": false,
"SeedDatabase": false
"SeedDatabase": false,
"ShowTestSessionize": true
},
"Admin": {
"SuperUser": {
Expand Down

0 comments on commit 3623e34

Please sign in to comment.