Skip to content

Commit

Permalink
Improved question's create and update administration styles. #106, #107
Browse files Browse the repository at this point in the history
  • Loading branch information
rozay committed Apr 18, 2017
1 parent c66eb7f commit e4907e1
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class QuestionCreateInputModel : IMapTo<Question>, IMapFrom<Question>
public string Text { get; set; }

[UIHint("EnumDropDownList")]
[PlaceHolder("Тип на въпроса")]
public QuestionType Type { get; set; }

[Display(Name = "Публичен?")]
Expand All @@ -31,6 +32,7 @@ public class QuestionCreateInputModel : IMapTo<Question>, IMapFrom<Question>

[Display(Name = "Присъства в модули")]
[UIHint("MultiSelectDropDownList")]
[PlaceHolder("Присъства в модули")]
public int[] ModulesIds { get; set; }

[HiddenInput(DisplayValue = false)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
@using HappyMe.Web.Areas.Administration.Controllers

@model HappyMe.Web.Areas.Administration.InputModels.Questions.QuestionCreateInputModel

@{
ViewBag.Title = "Добавяне на нов въпрос";
}

<h2>@ViewBag.Title</h2>
<div class="section-title-container">
<h3 class="section-title">@ViewBag.Title</h3>
</div>

@using (Html.BeginForm(nameof(QuestionsController.Create), "Questions", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
Expand All @@ -18,7 +21,7 @@
@Html.EditorFor(m => m.ImageData, new { htmlAttributes = new { @class = "top-buffer" }})

<input type="button" value="Назад" onClick="history.go(-1);return true;" class="btn btn-blue" />
<input type="submit" value="Създай" class="btn btn-primary pull-right" />
<input type="submit" value="Създай" class="btn btn-success pull-right" />
}

@section scripts {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
ViewBag.Title = "Редактиране на въпрос";
}

<h2>@ViewBag.Title</h2>
<div class="section-title-container">
<h3 class="section-title">@ViewBag.Title</h3>
</div>

@using (Html.BeginForm(
nameof(QuestionsController.Update),
Expand All @@ -22,7 +24,7 @@


<input type="button" value="Назад" onClick="history.go(-1);return true;" class="btn btn-blue" />
<input type="submit" value="Редактирай" class="btn btn-primary pull-right"/>
<input type="submit" value="Редактирай" class="btn btn-success pull-right"/>
}

@section scripts {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
@model Enum

@Html.EnumDropDownListFor(model => model, new { @class = "form-control" })
@{
var placeholder = string.Empty;
if (ViewData.ModelMetadata.AdditionalValues.ContainsKey("placeholder"))
{
placeholder = ViewData.ModelMetadata.AdditionalValues["placeholder"] as string;
}
}

@Html.EnumDropDownListFor(model => model, new { @class = "form-control", placeholder })
4 changes: 2 additions & 2 deletions source/Web/HappyMe.Web/Config/BundleConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ private static void RegisterStyleBundles(BundleCollection bundles)
"~/Content/vendor/bootstrap/administration/style-responsive.css",
"~/Content/vendor/chosen/chosen.css",
"~/Content/fonts/lato/latostyle.css",
"~/Content/custom/administration-styles.css",
"~/Content/custom/global.css"));
"~/Content/custom/global.css",
"~/Content/custom/administration-styles.css"));

bundles.Add(new StyleBundle("~/Content/bootstrap").Include(
"~/Content/vendor/bootstrap/bootstrap.min.css"));
Expand Down
18 changes: 18 additions & 0 deletions source/Web/HappyMe.Web/Content/custom/administration-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,24 @@ ul.top-menu > li .logout {
.editor-label {
display: none;
}

/*-------- Input styles --------*/
input, input[type="text"], input[type="password"], input[type="email"], select, .form-control, .chosen-container-multi .chosen-choices {
border: 2px solid #FF8A5C;
outline: none;
border-radius: 4px;
}

input:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, select:focus, .form-control:focus, .chosen-container-multi .chosen-choices:focus {
outline: none;
box-shadow: none;
}

.chosen-container .chosen-results li.highlighted {
background-image: none;
background: #FF8A5C;
}
/*-------- End Input styles --------*/
/*==============End overriding other styles=============*/

.bottom-buffer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
@*@Styles.Render("~/Content/guillotine")*@

<div class="editor-field top-buffer">
<label class="btn btn-default btn-file">
Browse <input type="file" name="@propertyName" style="display: none;" />
<label class="btn btn-primary btn-file">
Изберете файл <input type="file" name="@propertyName" style="display: none;" />
</label>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
@{
var propertyName = ViewData.ModelMetadata.PropertyName;
var viewDataName = $"{propertyName}Data";

var placeholder = string.Empty;
if (ViewData.ModelMetadata.AdditionalValues.ContainsKey("placeholder"))
{
placeholder = ViewData.ModelMetadata.AdditionalValues["placeholder"] as string;
}
}

@Html.ListBoxFor(m => m, ViewData[viewDataName] as MultiSelectList, new { @class = "form-control" })
@Html.ListBoxFor(m => m, ViewData[viewDataName] as MultiSelectList, new { @class = "form-control", placeholder })

0 comments on commit e4907e1

Please sign in to comment.