mirror of
https://gitlab.com/buildfeed/BuildFeed.git
synced 2024-03-22 21:10:34 +08:00
Language Override; RTL styling; Migration tooling
This commit is contained in:
parent
650248a95a
commit
302a9cc690
@ -34,4 +34,12 @@ $(function () {
|
|||||||
});
|
});
|
||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#lang-switcher a").click(function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
var lang = $(this).data("lang");
|
||||||
|
document.cookie = "lang=" + lang + "; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/";
|
||||||
|
|
||||||
|
location.reload(true);
|
||||||
|
});
|
||||||
});
|
});
|
@ -1,4 +1,5 @@
|
|||||||
@{
|
@using System.Globalization;
|
||||||
|
@{
|
||||||
bool IsRTL = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft;
|
bool IsRTL = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft;
|
||||||
}
|
}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@ -18,7 +19,7 @@
|
|||||||
@Styles.Render("~/content/css")
|
@Styles.Render("~/content/css")
|
||||||
@if (IsRTL)
|
@if (IsRTL)
|
||||||
{
|
{
|
||||||
Styles.Render("~/content/rtl");
|
@Styles.Render("~/content/rtl")
|
||||||
}
|
}
|
||||||
<title>@ViewBag.Title</title>
|
<title>@ViewBag.Title</title>
|
||||||
@RenderSection("head", false)
|
@RenderSection("head", false)
|
||||||
@ -78,10 +79,36 @@
|
|||||||
<li><a href="@Url.Action("addBuild", new { controller = "front", area = "" })" title="@BuildFeed.Local.Common.AddBuild"><i class="fa fa-fw fa-plus-square"></i> @BuildFeed.Local.Common.AddBuild</a></li>
|
<li><a href="@Url.Action("addBuild", new { controller = "front", area = "" })" title="@BuildFeed.Local.Common.AddBuild"><i class="fa fa-fw fa-plus-square"></i> @BuildFeed.Local.Common.AddBuild</a></li>
|
||||||
<li><a href="@Url.Action("logout", new { controller = "support", area = "" })" title="@BuildFeed.Local.Common.LogOut"><i class="fa fa-fw fa-user"></i> @BuildFeed.Local.Common.LogOut</a></li>
|
<li><a href="@Url.Action("logout", new { controller = "support", area = "" })" title="@BuildFeed.Local.Common.LogOut"><i class="fa fa-fw fa-user"></i> @BuildFeed.Local.Common.LogOut</a></li>
|
||||||
}
|
}
|
||||||
<li><a href="#" title="Search" id="page-navigation-search" title="@BuildFeed.Local.Common.Search"><i class="fa fa-fw fa-search"></i> @BuildFeed.Local.Common.Search</a></li>
|
<li><a href="#" id="page-navigation-search" title="@BuildFeed.Local.Common.Search"><i class="fa fa-fw fa-search"></i> @BuildFeed.Local.Common.Search</a></li>
|
||||||
<li><a href="@Url.Action("stats", new { controller = "support", area = "" })" title="@BuildFeed.Local.Common.Statistics"><i class="fa fa-fw fa-line-chart"></i> @BuildFeed.Local.Common.Statistics</a></li>
|
<li><a href="@Url.Action("stats", new { controller = "support", area = "" })" title="@BuildFeed.Local.Common.Statistics"><i class="fa fa-fw fa-line-chart"></i> @BuildFeed.Local.Common.Statistics</a></li>
|
||||||
<li><a href="@Url.Action("rss", new { controller = "support", area = "" })" title="@BuildFeed.Local.Common.RssFeeds"><i class="fa fa-fw fa-rss"></i> @BuildFeed.Local.Common.RssFeeds</a></li>
|
<li><a href="@Url.Action("rss", new { controller = "support", area = "" })" title="@BuildFeed.Local.Common.RssFeeds"><i class="fa fa-fw fa-rss"></i> @BuildFeed.Local.Common.RssFeeds</a></li>
|
||||||
<li><a href="https://twitter.com/buildfeed" title="@BuildFeed.Local.Common.Twitter" target="_blank"><i class="fa fa-fw fa-twitter"></i> @BuildFeed.Local.Common.Twitter</a></li>
|
<li><a href="https://twitter.com/buildfeed" title="@BuildFeed.Local.Common.Twitter" target="_blank"><i class="fa fa-fw fa-twitter"></i> @BuildFeed.Local.Common.Twitter</a></li>
|
||||||
|
<li>
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-globe"></i> <span class="caret"></span></a>
|
||||||
|
<ul id="lang-switcher" class="dropdown-menu">
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ar" ? "active" : "")"><a href="#" data-lang="ar">@CultureInfo.GetCultureInfo("ar").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "bn" ? "active" : "")"><a href="#" data-lang="bn">@CultureInfo.GetCultureInfo("bn").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "cs" ? "active" : "")"><a href="#" data-lang="cs">@CultureInfo.GetCultureInfo("cs").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "de" ? "active" : "")"><a href="#" data-lang="de">@CultureInfo.GetCultureInfo("de").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "el" ? "active" : "")"><a href="#" data-lang="el">@CultureInfo.GetCultureInfo("el").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "en" ? "active" : "")"><a href="#" data-lang="en">@CultureInfo.GetCultureInfo("en").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "es" ? "active" : "")"><a href="#" data-lang="es">@CultureInfo.GetCultureInfo("es").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "fi" ? "active" : "")"><a href="#" data-lang="fi">@CultureInfo.GetCultureInfo("fi").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "fr" ? "active" : "")"><a href="#" data-lang="fr">@CultureInfo.GetCultureInfo("fr").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "hr" ? "active" : "")"><a href="#" data-lang="hr">@CultureInfo.GetCultureInfo("hr").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "it" ? "active" : "")"><a href="#" data-lang="it">@CultureInfo.GetCultureInfo("it").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "nl" ? "active" : "")"><a href="#" data-lang="nl">@CultureInfo.GetCultureInfo("nl").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "pt" ? "active" : "")"><a href="#" data-lang="pt">@CultureInfo.GetCultureInfo("pt").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "pt-br" ? "active" : "")"><a href="#" data-lang="pt-br">@CultureInfo.GetCultureInfo("pt-br").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "qps-ploc" ? "active" : "")"><a href="#" data-lang="qps-ploc">@CultureInfo.GetCultureInfo("qps-ploc").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ru" ? "active" : "")"><a href="#" data-lang="ru">@CultureInfo.GetCultureInfo("ru").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "sk" ? "active" : "")"><a href="#" data-lang="sk">@CultureInfo.GetCultureInfo("sk").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "sl" ? "active" : "")"><a href="#" data-lang="en">@CultureInfo.GetCultureInfo("sl").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "sv" ? "active" : "")"><a href="#" data-lang="en">@CultureInfo.GetCultureInfo("sv").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "zh-cn" ? "active" : "")"><a href="#" data-lang="zh-cn">@CultureInfo.GetCultureInfo("zh-cn").NativeName</a></li>
|
||||||
|
<li class="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "zh-tw" ? "active" : "")"><a href="#" data-lang="zh-tw">@CultureInfo.GetCultureInfo("zh-tw").NativeName</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,3 +2,40 @@
|
|||||||
{
|
{
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pagination > li > a,
|
||||||
|
.pagination > li > span
|
||||||
|
{
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1[dir=ltr]
|
||||||
|
{
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px)
|
||||||
|
{
|
||||||
|
.navbar-header
|
||||||
|
{
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-nav > li
|
||||||
|
{
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-right
|
||||||
|
{
|
||||||
|
float: left !important;
|
||||||
|
margin-left: -15px;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-right .dropdown-menu
|
||||||
|
{
|
||||||
|
right: auto;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -9,6 +9,10 @@ using MBuild = RedisMongoMigration.Mongo.Build;
|
|||||||
using RBuild = RedisMongoMigration.Redis.Build;
|
using RBuild = RedisMongoMigration.Redis.Build;
|
||||||
using MongoLevelOfFlight = RedisMongoMigration.Mongo.MongoLevelOfFlight;
|
using MongoLevelOfFlight = RedisMongoMigration.Mongo.MongoLevelOfFlight;
|
||||||
using RedisLevelOfFlight = RedisMongoMigration.Redis.RedisLevelOfFlight;
|
using RedisLevelOfFlight = RedisMongoMigration.Redis.RedisLevelOfFlight;
|
||||||
|
using MMember = RedisMongoMigration.Mongo.MongoMember;
|
||||||
|
using RMember = RedisMongoMigration.Redis.RedisMember;
|
||||||
|
using RRole = RedisMongoMigration.Redis.RedisRole;
|
||||||
|
using MRole = RedisMongoMigration.Mongo.MongoRole;
|
||||||
|
|
||||||
namespace RedisMongoMigration
|
namespace RedisMongoMigration
|
||||||
{
|
{
|
||||||
@ -16,8 +20,7 @@ namespace RedisMongoMigration
|
|||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var builds = RBuild.Select();
|
var builds = from b in RBuild.Select()
|
||||||
var newBuilds = from b in builds
|
|
||||||
select new MBuildModel()
|
select new MBuildModel()
|
||||||
{
|
{
|
||||||
Id = Guid.NewGuid(),
|
Id = Guid.NewGuid(),
|
||||||
@ -38,8 +41,37 @@ namespace RedisMongoMigration
|
|||||||
FlightLevel = ExchangeFlights(b.FlightLevel)
|
FlightLevel = ExchangeFlights(b.FlightLevel)
|
||||||
};
|
};
|
||||||
MBuild m = new MBuild();
|
MBuild m = new MBuild();
|
||||||
m.InsertAll(newBuilds);
|
m.InsertAll(builds);
|
||||||
Console.WriteLine("Builds: Complete");
|
Console.WriteLine("Builds: Complete");
|
||||||
|
|
||||||
|
var members = from r in RMember.Select()
|
||||||
|
select new MMember()
|
||||||
|
{
|
||||||
|
CreationDate = r.CreationDate,
|
||||||
|
EmailAddress = r.EmailAddress,
|
||||||
|
Id = r.Id,
|
||||||
|
IsApproved = r.IsApproved,
|
||||||
|
IsLockedOut = r.IsLockedOut,
|
||||||
|
LastActivityDate = r.LastActivityDate,
|
||||||
|
LastLockoutDate = r.LastLockoutDate,
|
||||||
|
LastLoginDate = r.LastLoginDate,
|
||||||
|
LockoutWindowAttempts = r.LockoutWindowAttempts,
|
||||||
|
LockoutWindowStart = r.LockoutWindowStart,
|
||||||
|
PassHash = r.PassHash,
|
||||||
|
PassSalt = r.PassSalt,
|
||||||
|
UserName = r.UserName
|
||||||
|
};
|
||||||
|
Console.WriteLine("Members: Complete");
|
||||||
|
|
||||||
|
var roles = from r in RRole.Select()
|
||||||
|
select new MRole()
|
||||||
|
{
|
||||||
|
Id = r.Id,
|
||||||
|
RoleName = r.RoleName,
|
||||||
|
Users = r.Users
|
||||||
|
};
|
||||||
|
Console.WriteLine("Roles: Complete");
|
||||||
|
|
||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
using NServiceKit.DataAnnotations;
|
using NServiceKit.DataAnnotations;
|
||||||
using NServiceKit.DesignPatterns.Model;
|
using NServiceKit.DesignPatterns.Model;
|
||||||
|
using NServiceKit.Redis;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
@ -32,5 +35,14 @@ namespace RedisMongoMigration.Redis
|
|||||||
|
|
||||||
public DateTime LockoutWindowStart { get; set; }
|
public DateTime LockoutWindowStart { get; set; }
|
||||||
public int LockoutWindowAttempts { get; set; }
|
public int LockoutWindowAttempts { get; set; }
|
||||||
|
|
||||||
|
public static IEnumerable<RedisMember> Select()
|
||||||
|
{
|
||||||
|
using (RedisClient rClient = new RedisClient("localhost", 6379, db: 1))
|
||||||
|
{
|
||||||
|
var client = rClient.As<RedisMember>();
|
||||||
|
return client.GetAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
using NServiceKit.DataAnnotations;
|
using NServiceKit.DataAnnotations;
|
||||||
using NServiceKit.DesignPatterns.Model;
|
using NServiceKit.DesignPatterns.Model;
|
||||||
|
using NServiceKit.Redis;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
@ -17,5 +19,14 @@ namespace RedisMongoMigration.Redis
|
|||||||
public string RoleName { get; set; }
|
public string RoleName { get; set; }
|
||||||
|
|
||||||
public Guid[] Users { get; set; }
|
public Guid[] Users { get; set; }
|
||||||
|
|
||||||
|
public static IEnumerable<RedisRole> Select()
|
||||||
|
{
|
||||||
|
using (RedisClient rClient = new RedisClient("localhost", 6379, db: 1))
|
||||||
|
{
|
||||||
|
var client = rClient.As<RedisRole>();
|
||||||
|
return client.GetAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user