Some RTL fixes for #24

This commit is contained in:
Thomas Hounsell 2015-09-13 23:58:14 +01:00
parent db69587863
commit 856833d2ec
5 changed files with 98 additions and 74 deletions

View File

@ -19,6 +19,9 @@ namespace BuildFeed
bundles.Add(new StyleBundle("~/content/css").Include( bundles.Add(new StyleBundle("~/content/css").Include(
"~/content/style.css")); "~/content/style.css"));
bundles.Add(new StyleBundle("~/content/rtl").Include(
"~/content/rtl.css"));
// Set EnableOptimizations to false for debugging. For more information, // Set EnableOptimizations to false for debugging. For more information,
// visit http://go.microsoft.com/fwlink/?LinkId=301862 // visit http://go.microsoft.com/fwlink/?LinkId=301862
BundleTable.EnableOptimizations = true; BundleTable.EnableOptimizations = true;

View File

@ -666,6 +666,7 @@
<Content Include="content\icons-2x.png" /> <Content Include="content\icons-2x.png" />
<Content Include="content\icons.png" /> <Content Include="content\icons.png" />
<Content Include="content\tile\large.png" /> <Content Include="content\tile\large.png" />
<Content Include="content\rtl.css" />
<Content Include="content\tile\square.png" /> <Content Include="content\tile\square.png" />
<Content Include="content\tile\tiny.png" /> <Content Include="content\tile\tiny.png" />
<Content Include="content\tile\wide.png" /> <Content Include="content\tile\wide.png" />

View File

@ -1,5 +1,8 @@
<!DOCTYPE html> @{
<html dir="@(System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? "rtl" : "ltr")"> bool IsRTL = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft;
}
<!DOCTYPE html>
<html dir="@(IsRTL ? "rtl" : "ltr")">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
@ -13,6 +16,10 @@
<meta name="application-name" content="@BuildFeed.Local.Common.SiteName" /> <meta name="application-name" content="@BuildFeed.Local.Common.SiteName" />
@Styles.Render("~/content/css") @Styles.Render("~/content/css")
@if(IsRTL)
{
Styles.Render("~/content/rtl");
}
<title>@ViewBag.Title</title> <title>@ViewBag.Title</title>
@RenderSection("head", false) @RenderSection("head", false)
<script type="text/javascript"> <script type="text/javascript">
@ -89,10 +96,10 @@
</article> </article>
<footer id="page-footer"> <footer id="page-footer">
<div class="row"> <div class="row">
<div class="col-sm-8"> <div class="col-sm-8 text-left">
<p> <p>
<a href="@Url.Action("sitemap", new { controller = "support" })">@BuildFeed.Local.Common.Sitemap</a><br /> <a href="@Url.Action("sitemap", new { controller = "support" })">@BuildFeed.Local.Common.Sitemap</a><br />
<i class="fa fa-language"></i>&ensp; @System.Globalization.CultureInfo.CurrentUICulture.NativeName (<a href="@Url.Action("credits", new { controller = "support" })">@BuildFeed.Local.Common.Credits</a>) <i class="fa fa-language"></i>&ensp;@System.Globalization.CultureInfo.CurrentUICulture.NativeName (<a href="@Url.Action("credits", new { controller = "support" })">@BuildFeed.Local.Common.Credits</a>)
</p> </p>
</div> </div>
<div class="col-sm-4 text-right"> <div class="col-sm-4 text-right">

View File

@ -1,85 +1,94 @@
@model System.Web.Mvc.HandleErrorInfo @model System.Web.Mvc.HandleErrorInfo
@{ @{
Layout = null; bool IsRTL = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft;
} }
<!DOCTYPE html> <!DOCTYPE html>
<html> <html dir="@(IsRTL ? "rtl" : "ltr")">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.5/slate/bootstrap.min.css" rel="stylesheet" /> <link href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.5/slate/bootstrap.min.css" rel="stylesheet" />
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet" /> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="//fonts.googleapis.com/css?family=Hind:300,700,400" rel="stylesheet" type="text/css" /> <link href="//fonts.googleapis.com/css?family=Hind:300,700,400" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="~/favicon.ico" /> <link rel="shortcut icon" href="~/favicon.ico" />
<link rel="icon" href="~/favicon.ico" /> <link rel="icon" href="~/favicon.ico" />
<meta name="application-name" content="@BuildFeed.Local.Common.SiteName" /> <meta name="application-name" content="@BuildFeed.Local.Common.SiteName" />
@Styles.Render("~/content/css") @Styles.Render("~/content/css")
<title>@BuildFeed.Local.Common.Error | @BuildFeed.Local.Common.SiteName</title> @if (IsRTL)
<script type="text/javascript"> {
var appInsights = window.appInsights || function (config) { Styles.Render("~/content/rtl");
function s(config) { t[config] = function () { var i = arguments; t.queue.push(function () { t[config].apply(t, i) }) } } var t = { config: config }, r = document, f = window, e = "script", o = r.createElement(e), i, u; for (o.src = config.url || "//az416426.vo.msecnd.net/scripts/a/ai.0.js", r.getElementsByTagName(e)[0].parentNode.appendChild(o), t.cookie = r.cookie, t.queue = [], i = ["Event", "Exception", "Metric", "PageView", "Trace"]; i.length;) s("track" + i.pop()); return config.disableExceptionTracking || (i = "onerror", s("_" + i), u = f[i], f[i] = function (config, r, f, e, o) { var s = u && u(config, r, f, e, o); return s !== !0 && t["_" + i](config, r, f, e, o), s }), t }
}({ <title>@BuildFeed.Local.Common.Error | @BuildFeed.Local.Common.SiteName</title>
instrumentationKey: "4632419f-7a2f-4ab5-8374-34384b650f42" <script type="text/javascript">
}); var appInsights = window.appInsights || function (config) {
function s(config) { t[config] = function () { var i = arguments; t.queue.push(function () { t[config].apply(t, i) }) } } var t = { config: config }, r = document, f = window, e = "script", o = r.createElement(e), i, u; for (o.src = config.url || "//az416426.vo.msecnd.net/scripts/a/ai.0.js", r.getElementsByTagName(e)[0].parentNode.appendChild(o), t.cookie = r.cookie, t.queue = [], i = ["Event", "Exception", "Metric", "PageView", "Trace"]; i.length;) s("track" + i.pop()); return config.disableExceptionTracking || (i = "onerror", s("_" + i), u = f[i], f[i] = function (config, r, f, e, o) { var s = u && u(config, r, f, e, o); return s !== !0 && t["_" + i](config, r, f, e, o), s }), t
}({
instrumentationKey: "4632419f-7a2f-4ab5-8374-34384b650f42"
});
window.appInsights = appInsights; window.appInsights = appInsights;
appInsights.trackPageView(); appInsights.trackPageView();
</script> </script>
</head> </head>
<body> <body>
<script> <script>
(function (i, s, o, g, r, a, m) { (function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments) (i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o), }, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-55417692-1', 'auto'); ga('create', 'UA-55417692-1', 'auto');
ga('require', 'displayfeatures'); ga('require', 'displayfeatures');
ga('require', 'linkid', 'linkid.js'); ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview'); ga('send', 'pageview');
</script> </script>
<div class="container"> <div class="container">
<header id="page-header"></header> <header id="page-header"></header>
<nav id="page-navigation" role="navigation"> <nav id="page-navigation" role="navigation">
<div class="navbar navbar-default navbar-fixed-top"> <div class="navbar navbar-default navbar-fixed-top">
<div class="container"> <div class="container">
@Html.ActionLink(@BuildFeed.Local.Common.SiteName, "index", new { controller = "front", area = "" }, new { @class = "navbar-brand" }) @Html.ActionLink(@BuildFeed.Local.Common.SiteName, "index", new { controller = "front", area = "" }, new { @class = "navbar-brand" })
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li><a href="https://twitter.com/buildfeed" title="@BuildFeed.Local.Common.Twitter" target="_blank"><i class="fa 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-twitter"></i> @BuildFeed.Local.Common.Twitter</a></li>
</ul> </ul>
</div>
</div> </div>
</nav> </div>
<article id="page-content"> </nav>
<div class="row"> <article id="page-content">
<div class="col-sm-12"> <div class="row">
<h1>@BuildFeed.Local.Common.Error</h1> <div class="col-sm-12">
<p>Something's broke. Maybe it's because you did something weird. Probably it's because I did something weird. If you keep getting this error, take a screenshot and spam <a href="https://twitter.com/tomhounsell">me</a> on Twitter with it. <h1>@BuildFeed.Local.Common.Error</h1>
</p> <p>
<p>Controller: <code>@Model.ControllerName</code></p> Something's broke. Maybe it's because you did something weird. Probably it's because I did something weird. If you keep getting this error, take a screenshot and spam <a href="https://twitter.com/tomhounsell">me</a> on Twitter with it.
<p>Action: <code>@Model.ActionName</code></p> </p>
<p>Error: <code>@Model.Exception.Message</code></p> <p>Controller: <code>@Model.ControllerName</code></p>
</div> <p>Action: <code>@Model.ActionName</code></p>
<p>Error: <code>@Model.Exception.Message</code></p>
</div> </div>
</article> </div>
<footer id="page-footer"> </article>
<div class="row"> <footer id="page-footer">
<div class="col-sm-offset-8 col-sm-4 text-right"> <div class="row">
<p> <div class="col-sm-8 text-left">
&copy; 2013 - @DateTime.Now.Year.ToString(), @BuildFeed.Local.Common.SiteName<br /> <p>
@BuildFeed.Local.Common.DevelopedBy <a href="https://twitter.com/tomhounsell" target="_blank">Thomas Hounsell</a><br /> <i class="fa fa-language"></i>&ensp;@System.Globalization.CultureInfo.CurrentUICulture.NativeName (<a href="@Url.Action("credits", new { controller = "support" })">@BuildFeed.Local.Common.Credits</a>)
@BuildFeed.Local.Common.ContributeOn&ensp;<a href="https://github.com/hounsell/BuildFeed" target="_blank"><i class="fa fa-github"></i>&ensp;GitHub</a> </p>
</p>
</div>
</div> </div>
</footer> <div class="col-sm-4 text-right">
</div> <p>
@Scripts.Render("~/bundles/jquery") &copy; 2013 - @DateTime.Now.Year.ToString(), @BuildFeed.Local.Common.SiteName<br />
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> @BuildFeed.Local.Common.DevelopedBy <a href="https://twitter.com/tomhounsell" target="_blank">Thomas Hounsell</a><br />
@BuildFeed.Local.Common.ContributeOn&ensp;<a href="https://github.com/hounsell/BuildFeed" target="_blank"><i class="fa fa-github"></i>&ensp;GitHub</a>
</p>
</div>
</div>
</footer>
</div>
@Scripts.Render("~/bundles/jquery")
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body> </body>
</html> </html>

View File

@ -0,0 +1,4 @@
.form-horizontal .form-control-static
{
text-align: left;
}