Skip to content

Commit

Permalink
MVC sample refreshed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwaliszko committed Sep 7, 2014
1 parent c4f4099 commit 24de0be
Show file tree
Hide file tree
Showing 11 changed files with 310 additions and 183 deletions.
91 changes: 74 additions & 17 deletions src/ExpressiveAnnotations.MvcWebSample/Content/Site.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
body {
font-size: .85em;
font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif;
font-family: monospace, "Segoe UI", "Segoe UI Light", Verdana, Helvetica, Sans-Serif;
margin: 0;
padding: 0;
}
Expand All @@ -11,19 +11,24 @@
}

.prefix {
width: 170px;
width: 200px;
}

.date {
width: 85px;
}

.action {
cursor: pointer;
display: block;
margin: 0;
color: grey;
color: #aaa;
font-size: 1.0em;
margin: 0 0 0 -2px;
}

select {
width: 117px;
width: 212px;
}

.box {
Expand All @@ -38,6 +43,7 @@ select {
height: 35px;
width: 65%;
float: right;
font-size: 0.8em;
}

.box-small div {
Expand Down Expand Up @@ -68,8 +74,9 @@ h1 {
}

.code {
background-color: whitesmoke;
background: linear-gradient(to right, whitesmoke, white);
display: none;
margin: 10px 0 2px -2px;
}

a {
Expand All @@ -95,8 +102,11 @@ fieldset ol {
}

fieldset ol li {
padding-bottom: 3px;
padding: 1px;
}
fieldset ol li > div {
position: relative;
}

li fieldset legend {
display: none;
Expand All @@ -108,7 +118,7 @@ label {
vertical-align: baseline;
}

.inline {
.inline, .radio {
display: inline-block;
vertical-align: top;
}
Expand All @@ -117,9 +127,18 @@ input, textarea {
border: 1px solid #e2e2e2;
background: #fff;
color: #333;
margin: 5px 0 6px 0;
padding: 5px;
width: 200px;
}

input {
width: 208px;
}

textarea {
width: 440px;
max-width: 440px;
min-width: 208px;
resize: both;
overflow: hidden;
}

input:focus, textarea:focus {
Expand All @@ -131,6 +150,8 @@ input[type="radio"] {
background: transparent;
border: inherit;
width: auto;
margin-left: 0;
margin-right: 0;
}

input[type="submit"],
Expand Down Expand Up @@ -168,17 +189,19 @@ button {

.field-validation-error {
color: #e80c4d;
font-weight: bold;
padding-left: 5px;
font-weight: bold;
font-size: 0.8em;
padding-left: 10px;
position: absolute;
top: 50%;
}

input.input-validation-error {
border: 1px solid #e80c4d;
.input-validation-error {
outline: 1px solid #e80c4d;
}

input[type="checkbox"].input-validation-error {
border: 0 none;
input[type="radio"].input-validation-error {
outline: 0 none;
}

.validation-summary-errors {
Expand All @@ -189,4 +212,38 @@ input[type="checkbox"].input-validation-error {
.ctor {
font-weight: bold;
font-size: 1.4em;
}
}

/********************
* Mobile Styles *
********************/

@media only screen and (max-width: 850px) {

.inline {
display: block;
}

.field-validation-error {
display: block;
position: inherit;
padding-left: 0;
}

.box-small {
display: none;
}


.box, fieldset {
display: block;
}

.left-corner, .right-corner {
position: inherit;
}

.right-corner {
float: right;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@
<ItemGroup>
<Content Include="Views\Home\EditorTemplates\ISO8601Date.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Home\EditorTemplates\Query.cshtml" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
9 changes: 9 additions & 0 deletions src/ExpressiveAnnotations.MvcWebSample/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/ExpressiveAnnotations.MvcWebSample/Resources.pl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@
<data name="ReturnDate" xml:space="preserve">
<value>Data powrotu</value>
</data>
<data name="SelectDate" xml:space="preserve">
<value>Wybierz datę</value>
</data>
<data name="SpamAllowed" xml:space="preserve">
<value>Zgadzam się na otrzymywanie informacji</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions src/ExpressiveAnnotations.MvcWebSample/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@
<data name="ReturnDate" xml:space="preserve">
<value>Return date</value>
</data>
<data name="SelectDate" xml:space="preserve">
<value>Select a date</value>
</data>
<data name="SpamAllowed" xml:space="preserve">
<value>I agree for contact</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
@model ExpressiveAnnotations.MvcWebSample.Models.Contact

<fieldset>
<legend>Contact details</legend>
<ol>
<li>
<pre class="code">
<ol>
<li>
<pre class="code">
[RequiredIf("Phone == null")]
[AssertThat("IsEmail(Email)")]
</pre>
<pre class="action">[show attribute]</pre>
<pre class="action">[show attribute]</pre>
<div>
@Html.LabelFor(model => model.Email, new { @class = "inline prefix" })
@Html.EditorFor(model => model.Email)
@Html.ValidationMessageFor(model => model.Email)
</li>
<li>
<pre class="code">
</div>
</li>
<li>
<pre class="code">
[RequiredIf("Email == null")]
[AssertThat("IsDigitChain(Phone)")]
[AssertThat("Length(Phone) > 8 && Length(Phone) < 16")]
</pre>
<pre class="action">[show attribute]</pre>
<pre class="action">[show attribute]</pre>
<div>
@Html.LabelFor(model => model.Phone, new { @class = "inline prefix" })
@Html.EditorFor(model => model.Phone)
@Html.ValidationMessageFor(model => model.Phone)
</li>
</ol>
</fieldset>
</div>
</li>
</ol>
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
@model DateTime
@Html.Hidden("", Model.ToString ("s", System.Globalization.CultureInfo.InvariantCulture)) @*toString with s (sortable) format returns strict ISO 8601*@
@Html.Hidden("", Model.ToString ("o", System.Globalization.CultureInfo.InvariantCulture)) @*From MSDN: The "o" standard format specifier represents a custom date and time format
string using a pattern that preserves time zone information and emits a result string
that complies with ISO 8601*@
Loading

0 comments on commit 24de0be

Please sign in to comment.