FontAwesome Icon On Same Line As NavBar - html

I have a navigation bar that displays properly until a user logs in.
Before logging in:
After logging in:
I'm having trouble figuring out why the Log Out fontawesome icon is wrapping onto the next line, when it's the same size (I attempted making it slightly smaller even) than the avatar icon to login. The problem isn't the width of the parent div, because I attempted adding another <li><a>Test Item</a></li> and it didn't wrap to the next line.
HTML:
<ul class="nav navbar-nav navbar-right">
<li><a class="active" href="../../">Home</a></li>
<li>Build A Box</li>
<li>FAQ</li>
<li>Contact Us</li>
#if (User.Identity.IsAuthenticated)
{
<li>My Account</li>
using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))
{
#Html.AntiForgeryToken()
<li></li>
}
}
else
{
<li class="nav-item dropdown">
<div class="dropdown-menu" aria-labelledby="LoginDropdownLink">
#using (Html.BeginForm("Login", "Account", new { ReturnUrl = "../../Home/Account" }, FormMethod.Post, new { #class = "form-horizontal", role = "form" }))
{
#Html.AntiForgeryToken()
#Html.ValidationSummary(true, "", new { #class = "text-danger" })
#Html.TextBoxFor(m => m.Email, new { #class = "input-text", #placeholder="Email Address"})
#Html.ValidationMessageFor(m => m.Email, "", new { #class = "text-danger" })
#Html.PasswordFor(m => m.Password, new { #class = "input-text", #placeholder="Password" })
#Html.ValidationMessageFor(m => m.Password, "", new { #class = "text-danger" })
#Html.CheckBoxFor(m => m.RememberMe)
#Html.LabelFor(m => m.RememberMe)
<input type="submit" value="Log in" class="btn btn-default" />
}
</div>
</li>
}
</ul>

It's hard to say without the CSS but try to remove nav-link in the class attribute of the logout link (l.14 in your code).
So the line will be:
<li></li>
Because the other links do not have this class so I suspect it to be the cause of your trouble.

Related

width not applying for text area MVC

The width isnt setting for the textarea control. It sets for the other controls. Could somebody tell me why isnt the width applying for text area
For example
Setting border to solid for col-md-6
<div class="form-group">
#Html.LabelFor(model => model.ProjectName, htmlAttributes: new { #class = "control-label col-md-5" })
<div class="col-md-6">
#Html.EditorFor(model => model.ProjectName, new { htmlAttributes = new { #class = "form-control", style = "width:100%" } })
#Html.ValidationMessageFor(model => model.ProjectName, "", new { #class = "text-danger" })
</div>
</div>
<div class="clearfix"></div>
<div class="form-group">
#Html.LabelFor(model => model.ProjectSummary, htmlAttributes: new { #class = "control-label col-md-5" })
<div class="col-md-6">
#Html.TextAreaFor(model => model.ProjectSummary, new { htmlAttributes = new { #class = "form-control", rows = "3", style = "max-width:100%" } })
#Html.ValidationMessageFor(model => model.ProjectSummary, "", new { #class = "text-danger" })
</div>
</div>
The real width is the width the textarea has. The col-md-6 will make it that wide. The problem is that the container you're applying the border to does not actually constrain the textarea. If I understand you correctly that you're applying the border to the div with the col-md-6 class, that could very well be your issue. The grid classes that Boostrap employ various width, margin and padding settings to construct a grid that is as close to cross browser as possible, and applying actual visible style to them almost always causes weirdness like this. Instead, wrap your textarea with another div and apply the border to that:
<div class="col-md-6">
<div class="my-awesome-border">
#Html.TextAreaFor(model => model.ProjectSummary, new { htmlAttributes = new { #class = "form-control", rows = "3", style = "max-width:100%" } })
#Html.ValidationMessageFor(model => model.ProjectSummary, "", new { #class = "text-danger" })
</div>
</div>
Long and short, you should always avoid adding additional style to anything with Bootstrap's grid classes (col-*, row, etc.).

getChildRoutes block parent rendering

I've tried using setTimout ( 10 sec ) in getChildRoutes to simulate low latency network. let say www.example.com/user, I got server side rendering on "/user" path. when I access /user, I got blank page instead of the page from server side rendering, then after 10 sec, I get my page rendering.
var routes = [{
path: '/',
component: App,
indexRoute: { component: DashBoardPage },
getChildRoutes(location, cb) {
if (typeof window !== 'undefined') {
console.log("set sleep");
setTimeout(function () {
var test = [{path: 'about', component: DashBoardPage},
{path: 'feed', component: FeedChannelPage},
{path: 'host', component: HostPage},
{path: 'user', component: UserPage}];
console.log("location is " + location);
cb(null, test);
}, 10000);
}else{
var test = [{path: 'about', component: DashBoardPage},
{path: 'feed', component: FeedChannelPage},
{path: 'host', component: HostPage},
{path: 'user', component: UserPage}];
console.log("location is " + location);
cb(null, test);
}
}
}]
export default routes;
This my App.jsx
class App extends React.Component {
render () {
return (
<div id="wrapper">
<nav className="navbar navbar-default navbar-static-top" role="navigation" style={{marginBottom: 0}}>
<div className="navbar-header">
<a className="navbar-brand" href="index.html">SB Admin v2.0</a>
</div>
<div className="navbar-default sidebar" role="navigation">
<div className="sidebar-nav navbar-collapse">
<ul className="nav" id="side-menu">
<li className="sidebar-search">
<div className="input-group custom-search-form">
</div>
</li>
<li>
<Link to="/about"><i className="fa fa-dashboard fa-fw"></i> Dashboard</Link>
</li>
<li>
<Link to="/host"><i className="fa fa-dashboard fa-fw"></i> Host</Link>
</li>
<li>
<Link to="/user"><i className="fa fa-dashboard fa-fw"></i> User</Link>
</li>
</ul>
</div>
</div>
</nav>
<div id="page-wrapper" style={{'minHeight':'400px'}}>
{this.props.children}
</div>
</div>
)
}
}

ASP.Net mvc5 my site dosen't allow 'åäö'

I am working on a asp.net mvc5 project and I just noticed it doesn't allow me to use 'åäö' well it allows me to use these characters but it shows up like this. 'ä' and so on.
The weird thing I can use the characters in my nav bar but on a page it won't allow it.
This is my login page:
It should say "Användarnamn" and "Lösenord".
But it my navbar it works correctly..
this is my shared _Layout every site inherits from
<!DOCTYPE html>
<html lang="sv">
<head>
<title>Treetop #ViewBag.Title</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
#Styles.Render("~/Content/css")
#Scripts.Render("~/bundles/jquery")
#Scripts.Render("~/bundles/modernizr")
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css"/>
</head>
<body>
#if (User.Identity.IsAuthenticated)
{
<div class="page-header">
<div class="page-header-top">
<div class="container">
<div class="page-logo">
<h3>Treetop Innovation</h3>
</div>
</div>
</div>
<div class="page-header-menu">
<div class="container">
<div class="hor-menu ">
<ul class="nav navbar-nav">
<li>
#Html.ActionLink("Ny Rapport", "TimeReport", "Reports")
</li>
<li>
#Html.ActionLink("Rappotera frånvaro", "Absent", "Reports")
</li>
<li>
#Html.ActionLink("Rapporter", "Index", "Reports")
</li>
<li>
#Html.ActionLink("Inställningar", "Settings", "Reports")
</li>
<li>
#Html.ActionLink("Mina projekt", "Index", "Projects")
</li>
<li>
#Html.ActionLink("Begär semester", "Index", "Vacation")
</li>
</ul>
</div>
<div class=" hor-menu nav navbar-nav pull-right">
<ul class="nav navbar-nav">
<li><a>#User.Identity.Name</a></li>
<li>
#using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", #class = "navbar-right" }))
{
#Html.AntiForgeryToken()
Log off
}
</li>
</ul>
</div>
</div>
</div>
</div>
<script>
jQuery(document).ready(function () {
Metronic.init();
Layout.init();
Demo.init();
ComponentsPickers.init();
TableAdvanced.init();
});
</script>
}
#RenderBody()
#Scripts.Render("~/bundles/jquery")
#Scripts.Render("~/bundles/modernizr")
#RenderSection("scripts", required: false)
</body>
</html>
This is the view that does not work:
<body class="login">
<div class="logo">
<h3 style="color: white">Treetop Innovation</h3>
</div>
<div class="content">
#using (Html.BeginForm("LogOn", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { #class = "login-form", role = "form" }))
{
#Html.AntiForgeryToken()
<div class="alert alert-danger display-hide">
<button class="close" data-close="alert"></button>
<span>
#Html.ValidationSummary(true, "", new { #class = "text-danger" })
</span>
</div>
<h3 class="form-title">Logga in</h3>
<div class="form-group">
<div class="input-icon">
<i class="fa fa-user"></i>
#Html.TextBoxFor(m => m.UserName, new { #class = "form-control", placeholder = "Användarnamn" })
</div>
#Html.ValidationMessageFor(m => m.UserName, "", new { #class = "text-danger" })
</div>
<div class="form-group">
<div class="input-icon">
<i class="fa fa-lock"></i>
#Html.PasswordFor(m => m.Password, new { #class = "form-control", placeholder = "Lösenord" })
</div>
#Html.ValidationMessageFor(m => m.Password, "", new { #class = "text-danger" })
</div>
<div class="form-actions">
<div class="checkbox" style="padding: 0 20px">
#Html.CheckBoxFor(m => m.RememberMe)
Kom ihåg
</div>
<button type="submit" class="btn green-haze pull-right">
Login <i class="fa fa-arrow-right"></i>
</button>
</div>
}
</div>
</body>
This is basically a encoding issue. read more There Ain't No Such Thing as Plain Text
Användarnamn = Användarnamn
and
Lösenord = Lösenord
You can use HTML Entities or ISO Latin-1 code for these special characters.
https://www.utexas.edu/learn/html/spchar.html
UPDATE
#Broam's answer which solved the issue
Short version: edit one file, select File -> Advanced Save Options.
Instead of changing UTF-8 to Ascii, change it to UTF-8. Edit: Make
sure you select the option that says no byte-order-marker (BOM)
You have to save the .cshtml file with the right Encoding.
File > Save MyFile.cshtml As...
Chose Save with Encoding...
Chose Yes to replace it.
Chose UTF-8.

Menu is not showing menu items after using kendo splitter below menu

My menu is not showing items when I click on the setup menu item. Before using the kendo splitter it worked fine. Now the menu doesn't pop up even after setting a higher z-index on the menu element.
This is my menu bar
<nav class="top-bar bottomnav" data-topbar>
<section class="top-bar-section">
<ul class="right">
<li class="has-content-dropdown"><a href="#" data-dropdown="setuplist" title="Setup">
<img src="/Content/Images/setup-16x16.png" alt="Setup" /> Setup</a>
<div id="setuplist" data-dropdown-content class="medium f-dropdown iconlist">
#{
link="#";
}
{ link="/Classification/ClassificationLabel"; }
<div class="iconlink">
<a href='#link' title="Classification Label" onclick="OnclickPrem(this)">
<img src="/Content/Images/labels-72x72.png" /><div>Classification Label</div>
</a>
</div>
#{
link="#";
}
{ link="/Classification/Index"; }
<div class="iconlink">
<a href='#link' title="Classification" onclick="OnclickRPrem(this)">
<img src="/Content/Images/Classification-72x72.png" /><div>Classification</div>
</a>
</div>
</li>
</ul>
</section>
below this menu an using kendo splitter
#(Html.Kendo().Splitter()
.Name("vertical")
.Orientation(SplitterOrientation.Vertical)
.HtmlAttributes(new { style = "height: 70%;height:78.3vh;" })
.Panes(verticalPanes =>
{
verticalPanes.Add()
.HtmlAttributes(new { id = "top-pane" })
.Scrollable(false)
.Collapsible(false)
.Content(
Html.Kendo().Splitter()
.Name("horizontal")
.HtmlAttributes(new { style = "height: 100%;" })
.Panes(horizontalPanes =>
{
horizontalPanes.Add()
.HtmlAttributes(new { id = "left-pane" })
.MaxSize("300px")
.MinSize("250px")
.Size("300px")
.Collapsible(true)
.Collapsed(true)
.Content(Html.Action("Tasks").ToString());
horizontalPanes.Add()
.HtmlAttributes(new { id = "center-pane"})
.Content(#<div class="renderbodydiv" style="padding-top: 8px">
#RenderBody()
</div>);
}).ToHtmlString()
);
})
)
Splitter panes hide the overflow, so if your menu is in a position so it would show outside of the pane it is in, you need to override the CSS responsible for that; you can try with:
.k-splitter .k-pane {
overflow: visible !important;
}

Html style to align an image to the right of an input box

I am using Twitter bootstrap 3.0 and razor views.
How can I align the image in the below div to the immediate right of the artist text box ?
<div id="artist"class="form-group">
#Html.LabelFor(m => m.Artists, new { #class = "col-lg-2 control-label" })
<div class="container">
#Html.TextBoxFor(m => m.Artists, new { placeholder = "Artist name",#class="form-control", id="artistinput"})
<img onclick="AddArtist()" id="plusartist" src="\Content\bootstrap\img\plus-button.png" class="img-thumbnail"/>
#Html.ValidationMessageFor(m => m.Artists)
</div>
</div>