Skip to content
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.

Commit

Permalink
qwe
Browse files Browse the repository at this point in the history
Капча  не блокирует  отправку в /api/messages
  • Loading branch information
Reykudo committed May 8, 2019
1 parent a720edd commit 8be420f
Show file tree
Hide file tree
Showing 17 changed files with 159 additions and 284 deletions.
4 changes: 0 additions & 4 deletions Ang_form.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
<TypeScriptCompile Include="ClientApp\data.services.ts" />
</ItemGroup>

<ItemGroup>
<Folder Include="App_Data\" />
</ItemGroup>

<ItemGroup>
<Reference Include="SRVTextToImage">
<HintPath>lib\SRVTextToImage.dll</HintPath>
Expand Down
5 changes: 4 additions & 1 deletion Ang_form.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
<_SelectedScaffolderCategoryPath>root/Common/Api</_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
<WebStackScaffolding_DbContextTypeFullName>Ang_form.Models.ApplicationContext</WebStackScaffolding_DbContextTypeFullName>
<ActiveDebugProfile>IIS Express</ActiveDebugProfile>
<ActiveDebugProfile>Ang_form</ActiveDebugProfile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
Binary file removed App_Data/ang_formDB.ldf
Binary file not shown.
Binary file removed App_Data/ang_formDB.mdf
Binary file not shown.
74 changes: 47 additions & 27 deletions ClientApp/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
<!--The content below is only a placeholder and can be replaced.-->
<div class="form">
<div class="app" *ngIf="!sended">
<div class="header">
<p>Напишите нам</p>
</div>
<div class="header second"></div>

<form [formGroup]="myForm" (submit)="onSubmit()" autocomplete="off">
<div class="field">
<div class="field" id="name">
<label for="name">Ваше имя:</label>
<input type="text" id="name" formControlName="name" class="entry-field" />
<div class="error-field">
<div class="error" *ngIf="isControlInvalid('name')">
<input type="text" formControlName="name" class="entry-field" />
<div class="error">
<div *ngIf="isControlInvalid('name')">
Имя должно состоять только из букв
</div>
</div>
</div>

<div class="field">
<div class="field" id="email">
<label for="email">Ваш Email: </label>
<input type="text" id="email" formControlName="email" class="entry-field" />
<div class="error-field">
<div class="error" *ngIf="isControlInvalid('email')">
<input type="text" formControlName="email" class="entry-field" />
<div class="error">
<div *ngIf="isControlInvalid('email')">
Не корректный email
</div>
</div>
</div>

<div class="field">
<div class="field" id="phone">
<label for="phone">Ваш телефон:
</label>
<input type="text" id="phone" formControlName="phone" class="entry-field" prefix="+7 " mask="(000) 000-00-00"/>
<div class="error-field">
<div class="error" *ngIf="isControlInvalid('phone')">
<input type="text" formControlName="phone" class="entry-field" prefix="+7 " mask="(000) 000-00-00" />
<div class="error">
<div *ngIf="isControlInvalid('phone')">
Не корректный телефон
</div>
</div>
</div>

<div class="field">
<div class="field" id="subject">
<label for="subject">Тема:</label>
<select formControlName="subject" class="entry-field" ngInit>
<option *ngFor="let subject of subjects" [ngValue]="subject" [selected]="subject == subjects[0]">
{{ subject.name }}
</option>
</select>
<div class="error-field"></div>
<div class="error"></div>
</div>

<div class="field">
<div class="field" id="message">
<label for="message">
Ваше <br> сообщение:
</label>
<textarea rows="5" cols="20" id="message" formControlName="message" class="entry-field"></textarea>
<div class="error-field">
<div class="error" *ngIf="isControlInvalid('message')">
<textarea rows="5" cols="20" formControlName="message" class="entry-field"></textarea>
<div class="error">
<div *ngIf="isControlInvalid('message')">
Введите сообщение
</div>
</div>
</div>

<div class="field">
<div class="field" id="captcha">
<label for="captcha">
Цифры:
Цифры:
</label>
<input type="text" id="captcha" formControlName="captcha" class="entry-field" mask="00000"/>
<div class="captcha-img"></div>
<div class="error-field">
<div class="error" *ngIf="isControlInvalid('captcha')">
<input type="text" formControlName="captcha" class="entry-field" mask="00000" />
<div class="image"></div>
<div class="error">
<div *ngIf="isControlInvalid('captcha')">
Не верно
</div>
</div>
Expand All @@ -79,6 +79,26 @@
</form>
</div>

<div>
{{this.data | json}}
<div class="app" *ngIf="sended">
<div class="field">
<b>Имя: </b>
{{this.data.contact.name }}
</div>
<div class="field">
<b>Почта: </b>
{{this.data.contact.email}}
</div>
<div class="field">
<b>Телефон: </b>
{{this.data.contact.phone}}
</div>
<div class="field">
<b>Тема: </b>
{{this.data.subject.name }}
</div>
<div class="field">
<b>Сообщение: </b>
{{this.data.text}}
</div>

</div>
65 changes: 36 additions & 29 deletions ClientApp/app/app.component.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
@lcol-width: 100px;
@rcol-width: 300px;

.form {
.app {
font-family: Verdana, Arial, "Times New Roman";
color: #666;
text-align: left;

width: 430px;
margin: 0 auto;
padding: 15px 0 30px 0;
Expand All @@ -19,21 +22,21 @@
position: relative;
right: 12px;
background-image: url("./pic/form-title.svg");
-webkit-filter: drop-shadow( 3px 3px 2px rgba(0, 0, 0, .7));
filter: drop-shadow( 5px 5px 2px rgba(59, 59, 59, 0.5););
-webkit-filter: drop-shadow(3px 3px 2px rgba(0, 0, 0, .7));
filter: drop-shadow(5px 5px 2px rgba(59, 59, 59, 0.5); );
}
.header.second{

.header.second {
height: 12px;
background-image: url("./pic/form-title2.svg");
z-index: -1;
}

p{
p {
margin-top: 0px;
text-indent: 20px;
color: white;
font-size: 22pt;
font-size: 18pt;
}

.field {
Expand All @@ -54,20 +57,21 @@ p{

width: @rcol-width;
height: @entry-field-height;
border: 1px inset;
border: 1px solid #999;
border-radius: @entry-field-border;
}

textarea.entry-field {
height: 75px;
resize: vertical;
}
#captcha.entry-field {

#captcha>.entry-field {
width: 120px;
padding-left: 0px;
}

.captcha-img{
#captcha>div.image {
margin: 0 10px 0 10px;
display: inline-block;
vertical-align: middle;
Expand All @@ -77,18 +81,6 @@ textarea.entry-field {
background-image: url("/api/captcha");
}

.error-field {
padding-left: @lcol-width;
height: 1em;
}

.error {
color: red;
}

.ng-touched.ng-invalid{
border-color: red;
}

input.entry-field {
padding-left: 30px;
Expand All @@ -97,30 +89,45 @@ input.entry-field {
background-position: 5px;
}

#phone {
#phone>input {
background-image: url("./pic/phone.svg");

}

#email {
#email>input {
background-image: url("./pic/mail.svg");
}

#name {
#name>input {
background-image: url("./pic/person.svg");
}


label {
display: inline-block;
vertical-align: middle;
width: @lcol-width;
font-size: 11pt;
font-weight: bold;
text-align: left;
color: darkslategray;
//text-shadow: 1px 1px 1px gray;
font-size: 10pt;
font-weight: bold;
}

.error {
padding-left: @lcol-width;
font-size: 14px;
height: 16px;
color: red;
}


.ng-touched.ng-invalid {
border-color: red;
}

.ng-touched.ng-valid {
border-color: greenyellow;
}


input,
select,
textarea {
Expand Down
Loading

0 comments on commit 8be420f

Please sign in to comment.