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
88a272fc
Commit
88a272fc
authored
Feb 16, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1013 - dataLayer - для формы подписи в блоге
parent
7168c431
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
8 deletions
+48
-8
common/modules/bids/models/Bid.php
common/modules/bids/models/Bid.php
+7
-0
common/modules/blog/views/post/_subscribe.php
common/modules/blog/views/post/_subscribe.php
+7
-2
common/modules/blog/views/post/index.php
common/modules/blog/views/post/index.php
+1
-1
common/modules/blog/views/post/tag.php
common/modules/blog/views/post/tag.php
+1
-1
common/modules/blog/views/post/view.php
common/modules/blog/views/post/view.php
+1
-2
frontend/views/layouts/block/case-subscribe.php
frontend/views/layouts/block/case-subscribe.php
+7
-2
frontend/web/js/bids-form.js
frontend/web/js/bids-form.js
+24
-0
No files found.
common/modules/bids/models/Bid.php
View file @
88a272fc
...
...
@@ -26,6 +26,8 @@ class Bid extends \common\components\ActiveRecordModel
const
FORM_PROJECT
=
'project'
;
const
FORM_MESSAGE
=
'message'
;
const
TAG_INVOLVEMENT
=
'Вовлечение'
;
const
FILE_FOLDER
=
'/uploads/bids/'
;
public
$file
;
...
...
@@ -37,6 +39,11 @@ class Bid extends \common\components\ActiveRecordModel
self
::
FORM_MESSAGE
=>
'Сообщение с сайта'
,
];
public
static
$tag_titles
=
[
self
::
TAG_INVOLVEMENT
=>
'Вовлечение'
,
self
::
FORM_SUBSCRIBE
=>
'Ошибки'
,
];
/**
* @inheritdoc
*/
...
...
common/modules/blog/views/post/_subscribe.php
View file @
88a272fc
...
...
@@ -11,18 +11,23 @@ use common\modules\bids\models\Bid;
<?php
$model
=
new
Bid
;
$model
->
scenario
=
Bid
::
SCENARIO_SUBSCRIBE
;
$model
->
setScenario
(
Bid
::
SCENARIO_SUBSCRIBE
);
$model
->
form
=
Bid
::
FORM_SUBSCRIBE
;
$form
=
ActiveForm
::
begin
([
'action'
=>
'/'
,
'enableClientValidation'
=>
false
,
'options'
=>
[
'class'
=>
'subsc_blog_form bids-form'
,
'data-title'
=>
$title
,
'data-form'
=>
'Подпись на обновления в блоге'
,
'data-tag'
=>
Bid
::
TAG_INVOLVEMENT
],
]);
?>
<?php
echo
Html
::
hiddenInput
(
'scenario'
,
$model
->
scenario
,
[
'class'
=>
'not_clear'
]);
?>
<?php
echo
Html
::
hiddenInput
(
'Bid[form]'
,
Bid
::
FORM_SUBSCRIBE
,
[
'class'
=>
'not_clear'
]);
?>
<?php
echo
$form
->
field
(
$model
,
'form'
,
[
'template'
=>
'{input}'
])
->
hiddenInput
(
[
'class'
=>
'not_clear'
]);
?>
<?php
echo
$form
->
field
(
$model
,
'email'
,
[
'template'
=>
'<div class="row"><div class="col-sm-4">{input}</div></div>'
,
...
...
common/modules/blog/views/post/index.php
View file @
88a272fc
...
...
@@ -57,7 +57,7 @@ use yii\helpers\Url;
<?php
endforeach
;
?>
<?=
$this
->
render
(
'_subscribe'
)
?>
<?=
$this
->
render
(
'_subscribe'
,
[
'title'
=>
'Страница Блог'
]
)
?>
</section>
</div>
...
...
common/modules/blog/views/post/tag.php
View file @
88a272fc
...
...
@@ -57,7 +57,7 @@ use yii\helpers\Url;
<?php
endforeach
;
?>
<?=
$this
->
render
(
'_subscribe'
)
?>
<?=
$this
->
render
(
'_subscribe'
,
[
'title'
=>
'Тег: '
.
$model
->
name
]
)
?>
</section>
</div>
...
...
common/modules/blog/views/post/view.php
View file @
88a272fc
...
...
@@ -50,8 +50,7 @@ use yii\helpers\Html;
</div>
</article>
<?=
$this
->
render
(
'_subscribe'
)
?>
<?=
$this
->
render
(
'_subscribe'
,
[
'title'
=>
'Запись в блоге: '
.
$model
->
lang
->
title
])
?>
</section>
</div>
...
...
frontend/views/layouts/block/case-subscribe.php
View file @
88a272fc
...
...
@@ -11,18 +11,23 @@ use common\modules\bids\models\Bid;
<p>
Процесс создания кейса очень трудоемкий.Поэтому мы занимаемся созданием кейсов свободное от работы время. Подпишитесь, чтобы следить за обновлениями.
</p>
<?php
$model
=
new
Bid
;
$model
->
scenario
=
Bid
::
SCENARIO_SUBSCRIBE
;
$model
->
setScenario
(
Bid
::
SCENARIO_SUBSCRIBE
);
$model
->
form
=
Bid
::
FORM_SUBSCRIBE
;
$form
=
ActiveForm
::
begin
([
'action'
=>
'/'
,
'enableClientValidation'
=>
false
,
'options'
=>
[
'class'
=>
'keys_mail_form bids-form'
,
'data-title'
=>
'Страница Кейсы'
,
'data-form'
=>
'Подпись на обновления в кейсах'
,
'data-tag'
=>
Bid
::
TAG_INVOLVEMENT
],
]);
?>
<?php
echo
Html
::
hiddenInput
(
'scenario'
,
$model
->
scenario
,
[
'class'
=>
'not_clear'
]);
?>
<?php
echo
Html
::
hiddenInput
(
'Bid[form]'
,
Bid
::
FORM_SUBSCRIBE
,
[
'class'
=>
'not_clear'
]);
?>
<?php
echo
$form
->
field
(
$model
,
'form'
,
[
'template'
=>
'{input}'
])
->
hiddenInput
(
[
'class'
=>
'not_clear'
]);
?>
<?php
echo
$form
->
field
(
$model
,
'email'
,
[
'template'
=>
'<div class="row"><div class="col-sm-4">{input}</div></div>'
,
...
...
frontend/web/js/bids-form.js
View file @
88a272fc
...
...
@@ -36,6 +36,30 @@ $('form.bids-form').on('beforeSubmit', function(e) {
{
form
.
find
(
'
input:not(.not_clear), textarea
'
).
val
(
''
);
$
(
'
.send_secce
'
).
show
();
dataLayer
.
push
({
'
event
'
:
'
UA_event
'
,
'
Catagory
'
:
form
.
data
(
'
tag
'
),
'
Action
'
:
form
.
data
(
'
title
'
),
'
Label
'
:
'
Успешно
'
});
form
.
find
(
'
.has-error
'
).
removeClass
(
'
has-error
'
);
}
else
{
errors
=
[];
$
.
each
(
response
,
function
(
key
,
value
)
{
$
(
'
.field-
'
+
key
).
addClass
(
'
has-error
'
);
errors
=
errors
.
concat
(
value
);
});
dataLayer
.
push
({
'
event
'
:
'
UA_event
'
,
'
Catagory
'
:
'
Ошибки
'
,
'
Action
'
:
form
.
data
(
'
form
'
),
'
Label
'
:
errors
});
}
}
}
...
...
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