Compare commits
55 Commits
branch_Nor
...
master
Author | SHA1 | Date | |
---|---|---|---|
09ef1ca66e | |||
20655b74f0 | |||
ff5163cea5 | |||
1ed563fc7c | |||
cd89c4bdf7 | |||
d98f7d101a | |||
81b497f02d | |||
95bae9565f | |||
|
007fe99f1b | ||
|
e9ed7d4b77 | ||
18038707d0 | |||
|
3607ce2f2b | ||
7ef186c12b | |||
0e062a57e9 | |||
2cc1af2149 | |||
c5ca2aa2dc | |||
5115b88e85 | |||
1a97cae65f | |||
4f2e75eed1 | |||
cf4cc5650e | |||
|
a0c5d4357b | ||
|
d72384efe2 | ||
|
4240f1d563 | ||
|
d9521ae99d | ||
|
fd836b41b5 | ||
|
88edf07e00 | ||
|
15830cf648 | ||
|
62eba388b4 | ||
|
aa4ae61818 | ||
|
df046dc2a0 | ||
|
3fd3fc128c | ||
3c243891d0 | |||
a6521a35ef | |||
851b633e31 | |||
|
c79fed0334 | ||
13086a7f60 | |||
|
cd309a208e | ||
|
4a8e98e21f | ||
3cef1b6f15 | |||
66bad5435a | |||
1ac7861508 | |||
|
79eef508b5 | ||
|
c1a6d311e0 | ||
|
70bdf02761 | ||
57b54662ec | |||
446bd9988a | |||
|
8e90b463ae | ||
|
38c20d09ec | ||
|
c577b17923 | ||
58f0566d1d | |||
8dcc5b212c | |||
98218a4d17 | |||
|
26b46b9119 | ||
|
feb7c7b746 | ||
|
04e0f15629 |
BIN
Dokumentacja/Dokumentacja API.pdf
Normal file
BIN
Dokumentacja/Dokumentacja API.pdf
Normal file
Binary file not shown.
BIN
Dokumentacja/Dokumentacja_wykonanych_prac .pdf
Normal file
BIN
Dokumentacja/Dokumentacja_wykonanych_prac .pdf
Normal file
Binary file not shown.
BIN
Dokumentacja/Dokumetnacja.pdf
Normal file
BIN
Dokumentacja/Dokumetnacja.pdf
Normal file
Binary file not shown.
BIN
Dokumentacja/Najnowszy plan forum.pdf
Normal file
BIN
Dokumentacja/Najnowszy plan forum.pdf
Normal file
Binary file not shown.
BIN
Dokumentacja/Notatka.pdf
Normal file
BIN
Dokumentacja/Notatka.pdf
Normal file
Binary file not shown.
BIN
Dokumentacja/Poprawiona-architektura.pdf
Normal file
BIN
Dokumentacja/Poprawiona-architektura.pdf
Normal file
Binary file not shown.
BIN
Dokumentacja/Scenariusz testow.pdf
Normal file
BIN
Dokumentacja/Scenariusz testow.pdf
Normal file
Binary file not shown.
BIN
Dokumentacja/WstepnaDokumetnacja.pdf
Normal file
BIN
Dokumentacja/WstepnaDokumetnacja.pdf
Normal file
Binary file not shown.
BIN
Dokumentacja/instrukcja obsługi.pdf
Normal file
BIN
Dokumentacja/instrukcja obsługi.pdf
Normal file
Binary file not shown.
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Forum.DataAccessLayer.Models
|
namespace Forum.DataAccessLayer.Models
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Forum.DataAccessLayer.Models
|
namespace Forum.DataAccessLayer.Models
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System.Security.Claims;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Security.Claims;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Identity;
|
using Microsoft.AspNet.Identity;
|
||||||
using Microsoft.AspNet.Identity.EntityFramework;
|
using Microsoft.AspNet.Identity.EntityFramework;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Forum.DataAccessLayer.Models
|
namespace Forum.DataAccessLayer.Models
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System.Data.Entity;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data.Entity;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Forum.DataAccessLayer.Models;
|
using Forum.DataAccessLayer.Models;
|
||||||
using Microsoft.AspNet.Identity.EntityFramework;
|
using Microsoft.AspNet.Identity.EntityFramework;
|
||||||
|
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System.Security.Claims;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Security.Claims;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Forum.DataAccessLayer.Models;
|
using Forum.DataAccessLayer.Models;
|
||||||
using Microsoft.AspNet.Identity.Owin;
|
using Microsoft.AspNet.Identity.Owin;
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Forum.DataAccessLayer.Models;
|
using Forum.DataAccessLayer.Models;
|
||||||
using Forum.DataAccessLayer.Services;
|
using Forum.DataAccessLayer.Services;
|
||||||
using Microsoft.AspNet.Identity;
|
using Microsoft.AspNet.Identity;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
namespace Forum.DataAccessLayer.Migrations
|
namespace Forum.DataAccessLayer.Migrations
|
||||||
{
|
{
|
||||||
using System;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
|
|
||||||
public partial class Dbinit : DbMigration
|
public partial class Dbinit : DbMigration
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
namespace Forum.DataAccessLayer.Migrations
|
namespace Forum.DataAccessLayer.Migrations
|
||||||
{
|
{
|
||||||
using System;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
|
|
||||||
public partial class ConfigureDbTables : DbMigration
|
public partial class ConfigureDbTables : DbMigration
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
namespace Forum.DataAccessLayer.Migrations
|
namespace Forum.DataAccessLayer.Migrations
|
||||||
{
|
{
|
||||||
using System;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
|
|
||||||
public partial class Emailvalidation : DbMigration
|
public partial class Emailvalidation : DbMigration
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
namespace Forum.DataAccessLayer.Migrations
|
namespace Forum.DataAccessLayer.Migrations
|
||||||
{
|
{
|
||||||
using System;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
|
|
||||||
public partial class AddedTitle : DbMigration
|
public partial class AddedTitle : DbMigration
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
namespace Forum.DataAccessLayer.Migrations
|
namespace Forum.DataAccessLayer.Migrations
|
||||||
{
|
{
|
||||||
using System;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
|
|
||||||
public partial class Seedtry : DbMigration
|
public partial class Seedtry : DbMigration
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
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
|
||||||
{
|
{
|
||||||
using System;
|
using System;
|
||||||
using System.Data.Entity;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
internal sealed class Configuration : DbMigrationsConfiguration<Forum.DataAccessLayer.ApplicationDbContext>
|
internal sealed class Configuration : DbMigrationsConfiguration<Forum.DataAccessLayer.ApplicationDbContext>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNet.Identity;
|
using Microsoft.AspNet.Identity;
|
||||||
|
|
||||||
namespace Forum.DataAccessLayer.Services
|
namespace Forum.DataAccessLayer.Services
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNet.Identity;
|
using Microsoft.AspNet.Identity;
|
||||||
|
|
||||||
namespace Forum.DataAccessLayer.Services
|
namespace Forum.DataAccessLayer.Services
|
||||||
|
@ -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
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
body {
|
body {
|
||||||
padding-top: 50px;
|
padding-top: 15rem;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,7 +18,369 @@
|
|||||||
|
|
||||||
/* 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
|
||||||
textarea {
|
{
|
||||||
max-width: 280px;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
padding: 3rem;
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.delete-category__span{
|
||||||
|
font-size:2rem;
|
||||||
|
font-weight:400;
|
||||||
|
margin-bottom:10rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.delete-category__dl {
|
||||||
|
height: 3rem;
|
||||||
|
margin-bottom: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
114
Trunk/Server/Forum/Forum/Controllers/CategoriesController.cs
Normal file
114
Trunk/Server/Forum/Forum/Controllers/CategoriesController.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
|
|
||||||
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
|
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
@ -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" />
|
||||||
@ -234,7 +243,9 @@
|
|||||||
<Content Include="Scripts\umd\popper-utils.min.js" />
|
<Content Include="Scripts\umd\popper-utils.min.js" />
|
||||||
<Content Include="Scripts\umd\popper.js" />
|
<Content Include="Scripts\umd\popper.js" />
|
||||||
<Content Include="Scripts\umd\popper.min.js" />
|
<Content Include="Scripts\umd\popper.min.js" />
|
||||||
<Content Include="Web.config" />
|
<Content Include="Web.config">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Content>
|
||||||
<Content Include="Web.Debug.config">
|
<Content Include="Web.Debug.config">
|
||||||
<DependentUpon>Web.config</DependentUpon>
|
<DependentUpon>Web.config</DependentUpon>
|
||||||
</Content>
|
</Content>
|
||||||
@ -279,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" />
|
||||||
|
@ -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
|
||||||
|
@ -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 {
|
||||||
|
@ -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>
|
||||||
}
|
}
|
||||||
|
44
Trunk/Server/Forum/Forum/Views/Categories/Create.cshtml
Normal file
44
Trunk/Server/Forum/Forum/Views/Categories/Create.cshtml
Normal 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")
|
||||||
|
}
|
34
Trunk/Server/Forum/Forum/Views/Categories/Delete.cshtml
Normal file
34
Trunk/Server/Forum/Forum/Views/Categories/Delete.cshtml
Normal 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>
|
42
Trunk/Server/Forum/Forum/Views/Categories/Edit.cshtml
Normal file
42
Trunk/Server/Forum/Forum/Views/Categories/Edit.cshtml
Normal 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")
|
||||||
|
}
|
35
Trunk/Server/Forum/Forum/Views/Categories/Index.cshtml
Normal file
35
Trunk/Server/Forum/Forum/Views/Categories/Index.cshtml
Normal 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>
|
@ -3,24 +3,43 @@
|
|||||||
ViewBag.Title = "AddAnswer";
|
ViewBag.Title = "AddAnswer";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h2>AddAnswer</h2>
|
|
||||||
|
<div class="add-answer">
|
||||||
|
|
||||||
|
<h2>Dodaj odpowiedź</h2>
|
||||||
|
|
||||||
|
<hr style="border-top: 1px solid #d3d3d3; margin-bottom: 3rem;" />
|
||||||
|
|
||||||
|
|
||||||
@using (Html.BeginForm("AddAnswer", "Home", FormMethod.Post))
|
@using (Html.BeginForm("AddAnswer", "Home", FormMethod.Post))
|
||||||
{
|
{
|
||||||
|
|
||||||
<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" } })
|
if (User.Identity.IsAuthenticated)
|
||||||
|
{
|
||||||
|
<label>Odpowiedz jako @User.Identity.Name</label>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@Html.EditorFor(model => model.Nick, new { htmlAttributes = new { @class = "form-control", placeholder = "Nick" } })
|
||||||
|
}
|
||||||
|
}
|
||||||
</div>
|
</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" } })
|
@Html.TextAreaFor(model => model.Content, new { @class = "form-control", @id = "exampleFormControlTextarea3", rows = 7, placeholder = "Odpowiedź" })<br />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Html.HiddenFor(model=>model.QuestionId)
|
@Html.HiddenFor(model=>model.QuestionId)
|
||||||
|
|
||||||
<input type="submit" value="Zgłoś" />
|
<input type="submit" value="Zgłoś odpowiedź" />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@ -3,36 +3,47 @@
|
|||||||
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-AddQuestion">
|
||||||
|
<h2>Dodaj zapytanie</h2>
|
||||||
|
<hr style="border-top: 1px solid #d3d3d3; margin-bottom:3rem;" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@Html.LabelFor(model => model.Title, new { @class = "label-form" })
|
@Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control", placeholder="Temat" } })
|
||||||
@Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
|
|
||||||
</div>
|
</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" } })
|
|
||||||
|
@Html.TextAreaFor(model => model.Content, new { @class="form-control", @id = "exampleFormControlTextarea3", rows=7, placeholder="Treść zapytania" })<br />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-personal-data">
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.EditorFor(model => model.Nick, new { htmlAttributes = new { @class = "form-control", placeholder="Nick" } })
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@Html.LabelFor(model => model.Nick, new { @class = "label-form" })
|
@Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control", placeholder="Adres email" } })
|
||||||
@Html.EditorFor(model => model.Nick, new { htmlAttributes = new { @class = "form-control" } })
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-AddQuestion__btn">
|
||||||
@Html.LabelFor(model => model.Email, new { @class = "label-form" })
|
|
||||||
@Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control" } })
|
|
||||||
|
@Html.DropDownListFor(x=>x.CategoryId,new SelectList(Model.Categories,"Id", "CategoryName"), new { @class = "form-control" })
|
||||||
|
|
||||||
|
<input type="submit" value="Dodaj zapytanie"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@Html.DropDownListFor(x=>x.CategoryId,new SelectList(Model.Categories,"Id", "CategoryName"))
|
|
||||||
|
|
||||||
<input type="submit" value="Zgłoś"/>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,15 +4,33 @@
|
|||||||
ViewBag.Title = Model.CategoryName;
|
ViewBag.Title = Model.CategoryName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<div class="single-category-wrapper">
|
||||||
|
|
||||||
<h2>@Model.CategoryName</h2>
|
<h2>@Model.CategoryName</h2>
|
||||||
|
|
||||||
@Html.ActionLink("Dodaj pytanie", "AddQuestion", "Home",new {category=Model.CategoryName},null)
|
<hr style="border-top: 1px solid #d3d3d3" />
|
||||||
|
|
||||||
<ul>
|
<ul class="single-category__topic">
|
||||||
@{
|
@{
|
||||||
foreach (var question in Model.Questions)
|
foreach (var question in Model.Questions)
|
||||||
{
|
{
|
||||||
<li>@Html.ActionLink(question.Title,"Question","Home",new{id=question.Id},null)</li>
|
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>
|
</ul>
|
||||||
|
|
||||||
|
<button class="add-topic">
|
||||||
|
|
||||||
|
@Html.ActionLink("Dodaj zapytanie", "AddQuestion", "Home", new { category = Model.CategoryName }, null)
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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 class="category-list">
|
||||||
|
|
||||||
<ul>
|
@{
|
||||||
|
foreach (var category in Model)
|
||||||
|
{
|
||||||
|
<li>
|
||||||
|
@Html.ActionLink(category.CategoryName, "Category", "Home", new { name = category.CategoryName }, null)
|
||||||
|
</li>
|
||||||
|
|
||||||
@{
|
}
|
||||||
foreach (var category in Model)
|
}
|
||||||
{
|
|
||||||
<li>
|
|
||||||
@Html.ActionLink(category.CategoryName,"Category","Home",new{name=category.CategoryName},null)
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<div class="answer-list__question">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="answer-list__info">
|
||||||
|
<h2>@Model.Title</h2>
|
||||||
@Model.PostDate
|
@Model.PostDate
|
||||||
|
|
||||||
<h2>@Model.Title</h2>
|
</div>
|
||||||
|
<hr style="border-top: 1px solid #d3d3d3" />
|
||||||
|
|
||||||
<div>
|
|
||||||
|
<div class="answer-list__question__content">
|
||||||
@Model.Content
|
@Model.Content
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr/>
|
</div>
|
||||||
@Html.ActionLink("Dodaj odpowiedź","AddAnswer",new{id=@Model.Id})
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<b>Odpowiedzi</b>
|
|
||||||
<ul>
|
<h3 class="answer-list__heading">Odpowiedzi</h3>
|
||||||
|
<ul class="answer-list__answer">
|
||||||
@{
|
@{
|
||||||
foreach (var answer in Model.Answers)
|
foreach (var answer in Model.Answers)
|
||||||
{
|
{
|
||||||
<li>@answer.Nick @answer.Date @answer.Content </li>
|
<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>
|
</ul>
|
||||||
|
|
||||||
|
<div class="answer-list__add-btn">
|
||||||
|
|
||||||
|
@Html.ActionLink("Dodaj odpowiedź", "AddAnswer", new { id = @Model.Id })
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@ -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>© @DateTime.Now.Year - My ASP.NET Application</p>
|
<p>© @DateTime.Now.Year - Grupa 1CF Inżynieria oprogramowania</p>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -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>
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
</configSections>
|
</configSections>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\ForumInzyneria.mdf;Initial Catalog=ForumInzyneria;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>
|
||||||
|
@ -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" />
|
||||||
|
15
Trunk/Server/Forum/MailDTO/MailDTO.cs
Normal file
15
Trunk/Server/Forum/MailDTO/MailDTO.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
}
|
47
Trunk/Server/Forum/MailDTO/MailDTO.csproj
Normal file
47
Trunk/Server/Forum/MailDTO/MailDTO.csproj
Normal 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>
|
36
Trunk/Server/Forum/MailDTO/Properties/AssemblyInfo.cs
Normal file
36
Trunk/Server/Forum/MailDTO/Properties/AssemblyInfo.cs
Normal 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")]
|
@ -1,5 +1,4 @@
|
|||||||
using System.Web;
|
using System.Web.Optimization;
|
||||||
using System.Web.Optimization;
|
|
||||||
|
|
||||||
namespace MailSender
|
namespace MailSender
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System.Web;
|
using System.Web.Mvc;
|
||||||
using System.Web.Mvc;
|
|
||||||
|
|
||||||
namespace MailSender
|
namespace MailSender
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System.Web.Mvc;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
using System.Web.Mvc;
|
|
||||||
using System.Web.Routing;
|
using System.Web.Routing;
|
||||||
|
|
||||||
namespace MailSender
|
namespace MailSender
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
body {
|
body {
|
||||||
padding-top: 50px;
|
padding-top: 15rem;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,7 +18,372 @@
|
|||||||
|
|
||||||
/* 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 {
|
||||||
textarea {
|
|
||||||
max-width: 280px;
|
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: 280px;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w100 {
|
||||||
|
width: 100% !important;
|
||||||
|
max-width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-emailsend
|
||||||
|
{
|
||||||
|
color: black;
|
||||||
|
width: 500px;
|
||||||
|
}
|
||||||
|
.answer-list__add-btn--sendButton
|
||||||
|
{
|
||||||
|
/*margin-left: 18%;*/
|
||||||
|
width:7%;
|
||||||
|
|
||||||
|
}
|
||||||
|
#exampleFormControlTextarea3
|
||||||
|
{
|
||||||
|
width: 280px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace MailSender.Controllers
|
||||||
|
{
|
||||||
|
[RoutePrefix("def")]
|
||||||
|
public class DefaultController : Controller
|
||||||
|
{
|
||||||
|
[HttpGet]
|
||||||
|
public ActionResult Index()
|
||||||
|
{
|
||||||
|
//var model = JsonConvert.SerializeObject(new Models.MailModel() { Content = "DDD", EMailTo = "ddd@o2.pl", Subject = "LLLLLL" });
|
||||||
|
//TempData.Add("mailModel", model);
|
||||||
|
return RedirectToAction("Index", "Home");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +1,59 @@
|
|||||||
using System;
|
using System.Net.Mail;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
using System.Net.Mail;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Web.Helpers;
|
using System.Web.ModelBinding;
|
||||||
using System.Threading.Tasks;
|
using System;
|
||||||
|
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()
|
||||||
{
|
{
|
||||||
|
if(TempData["mailMod"] != null)
|
||||||
|
{
|
||||||
|
return View(TempData["mailMod"]);
|
||||||
|
}
|
||||||
return View(new Models.MailModel());
|
return View(new Models.MailModel());
|
||||||
}
|
}
|
||||||
|
|
||||||
[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 Index(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." });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System.Web.Mvc;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
using System.Web.Mvc;
|
|
||||||
using System.Web.Optimization;
|
using System.Web.Optimization;
|
||||||
using System.Web.Routing;
|
using System.Web.Routing;
|
||||||
|
|
||||||
|
@ -51,6 +51,9 @@
|
|||||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.Owin, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Owin, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Owin.4.0.0\lib\net451\Microsoft.Owin.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Owin.4.0.0\lib\net451\Microsoft.Owin.dll</HintPath>
|
||||||
@ -61,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" />
|
||||||
@ -151,21 +163,18 @@
|
|||||||
<Reference Include="Microsoft.AI.Web">
|
<Reference Include="Microsoft.AI.Web">
|
||||||
<HintPath>..\packages\Microsoft.ApplicationInsights.Web.2.5.1\lib\net45\Microsoft.AI.Web.dll</HintPath>
|
<HintPath>..\packages\Microsoft.ApplicationInsights.Web.2.5.1\lib\net45\Microsoft.AI.Web.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
|
|
||||||
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="App_Start\BundleConfig.cs" />
|
<Compile Include="App_Start\BundleConfig.cs" />
|
||||||
<Compile Include="App_Start\FilterConfig.cs" />
|
<Compile Include="App_Start\FilterConfig.cs" />
|
||||||
<Compile Include="App_Start\RouteConfig.cs" />
|
<Compile Include="App_Start\RouteConfig.cs" />
|
||||||
|
<Compile Include="Controllers\DefaultController.cs" />
|
||||||
<Compile Include="Controllers\HomeController.cs" />
|
<Compile Include="Controllers\HomeController.cs" />
|
||||||
<Compile Include="Global.asax.cs">
|
<Compile Include="Global.asax.cs">
|
||||||
<DependentUpon>Global.asax</DependentUpon>
|
<DependentUpon>Global.asax</DependentUpon>
|
||||||
</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" />
|
||||||
@ -181,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" />
|
||||||
@ -207,6 +218,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="App_Data\" />
|
<Folder Include="App_Data\" />
|
||||||
|
<Folder Include="Views\Default\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="fonts\glyphicons-halflings-regular.woff2" />
|
<Content Include="fonts\glyphicons-halflings-regular.woff2" />
|
||||||
@ -221,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>
|
||||||
@ -251,7 +269,7 @@
|
|||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>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}.</ErrorText>
|
<ErrorText>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}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
|
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
|
||||||
</Target>
|
</Target>
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
using System;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Collections.Generic;
|
using MailDTO;
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
using System.Data.Entity;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace MailSender.Models
|
namespace MailSender.Models
|
||||||
@ -17,19 +13,33 @@ namespace MailSender.Models
|
|||||||
//[ForeignKey]
|
//[ForeignKey]
|
||||||
//public int UserId //id usera ktory wyslal maila
|
//public int UserId //id usera ktory wyslal maila
|
||||||
|
|
||||||
[Display(Name = "Subject")]
|
[Display(Name = "Temat")]
|
||||||
[Required(AllowEmptyStrings = false)]
|
[Required(AllowEmptyStrings = false)]
|
||||||
public string Subject { get; set; }
|
public string Subject { get; set; }
|
||||||
|
|
||||||
[DataType(DataType.EmailAddress)]
|
[DataType(DataType.EmailAddress)]
|
||||||
[Required(AllowEmptyStrings = false, ErrorMessage = "You need to type in an e-mail")]
|
[Required(AllowEmptyStrings = false, ErrorMessage = "Musisz wprowadzić adres e-mail odbiorcy")]
|
||||||
[RegularExpression(".*@.*\\..*", ErrorMessage = "You typed in e-mail in wrong format")]
|
[RegularExpression(".*@.*\\..*", ErrorMessage = "Zły format")]
|
||||||
[Display(Name = "E-Mail to")]
|
[Display(Name = "Adres odbiorcy")]
|
||||||
|
[EmailAddress(ErrorMessage ="Zły format")]
|
||||||
public string EMailTo { get; set; }
|
public string EMailTo { get; set; }
|
||||||
|
|
||||||
[Required(AllowEmptyStrings = false, ErrorMessage = "You need to type in a message to send")]
|
[Display(Name ="Odpowiedź")]
|
||||||
[DataType(DataType.Text)]
|
[Required(AllowEmptyStrings = false, ErrorMessage = "Proszę wprowadzić odpowiedź")]
|
||||||
|
[DataType(DataType.MultilineText)]
|
||||||
[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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,5 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// Informacje ogólne o zestawie zależą od poniższego
|
// Informacje ogólne o zestawie zależą od poniższego
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
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";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,35 +1,37 @@
|
|||||||
@model MailSender.Models.MailModel
|
@model MailSender.Models.MailModel
|
||||||
@{
|
@{
|
||||||
ViewBag.Title = "Mail Sender";
|
//ViewBag.Title = "Mail Sender";
|
||||||
}
|
}
|
||||||
<h2>Send Mail</h2>
|
|
||||||
|
|
||||||
@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("Index", "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 { @class = "form-control", @placeholder = "Subject" } })
|
@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 { @class = "form-control", @placeholder = "To" } })
|
@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 { @class = "form-control", @placeholder = "Body" } })
|
@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>
|
||||||
|
|
||||||
<input type="submit" value="Send" />
|
<input type="submit" value="Wyślij" class="answer-list__add-btn answer-list__add-btn--sendButton" />
|
||||||
}
|
}
|
||||||
|
|
||||||
@section Scripts {
|
@section Scripts {
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>@ViewBag.Title — moja aplikacja platformy ASP.NET</title>
|
<title>Serwis Email</title>
|
||||||
@Styles.Render("~/Content/css")
|
@Styles.Render("~/Content/css")
|
||||||
@Scripts.Render("~/bundles/modernizr")
|
@Scripts.Render("~/bundles/modernizr")
|
||||||
</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,11 @@
|
|||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
@Html.ActionLink("Nazwa aplikacji", "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("Informacje", "About", "Home")</li>
|
|
||||||
<li>@Html.ActionLink("Kontakt", "Contact", "Home")</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -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,13 +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>
|
||||||
<system.codedom>
|
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||||
<compilers>
|
<remove name="OPTIONSVerbHandler" />
|
||||||
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
|
<remove name="TRACEVerbHandler" />
|
||||||
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
|
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||||
</compilers>
|
</handlers></system.webServer>
|
||||||
</system.codedom>
|
|
||||||
<entityFramework>
|
<entityFramework>
|
||||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
|
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
|
||||||
<parameters>
|
<parameters>
|
||||||
@ -82,4 +86,10 @@
|
|||||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||||
</providers>
|
</providers>
|
||||||
</entityFramework>
|
</entityFramework>
|
||||||
|
<system.codedom>
|
||||||
|
<compilers>
|
||||||
|
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
|
||||||
|
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
|
||||||
|
</compilers>
|
||||||
|
</system.codedom>
|
||||||
</configuration>
|
</configuration>
|
@ -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>
|
Loading…
Reference in New Issue
Block a user