Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f60a7639
authored
May 17, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19462 Добавление в настройки городов переменных. (перенес редактирование)
1 parent
58d7c673
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
24 deletions
app/Http/Controllers/CampaignVarsController.php
resources/js/Pages/Tokens/CampaignsSettings.vue
resources/js/Pages/Tokens/CitySettings.vue
resources/js/Pages/Tokens/Edit.vue
app/Http/Controllers/CampaignVarsController.php
View file @
f60a763
...
@@ -20,11 +20,11 @@ class CampaignVarsController extends Controller
...
@@ -20,11 +20,11 @@ class CampaignVarsController extends Controller
function
__invoke
(
Tokens
$token
,
$campaign_id
)
function
__invoke
(
Tokens
$token
,
$campaign_id
)
{
{
if
(
!
$token
->
isMain
())
{
if
(
$token
->
isMain
())
{
return
Redirect
::
back
();
return
Redirect
::
back
();
}
}
$campaign
=
$token
->
campaigns
()
->
with
(
'vars'
)
->
find
(
$campaign_id
);
$campaign
=
Tokens
::
where
(
'type'
,
Tokens
::
MAIN
)
->
get
()
->
first
()
->
campaigns
()
->
with
(
'vars'
)
->
find
(
$campaign_id
);
if
(
!
$campaign
)
{
if
(
!
$campaign
)
{
return
Redirect
::
back
();
return
Redirect
::
back
();
...
...
resources/js/Pages/Tokens/CampaignsSettings.vue
View file @
f60a763
...
@@ -26,16 +26,12 @@
...
@@ -26,16 +26,12 @@
<table
class=
"w-full whitespace-nowrap"
>
<table
class=
"w-full whitespace-nowrap"
>
<tr
class=
"text-left font-bold"
>
<tr
class=
"text-left font-bold"
>
<th
class=
"px-6 pt-6 pb-4"
>
Name
</th>
<th
class=
"px-6 pt-6 pb-4"
>
Name
</th>
<th
class=
"px-6 pt-6 pb-4"
colspan=
"2"
>
Action
</th>
<th
class=
"px-6 pt-6 pb-4"
>
Action
</th>
</tr>
</tr>
<tr
v-for=
"campaign in token.campaigns"
:key=
"campaign.id"
<tr
v-for=
"campaign in token.campaigns"
:key=
"campaign.id"
class=
"hover:bg-gray-100 focus-within:bg-gray-100"
>
class=
"hover:bg-gray-100 focus-within:bg-gray-100"
>
<td
class=
"border-t px-6 py-3"
>
<td
class=
"border-t px-6 py-3"
>
<inertia-link
class=
"hover:text-indigo-500 focus:text-indigo-500"
{{
campaign
.
name
}}
:href=
"route('token.campaign.vars', [token.id, campaign.id])"
>
{{
campaign
.
name
}}
</inertia-link>
</td>
</td>
<td
class=
"border-t px-6 py-3"
>
<td
class=
"border-t px-6 py-3"
>
<input
:id=
"'campaign-enabled-' + campaign.id"
:checked=
"campaign.enabled"
<input
:id=
"'campaign-enabled-' + campaign.id"
:checked=
"campaign.enabled"
...
@@ -51,14 +47,6 @@
...
@@ -51,14 +47,6 @@
Delete Campaign
Delete Campaign
</button>
</button>
</td>
</td>
<td
class=
"border-t w-px"
>
<inertia-link
class=
"px-4 flex items-center"
:href=
"route('token.campaign.vars', [token.id, campaign.id])"
tabindex=
"-1"
>
<icon
name=
"cheveron-right"
class=
"block w-6 h-6 fill-gray-400"
/>
</inertia-link>
</td>
</tr>
</tr>
<tr
v-if=
"token.campaigns.length === 0"
>
<tr
v-if=
"token.campaigns.length === 0"
>
<td
class=
"border-t px-6 py-4"
colspan=
"5"
>
No campaigns found.
</td>
<td
class=
"border-t px-6 py-4"
colspan=
"5"
>
No campaigns found.
</td>
...
...
resources/js/Pages/Tokens/CitySettings.vue
View file @
f60a763
...
@@ -26,10 +26,10 @@
...
@@ -26,10 +26,10 @@
<th
class=
"px-6 pt-6 pb-4"
>
Обновлять?
</th>
<th
class=
"px-6 pt-6 pb-4"
>
Обновлять?
</th>
<th
class=
"px-6 pt-6 pb-4"
></th>
<th
class=
"px-6 pt-6 pb-4"
></th>
</tr>
</tr>
<template
v-for=
"city in token
_
cities"
>
<template
v-for=
"city in token
.
cities"
>
<tr
:key=
"city.id"
class=
"hover:bg-gray-100 focus-within:bg-gray-100"
>
<tr
:key=
"city.id"
class=
"hover:bg-gray-100 focus-within:bg-gray-100"
>
<td
colspan=
"2"
class=
"border-t"
>
<td
colspan=
"2"
class=
"border-t"
>
<span
class=
"px-6 py-4 flex items-center focus:text-indigo-500"
>
{{
city
.
name
}}
</span>
{{
city
.
name
}}
</td>
</td>
<td
class=
"border-t"
>
<td
class=
"border-t"
>
<input
:checked=
"city.update"
<input
:checked=
"city.update"
...
@@ -49,14 +49,18 @@
...
@@ -49,14 +49,18 @@
<tr>
<tr>
<th
class=
"px-6 pt-6 pb-4"
></th>
<th
class=
"px-6 pt-6 pb-4"
></th>
<th
class=
"px-6 pt-6 pb-4"
>
Кампания
</th>
<th
class=
"px-6 pt-6 pb-4"
>
Кампания
</th>
<th
class=
"px-6 pt-6 pb-4"
>
Синхронизировать?
</th>
<th
class=
"px-6 pt-6 pb-4"
colspan=
"2"
>
Синхронизировать?
</th>
<th></th>
<th></th>
</tr>
</tr>
<tr
v-for=
"campaign in main_token_campaigns"
>
<tr
v-for=
"campaign in main_token_campaigns"
>
<td
class=
"border-t"
></td>
<td
class=
"border-t"
></td>
<td
class=
"border-t"
>
<td
class=
"border-t"
>
<span
class=
"px-6 py-4 flex items-center focus:text-indigo-500"
>
<span
class=
"px-6 py-4 flex items-center focus:text-indigo-500"
>
{{
campaign
.
name
}}
<inertia-link
class=
"hover:text-indigo-500 focus:text-indigo-500"
:href=
"route('token.campaign.vars', [token.id, campaign.id])"
>
{{
campaign
.
name
}}
</inertia-link>
</span>
</span>
</td>
</td>
<td
class=
"border-t"
>
<td
class=
"border-t"
>
...
@@ -65,10 +69,17 @@
...
@@ -65,10 +69,17 @@
type=
"checkbox"
type=
"checkbox"
>
>
</td>
</td>
<td></td>
<td>
<inertia-link
class=
"px-4 flex items-center"
tabindex=
"-1"
:href=
"route('token.campaign.vars', [token.id, campaign.id])"
>
<icon
name=
"book"
class=
"block w-6 h-6 fill-gray-400"
/>
</inertia-link>
</td>
</tr>
</tr>
</
template
>
</
template
>
<tr
v-if=
"token
_
cities.length === 0"
>
<tr
v-if=
"token
.
cities.length === 0"
>
<td
class=
"border-t px-6 py-4"
colspan=
"4"
>
No City found.
</td>
<td
class=
"border-t px-6 py-4"
colspan=
"4"
>
No City found.
</td>
</tr>
</tr>
</table>
</table>
...
@@ -84,7 +95,7 @@ export default {
...
@@ -84,7 +95,7 @@ export default {
components
:
{
Icon
,
SelectInput
},
components
:
{
Icon
,
SelectInput
},
props
:
{
props
:
{
cities
:
Array
,
cities
:
Array
,
token
_cities
:
Array
,
token
:
Object
,
main_token_campaigns
:
Array
,
main_token_campaigns
:
Array
,
},
},
data
()
{
data
()
{
...
...
resources/js/Pages/Tokens/Edit.vue
View file @
f60a763
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
<city-settings
v-if=
"token.type !== 'main'"
<city-settings
v-if=
"token.type !== 'main'"
:cities=
"cities"
:cities=
"cities"
:token
_cities=
"token.cities
"
:token
=
"token
"
:main_token_campaigns=
"main_token_campaigns"
:main_token_campaigns=
"main_token_campaigns"
v-on:add=
"cityAdd"
v-on:add=
"cityAdd"
v-on:updated=
"cityUpdated"
v-on:updated=
"cityUpdated"
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment