Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
9ec0dda3
Commit
9ec0dda3
authored
Apr 28, 2016
by
Shakarim Sapa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Добавлены изменения в форму подписки на кейсы
parent
77af80be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
7 deletions
+97
-7
frontend/views/layouts/block/case-subscribe.php
frontend/views/layouts/block/case-subscribe.php
+97
-7
No files found.
frontend/views/layouts/block/case-subscribe.php
View file @
9ec0dda3
...
@@ -2,31 +2,36 @@
...
@@ -2,31 +2,36 @@
use
yii\widgets\ActiveForm
;
use
yii\widgets\ActiveForm
;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
common\modules\bids\models\Bid
;
use
common\modules\cases\models\CasesBids
;
$userIsSubscribed
=
false
;
$cacheEmail
=
Yii
::
$app
->
cache
->
get
(
'user_email'
);
if
(
$cacheEmail
!==
false
&&
CasesBids
::
find
()
->
where
([
'email'
=>
$cacheEmail
])
->
exists
()
===
true
)
$userIsSubscribed
=
true
;
?>
?>
<?php
if
(
$userIsSubscribed
===
false
)
:
?>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"keys_send_mail"
>
<div
class=
"keys_send_mail"
>
<p>
<?=
\Yii
::
t
(
'form'
,
'The cases description process require a lot of time. Thus, we write them at free time. Subscribe to follow the updates.'
)
?>
</p>
<p>
<?=
\Yii
::
t
(
'form'
,
'The cases description process require a lot of time. Thus, we write them at free time. Subscribe to follow the updates.'
)
?>
</p>
<?php
<?php
$model
=
new
Bid
;
$model
=
new
CasesBids
();
$model
->
setScenario
(
Bid
::
SCENARIO_SUBSCRIBE
);
$model
->
form
=
Bid
::
FORM_SUBSCRIBE
;
$form
=
ActiveForm
::
begin
([
$form
=
ActiveForm
::
begin
([
'action'
=>
'/
bids/bid
/add'
,
'action'
=>
'/
cases/default
/add'
,
'enableClientValidation'
=>
false
,
'enableClientValidation'
=>
false
,
'options'
=>
[
'options'
=>
[
'class'
=>
'keys_mail_form bids-form'
,
'class'
=>
'keys_mail_form bids-form'
,
'data-title'
=>
'Страница Кейсы'
,
'data-title'
=>
'Страница Кейсы'
,
'data-form'
=>
'Подпись на обновления в кейсах'
,
'data-form'
=>
'Подпись на обновления в кейсах'
,
'data-tag'
=>
Bid
::
TAG_INVOLVEMENT
],
],
]);
?>
]);
?>
<div
class=
"message-box send_secce"
>
Теперь вы подписаны на обновления кейсов.
</div>
<div
class=
"message-box send_secce"
>
Теперь вы подписаны на обновления кейсов.
</div>
<div
class=
"message-box send_err"
style=
"color:red; left: 26%; top: 44%;"
></div>
<div
class=
"content"
>
<div
class=
"content"
>
<?php
echo
Html
::
hiddenInput
(
'scenario'
,
$model
->
scenario
,
[
'class'
=>
'not_clear'
]);
?>
<?php
echo
Html
::
hiddenInput
(
'scenario'
,
$model
->
scenario
,
[
'class'
=>
'not_clear'
]);
?>
...
@@ -47,4 +52,89 @@ use common\modules\bids\models\Bid;
...
@@ -47,4 +52,89 @@ use common\modules\bids\models\Bid;
<?php
ActiveForm
::
end
();
?>
<?php
ActiveForm
::
end
();
?>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
<script
type=
'text/javascript'
>
$
(
'
form.keys_mail_form
'
).
on
(
'
beforeSubmit
'
,
function
(
e
)
{
var
form
=
$
(
this
),
xhr
=
new
XMLHttpRequest
,
filebool
=
false
,
file
,
data
=
new
FormData
();
form
.
find
(
'
input, textarea
'
).
each
(
function
(){
data
.
append
(
$
(
this
).
attr
(
'
name
'
),
$
(
this
).
val
());
});
xhr
.
open
(
"
POST
"
,
form
.
attr
(
'
action
'
),
true
);
xhr
.
setRequestHeader
(
"
X-Requested-With
"
,
"
XMLHttpRequest
"
);
xhr
.
send
(
data
);
xhr
.
onreadystatechange
=
function
()
{
if
(
xhr
.
readyState
==
4
){
try
{
var
response
=
JSON
.
parse
(
xhr
.
responseText
);
}
catch
(
e
)
{
var
response
=
xhr
.
responseText
;
}
form
.
find
(
'
.has-error
'
).
removeClass
(
'
has-error
'
);
if
(
response
.
success
)
{
if
(
form
.
find
(
'
.message-box.send_secce
'
).
length
>
0
)
{
form
.
find
(
'
.message-box.send_secce
'
).
fadeIn
(
'
fast
'
);
form
.
find
(
'
.content
'
).
css
(
'
visibility
'
,
'
hidden
'
);
setTimeout
(
function
(){
form
.
find
(
'
.message-box.send_secce
'
).
fadeOut
(
'
fast
'
);
form
.
find
(
'
.content
'
).
css
(
'
visibility
'
,
'
visible
'
);
},
2000
);
}
form
.
find
(
'
input:not(.not_clear), textarea
'
).
val
(
''
);
form
.
find
(
'
#files-zone
'
).
html
(
''
);
$
(
'
.dz-preview.dz-processing
'
).
remove
();
dataLayer
.
push
({
'
event
'
:
'
UA_event
'
,
'
Catagory
'
:
form
.
data
(
'
tag
'
),
'
Action
'
:
form
.
data
(
'
title
'
),
'
Label
'
:
'
Успешно
'
});
setInterval
(
function
()
{
form
.
parent
(
'
div
'
).
fadeOut
(
500
);
},
1600
);
}
else
{
var
errors
=
[];
$
.
each
(
response
,
function
(
key
,
value
)
{
form
.
find
(
'
.field-
'
+
key
).
addClass
(
'
has-error
'
);
errors
=
errors
.
concat
(
value
);
});
console
.
log
(
errors
);
if
(
form
.
find
(
'
.message-box.send_err
'
).
length
>
0
)
{
form
.
find
(
'
.message-box.send_err
'
).
html
(
errors
[
0
]);
form
.
find
(
'
.message-box.send_err
'
).
fadeIn
(
'
fast
'
);
setTimeout
(
function
(){
form
.
find
(
'
.message-box.send_err
'
).
fadeOut
(
'
fast
'
);
},
2000
);
}
dataLayer
.
push
({
'
event
'
:
'
UA_event
'
,
'
Catagory
'
:
'
Ошибки
'
,
'
Action
'
:
form
.
data
(
'
form
'
),
'
Label
'
:
errors
});
}
}
}
}).
on
(
'
submit
'
,
function
(
e
){
return
false
;
});
</script>
<?php
endif
;
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment