diff --git a/src/EventHub.Web/Pages/Index.cshtml b/src/EventHub.Web/Pages/Index.cshtml index 6af7b65..ec9c992 100644 --- a/src/EventHub.Web/Pages/Index.cshtml +++ b/src/EventHub.Web/Pages/Index.cshtml @@ -9,11 +9,14 @@ @section styles { + } @section scripts { + + } @@ -47,23 +50,30 @@
- - @foreach (var country in Model.Countries) + @foreach (var language in Model.Languages) { - + }
-
- - +
+ + +
- +
diff --git a/src/EventHub.Web/Pages/Index.cshtml.cs b/src/EventHub.Web/Pages/Index.cshtml.cs index 3253cfa..829e9e6 100644 --- a/src/EventHub.Web/Pages/Index.cshtml.cs +++ b/src/EventHub.Web/Pages/Index.cshtml.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Threading.Tasks; @@ -14,6 +15,8 @@ namespace EventHub.Web.Pages public IReadOnlyList Events { get; private set; } public IReadOnlyList OnlineEvents { get; private set; } + + public List Languages { get; private set; } public List Countries { get; private set; } @@ -42,7 +45,18 @@ namespace EventHub.Web.Pages } )).Items; + Languages = CultureInfo.GetCultures(CultureTypes.NeutralCultures) + .DistinctBy(x => x.EnglishName) + .OrderBy(x => x.EnglishName) + .ToList(); + Languages.Remove(Languages.Single(x => x.TwoLetterISOLanguageName == "iv")); // Invariant Language + Countries = await _eventAppService.GetCountriesLookupAsync(); + Countries.Insert(0, new CountryLookupDto + { + Id = Guid.Empty, + Name = "Online" + }); } public async Task OnPostLoginAsync() diff --git a/src/EventHub.Web/Pages/Index.css b/src/EventHub.Web/Pages/Index.css index 3f73b78..6e7bc8d 100644 --- a/src/EventHub.Web/Pages/Index.css +++ b/src/EventHub.Web/Pages/Index.css @@ -1,3 +1,19 @@ -body { - +.inputLocation { + width: 300px; + position: relative; } + +.backToLocation { + position: absolute; + top: 0; + border-radius: 5px; + right: 10px; + z-index: 2; + border: none; + top: 10px; + height: 30px; + cursor: pointer; + color: white; + background-color: #D64560; + transform: translateX(2px); +} \ No newline at end of file diff --git a/src/EventHub.Web/Pages/Index.js b/src/EventHub.Web/Pages/Index.js index 2d85255..eca7f4d 100644 --- a/src/EventHub.Web/Pages/Index.js +++ b/src/EventHub.Web/Pages/Index.js @@ -1,29 +1,61 @@ $(function () { $('.main-slider .owl-carousel').owlCarousel({ - loop:true, - center:true, - margin:0, - padding:0, - nav:true, - items:1, + loop: true, + center: true, + margin: 0, + padding: 0, + nav: true, + items: 1, dots: false, }); - + $('.card-slider .owl-carousel').owlCarousel({ - loop:false, - center:false, - margin:30, - padding:0, - nav:true, + loop: false, + center: false, + margin: 30, + padding: 0, + nav: true, slideBy: 2, - responsive:{ - 0:{ - items:1, + responsive: { + 0: { + items: 1, }, - 600:{ - items:2, + 600: { + items: 2, }, }, dots: true, }); + + var countryId = "00000000-0000-0000-0000-000000000000" + $('#inputLocation').on('change', function (e) { + countryId = this.value + if (countryId !== "00000000-0000-0000-0000-000000000000" && countryId !== "Location"){ + $('#inputLocation').hide() + $('.locationGroup').append("") + $('.backToLocation').css('visibility', 'visible') + $('#inputCity').attr('type', 'text').show() + } + }); + + $('.backToLocation').on('click', '', function (e) { + $('.labelCity').remove() + $('.backToLocation').css('visibility', 'hidden') + $('#inputCity').val('').attr('type', 'text').hide() + $('#inputLocation').show() + }); + + var $inputWhen = $("#inputWhen"); + $inputWhen.daterangepicker({ + autoUpdateInput: false, + locale: { + cancelLabel: 'Clear' + } + }); + $inputWhen.on('apply.daterangepicker', function(ev, picker) { + $(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format('MM/DD/YYYY')); + }); + $inputWhen.on('cancel.daterangepicker', function(ev, picker) { + $(this).val(''); + }); }); \ No newline at end of file