From 446bd9988a9e6539b8295b8a6ffe762b8683a4c1 Mon Sep 17 00:00:00 2001 From: Arkadiusz Jurga Date: Thu, 13 Dec 2018 23:05:57 +0100 Subject: [PATCH] Add Simple Style To E-mail Sender --- Trunk/Server/Forum/Forum/Content/Site.css | 345 ++++++++++++++++- Trunk/Server/Forum/Forum/Forum.csproj | 6 +- Trunk/Server/Forum/Forum/Web.config | 2 +- .../Server/Forum/MailSender/Content/Site.css | 350 +++++++++++++++++- .../Server/Forum/MailSender/MailSender.csproj | 8 +- .../Forum/MailSender/Models/MailModel.cs | 9 +- .../Forum/MailSender/Views/Home/Index.cshtml | 14 +- .../MailSender/Views/Shared/_Layout.cshtml | 10 +- Trunk/Server/Forum/MailSender/Web.config | 12 +- 9 files changed, 721 insertions(+), 35 deletions(-) diff --git a/Trunk/Server/Forum/Forum/Content/Site.css b/Trunk/Server/Forum/Forum/Content/Site.css index 6ea5d8f..2511694 100644 --- a/Trunk/Server/Forum/Forum/Content/Site.css +++ b/Trunk/Server/Forum/Forum/Content/Site.css @@ -1,5 +1,5 @@ body { - padding-top: 50px; + padding-top: 15rem; padding-bottom: 20px; } @@ -18,7 +18,346 @@ /* Set width on the form input elements since they're 100% wide by default */ input, -select, -textarea { +select { max-width: 280px; } + +.navbar { + background: linear-gradient(#47478f 15%,#4d4794); + height: auto; +} + + .navbar a { + color: #fafafa; + } + +h2 { + margin: 1rem 0; +} + + + + +.navbar-toggle .icon-bar { + background: #b7c5d8; + width: 28px; +} + +.navbar-brand { + font-size: 2.5rem; + font-weight: 700; + height: 70px; + line-height: 4rem; +} + +.navbar-toggle { + margin-top: 18px; +} + +.navbar > .container { + width: 90%; +} + +.nav > li > a:hover, .nav > li > a:focus { + background-color: #5a5aa7; +} + + +.category-list-wrapper { + width: 80%; + margin: 0 auto; +} + +.category-wrapper > ul { + list-style: none; +} + +.category-list { + display: grid; + padding: 0; + grid-row-gap: 2rem; +} + + .category-list > li { + height: 9rem; + display: flex; + justify-content: center; + align-items: center; + background-color: #bbbbc5; + border-radius: 1rem; + position: relative; + } + + .category-list > li > a { + text-decoration: none; + color: #fafafa; + font-size: 3rem; + display: block; + width: 100%; + height: 100%; + text-align: center; + line-height: 9rem; + overflow: hidden; + } + +.single-category-wrapper { + padding: 3rem; + background-color: #f2f2f2; + border-radius: 1rem; +} + + .single-category-wrapper > h2 { + margin: 1rem 0; + } + + .single-category-wrapper > ul { + padding: 0; + list-style: none; + } + + .single-category-wrapper > ul li { + padding: 1.5rem 0; + font-size: 1.5rem; + } + + + + .single-category-wrapper > ul li a { + text-decoration: none; + color: #3b3b3b; + } + +.add-topic { + width: 100%; + border: none; + background: #79bd9b; + padding: 10px; + border-radius: 1rem; + font-size: 1.8rem; + margin-top: 1rem; +} + + + .add-topic > a { + color: #fafafa; + text-decoration: none; + display: block; + width: 100%; + height: 100%; + } + + +.form-AddQuestion { + background-color: #f1f1f3; + padding: 3rem; + border-radius: 1rem; +} + + .form-AddQuestion input { + max-width: none; + } + +.form-personal-data { + display: flex; + flex-direction: column; + width: 100%; + justify-content: space-between; +} + + .form-personal-data .form-group { + width: 100%; + } + +.form-AddQuestion input[type=submit], .add-answer input[type=submit] { + border: none; + background: #79bd9b; + padding: 10px; + border-radius: 1rem; + font-size: 1.8rem; + color: #fafafa; +} + +.form-AddQuestion input[type=submit] { + margin-top: 1.7rem; +} + +.form-AddQuestion__btn { + width: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; +} + +.textarea-wrapper { + width: 50%; + margin: 20px auto; + padding: 5px; /*workaround for textarea margin*/ + background: #FFF; + border: 1px solid #808080; +} + +textarea { + max-width: none; + width: 100%; +} + +.answer-list__question { + background: #dee0eb; + padding: 3rem; + overflow-wrap: break-word; + border-radius: 1rem; + margin-bottom: 5rem; +} + + .answer-list__question h2 { + margin: 0; + width: 80%; + } + +.answer-list__info { + display: flex; + justify-content: space-between; + align-items: center; +} + +.answer-list__answer { + list-style: none; + padding: 0; +} + +.username { + font-weight: 700; +} + +.answer-list__answer__info { + background: #4d4c4c; + color: #fafafa; + padding: 1rem 2rem; + display: flex; + justify-content: space-between; + border-radius: 1rem; +} + +.answer-list__answer__info--proffesional { + background: #c68585; +} + +.answer-list__single-answer { + border: 1px solid #c0bebe; + border-radius: 1rem; + margin-bottom: 3rem; + border-top: none; +} + +.answer-list__content { + padding: 2rem 2rem; + width: 100%; + overflow-wrap: break-word; +} + +.answer-list__heading { + margin: 2rem 0; +} + +.answer-list__add-btn { + border: none; + background: #79bd9b; + border-radius: 1rem; + font-size: 1.8rem; + color: #fafafa; + width: 20rem; + display: flex; + justify-content: center; + align-items: center; + height: 5rem; +} + + .answer-list__add-btn a { + text-decoration: none; + display: block; + width: 100%; + height: 100%; + color: white; + text-align: center; + line-height: 5rem; + } + +.add-answer { + background: #f2f2f2; + padding: 3rem; + border-radius: 1rem; +} + + + + + + + +@media (min-width: 768px) { + + + + .navbar > .container { + height: 10rem; + } + + .navbar-header { + height: 100%; + display: flex; + align-items: center; + } + + .navbar-brand { + font-size: 3.5rem; + } + + .navbar-nav { + height: 100px; + display: flex; + align-items: center; + } + + .navbar-nav > li { + height: 50%; + } + + + + .navbar-nav > li > a { + height: 100%; + border-radius: 0.8rem; + } + + .nav > li > a:hover, .nav > li > a:focus { + transition: background-color .1s ease; + } + + .category-list { + /*grid-template-columns: 1fr 1fr;*/ + grid-column-gap: 2rem; + } + + .single-category-wrapper { + width: 65%; + margin: 0 auto; + } + + .form-AddQuestion__btn { + flex-direction: row; + margin-top: 1rem; + } + + .form-personal-data { + flex-direction: row; + } + + .form-personal-data .form-group { + width: 49%; + } + + .form-AddQuestion input[type=submit] { + margin-top: 0; + } +} diff --git a/Trunk/Server/Forum/Forum/Forum.csproj b/Trunk/Server/Forum/Forum/Forum.csproj index 5083301..a5ae9fb 100644 --- a/Trunk/Server/Forum/Forum/Forum.csproj +++ b/Trunk/Server/Forum/Forum/Forum.csproj @@ -1,7 +1,7 @@  - + Debug @@ -234,7 +234,9 @@ - + + Designer + Web.config diff --git a/Trunk/Server/Forum/Forum/Web.config b/Trunk/Server/Forum/Forum/Web.config index a347020..7b4ee10 100644 --- a/Trunk/Server/Forum/Forum/Web.config +++ b/Trunk/Server/Forum/Forum/Web.config @@ -9,7 +9,7 @@
- + diff --git a/Trunk/Server/Forum/MailSender/Content/Site.css b/Trunk/Server/Forum/MailSender/Content/Site.css index 6ea5d8f..ba2f80f 100644 --- a/Trunk/Server/Forum/MailSender/Content/Site.css +++ b/Trunk/Server/Forum/MailSender/Content/Site.css @@ -1,5 +1,5 @@ body { - padding-top: 50px; + padding-top: 15rem; padding-bottom: 20px; } @@ -18,7 +18,351 @@ /* Set width on the form input elements since they're 100% wide by default */ input, -select, -textarea { +select { max-width: 280px; } + +.navbar { + background: linear-gradient(#47478f 15%,#4d4794); + height: auto; +} + + .navbar a { + color: #fafafa; + } + +h2 { + margin: 1rem 0; +} + + + + +.navbar-toggle .icon-bar { + background: #b7c5d8; + width: 28px; +} + +.navbar-brand { + font-size: 2.5rem; + font-weight: 700; + height: 70px; + line-height: 4rem; +} + +.navbar-toggle { + margin-top: 18px; +} + +.navbar > .container { + width: 90%; +} + +.nav > li > a:hover, .nav > li > a:focus { + background-color: #5a5aa7; +} + + +.category-list-wrapper { + width: 80%; + margin: 0 auto; +} + +.category-wrapper > ul { + list-style: none; +} + +.category-list { + display: grid; + padding: 0; + grid-row-gap: 2rem; +} + + .category-list > li { + height: 9rem; + display: flex; + justify-content: center; + align-items: center; + background-color: #bbbbc5; + border-radius: 1rem; + position: relative; + } + + .category-list > li > a { + text-decoration: none; + color: #fafafa; + font-size: 3rem; + display: block; + width: 100%; + height: 100%; + text-align: center; + line-height: 9rem; + overflow: hidden; + } + +.single-category-wrapper { + padding: 3rem; + background-color: #f2f2f2; + border-radius: 1rem; +} + + .single-category-wrapper > h2 { + margin: 1rem 0; + } + + .single-category-wrapper > ul { + padding: 0; + list-style: none; + } + + .single-category-wrapper > ul li { + padding: 1.5rem 0; + font-size: 1.5rem; + } + + + + .single-category-wrapper > ul li a { + text-decoration: none; + color: #3b3b3b; + } + +.add-topic { + width: 100%; + border: none; + background: #79bd9b; + padding: 10px; + border-radius: 1rem; + font-size: 1.8rem; + margin-top: 1rem; +} + + + .add-topic > a { + color: #fafafa; + text-decoration: none; + display: block; + width: 100%; + height: 100%; + } + + +.form-AddQuestion { + background-color: #f1f1f3; + padding: 3rem; + border-radius: 1rem; +} + + .form-AddQuestion input { + max-width: none; + } + +.form-personal-data { + display: flex; + flex-direction: column; + width: 100%; + justify-content: space-between; +} + + .form-personal-data .form-group { + width: 100%; + } + +.form-AddQuestion input[type=submit], .add-answer input[type=submit] { + border: none; + background: #79bd9b; + padding: 10px; + border-radius: 1rem; + font-size: 1.8rem; + color: #fafafa; +} + +.form-AddQuestion input[type=submit] { + margin-top: 1.7rem; +} + +.form-AddQuestion__btn { + width: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; +} + +.textarea-wrapper { + width: 50%; + margin: 20px auto; + padding: 5px; /*workaround for textarea margin*/ + background: #FFF; + border: 1px solid #808080; +} + +textarea { + max-width: none; + width: 100%; +} + +.answer-list__question { + background: #dee0eb; + padding: 3rem; + overflow-wrap: break-word; + border-radius: 1rem; + margin-bottom: 5rem; +} + + .answer-list__question h2 { + margin: 0; + width: 80%; + } + +.answer-list__info { + display: flex; + justify-content: space-between; + align-items: center; +} + +.answer-list__answer { + list-style: none; + padding: 0; +} + +.username { + font-weight: 700; +} + +.answer-list__answer__info { + background: #4d4c4c; + color: #fafafa; + padding: 1rem 2rem; + display: flex; + justify-content: space-between; + border-radius: 1rem; +} + +.answer-list__answer__info--proffesional { + background: #c68585; +} + +.answer-list__single-answer { + border: 1px solid #c0bebe; + border-radius: 1rem; + margin-bottom: 3rem; + border-top: none; +} + +.answer-list__content { + padding: 2rem 2rem; + width: 100%; + overflow-wrap: break-word; +} + +.answer-list__heading { + margin: 2rem 0; +} + +.answer-list__add-btn { + border: none; + background: #79bd9b; + border-radius: 1rem; + font-size: 1.8rem; + color: #fafafa; + width: 20rem; + display: flex; + justify-content: center; + align-items: center; + height: 5rem; +} + + .answer-list__add-btn a { + text-decoration: none; + display: block; + width: 100%; + height: 100%; + color: white; + text-align: center; + line-height: 5rem; + } + +.add-answer { + background: #f2f2f2; + padding: 3rem; + border-radius: 1rem; +} + +.form-group--mailContent +{ + width:35%; + +} + + +.form-control--input +{ + width: 30%; +} + + + +@media (min-width: 768px) { + .navbar > .container { + height: 10rem; + } + + .navbar-header { + height: 100%; + display: flex; + align-items: center; + } + + .navbar-brand { + font-size: 3.5rem; + } + + .navbar-nav { + height: 100px; + display: flex; + align-items: center; + } + + .navbar-nav > li { + height: 50%; + } + + + + .navbar-nav > li > a { + height: 100%; + border-radius: 0.8rem; + } + + .nav > li > a:hover, .nav > li > a:focus { + transition: background-color .1s ease; + } + + .category-list { + /*grid-template-columns: 1fr 1fr;*/ + grid-column-gap: 2rem; + } + + .single-category-wrapper { + width: 65%; + margin: 0 auto; + } + + .form-AddQuestion__btn { + flex-direction: row; + margin-top: 1rem; + } + + .form-personal-data { + flex-direction: row; + } + + .form-personal-data .form-group { + width: 49%; + } + + .form-AddQuestion input[type=submit] { + margin-top: 0; + } +} diff --git a/Trunk/Server/Forum/MailSender/MailSender.csproj b/Trunk/Server/Forum/MailSender/MailSender.csproj index d7ca89e..0d45204 100644 --- a/Trunk/Server/Forum/MailSender/MailSender.csproj +++ b/Trunk/Server/Forum/MailSender/MailSender.csproj @@ -51,6 +51,9 @@ ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + + ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + ..\packages\Microsoft.Owin.4.0.0\lib\net451\Microsoft.Owin.dll @@ -151,9 +154,6 @@ ..\packages\Microsoft.ApplicationInsights.Web.2.5.1\lib\net45\Microsoft.AI.Web.dll - - ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - @@ -251,7 +251,7 @@ - Ten projekt zawiera odwołania do pakietów NuGet, których nie ma na tym komputerze. Użyj przywracania pakietów NuGet, aby je pobrać. Aby uzyskać więcej informacji, zobacz http://go.microsoft.com/fwlink/?LinkID=322105. Brakujący plik: {0}. + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. diff --git a/Trunk/Server/Forum/MailSender/Models/MailModel.cs b/Trunk/Server/Forum/MailSender/Models/MailModel.cs index 8bbdac1..b414ad6 100644 --- a/Trunk/Server/Forum/MailSender/Models/MailModel.cs +++ b/Trunk/Server/Forum/MailSender/Models/MailModel.cs @@ -17,19 +17,20 @@ namespace MailSender.Models //[ForeignKey] //public int UserId //id usera ktory wyslal maila - [Display(Name = "Subject")] + [Display(Name = "Temat")] [Required(AllowEmptyStrings = false)] public string Subject { get; set; } [DataType(DataType.EmailAddress)] [Required(AllowEmptyStrings = false, ErrorMessage = "You need to type in an e-mail")] [RegularExpression(".*@.*\\..*", ErrorMessage = "You typed in e-mail in wrong format")] - [Display(Name = "E-Mail to")] + [Display(Name = "Adres odbiorcy")] public string EMailTo { get; set; } + [Display(Name ="Odpowiedź")] [Required(AllowEmptyStrings = false, ErrorMessage = "You need to type in a message to send")] - [DataType(DataType.Text)] + [DataType(DataType.MultilineText)] [StringLength(500, ErrorMessage = "Message has to have between 1 and 500 chars", MinimumLength = 1)] - public string Content { get; set; } + public string Content { get; set; } } } \ No newline at end of file diff --git a/Trunk/Server/Forum/MailSender/Views/Home/Index.cshtml b/Trunk/Server/Forum/MailSender/Views/Home/Index.cshtml index 8bb0d98..6111fe0 100644 --- a/Trunk/Server/Forum/MailSender/Views/Home/Index.cshtml +++ b/Trunk/Server/Forum/MailSender/Views/Home/Index.cshtml @@ -1,8 +1,8 @@ @model MailSender.Models.MailModel @{ - ViewBag.Title = "Mail Sender"; + //ViewBag.Title = "Mail Sender"; } -

Send Mail

+ @if (ViewData.ContainsKey("mailErr")) { @@ -13,23 +13,23 @@ {
@Html.LabelFor(i => i.Subject, new { @class = "label-form" }) - @Html.EditorFor(i => i.Subject, new { htmlAttributes = new { @class = "form-control", @placeholder = "Subject" } }) + @Html.EditorFor(i => i.Subject, new { htmlAttributes = new { @class = "form-control form-control--input", @placeholder = "Temat" } }) @Html.ValidationMessageFor(i => i.Subject)
@Html.LabelFor(i => i.EMailTo, new { @class = "label-form" }) - @Html.EditorFor(i => i.EMailTo, new { htmlAttributes = new { @class = "form-control", @placeholder = "To" } }) + @Html.EditorFor(i => i.EMailTo, new { htmlAttributes = new { @class = "form-control form-control--input", @placeholder = "Do" } }) @Html.ValidationMessageFor(i => i.EMailTo)
-
+
@Html.LabelFor(i => i.Content, new { @class = "label-form" }) - @Html.EditorFor(i => i.Content, new { htmlAttributes = new { @class = "form-control", @placeholder = "Body" } }) + @Html.EditorFor(i => i.Content, new { htmlAttributes = new { @class = "form-control form-control--input", @placeholder = "Odpowiedź" } }) @Html.ValidationMessageFor(i => i.Content)
- + } @section Scripts { diff --git a/Trunk/Server/Forum/MailSender/Views/Shared/_Layout.cshtml b/Trunk/Server/Forum/MailSender/Views/Shared/_Layout.cshtml index 8d60528..157ba56 100644 --- a/Trunk/Server/Forum/MailSender/Views/Shared/_Layout.cshtml +++ b/Trunk/Server/Forum/MailSender/Views/Shared/_Layout.cshtml @@ -4,12 +4,12 @@ - @ViewBag.Title — moja aplikacja platformy ASP.NET + Serwis Email @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") -