Compare commits

...

52 Commits

Author SHA1 Message Date
09ef1ca66e Niekompletna 2018-12-20 07:27:02 +00:00
20655b74f0 Dokumentacja z dodaną zmianą hasła 2018-12-20 06:34:34 +00:00
ff5163cea5 Delete 'instrukcja obsługi.pdf' 2018-12-20 06:34:10 +00:00
1ed563fc7c Dokumentacja z dodaną zmianą hasła 2018-12-20 06:33:41 +00:00
cd89c4bdf7 Delete 'Dokumentacja/instrukcja obsługi.pdf' 2018-12-20 06:33:00 +00:00
d98f7d101a Upload files to 'Dokumentacja' 2018-12-20 06:09:23 +00:00
81b497f02d Najnowsza architektura, poprawione błędy 2018-12-20 01:03:19 +00:00
95bae9565f Usuń 'Dokumentacja/Architektura najnowsza.pdf' 2018-12-20 01:02:55 +00:00
nlitkowski
007fe99f1b Merge branch 'master' of https://git.wmi.amu.edu.pl/s434799/Forum-Inzynieria1 2018-12-20 01:59:57 +01:00
nlitkowski
e9ed7d4b77 redirect do forum po mailu, bug fix, setings wywalone w kosmos 2018-12-20 01:59:38 +01:00
18038707d0 Poprawiona dokumentacja API 2018-12-20 00:29:52 +00:00
nlitkowski
3607ce2f2b naprawiony mailsener 2018-12-20 01:22:51 +01:00
7ef186c12b Plan forum z poprawionymi błędami 2018-12-20 00:09:30 +00:00
0e062a57e9 Najnowsza architektura, poprawione błędy 2018-12-19 23:53:58 +00:00
2cc1af2149 Usuń 'Dokumentacja/Poprawiona-architektura.docx' 2018-12-19 23:49:44 +00:00
c5ca2aa2dc Architektura najnowsza, poprawione błędy 2018-12-19 23:49:18 +00:00
5115b88e85 Prześlij pliki do 'Dokumentacja' 2018-12-19 22:36:45 +00:00
1a97cae65f Usuń 'Dokumentacja/Poprawiona architektura.pdf' 2018-12-19 22:35:59 +00:00
4f2e75eed1 Prześlij pliki do 'Dokumentacja' 2018-12-19 22:30:44 +00:00
cf4cc5650e Usuń 'Dokumentacja/Wstępna architektura systemu.pdf' 2018-12-19 22:28:51 +00:00
Bartosz Chyzy
a0c5d4357b Dodani usuwanie odpowiedzi 2018-12-19 23:26:12 +01:00
Bartosz Chyzy
d72384efe2 Norbert Litkowski nie umie w CSSa 2018-12-19 22:13:44 +01:00
Damian Lasecki
4240f1d563 Add style to edit and delete 2018-12-19 21:15:59 +01:00
Damian Lasecki
d9521ae99d Merge branch 'master' of https://git.wmi.amu.edu.pl/s434799/Forum-Inzynieria1 2018-12-19 21:13:11 +01:00
Damian Lasecki
fd836b41b5 Add style to edit and delete in category view 2018-12-19 21:12:04 +01:00
Bartosz Chyzy
88edf07e00 Zablokowano dostep do tworzenia kont przez randomow 2018-12-19 20:25:54 +01:00
Bartosz Chyzy
15830cf648 Pare spolszczen 2018-12-19 19:48:20 +01:00
Damian Lasecki
62eba388b4 Remove letter bug 2018-12-19 19:26:24 +01:00
Damian Lasecki
aa4ae61818 Styling manage category 2018-12-19 19:19:48 +01:00
Bartosz Chyzy
df046dc2a0 Merge branch 'master' of https://git.wmi.amu.edu.pl/s434799/Forum-Inzynieria1 2018-12-19 13:51:04 +01:00
Bartosz Chyzy
3fd3fc128c Podpiecie do mailSendera 2018-12-19 13:50:49 +01:00
3c243891d0 Upload files to 'Dokumentacja' 2018-12-19 12:12:12 +00:00
a6521a35ef Delete 'Dokumentacja/Poprawiona architektura.pdf' 2018-12-19 12:11:54 +00:00
851b633e31 poprawiony kontroler MailSender 2018-12-19 13:09:24 +01:00
Bartosz Chyzy
c79fed0334 Poprawiono namespacey 2018-12-19 12:55:35 +01:00
13086a7f60 added maildto 2018-12-19 12:32:14 +01:00
Adnovac
cd309a208e Merge branch 'master' of https://git.wmi.amu.edu.pl/s434799/Forum-Inzynieria1 2018-12-19 12:10:30 +01:00
Adnovac
4a8e98e21f merge mailsender 2018-12-19 12:10:05 +01:00
3cef1b6f15 Delete 'Dokumentacja/Diagramy_Klas_UML_ERD.docx' 2018-12-19 10:55:49 +00:00
1ac7861508 Poprawiona architektura 2018-12-18 14:29:02 +00:00
Bartosz Chyży
79eef508b5 Dodano oznaczenie opowiedzi jako profesionalista 2018-12-18 13:42:59 +01:00
Bartosz Chyży
c1a6d311e0 Dodano zapisywanie odpowiedzi jako profesionalista 2018-12-18 13:39:47 +01:00
Bartosz Chyży
70bdf02761 Dodano konntroler kategorii 2018-12-18 12:54:02 +01:00
Bartosz Chyzy
8e90b463ae Merge remote-tracking branch 'remotes/origin/Styling-home-views' 2018-12-06 22:58:14 +01:00
Damian Lasecki
38c20d09ec Wystylizowano widoki z /home 2018-12-06 22:31:18 +01:00
Damian Lasecki
c577b17923 Wystylizowano widoki w /Home 2018-12-06 22:27:25 +01:00
58f0566d1d Scenariusz testów 2018-12-06 15:54:25 +00:00
8dcc5b212c Notatka 2018-12-05 22:24:11 +00:00
98218a4d17 Architektura systemu 2018-12-05 22:07:15 +00:00
Adnovac
26b46b9119 Diagramy ERD 2018-12-05 13:10:39 +01:00
Adnovac
feb7c7b746 -zbedny txt 2018-12-05 12:09:56 +01:00
Adnovac
04e0f15629 +wstepna dokumentacja 2018-12-05 12:08:07 +01:00
57 changed files with 1183 additions and 571 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Dokumentacja/Notatka.pdf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,7 @@
using System.Security.Claims; using System.Security.Claims;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
namespace Forum.DataAccessLayer.Models namespace Forum.DataAccessLayer.Models
{ {

View File

@ -1,4 +1,6 @@
using Forum.DataAccessLayer.Models; using System.Data.Entity;
using Forum.DataAccessLayer.Models;
using Microsoft.AspNet.Identity.EntityFramework;
namespace Forum.DataAccessLayer namespace Forum.DataAccessLayer
{ {

View File

@ -1,6 +1,9 @@
using System.Security.Claims; using System.Security.Claims;
using System.Threading.Tasks; using System.Threading.Tasks;
using Forum.DataAccessLayer.Models; using Forum.DataAccessLayer.Models;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using Microsoft.Owin.Security;
namespace Forum.DataAccessLayer.Managers namespace Forum.DataAccessLayer.Managers
{ {

View File

@ -1,6 +1,10 @@
using System; using System;
using Forum.DataAccessLayer.Models; using Forum.DataAccessLayer.Models;
using Forum.DataAccessLayer.Services; using Forum.DataAccessLayer.Services;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
namespace Forum.DataAccessLayer.Managers namespace Forum.DataAccessLayer.Managers
{ {

View File

@ -1,3 +1,5 @@
using System.Data.Entity.Migrations;
namespace Forum.DataAccessLayer.Migrations namespace Forum.DataAccessLayer.Migrations
{ {

View File

@ -1,3 +1,5 @@
using System.Data.Entity.Migrations;
namespace Forum.DataAccessLayer.Migrations namespace Forum.DataAccessLayer.Migrations
{ {

View File

@ -1,3 +1,5 @@
using System.Data.Entity.Migrations;
namespace Forum.DataAccessLayer.Migrations namespace Forum.DataAccessLayer.Migrations
{ {

View File

@ -1,3 +1,5 @@
using System.Data.Entity.Migrations;
namespace Forum.DataAccessLayer.Migrations namespace Forum.DataAccessLayer.Migrations
{ {

View File

@ -1,3 +1,5 @@
using System.Data.Entity.Migrations;
namespace Forum.DataAccessLayer.Migrations namespace Forum.DataAccessLayer.Migrations
{ {

View File

@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Data.Entity.Migrations;
using Forum.DataAccessLayer.Models; using Forum.DataAccessLayer.Models;
namespace Forum.DataAccessLayer.Migrations namespace Forum.DataAccessLayer.Migrations

View File

@ -1,4 +1,5 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
namespace Forum.DataAccessLayer.Services namespace Forum.DataAccessLayer.Services
{ {

View File

@ -1,4 +1,5 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
namespace Forum.DataAccessLayer.Services namespace Forum.DataAccessLayer.Services
{ {

View File

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio 15
VisualStudioVersion = 15.0.28307.136 VisualStudioVersion = 15.0.26730.15
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Forum", "Forum\Forum.csproj", "{E3C0D1F3-C4CC-4D3D-9960-F20179C60269}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Forum", "Forum\Forum.csproj", "{E3C0D1F3-C4CC-4D3D-9960-F20179C60269}"
EndProject EndProject
@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Forum.DataAccessLayer", "Fo
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MailSender", "MailSender\MailSender.csproj", "{24F3A3E9-F8B9-43A5-A5AB-FA627683750C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MailSender", "MailSender\MailSender.csproj", "{24F3A3E9-F8B9-43A5-A5AB-FA627683750C}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MailDTO", "MailDTO\MailDTO.csproj", "{07B5BD11-726F-4506-9FD8-783880AAE0EF}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -35,6 +37,10 @@ Global
{24F3A3E9-F8B9-43A5-A5AB-FA627683750C}.Debug|Any CPU.Build.0 = Debug|Any CPU {24F3A3E9-F8B9-43A5-A5AB-FA627683750C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24F3A3E9-F8B9-43A5-A5AB-FA627683750C}.Release|Any CPU.ActiveCfg = Release|Any CPU {24F3A3E9-F8B9-43A5-A5AB-FA627683750C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24F3A3E9-F8B9-43A5-A5AB-FA627683750C}.Release|Any CPU.Build.0 = Release|Any CPU {24F3A3E9-F8B9-43A5-A5AB-FA627683750C}.Release|Any CPU.Build.0 = Release|Any CPU
{07B5BD11-726F-4506-9FD8-783880AAE0EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07B5BD11-726F-4506-9FD8-783880AAE0EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07B5BD11-726F-4506-9FD8-783880AAE0EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07B5BD11-726F-4506-9FD8-783880AAE0EF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -1,363 +1,386 @@
body { body {
padding-top: 15rem; padding-top: 15rem;
padding-bottom: 20px; padding-bottom: 20px;
} }
/* Set padding to keep content from hitting the edges */ /* Set padding to keep content from hitting the edges */
.body-content { .body-content {
padding-left: 15px; padding-left: 15px;
padding-right: 15px; padding-right: 15px;
} }
/* Override the default bootstrap behavior where horizontal description lists /* Override the default bootstrap behavior where horizontal description lists
will truncate terms that are too long to fit in the left column will truncate terms that are too long to fit in the left column
*/ */
.dl-horizontal dt { .dl-horizontal dt {
white-space: normal; white-space: normal;
} }
/* Set width on the form input elements since they're 100% wide by default */ /* Set width on the form input elements since they're 100% wide by default */
input, input,
select { select
max-width: 280px; {
} max-width: 280px;
}
.navbar {
background: linear-gradient(#47478f 15%,#4d4794); .navbar {
height: auto; background: linear-gradient(#47478f 15%,#4d4794);
} height: auto;
}
.navbar a {
color: #fafafa; .navbar a {
} color: #fafafa;
}
h2 {
margin: 1rem 0; h2{
} margin: 1rem 0;
}
.navbar-toggle .icon-bar {
background: #b7c5d8; .navbar-toggle .icon-bar {
width: 28px; background: #b7c5d8;
} width: 28px;
}
.navbar-brand {
font-size: 2.5rem; .navbar-brand{
font-weight: 700; font-size:2.5rem;
height: 70px; font-weight:700;
line-height: 4rem; height:70px;
} line-height:4rem;
}
.navbar-toggle {
margin-top: 18px; .navbar-toggle{
} margin-top:18px;
}
.navbar > .container {
width: 90%; .navbar > .container {
} width: 90%;
}
.nav > li > a:hover, .nav > li > a:focus {
background-color: #5a5aa7; .nav > li > a:hover, .nav > li > a:focus{
}
background-color:#5a5aa7 ;
}
.category-list-wrapper {
width: 80%;
margin: 0 auto; .category-list-wrapper{
} width:80%;
margin:0 auto;
.category-wrapper > ul {
list-style: none; }
}
.category-wrapper > ul {
.category-list { list-style: none;
display: grid; }
padding: 0;
grid-row-gap: 2rem; .category-list{
} display: grid;
padding:0;
.category-list > li { grid-row-gap: 2rem;
height: 9rem; }
display: flex;
justify-content: center; .category-list > li {
align-items: center; height: 9rem;
background-color: #bbbbc5; display: flex;
border-radius: 1rem; justify-content: center;
position: relative; align-items: center;
} background-color:#bbbbc5;
border-radius: 1rem;
.category-list > li > a { position:relative;
text-decoration: none; }
color: #fafafa;
font-size: 3rem; .category-list > li > a {
display: block; text-decoration: none;
width: 100%; color: #fafafa;
height: 100%; font-size: 3rem;
text-align: center; display: block;
line-height: 9rem; width: 100%;
overflow: hidden; height: 100%;
} text-align: center;
line-height: 9rem;
.single-category-wrapper { overflow: hidden;
padding: 3rem; }
background-color: #f2f2f2;
border-radius: 1rem; .single-category-wrapper{
} padding: 3rem;
background-color: #f2f2f2;
.single-category-wrapper > h2 { border-radius: 1rem;
margin: 1rem 0; }
}
.single-category-wrapper > h2 {
.single-category-wrapper > ul { margin:1rem 0;
padding: 0; }
list-style: none;
} .single-category-wrapper > ul {
padding:0;
.single-category-wrapper > ul li { list-style: none;
padding: 1.5rem 0; }
font-size: 1.5rem;
} .single-category-wrapper > ul li {
padding: 1.5rem 0;
font-size:1.5rem;
}
.single-category-wrapper > ul li a {
text-decoration: none;
color: #3b3b3b;
} .single-category-wrapper > ul li a {
text-decoration: none;
.add-topic { color: #3b3b3b;
width: 100%;
border: none; }
background: #79bd9b;
padding: 10px; .add-topic {
border-radius: 1rem; width: 100%;
font-size: 1.8rem; border: none;
margin-top: 1rem; background: #79bd9b;
} padding: 10px;
border-radius: 1rem;
font-size: 1.8rem;
.add-topic > a { margin-top: 1rem;
color: #fafafa; }
text-decoration: none;
display: block;
width: 100%; .add-topic > a{
height: 100%; color: #fafafa;
} text-decoration: none;
display:block;
width:100%;
.form-AddQuestion { height:100%;
background-color: #f1f1f3; }
padding: 3rem;
border-radius: 1rem;
} .form-AddQuestion {
background-color: #f1f1f3;
.form-AddQuestion input { padding: 3rem;
max-width: none; border-radius: 1rem;
} }
.form-personal-data { .form-AddQuestion input {
display: flex; max-width: none;
flex-direction: column; }
width: 100%;
justify-content: space-between; .form-personal-data{
} display: flex;
flex-direction: column;
.form-personal-data .form-group { width:100%;
width: 100%; justify-content: space-between;
}
}
.form-AddQuestion input[type=submit], .add-answer input[type=submit] {
border: none; .form-personal-data .form-group {
background: #79bd9b; width:100%;
padding: 10px; }
border-radius: 1rem;
font-size: 1.8rem; .form-AddQuestion input[type=submit], .add-answer input[type=submit] {
color: #fafafa; border: none;
} background: #79bd9b;
padding: 10px;
.form-AddQuestion input[type=submit] { border-radius: 1rem;
margin-top: 1.7rem; font-size: 1.8rem;
} color: #fafafa;
.form-AddQuestion__btn { }
width: 100%;
display: flex; .form-AddQuestion input[type=submit]{
flex-direction: column; margin-top: 1.7rem;
justify-content: space-between; }
align-items: center;
} .form-AddQuestion__btn{
width:100%;
.textarea-wrapper { display: flex;
width: 50%; flex-direction: column;
margin: 20px auto; justify-content: space-between;
padding: 5px; /*workaround for textarea margin*/ align-items: center;
background: #FFF;
border: 1px solid #808080; }
}
.textarea-wrapper {
textarea { width: 50%;
max-width: none; margin: 20px auto;
width: 100%; padding: 5px; /*workaround for textarea margin*/
} background: #FFF;
border: 1px solid #808080;
.answer-list__question { }
background: #dee0eb;
padding: 3rem; textarea {
overflow-wrap: break-word; max-width: none;
border-radius: 1rem; width: 100%;
margin-bottom: 5rem; }
}
.answer-list__question {
.answer-list__question h2 { background: #dee0eb;
margin: 0; padding: 3rem;
width: 80%; overflow-wrap: break-word;
} border-radius: 1rem;
margin-bottom: 5rem;
.answer-list__info { }
display: flex;
justify-content: space-between; .answer-list__question h2 {
align-items: center; margin:0;
} width: 80%;
}
.answer-list__answer {
list-style: none; .answer-list__info {
padding: 0; display: flex;
} justify-content: space-between;
align-items:center;
.username { }
font-weight: 700;
} .answer-list__answer {
list-style: none;
.answer-list__answer__info { padding:0;
background: #4d4c4c; }
color: #fafafa;
padding: 1rem 2rem; .username {
display: flex; font-weight: 700;
justify-content: space-between; }
border-radius: 1rem;
} .answer-list__answer__info {
background: #4d4c4c;
.answer-list__answer__info--proffesional { color: #fafafa;
background: #c68585; padding: 1rem 2rem;
} display: flex;
justify-content: space-between;
.answer-list__single-answer { border-radius: 1rem;
border: 1px solid #c0bebe; }
border-radius: 1rem;
margin-bottom: 3rem; .answer-list__answer__info--proffesional {
border-top: none; background: #c68585;
} }
.answer-list__content { .answer-list__single-answer {
padding: 2rem 2rem; border: 1px solid #c0bebe;
width: 100%; border-radius: 1rem;
overflow-wrap: break-word; margin-bottom: 3rem;
} border-top: none;
}
.answer-list__heading {
margin: 2rem 0; .answer-list__content {
} padding: 2rem 2rem;
width: 100%;
.answer-list__add-btn { overflow-wrap: break-word;
border: none; }
background: #79bd9b;
border-radius: 1rem; .answer-list__heading {
font-size: 1.8rem; margin: 2rem 0;
color: #fafafa; }
width: 20rem;
display: flex; .answer-list__add-btn {
justify-content: center; border: none;
align-items: center; background: #79bd9b;
height: 5rem; border-radius: 1rem;
} font-size: 1.8rem;
color: #fafafa;
.answer-list__add-btn a { width: 20rem;
text-decoration: none; display: flex;
display: block; justify-content:center;
width: 100%; align-items:center;
height: 100%; height: 5rem;
color: white;
text-align: center; }
line-height: 5rem;
} .answer-list__add-btn a {
text-decoration: none;
.add-answer { display: block;
background: #f2f2f2; width: 100%;
padding: 3rem; height: 100%;
border-radius: 1rem; color: white;
} text-align: center;
line-height: 5rem;
}
.add-answer {
background: #f2f2f2;
padding: 3rem;
border-radius: 1rem;
@media (min-width: 768px) { }
.wrapper {
padding: 3rem;
.navbar > .container { background-color: #f2f2f2;
height: 10rem; }
}
.delete-category__span{
.navbar-header { font-size:2rem;
height: 100%; font-weight:400;
display: flex; margin-bottom:10rem;
align-items: center; }
}
.delete-category__dl {
.navbar-brand { height: 3rem;
font-size: 3.5rem; margin-bottom: 3rem;
} }
.navbar-nav {
height: 100px;
display: flex; @media (min-width: 768px) {
align-items: center;
}
.navbar-nav > li { .navbar > .container {
height: 50%; height: 10rem;
} }
.navbar-header {
height: 100%;
.navbar-nav > li > a { display: flex;
height: 100%; align-items: center;
border-radius: 0.8rem; }
}
.navbar-brand {
.nav > li > a:hover, .nav > li > a:focus { font-size: 3.5rem;
transition: background-color .1s ease; }
}
.navbar-nav {
.category-list { height: 100px;
/*grid-template-columns: 1fr 1fr;*/ display: flex;
grid-column-gap: 2rem; align-items: center;
} }
.single-category-wrapper { .navbar-nav > li {
width: 65%; height: 50%;
margin: 0 auto; }
}
.form-AddQuestion__btn {
flex-direction: row; .navbar-nav > li > a {
margin-top: 1rem; height: 100%;
} border-radius: 0.8rem;
}
.form-personal-data {
flex-direction: row; .nav > li > a:hover, .nav > li > a:focus {
} transition: background-color .1s ease;
}
.form-personal-data .form-group {
width: 49%; .category-list {
} grid-template-columns: 1fr 1fr;
grid-column-gap: 2rem;
.form-AddQuestion input[type=submit] { }
margin-top: 0;
} .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;
}
}

View File

@ -20,9 +20,7 @@ namespace Forum.Controllers
private ApplicationSignInManager _signInManager; private ApplicationSignInManager _signInManager;
private ApplicationUserManager _userManager; private ApplicationUserManager _userManager;
public AccountController() public AccountController(){}
{
}
public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager ) public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager )
{ {
@ -88,7 +86,7 @@ namespace Forum.Controllers
return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }); return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe });
case SignInStatus.Failure: case SignInStatus.Failure:
default: default:
ModelState.AddModelError("", "Invalid login attempt."); ModelState.AddModelError("", "Niepoprawny login lub hasło");
return View(model); return View(model);
} }
} }
@ -138,7 +136,7 @@ namespace Forum.Controllers
// //
// GET: /Account/Register // GET: /Account/Register
[AllowAnonymous] [Authorize]
public ActionResult Register() public ActionResult Register()
{ {
return View(); return View();
@ -147,13 +145,13 @@ namespace Forum.Controllers
// //
// POST: /Account/Register // POST: /Account/Register
[HttpPost] [HttpPost]
[AllowAnonymous] [Authorize]
[ValidateAntiForgeryToken] [ValidateAntiForgeryToken]
public async Task<ActionResult> Register(RegisterViewModel model) public async Task<ActionResult> Register(RegisterViewModel model)
{ {
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
var user = new ProfessionalUser() { UserName = model.Email, Email = model.Email }; var user = new ProfessionalUser() { UserName = model.Email, Email = model.Email,FullName = model.FullName};
var result = await UserManager.CreateAsync(user, model.Password); var result = await UserManager.CreateAsync(user, model.Password);
if (result.Succeeded) if (result.Succeeded)
{ {

View File

@ -0,0 +1,114 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using Forum.DataAccessLayer;
using Forum.DataAccessLayer.Models;
namespace Forum.Controllers
{
[Authorize]
public class CategoriesController : Controller
{
private ApplicationDbContext db = new ApplicationDbContext();
// GET: Categories
public ActionResult Index()
{
return View(db.Categories.ToList());
}
// GET: Categories/Create
public ActionResult Create()
{
return View();
}
// POST: Categories/Create
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see https://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create([Bind(Include = "Id,CategoryName")] Category category)
{
if (ModelState.IsValid)
{
db.Categories.Add(category);
db.SaveChanges();
return RedirectToAction("Index");
}
return View(category);
}
// GET: Categories/Edit/5
public ActionResult Edit(int? id)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
Category category = db.Categories.Find(id);
if (category == null)
{
return HttpNotFound();
}
return View(category);
}
// POST: Categories/Edit/5
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see https://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Edit([Bind(Include = "Id,CategoryName")] Category category)
{
if (ModelState.IsValid)
{
db.Entry(category).State = EntityState.Modified;
db.SaveChanges();
return RedirectToAction("Index");
}
return View(category);
}
// GET: Categories/Delete/5
public ActionResult Delete(int? id)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
Category category = db.Categories.Find(id);
if (category == null)
{
return HttpNotFound();
}
return View(category);
}
// POST: Categories/Delete/5
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public ActionResult DeleteConfirmed(int id)
{
Category category = db.Categories.Find(id);
db.Categories.Remove(category);
db.SaveChanges();
return RedirectToAction("Index");
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
db.Dispose();
}
base.Dispose(disposing);
}
}
}

View File

@ -1,11 +1,16 @@
using System; using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.Entity; using System.Data.Entity;
using System.Linq; using System.Linq;
using System.Security.Principal;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web.Mvc; using System.Web.Mvc;
using Fluentx.Mvc;
using Forum.DataAccessLayer; using Forum.DataAccessLayer;
using Forum.DataAccessLayer.Models; using Forum.DataAccessLayer.Models;
using Forum.ViewModels; using Forum.ViewModels;
using Microsoft.AspNet.Identity;
namespace Forum.Controllers namespace Forum.Controllers
{ {
@ -99,19 +104,54 @@ namespace Forum.Controllers
if (question == null) if (question == null)
return HttpNotFound(); return HttpNotFound();
var user = _dbContext.Users.Find(User.Identity.GetUserId());
var answer = new Answer() var answer = new Answer()
{ {
Content = model.Content, Content = model.Content,
Nick = model.Nick, Nick = model.Nick,
Date = DateTime.Now Date = DateTime.Now,
Professional = user
}; };
question.Answers.Add(answer); question.Answers.Add(answer);
_dbContext.SaveChanges(); _dbContext.SaveChanges();
//Logika wysylania maili
if (User.Identity.IsAuthenticated && !string.IsNullOrEmpty(question.ReportersEmail))
{
var dataToPost = new Dictionary<string, object>();
dataToPost.Add("Subject",question.Title);
dataToPost.Add("EMailTo",question.ReportersEmail);
dataToPost.Add("Content",model.Content);
return this.RedirectAndPost(ConfigurationManager.AppSettings["MailSenderAddress"], dataToPost);
}
return RedirectToAction("Question", new {id = model.QuestionId}); return RedirectToAction("Question", new {id = model.QuestionId});
} }
[Authorize]
[System.Web.Mvc.Route("Home/DeleteAnswer/{id}")]
public ActionResult DeleteAnswer(int? id)
{
var answer = _dbContext.Answers.Find(id);
var question = _dbContext.Questions.FirstOrDefault(x => x.Answers.Any(y => y.Id == id));
if (answer != null)
{
_dbContext.Answers.Remove(answer);
_dbContext.SaveChanges();
}
if (question != null)
return RedirectToAction("Question", new {id = question.Id});
return HttpNotFound();
}
} }
} }

View File

@ -47,6 +47,12 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Fluentx, Version=2.0.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Fluentx.2.0.4\lib\Fluentx.dll</HintPath>
</Reference>
<Reference Include="Fluentx.Mvc, Version=1.0.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Fluentx.Mvc.1.0.4\lib\Fluentx.Mvc.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.TelemetryCorrelation, Version=1.0.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.AspNet.TelemetryCorrelation, Version=1.0.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.4\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll</HintPath> <HintPath>..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.4\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll</HintPath>
</Reference> </Reference>
@ -176,6 +182,7 @@
<Compile Include="App_Start\RouteConfig.cs" /> <Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="App_Start\Startup.Auth.cs" /> <Compile Include="App_Start\Startup.Auth.cs" />
<Compile Include="Controllers\AccountController.cs" /> <Compile Include="Controllers\AccountController.cs" />
<Compile Include="Controllers\CategoriesController.cs" />
<Compile Include="Controllers\HomeController.cs" /> <Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\ManageController.cs" /> <Compile Include="Controllers\ManageController.cs" />
<Compile Include="Global.asax.cs"> <Compile Include="Global.asax.cs">
@ -215,6 +222,8 @@
<Content Include="Content\bootstrap.css.map" /> <Content Include="Content\bootstrap.css.map" />
<Content Include="Content\bootstrap-theme.min.css.map" /> <Content Include="Content\bootstrap-theme.min.css.map" />
<Content Include="Content\bootstrap-theme.css.map" /> <Content Include="Content\bootstrap-theme.css.map" />
<None Include="Properties\PublishProfiles\forum-inzynieria1 - FTP.pubxml" />
<None Include="Properties\PublishProfiles\forum-inzynieria1 - Web Deploy.pubxml" />
<None Include="Scripts\jquery-3.3.1.intellisense.js" /> <None Include="Scripts\jquery-3.3.1.intellisense.js" />
<Content Include="Scripts\jquery-3.3.1.js" /> <Content Include="Scripts\jquery-3.3.1.js" />
<Content Include="Scripts\jquery-3.3.1.min.js" /> <Content Include="Scripts\jquery-3.3.1.min.js" />
@ -281,9 +290,14 @@
<Content Include="Scripts\popper-utils.js.map" /> <Content Include="Scripts\popper-utils.js.map" />
<Content Include="Views\Home\AddQuestion.cshtml" /> <Content Include="Views\Home\AddQuestion.cshtml" />
<Content Include="Views\Home\AddAnswer.cshtml" /> <Content Include="Views\Home\AddAnswer.cshtml" />
<Content Include="Views\Categories\Create.cshtml" />
<Content Include="Views\Categories\Delete.cshtml" />
<Content Include="Views\Categories\Edit.cshtml" />
<Content Include="Views\Categories\Index.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="App_Data\" /> <Folder Include="App_Data\" />
<Folder Include="Views\Professional\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />

View File

@ -55,10 +55,10 @@ namespace Forum.Models
[Required] [Required]
[DataType(DataType.Password)] [DataType(DataType.Password)]
[Display(Name = "Password")] [Display(Name = "Hasło")]
public string Password { get; set; } public string Password { get; set; }
[Display(Name = "Remember me?")] [Display(Name = "Zapamiętaj mnie")]
public bool RememberMe { get; set; } public bool RememberMe { get; set; }
} }
@ -72,13 +72,17 @@ namespace Forum.Models
[Required] [Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)] [DataType(DataType.Password)]
[Display(Name = "Password")] [Display(Name = "Hasło")]
public string Password { get; set; } public string Password { get; set; }
[DataType(DataType.Password)] [DataType(DataType.Password)]
[Display(Name = "Confirm password")] [Display(Name = "Potwierdź hasło")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; } public string ConfirmPassword { get; set; }
[Display(Name = "Imię i nazwisko")]
[Required]
public string FullName { get; set; }
} }
public class ResetPasswordViewModel public class ResetPasswordViewModel

View File

@ -1,7 +1,7 @@
@using Forum.Models @using Forum.Models
@model LoginViewModel @model LoginViewModel
@{ @{
ViewBag.Title = "Log in"; ViewBag.Title = "Zaloguj się";
} }
<h2>@ViewBag.Title.</h2> <h2>@ViewBag.Title.</h2>
@ -11,7 +11,6 @@
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{ {
@Html.AntiForgeryToken() @Html.AntiForgeryToken()
<h4>Use a local account to log in.</h4>
<hr /> <hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group"> <div class="form-group">
@ -38,11 +37,11 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-md-offset-2 col-md-10"> <div class="col-md-offset-2 col-md-10">
<input type="submit" value="Log in" class="btn btn-default" /> <input type="submit" value="Zaloguj się" class="btn btn-default" />
</div> </div>
</div> </div>
<p> <p>
@Html.ActionLink("Register as a new user", "Register") @*@Html.ActionLink("Utwórz nowego użytkownika", "Register")*@
</p> </p>
@* Enable this once you have account confirmation enabled for password reset functionality @* Enable this once you have account confirmation enabled for password reset functionality
<p> <p>
@ -51,11 +50,7 @@
} }
</section> </section>
</div> </div>
<div class="col-md-4">
<section id="socialLoginForm">
@Html.Partial("_ExternalLoginsListPartial", new ExternalLoginListViewModel { ReturnUrl = ViewBag.ReturnUrl })
</section>
</div>
</div> </div>
@section Scripts { @section Scripts {

View File

@ -1,6 +1,6 @@
@model Forum.Models.RegisterViewModel @model Forum.Models.RegisterViewModel
@{ @{
ViewBag.Title = "Register"; ViewBag.Title = "Zarejestruj się";
} }
<h2>@ViewBag.Title.</h2> <h2>@ViewBag.Title.</h2>
@ -8,7 +8,6 @@
@using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{ {
@Html.AntiForgeryToken() @Html.AntiForgeryToken()
<h4>Create a new account.</h4>
<hr /> <hr />
@Html.ValidationSummary("", new { @class = "text-danger" }) @Html.ValidationSummary("", new { @class = "text-danger" })
<div class="form-group"> <div class="form-group">
@ -17,6 +16,12 @@
@Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) @Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
</div> </div>
</div> </div>
<div class="form-group">
@Html.LabelFor(m => m.FullName, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.TextBoxFor(m => m.FullName, new { @class = "form-control" })
</div>
</div>
<div class="form-group"> <div class="form-group">
@Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" })
<div class="col-md-10"> <div class="col-md-10">
@ -31,7 +36,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-md-offset-2 col-md-10"> <div class="col-md-offset-2 col-md-10">
<input type="submit" class="btn btn-default" value="Register" /> <input type="submit" class="btn btn-default" value="Zarejestruj" />
</div> </div>
</div> </div>
} }

View File

@ -0,0 +1,44 @@
@model Forum.DataAccessLayer.Models.Category
@{
ViewBag.Title = "Create";
}
<div class="single-category-wrapper">
<h2>Utwórz kategorie</h2>
<hr style="border-top: 1px solid #d3d3d3; margin-bottom: 3rem;" />
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.CategoryName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.CategoryName, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.CategoryName, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Utwórz kategorie" class="answer-list__add-btn" style="height:4rem; width:17rem" />
</div>
</div>
</div>
}
<div>
@Html.ActionLink("Powrót", "Index")
</div>
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}

View File

@ -0,0 +1,34 @@
@model Forum.DataAccessLayer.Models.Category
@{
ViewBag.Title = "Delete";
}
<div class="single-category-wrapper">
<h2>Usuwanie ketegorii</h2>
<hr style="border-top: 1px solid #d3d3d3;" />
<span class="delete-category__span">Jesteś pewien, że chcesz usunąć kategorię?</span>
<div style="margin-top: 3rem;">
<dl class="dl-horizontal delete-category__dl">
<dt style="text-align:left">
@Html.DisplayNameFor(model => model.CategoryName)
</dt>
<dd style="margin-left:0;">
@Html.DisplayFor(model => model.CategoryName)
</dd>
</dl>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-actions no-color">
<input type="submit" value="Usuń" class="answer-list__add-btn" style="height:4rem; width:17rem; background-color:#af4f4f; margin-bottom: 3rem;" />
</div>
<div>@Html.ActionLink("Powrót do listy kategorii", "Index")
</div>
}
</div>
</div>

View File

@ -0,0 +1,42 @@
@model Forum.DataAccessLayer.Models.Category
@{
ViewBag.Title = "Edit";
}
<div class="single-category-wrapper">
<h2>Edytuj nazwię kategorii</h2>
<hr style="border-top: 1px solid #d3d3d3; margin-bottom: 3rem;" />
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
@Html.HiddenFor(model => model.Id)
<div class="form-group">
@Html.LabelFor(model => model.CategoryName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.CategoryName, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.CategoryName, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Zapisz" class="answer-list__add-btn" style="height:4rem; width:17rem" />
</div>
</div>
</div>
}
<div>
@Html.ActionLink("Powrót do listy kategorii", "Index")
</div>
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}

View File

@ -0,0 +1,35 @@
@model IEnumerable<Forum.DataAccessLayer.Models.Category>
@{
ViewBag.Title = "Index";
}
<div class="single-category-wrapper">
<h2 style="margin-bottom:3rem;">Kategorie</h2>
<table class="table">
<tr>
<th>
Nazwa kategorii
</th>
<th></th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.CategoryName)
</td>
<td>
@Html.ActionLink("Edytuj", "Edit", new { id = item.Id }) |
@Html.ActionLink("Usuń", "Delete", new { id = item.Id })
</td>
</tr>
}
</table>
<p class="answer-list__add-btn">
@Html.ActionLink("Utwórz kategorie", "Create")
</p>
</div>

View File

@ -1,26 +1,45 @@
@model Forum.ViewModels.AddAnswerViewModel @model Forum.ViewModels.AddAnswerViewModel
@{ @{
ViewBag.Title = "AddAnswer"; ViewBag.Title = "AddAnswer";
} }
<h2>AddAnswer</h2>
<div class="add-answer">
@using (Html.BeginForm("AddAnswer", "Home", FormMethod.Post)) <h2>Dodaj odpowiedź</h2>
{
<hr style="border-top: 1px solid #d3d3d3; margin-bottom: 3rem;" />
<div class="form-group">
@Html.LabelFor(model => model.Nick, new { @class = "label-form" })
@Html.EditorFor(model => model.Nick, new { htmlAttributes = new { @class = "form-control" } }) @using (Html.BeginForm("AddAnswer", "Home", FormMethod.Post))
</div> {
<div class="form-group"> <div class="form-group">
@Html.LabelFor(model => model.Content, new { @class = "label-form" }) @{
@Html.EditorFor(model => model.Content, new { htmlAttributes = new { @class = "form-control" } }) if (User.Identity.IsAuthenticated)
</div> {
<label>Odpowiedz jako @User.Identity.Name</label>
@Html.HiddenFor(model=>model.QuestionId) }
else
<input type="submit" value="Zgłoś" /> {
} @Html.EditorFor(model => model.Nick, new { htmlAttributes = new { @class = "form-control", placeholder = "Nick" } })
}
}
</div>
<div class="form-group">
@Html.TextAreaFor(model => model.Content, new { @class = "form-control", @id = "exampleFormControlTextarea3", rows = 7, placeholder = "Odpowiedź" })<br />
</div>
@Html.HiddenFor(model=>model.QuestionId)
<input type="submit" value="Zgłoś odpowiedź" />
}
</div>

View File

@ -1,38 +1,49 @@
@model Forum.ViewModels.AddQuestionViewModel @model Forum.ViewModels.AddQuestionViewModel
@{ @{
ViewBag.Title = "AddQuestion"; ViewBag.Title = "AddQuestion";
} }
<h2>AddQuestion</h2>
@using (Html.BeginForm("AddQuestion", "Home", FormMethod.Post)) @using (Html.BeginForm("AddQuestion", "Home", FormMethod.Post))
{ {
<div class="form-group"> <div class="form-AddQuestion">
@Html.LabelFor(model => model.Title, new { @class = "label-form" }) <h2>Dodaj zapytanie</h2>
@Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } }) <hr style="border-top: 1px solid #d3d3d3; margin-bottom:3rem;" />
</div>
<div class="form-group">
@Html.LabelFor(model => model.Content, new { @class = "label-form" }) <div class="form-group">
@Html.EditorFor(model => model.Content, new { htmlAttributes = new { @class = "form-control" } }) @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control", placeholder="Temat" } })
</div> </div>
<div class="form-group"> <div class="form-group">
@Html.LabelFor(model => model.Nick, new { @class = "label-form" })
@Html.EditorFor(model => model.Nick, new { htmlAttributes = new { @class = "form-control" } })
</div> @Html.TextAreaFor(model => model.Content, new { @class="form-control", @id = "exampleFormControlTextarea3", rows=7, placeholder="Treść zapytania" })<br />
<div class="form-group"> </div>
@Html.LabelFor(model => model.Email, new { @class = "label-form" }) <div class="form-personal-data">
@Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control" } }) <div class="form-group">
</div> @Html.EditorFor(model => model.Nick, new { htmlAttributes = new { @class = "form-control", placeholder="Nick" } })
</div>
@Html.DropDownListFor(x=>x.CategoryId,new SelectList(Model.Categories,"Id", "CategoryName"))
<div class="form-group">
<input type="submit" value="Zgłoś"/> @Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control", placeholder="Adres email" } })
} </div>
</div>
<div class="form-AddQuestion__btn">
@Html.DropDownListFor(x=>x.CategoryId,new SelectList(Model.Categories,"Id", "CategoryName"), new { @class = "form-control" })
<input type="submit" value="Dodaj zapytanie"/>
</div>
</div>
}

View File

@ -1,18 +1,36 @@
@model Forum.DataAccessLayer.Models.Category @model Forum.DataAccessLayer.Models.Category
@{ @{
ViewBag.Title = Model.CategoryName; ViewBag.Title = Model.CategoryName;
} }
<h2>@Model.CategoryName</h2>
<div class="single-category-wrapper">
@Html.ActionLink("Dodaj pytanie", "AddQuestion", "Home",new {category=Model.CategoryName},null)
<h2>@Model.CategoryName</h2>
<ul>
@{ <hr style="border-top: 1px solid #d3d3d3" />
foreach (var question in Model.Questions)
{ <ul class="single-category__topic">
<li>@Html.ActionLink(question.Title,"Question","Home",new{id=question.Id},null)</li> @{
} foreach (var question in Model.Questions)
} {
</ul> string title = question.Title;
if (String.IsNullOrEmpty(title))
{
title = "Brak tytułu pytania";
}
<li>@Html.ActionLink(title, "Question", "Home", new { id = question.Id }, null)</li>
}
}
</ul>
<button class="add-topic">
@Html.ActionLink("Dodaj zapytanie", "AddQuestion", "Home", new { category = Model.CategoryName }, null)
</button>
</div>

View File

@ -1,18 +1,19 @@
@model IEnumerable<Forum.DataAccessLayer.Models.Category> @model IEnumerable<Forum.DataAccessLayer.Models.Category>
@{ @{
ViewBag.Title = "Strona Główna"; ViewBag.Title = "Strona Główna";
} }
<div class="category-list-wrapper">
<ul> <ul class="category-list">
@{ @{
foreach (var category in Model) foreach (var category in Model)
{ {
<li> <li>
@Html.ActionLink(category.CategoryName,"Category","Home",new{name=category.CategoryName},null) @Html.ActionLink(category.CategoryName, "Category", "Home", new { name = category.CategoryName }, null)
</li> </li>
}
} }
</ul> }
</ul>
</div>

View File

@ -1,28 +1,65 @@
@model Forum.DataAccessLayer.Models.Question @using WebGrease.Css.Extensions
@model Forum.DataAccessLayer.Models.Question
@{
ViewBag.Title = @Model.Title; @{
} ViewBag.Title = @Model.Title;
}
@Model.PostDate
<h2>@Model.Title</h2> <div class="answer-list__question">
<div>
@Model.Content <div class="answer-list__info">
</div> <h2>@Model.Title</h2>
@Model.PostDate
<hr/>
@Html.ActionLink("Dodaj odpowiedź","AddAnswer",new{id=@Model.Id}) </div>
<hr/> <hr style="border-top: 1px solid #d3d3d3" />
<b>Odpowiedzi</b>
<ul> <div class="answer-list__question__content">
@{ @Model.Content
foreach (var answer in Model.Answers) </div>
{
<li>@answer.Nick @answer.Date @answer.Content </li> </div>
}
}
</ul> <h3 class="answer-list__heading">Odpowiedzi</h3>
<ul class="answer-list__answer">
@{
foreach (var answer in Model.Answers)
{
<li class="answer-list__single-answer">
<div class="answer-list__answer__info" @{if (answer.Professional != null) { <text> style="background-color: #7ecc2a" </text> }}>
@{
if (answer.Professional != null)
{
<span class="username">@answer.Professional.FullName napisał(a)</span>
}
else
{
<span class="username">@answer.Nick napisał(a)</span>
}
}
@{
if (User.Identity.IsAuthenticated)
{
@Html.ActionLink("Usuń odpowiedź", "DeleteAnswer", new {id = answer.Id},new{@style="color:#fff;"});
}
}
@answer.Date
</div>
<div class="answer-list__content">
@answer.Content
</div>
</li>
}
}
</ul>
<div class="answer-list__add-btn">
@Html.ActionLink("Dodaj odpowiedź", "AddAnswer", new { id = @Model.Id })
</div>

View File

@ -9,7 +9,7 @@
</head> </head>
<body> <body>
<div class="navbar navbar-inverse navbar-fixed-top"> <div class="navbar navbar-fixed-top">
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
@ -17,13 +17,14 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
@Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) @Html.ActionLink("FORUM", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
</div> </div>
<div class="navbar-collapse collapse"> <div class="navbar-collapse collapse">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li>@Html.ActionLink("Home", "Index", "Home")</li> @if (User.Identity.IsAuthenticated)
<li>@Html.ActionLink("About", "About", "Home")</li> {
<li>@Html.ActionLink("Contact", "Contact", "Home")</li> <li>@Html.ActionLink("Zarządzaj kategoriami", "Index", "Categories")</li>
}
</ul> </ul>
@Html.Partial("_LoginPartial") @Html.Partial("_LoginPartial")
</div> </div>
@ -33,7 +34,7 @@
@RenderBody() @RenderBody()
<hr /> <hr />
<footer> <footer>
<p>&copy; @DateTime.Now.Year - My ASP.NET Application</p> <p>&copy; @DateTime.Now.Year - Grupa 1CF Inżynieria oprogramowania</p>
</footer> </footer>
</div> </div>

View File

@ -7,16 +7,16 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
@Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" }) @Html.ActionLink("Witaj " + User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
</li> </li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li> <li>@Html.ActionLink("Dodaj profesjonalistę", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Wyloguj się</a></li>
</ul> </ul>
} }
} }
else else
{ {
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li> <li>@Html.ActionLink("Zaloguj się", "Login", "Account", routeValues: null, htmlAttributes: new {id = "loginLink"})</li>
<li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
</ul> </ul>
} }

View File

@ -12,6 +12,7 @@
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\ForumInzyneria1.mdf;Initial Catalog=ForumInzyneria1;Integrated Security=True" providerName="System.Data.SqlClient" /> <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\ForumInzyneria1.mdf;Initial Catalog=ForumInzyneria1;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings> </connectionStrings>
<appSettings> <appSettings>
<add key="MailSenderAddress" value="http://mailsender-inzynieria1.azurewebsites.net/Home/Index" />
<add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" /> <add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" /> <add key="ClientValidationEnabled" value="true" />
@ -86,7 +87,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" /> <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>

View File

@ -3,6 +3,8 @@
<package id="Antlr" version="3.5.0.2" targetFramework="net461" /> <package id="Antlr" version="3.5.0.2" targetFramework="net461" />
<package id="bootstrap" version="3.3.7" targetFramework="net461" /> <package id="bootstrap" version="3.3.7" targetFramework="net461" />
<package id="EntityFramework" version="6.2.0" targetFramework="net461" /> <package id="EntityFramework" version="6.2.0" targetFramework="net461" />
<package id="Fluentx" version="2.0.4" targetFramework="net461" />
<package id="Fluentx.Mvc" version="1.0.4" targetFramework="net461" />
<package id="jQuery" version="3.3.1" targetFramework="net461" /> <package id="jQuery" version="3.3.1" targetFramework="net461" />
<package id="jQuery.Validation" version="1.17.0" targetFramework="net461" /> <package id="jQuery.Validation" version="1.17.0" targetFramework="net461" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.2" targetFramework="net461" /> <package id="Microsoft.AspNet.Identity.Core" version="2.2.2" targetFramework="net461" />

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MailDTO
{
public class MailDTO
{
public string Subject { get; set; }
public string EMailTo { get; set; }
public string Content { get; set; }
}
}

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{07B5BD11-726F-4506-9FD8-783880AAE0EF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MailDTO</RootNamespace>
<AssemblyName>MailDTO</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MailDTO.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MailDTO")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MailDTO")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("07b5bd11-726f-4506-9fd8-783880aae0ef")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -301,6 +301,11 @@ textarea {
height: 200px; height: 200px;
} }
.w100 {
width: 100% !important;
max-width: 100% !important;
}
.form-emailsend .form-emailsend
{ {
color: black; color: black;

View File

@ -13,8 +13,8 @@ namespace MailSender.Controllers
[HttpGet] [HttpGet]
public ActionResult Index() public ActionResult Index()
{ {
var model = JsonConvert.SerializeObject(new Models.MailModel() { Content = "DDD", EMailTo = "ddd@o2.pl", Subject = "LLLLLL" }); //var model = JsonConvert.SerializeObject(new Models.MailModel() { Content = "DDD", EMailTo = "ddd@o2.pl", Subject = "LLLLLL" });
TempData.Add("mailModel", model); //TempData.Add("mailModel", model);
return RedirectToAction("Index", "Home"); return RedirectToAction("Index", "Home");
} }
} }

View File

@ -1,49 +1,59 @@
using System.Net.Mail; using System.Net.Mail;
using System.Net; using System.Net;
using System.Web.Mvc; using System.Web.Mvc;
using System.Net.Http;
using System.Web.ModelBinding; using System.Web.ModelBinding;
using System; using System;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Configuration;
namespace MailSender.Controllers namespace MailSender.Controllers
{ {
[RoutePrefix("")]
public class HomeController : Controller public class HomeController : Controller
{ {
[HttpPost]
public ActionResult Index([System.Web.Http.FromBody]MailDTO.MailDTO mail)
{
var model = new Models.MailModel(mail);
TempData.Add("mailMod", model);
return View(model);
}
[HttpGet] [HttpGet]
public ActionResult Index() public ActionResult Index()
{ {
string jsonString = TempData["mailModel"] as string; if(TempData["mailMod"] != null)
Models.MailModel model = null; {
if (!String.IsNullOrEmpty(jsonString)) return View(TempData["mailMod"]);
model = JsonConvert.DeserializeObject<Models.MailModel>(jsonString); }
if (model == null) return View(new Models.MailModel());
model = new Models.MailModel();
return View(model);
} }
[HttpGet] [System.Web.Http.HttpGet]
public ActionResult Error(string errMsg) public ActionResult Error(string errMsg)
{ {
ViewData.Add("errMsg", errMsg); TempData.Add("errMsg", errMsg);
return View(); return RedirectToAction("Index");
} }
[HttpPost] [System.Web.Mvc.HttpPost]
public ActionResult Send(MailSender.Models.MailModel model) public ActionResult Send(MailSender.Models.MailModel model)
{ {
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
var smtpClient = new SmtpClient(Settings.smtpServer, Settings.smtpPort) var smtpClient = new SmtpClient(ConfigurationManager.AppSettings["smtp-server"],
Int32.Parse(ConfigurationManager.AppSettings["smtp-port"]))
{ {
Credentials = new NetworkCredential(Settings.user, Settings.pass), Credentials = new NetworkCredential(
ConfigurationManager.AppSettings["user-mail"],
ConfigurationManager.AppSettings["pass-mail"]),
EnableSsl = true EnableSsl = true
}; };
smtpClient.Send(Settings.user, model.EMailTo, model.Subject, model.Content); smtpClient.Send(ConfigurationManager.AppSettings["user-mail"], model.EMailTo, model.Subject, model.Content);
return RedirectToAction("Index"); return Redirect(ConfigurationManager.AppSettings["forum-address"]);
} }
else else
return RedirectToAction("Error", new { errMsg = "Error nie umiesz pisac maila menelu" }); return RedirectToAction("Error", new { errMsg = "Błąd wysyłania wiadomości e-mail." });
} }
} }
} }

View File

@ -64,12 +64,21 @@
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Web.DynamicData" /> <Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" /> <Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" /> <Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Web.Http.Common.4.0.20126.16343\lib\net40\System.Web.Http.Common.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" /> <Reference Include="System.Web.Extensions" />
@ -166,7 +175,6 @@
</Compile> </Compile>
<Compile Include="Models\MailModel.cs" /> <Compile Include="Models\MailModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Content\bootstrap-theme.css" /> <Content Include="Content\bootstrap-theme.css" />
@ -182,6 +190,8 @@
<Content Include="ApplicationInsights.config"> <Content Include="ApplicationInsights.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<None Include="Properties\PublishProfiles\mailsender-inzynieria1 - FTP.pubxml" />
<None Include="Properties\PublishProfiles\mailsender-inzynieria1 - Web Deploy.pubxml" />
<None Include="Scripts\jquery-3.3.1.intellisense.js" /> <None Include="Scripts\jquery-3.3.1.intellisense.js" />
<Content Include="Scripts\jquery-3.3.1.js" /> <Content Include="Scripts\jquery-3.3.1.js" />
<Content Include="Scripts\jquery-3.3.1.min.js" /> <Content Include="Scripts\jquery-3.3.1.min.js" />
@ -223,6 +233,12 @@
<Content Include="Scripts\jquery-3.3.1.slim.min.map" /> <Content Include="Scripts\jquery-3.3.1.slim.min.map" />
<Content Include="Scripts\jquery-3.3.1.min.map" /> <Content Include="Scripts\jquery-3.3.1.min.map" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MailDTO\MailDTO.csproj">
<Project>{07b5bd11-726f-4506-9fd8-783880aae0ef}</Project>
<Name>MailDTO</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup> <PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

View File

@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using MailDTO;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace MailSender.Models namespace MailSender.Models
@ -17,7 +18,7 @@ namespace MailSender.Models
public string Subject { get; set; } public string Subject { get; set; }
[DataType(DataType.EmailAddress)] [DataType(DataType.EmailAddress)]
[Required(AllowEmptyStrings = false, ErrorMessage = "Musisz wprowadzić adres e-mail")] [Required(AllowEmptyStrings = false, ErrorMessage = "Musisz wprowadzić adres e-mail odbiorcy")]
[RegularExpression(".*@.*\\..*", ErrorMessage = "Zły format")] [RegularExpression(".*@.*\\..*", ErrorMessage = "Zły format")]
[Display(Name = "Adres odbiorcy")] [Display(Name = "Adres odbiorcy")]
[EmailAddress(ErrorMessage ="Zły format")] [EmailAddress(ErrorMessage ="Zły format")]
@ -29,5 +30,16 @@ namespace MailSender.Models
[StringLength(500, ErrorMessage = "Message has to have between 1 and 500 chars", MinimumLength = 1)] [StringLength(500, ErrorMessage = "Message has to have between 1 and 500 chars", MinimumLength = 1)]
public string Content { get; set; } public string Content { get; set; }
public MailModel()
{
Content = EMailTo = Subject = string.Empty;
}
public MailModel(MailDTO.MailDTO DTO)
{
this.Content = DTO.Content;
this.EMailTo = DTO.EMailTo;
this.Subject = DTO.Subject;
}
} }
} }

View File

@ -1,10 +0,0 @@
namespace MailSender
{
public class Settings
{
public static string smtpServer = "smtp.gmail.com";
public static int smtpPort = 587;
public static string user = "ttestowy504@gmail.com";
public static string pass = "ChyzySoftware";
}
}

View File

@ -4,28 +4,30 @@
} }
@if (ViewData.ContainsKey("mailErr")) @if (TempData["mailErr"] != null)
{ {
<h3>Error: @ViewData["mailErr"]</h3> string errStr = TempData["mailErr"] as string;
<h3>Error: @TempData["mailErr"]</h3>
TempData["mailErr"] = null;
} }
@using (Html.BeginForm("Send", "Home", FormMethod.Post)) @using (Html.BeginForm("Send", "Home", FormMethod.Post))
{ {
<div class="form-group"> <div class="form-group">
@Html.LabelFor(i => i.Subject, new { @class = "label-form" }) @Html.LabelFor(i => i.Subject, new { @class = "label-form" })
@Html.EditorFor(i => i.Subject, new { htmlAttributes = new { @value = Model.Subject, @class = "form-control form-emailsend", @placeholder = "Temat" } }) @Html.EditorFor(i => i.Subject, new { htmlAttributes = new { @value = Model.Subject, @class = "form-control form-emailsend w100", @placeholder = "Temat" } })
@Html.ValidationMessageFor(i => i.Subject) @Html.ValidationMessageFor(i => i.Subject)
</div> </div>
<div class="form-group"> <div class="form-group">
@Html.LabelFor(i => i.EMailTo, new { @class = "label-form" }) @Html.LabelFor(i => i.EMailTo, new { @class = "label-form" })
@Html.EditorFor(i => i.EMailTo, new { htmlAttributes = new { @value = Model.EMailTo, @class = "form-control form-emailsend", @placeholder = "Do" } }) @Html.EditorFor(i => i.EMailTo, new { htmlAttributes = new { @value = Model.EMailTo, @class = "form-control form-emailsend w100", @placeholder = "Do" } })
@Html.ValidationMessageFor(i => i.EMailTo) @Html.ValidationMessageFor(i => i.EMailTo)
</div> </div>
<div class="form-group" > <div class="form-group" >
@Html.LabelFor(i => i.Content, new { @class = "label-form" }) @Html.LabelFor(i => i.Content, new { @class = "label-form" })
@Html.EditorFor(i => i.Content, new { htmlAttributes = new { @value = Model.Content, @class = "form-control", @id = "exampleFormControlTextarea3", @rows=9, @placeholder = "Odpowiedź" } }) @Html.EditorFor(i => i.Content, new { htmlAttributes = new { @value = Model.Content, @class = "form-control w100", @id = "exampleFormControlTextarea3", @rows=9, @placeholder = "Odpowiedź" } })
@Html.ValidationMessageFor(i => i.Content) @Html.ValidationMessageFor(i => i.Content)
</div> </div>

View File

@ -20,10 +20,8 @@
@Html.ActionLink("E-mail", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) @Html.ActionLink("E-mail", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
</div> </div>
<div class="navbar-collapse collapse"> <div class="navbar-collapse collapse">
<ul class="nav navbar-nav"> <ul class="nav navbar-nar">
<li>@Html.ActionLink("Strona Główna", "Index", "Home")</li>
<li>@Html.ActionLink("O mnie", "About", "Home")</li>
<li>@Html.ActionLink("Kontakt", "Contact", "Home")</li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -10,6 +10,11 @@
</configSections> </configSections>
<appSettings> <appSettings>
<add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Version" value="3.0.0.0" />
<add key="user-mail" value="ttestowy504@gmail.com" />
<add key="pass-mail" value="ChyzySoftware" />
<add key="smtp-port" value="587" />
<add key="smtp-server" value="smtp.gmail.com" />
<add key="forum-address" value="http://forum-inzynieria1.azurewebsites.net/home/index"/>
<add key="webpages:Enabled" value="false" /> <add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" /> <add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" />
@ -65,7 +70,12 @@
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" /> <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
</modules> </modules>
<validation validateIntegratedModeConfiguration="false" /> <validation validateIntegratedModeConfiguration="false" />
</system.webServer> <handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers></system.webServer>
<entityFramework> <entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters> <parameters>

View File

@ -19,6 +19,8 @@
<package id="Microsoft.AspNet.TelemetryCorrelation" version="1.0.0" targetFramework="net461" /> <package id="Microsoft.AspNet.TelemetryCorrelation" version="1.0.0" targetFramework="net461" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net461" /> <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net461" />
<package id="Microsoft.AspNet.Web.Optimization.pl" version="1.1.3" targetFramework="net461" /> <package id="Microsoft.AspNet.Web.Optimization.pl" version="1.1.3" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.AspNet.WebPages" version="3.2.4" targetFramework="net461" /> <package id="Microsoft.AspNet.WebPages" version="3.2.4" targetFramework="net461" />
<package id="Microsoft.AspNet.WebPages.pl" version="3.2.4" targetFramework="net461" /> <package id="Microsoft.AspNet.WebPages.pl" version="3.2.4" targetFramework="net461" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.0" targetFramework="net461" /> <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.0" targetFramework="net461" />
@ -29,5 +31,6 @@
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net461" /> <package id="Newtonsoft.Json" version="11.0.1" targetFramework="net461" />
<package id="Owin" version="1.0" targetFramework="net461" /> <package id="Owin" version="1.0" targetFramework="net461" />
<package id="System.Diagnostics.DiagnosticSource" version="4.4.1" targetFramework="net461" /> <package id="System.Diagnostics.DiagnosticSource" version="4.4.1" targetFramework="net461" />
<package id="System.Web.Http.Common" version="4.0.20126.16343" targetFramework="net461" />
<package id="WebGrease" version="1.6.0" targetFramework="net461" /> <package id="WebGrease" version="1.6.0" targetFramework="net461" />
</packages> </packages>