Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
7b190dcc
Unverified
Commit
7b190dcc
authored
Oct 02, 2018
by
Nicolas Widart
Committed by
GitHub
Oct 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #598 from mikemand/master
Merge 3.0 into master
parents
4e7bdb92
1d4d7027
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
298 additions
and
103 deletions
+298
-103
RoutingServiceProvider.php
Modules/Core/Providers/RoutingServiceProvider.php
+8
-24
changelog.yml
Modules/Core/changelog.yml
+3
-0
MultipleMedia.vue
Modules/Media/Assets/js/components/MultipleMedia.vue
+16
-22
SingleMedia.vue
Modules/Media/Assets/js/components/SingleMedia.vue
+11
-17
MultipleFileSelector.js
Modules/Media/Assets/js/mixins/MultipleFileSelector.js
+19
-16
RandomString.js
Modules/Media/Assets/js/mixins/RandomString.js
+15
-0
SingleFileSelector.js
Modules/Media/Assets/js/mixins/SingleFileSelector.js
+15
-5
number.blade.php
...tting/Resources/views/admin/fields/plain/number.blade.php
+3
-2
text.blade.php
...Setting/Resources/views/admin/fields/plain/text.blade.php
+3
-2
textarea.blade.php
...ing/Resources/views/admin/fields/plain/textarea.blade.php
+3
-2
number.blade.php
...esources/views/admin/fields/translatable/number.blade.php
+4
-3
text.blade.php
.../Resources/views/admin/fields/translatable/text.blade.php
+3
-2
textarea.blade.php
...ources/views/admin/fields/translatable/textarea.blade.php
+3
-2
pages.php
Modules/Translation/Resources/lang/page/de/pages.php
+1
-1
WorkshopServiceProvider.php
Modules/Workshop/Providers/WorkshopServiceProvider.php
+2
-2
ModuleScaffold.php
Modules/Workshop/Scaffold/Module/ModuleScaffold.php
+12
-1
themeJson.stub
Modules/Workshop/Scaffold/Theme/stubs/themeJson.stub
+2
-1
ModuleScaffoldTest.php
Modules/Workshop/Tests/ModuleScaffoldTest.php
+10
-0
ThemeScaffoldTest.php
Modules/Workshop/Tests/ThemeScaffoldTest.php
+11
-0
changelog.yml
Modules/Workshop/changelog.yml
+3
-0
modules.php
config/modules.php
+1
-1
MultipleMedia.vue
public/modules/media/js/components/MultipleMedia.vue
+123
-0
MultipleFileSelector.js
public/modules/media/js/mixins/MultipleFileSelector.js
+27
-0
No files found.
Modules/Core/Providers/RoutingServiceProvider.php
View file @
7b190dcc
...
@@ -52,31 +52,15 @@ abstract class RoutingServiceProvider extends ServiceProvider
...
@@ -52,31 +52,15 @@ abstract class RoutingServiceProvider extends ServiceProvider
$this
->
loadApiRoutes
(
$router
);
$this
->
loadApiRoutes
(
$router
);
});
});
$prefixes
=
$this
->
getPrefixes
();
foreach
(
$prefixes
as
$prefix
)
{
$router
->
group
([
$router
->
group
([
'namespace'
=>
$this
->
namespace
,
'namespace'
=>
$this
->
namespace
,
'prefix'
=>
$prefix
,
'prefix'
=>
LaravelLocalization
::
setLocale
()
,
'middleware'
=>
[
'localizationRedirect'
,
'web'
],
'middleware'
=>
[
'localizationRedirect'
,
'web'
],
],
function
(
Router
$router
)
{
],
function
(
Router
$router
)
{
$this
->
loadBackendRoutes
(
$router
);
$this
->
loadBackendRoutes
(
$router
);
$this
->
loadFrontendRoutes
(
$router
);
$this
->
loadFrontendRoutes
(
$router
);
});
});
}
}
}
/**
* Get locale prefixes
* @return array
*/
private
function
getPrefixes
()
{
if
(
app
(
'asgard.isInstalled'
))
{
return
array_merge
(
json_decode
(
setting
(
'core::locales'
)),
[
''
]);
}
return
[
LaravelLocalization
::
setLocale
()];
}
/**
/**
* @param Router $router
* @param Router $router
...
...
Modules/Core/changelog.yml
View file @
7b190dcc
...
@@ -3,6 +3,9 @@ versions:
...
@@ -3,6 +3,9 @@ versions:
"
@unreleased"
:
"
@unreleased"
:
added
:
added
:
-
Laravel 5.6 compatibility
-
Laravel 5.6 compatibility
"
3.6.1"
:
changed
:
-
Fixed routing issues with localization introduced in 3.6.0
"
3.6.0"
:
"
3.6.0"
:
added
:
added
:
-
New Hungarian translations
-
New Hungarian translations
...
...
Modules/Media/Assets/js/components/MultipleMedia.vue
View file @
7b190dcc
<
template
>
<
template
>
<div>
<div>
<label
class=
"el-form-item__label"
>
{{
getFieldLabel
()
}}
</label>
<label
class=
"el-form-item__label"
>
{{
getFieldLabel
()
}}
</label>
<div
class=
"jsThumbnailImageWrapper jsSingleThumbnailWrapper"
v-if=
"hasSelectedMedia"
>
<div
class=
"jsThumbnailImageWrapper jsSingleThumbnailWrapper"
v-if=
"hasSelectedMedia"
>
<figure
v-for=
"media in this.selectedMedia"
:key=
"media.id"
>
<figure
v-for=
"media in this.selectedMedia"
:key=
"media.id"
>
<img
:src=
"media.small_thumb"
alt=
""
v-if=
"media.is_image"
/>
<img
:src=
"media.small_thumb"
alt=
""
v-if=
"media.is_image"
/>
<i
:class=
"`fa $
{media.fa_icon}`" style="font-size: 60px;" v-if="! media.is_image">
</i>
<i
:class=
"`fa $
{media.fa_icon}`" style="font-size: 60px;" v-if="! media.is_image">
</i>
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</div>
</div>
<el-dialog
<el-dialog
:visible
.
sync=
"dialogVisible"
:visible
.
sync=
"dialogVisible"
fullscreen
width=
"75%"
:before-close=
"handleClose"
>
:before-close=
"handleClose"
>
<media-list
single-modal
:event-name=
"this.eventName"
></media-list>
<media-list
single-modal
:event-name=
"this.eventName"
></media-list>
...
@@ -29,12 +29,14 @@
...
@@ -29,12 +29,14 @@
<
script
>
<
script
>
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
UploadZone
from
'
../../../../Media/Assets/js/components/UploadZone.vue
'
;
import
_
from
'
lodash
'
;
import
MediaList
from
'
../../../../Media/Assets/js/components/MediaList.vue
'
;
import
UploadZone
from
'
./UploadZone.vue
'
;
import
MediaList
from
'
./MediaList.vue
'
;
import
StringHelpers
from
'
../../../../Core/Assets/js/mixins/StringHelpers.vue
'
;
import
StringHelpers
from
'
../../../../Core/Assets/js/mixins/StringHelpers.vue
'
;
import
RandomString
from
'
../mixins/RandomString
'
;
export
default
{
export
default
{
mixins
:
[
StringHelpers
],
mixins
:
[
StringHelpers
,
RandomString
],
props
:
{
props
:
{
zone
:
{
type
:
String
,
required
:
true
},
zone
:
{
type
:
String
,
required
:
true
},
entity
:
{
type
:
String
,
required
:
true
},
entity
:
{
type
:
String
,
required
:
true
},
...
@@ -88,20 +90,12 @@
...
@@ -88,20 +90,12 @@
getFieldLabel
()
{
getFieldLabel
()
{
return
this
.
label
||
this
.
ucwords
(
this
.
zone
.
replace
(
'
_
'
,
'
'
));
return
this
.
label
||
this
.
ucwords
(
this
.
zone
.
replace
(
'
_
'
,
'
'
));
},
},
makeId
()
{
let
text
=
''
;
const
possible
=
'
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
'
;
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
text
+=
possible
.
charAt
(
Math
.
floor
(
Math
.
random
()
*
possible
.
length
));
}
return
text
;
},
},
},
mounted
()
{
mounted
()
{
if
(
this
.
entityId
)
{
if
(
this
.
entityId
)
{
this
.
fetchMedia
();
this
.
fetchMedia
();
}
}
this
.
eventName
=
`fileWasSelected
${
this
.
makeId
()}${
Math
.
floor
(
Math
.
random
()
*
999999
)}
`
;
this
.
eventName
=
`fileWasSelected
${
this
.
randomString
()}${
Math
.
floor
(
Math
.
random
()
*
999999
)}
`
;
this
.
$events
.
listen
(
this
.
eventName
,
(
mediaData
)
=>
{
this
.
$events
.
listen
(
this
.
eventName
,
(
mediaData
)
=>
{
if
(
_
.
find
(
this
.
selectedMedia
,
mediaData
)
===
undefined
)
{
if
(
_
.
find
(
this
.
selectedMedia
,
mediaData
)
===
undefined
)
{
...
@@ -114,7 +108,7 @@
...
@@ -114,7 +108,7 @@
};
};
</
script
>
</
script
>
<
style
>
<
style
>
.remove-media
{
.remove-media
{
position
:
absolute
;
position
:
absolute
;
top
:
5px
;
top
:
5px
;
left
:
5px
;
left
:
5px
;
...
...
Modules/Media/Assets/js/components/SingleMedia.vue
View file @
7b190dcc
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<el-dialog
<el-dialog
:visible
.
sync=
"dialogVisible"
:visible
.
sync=
"dialogVisible"
fullscreen
width=
"75%"
:before-close=
"handleClose"
>
:before-close=
"handleClose"
>
<media-list
single-modal
:event-name=
"this.eventName"
></media-list>
<media-list
single-modal
:event-name=
"this.eventName"
></media-list>
...
@@ -30,12 +30,14 @@
...
@@ -30,12 +30,14 @@
<
script
>
<
script
>
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
_
from
'
lodash
'
;
import
UploadZone
from
'
./UploadZone.vue
'
;
import
UploadZone
from
'
./UploadZone.vue
'
;
import
MediaList
from
'
./MediaList.vue
'
;
import
MediaList
from
'
./MediaList.vue
'
;
import
StringHelpers
from
'
../../../../Core/Assets/js/mixins/StringHelpers.vue
'
;
import
StringHelpers
from
'
../../../../Core/Assets/js/mixins/StringHelpers.vue
'
;
import
RandomString
from
'
../mixins/RandomString
'
;
export
default
{
export
default
{
mixins
:
[
StringHelpers
],
mixins
:
[
StringHelpers
,
RandomString
],
props
:
{
props
:
{
zone
:
{
type
:
String
,
required
:
true
},
zone
:
{
type
:
String
,
required
:
true
},
entity
:
{
type
:
String
,
required
:
true
},
entity
:
{
type
:
String
,
required
:
true
},
...
@@ -87,20 +89,12 @@
...
@@ -87,20 +89,12 @@
getFieldLabel
()
{
getFieldLabel
()
{
return
this
.
label
||
this
.
ucwords
(
this
.
zone
.
replace
(
'
_
'
,
'
'
));
return
this
.
label
||
this
.
ucwords
(
this
.
zone
.
replace
(
'
_
'
,
'
'
));
},
},
makeId
()
{
let
text
=
''
;
const
possible
=
'
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
'
;
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
text
+=
possible
.
charAt
(
Math
.
floor
(
Math
.
random
()
*
possible
.
length
));
}
return
text
;
},
},
},
mounted
()
{
mounted
()
{
if
(
this
.
entityId
)
{
if
(
this
.
entityId
)
{
this
.
fetchMedia
();
this
.
fetchMedia
();
}
}
this
.
eventName
=
`fileWasSelected
${
this
.
makeId
()}${
Math
.
floor
(
Math
.
random
()
*
999999
)}
`
;
this
.
eventName
=
`fileWasSelected
${
this
.
randomString
()}${
Math
.
floor
(
Math
.
random
()
*
999999
)}
`
;
this
.
$events
.
listen
(
this
.
eventName
,
(
mediaData
)
=>
{
this
.
$events
.
listen
(
this
.
eventName
,
(
mediaData
)
=>
{
this
.
dialogVisible
=
false
;
this
.
dialogVisible
=
false
;
...
...
Modules/Media/Assets/js/mixins/MultipleFileSelector.js
View file @
7b190dcc
export
default
{
export
default
{
methods
:
{
methods
:
{
selectMultipleFile
(
event
,
model
)
{
selectMultipleFile
(
event
,
model
)
{
if
(
!
this
[
model
].
medias_multi
)
{
if
(
typeof
this
[
model
].
medias_multi
===
'
undefined
'
)
{
this
[
model
].
medias_multi
=
{}
;
this
.
$set
(
model
,
'
medias_multi
'
,
{})
;
}
}
if
(
!
this
[
model
].
medias_multi
[
event
.
zone
])
{
this
[
model
].
medias_multi
[
event
.
zone
]
=
{
files
:
[]
};
if
(
typeof
this
[
model
].
medias_multi
[
event
.
zone
]
===
'
undefined
'
)
{
this
.
$set
(
this
[
model
].
medias_multi
,
event
.
zone
,
{
files
:
[],
orders
:
''
});
}
if
(
event
.
id
!==
null
&&
event
.
id
!==
undefined
)
{
const
medias
=
new
Set
(
this
[
model
].
medias_multi
[
event
.
zone
].
files
);
medias
.
add
(
event
.
id
);
this
.
$set
(
this
[
model
].
medias_multi
[
event
.
zone
],
'
files
'
,
[...
medias
]);
}
}
this
[
model
].
medias_multi
[
event
.
zone
].
files
.
push
(
event
.
id
);
},
},
unselectFile
(
event
,
model
)
{
unselectFile
(
event
,
model
)
{
if
(
!
this
[
model
].
medias_multi
)
{
if
(
event
.
id
!==
null
&&
event
.
id
!==
undefined
)
{
this
[
model
].
medias_multi
=
{};
const
medias
=
new
Set
(
this
[
model
].
medias_multi
[
event
.
zone
].
files
);
}
medias
.
delete
(
event
.
id
);
if
(
!
this
[
model
].
medias_multi
[
event
.
zone
])
{
this
.
$set
(
this
[
model
].
medias_multi
[
event
.
zone
],
'
files
'
,
[...
medias
]);
this
[
model
].
medias_multi
[
event
.
zone
]
=
{
files
:
[]
};
if
(
this
.
$refs
[
'
multiple-media
'
]
!==
undefined
&&
this
.
$refs
[
'
multiple-media
'
].
selectedMedia
!==
undefined
&&
!
_
.
isEmpty
(
this
.
$refs
[
'
multiple-media
'
].
selectedMedia
))
{
_
.
forEach
(
this
.
$refs
[
'
multiple-media
'
].
selectedMedia
,
(
file
,
key
)
=>
{
this
[
model
].
medias_multi
[
event
.
zone
].
files
.
push
(
file
.
id
);
});
}
}
if
(
this
[
model
].
medias_multi
[
event
.
zone
].
files
.
length
===
0
)
{
this
.
$delete
(
this
[
model
].
medias_multi
,
event
.
zone
);
}
}
this
[
model
].
medias_multi
[
event
.
zone
].
files
=
_
.
reject
(
this
[
model
].
medias_multi
[
event
.
zone
].
files
,
media
=>
media
===
event
.
id
);
},
},
},
},
};
};
Modules/Media/Assets/js/mixins/RandomString.js
0 → 100644
View file @
7b190dcc
export
default
{
methods
:
{
randomString
(
length
)
{
const
len
=
length
||
5
;
let
text
=
''
;
const
possible
=
'
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
'
;
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
text
+=
possible
.
charAt
(
Math
.
floor
(
Math
.
random
()
*
possible
.
length
));
}
return
text
;
},
},
};
Modules/Media/Assets/js/mixins/SingleFileSelector.js
View file @
7b190dcc
export
default
{
export
default
{
methods
:
{
methods
:
{
selectSingleFile
(
event
,
model
)
{
selectSingleFile
(
event
,
model
)
{
this
[
model
].
medias_single
=
_
.
merge
(
this
[
model
].
medias_single
,
{
if
(
typeof
this
[
model
].
medias_single
===
'
undefined
'
)
{
[
event
.
zone
]:
event
.
id
,
this
.
$set
(
this
[
model
],
'
medias_single
'
,
{});
});
}
},
if
(
typeof
this
[
model
].
medias_single
[
event
.
zone
]
===
'
undefined
'
)
{
this
.
$set
(
this
[
model
].
medias_single
,
event
.
zone
,
null
);
}
if
(
event
.
id
!==
null
&&
event
.
id
!==
undefined
)
{
this
.
$set
(
this
[
model
].
medias_single
,
event
.
zone
,
event
.
id
);
}
else
{
this
.
$delete
(
this
[
model
].
medias_single
,
event
.
zone
);
}
}
}
},
},
};
Modules/Setting/Resources/views/admin/fields/plain/number.blade.php
View file @
7b190dcc
<?php
$defaultValue
=
isset
(
$moduleInfo
[
'default'
])
?
$moduleInfo
[
'default'
]
:
''
;
?>
<div
class=
'form-group'
>
<div
class=
'form-group'
>
{!! Form::label($settingName, trans($moduleInfo['description'])) !!}
{!! Form::label($settingName, trans($moduleInfo['description'])) !!}
<?php
if
(
isset
(
$dbSettings
[
$settingName
])
&&
$dbSettings
[
$settingName
]
->
plainValue
!==
null
)
:
?>
<?php
if
(
isset
(
$dbSettings
[
$settingName
])
&&
$dbSettings
[
$settingName
]
->
plainValue
!==
null
)
:
?>
{!! Form::
input('number', $settingName, old($settingName, $dbSettings[$settingName]->plainValue)
, ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::
number($settingName, old($settingName, $dbSettings[$settingName]->plainValue) ?: $defaultValue
, ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
else
:
?>
<?php
else
:
?>
{!! Form::
input('number', $settingName, old($settingNam
e), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::
number($settingName, old($settingName, $defaultValu
e), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
endif
;
?>
<?php
endif
;
?>
</div>
</div>
Modules/Setting/Resources/views/admin/fields/plain/text.blade.php
View file @
7b190dcc
<?php
$defaultValue
=
isset
(
$moduleInfo
[
'default'
])
?
$moduleInfo
[
'default'
]
:
''
;
?>
<div
class=
'form-group'
>
<div
class=
'form-group'
>
{!! Form::label($settingName, trans($moduleInfo['description'])) !!}
{!! Form::label($settingName, trans($moduleInfo['description'])) !!}
<?php
if
(
isset
(
$dbSettings
[
$settingName
])
&&
$dbSettings
[
$settingName
]
->
plainValue
!==
null
)
:
?>
<?php
if
(
isset
(
$dbSettings
[
$settingName
])
&&
$dbSettings
[
$settingName
]
->
plainValue
!==
null
)
:
?>
{!! Form::text($settingName, old($settingName, $dbSettings[$settingName]->plainValue), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::text($settingName, old($settingName, $dbSettings[$settingName]->plainValue)
?: $defaultValue
, ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
else
:
?>
<?php
else
:
?>
{!! Form::text($settingName, old($settingName), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::text($settingName, old($settingName
, $defaultValue
), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
endif
;
?>
<?php
endif
;
?>
</div>
</div>
Modules/Setting/Resources/views/admin/fields/plain/textarea.blade.php
View file @
7b190dcc
<?php
$defaultValue
=
isset
(
$moduleInfo
[
'default'
])
?
$moduleInfo
[
'default'
]
:
''
;
?>
<div
class=
'form-group'
>
<div
class=
'form-group'
>
{!! Form::label($settingName, trans($moduleInfo['description'])) !!}
{!! Form::label($settingName, trans($moduleInfo['description'])) !!}
<?php
if
(
isset
(
$dbSettings
[
$settingName
])
&&
$dbSettings
[
$settingName
]
->
plainValue
!==
null
)
:
?>
<?php
if
(
isset
(
$dbSettings
[
$settingName
])
&&
$dbSettings
[
$settingName
]
->
plainValue
!==
null
)
:
?>
{!! Form::textarea($settingName, old($settingName, $dbSettings[$settingName]->plainValue), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::textarea($settingName, old($settingName, $dbSettings[$settingName]->plainValue)
?: $defaultValue
, ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
else
:
?>
<?php
else
:
?>
{!! Form::textarea($settingName, old($settingName), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::textarea($settingName, old($settingName
, $defaultValue
), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
endif
;
?>
<?php
endif
;
?>
</div>
</div>
Modules/Setting/Resources/views/admin/fields/translatable/number.blade.php
View file @
7b190dcc
<?php
$defaultValue
=
isset
(
$moduleInfo
[
'default'
])
?
$moduleInfo
[
'default'
]
:
''
;
?>
<div
class=
'form-group'
>
<div
class=
'form-group'
>
{!! Form::label($settingName . "[$lang]", trans($moduleInfo['description'])) !!}
{!! Form::label($settingName . "[$lang]", trans($moduleInfo['description'])) !!}
<?php
if
(
isset
(
$dbSettings
[
$settingName
]))
:
?>
<?php
if
(
isset
(
$dbSettings
[
$settingName
]))
:
?>
<?php
$value
=
$dbSettings
[
$settingName
]
->
hasTranslation
(
$lang
)
?
$dbSettings
[
$settingName
]
->
translate
(
$lang
)
->
value
:
''
;
?>
<?php
$value
=
$dbSettings
[
$settingName
]
->
hasTranslation
(
$lang
)
?
$dbSettings
[
$settingName
]
->
translate
(
$lang
)
->
value
:
$defaultValue
;
?>
{!! Form::
input('number',
$settingName . "[$lang]", old($settingName . "[$lang]", $value), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::
number(
$settingName . "[$lang]", old($settingName . "[$lang]", $value), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
else
:
?>
<?php
else
:
?>
{!! Form::
input('number', $settingName . "[$lang]", old($settingName . "[$lang]"
), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::
number($settingName . "[$lang]", old($settingName . "[$lang]", $defaultValue
), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
endif
;
?>
<?php
endif
;
?>
</div>
</div>
Modules/Setting/Resources/views/admin/fields/translatable/text.blade.php
View file @
7b190dcc
<?php
$defaultValue
=
isset
(
$moduleInfo
[
'default'
])
?
$moduleInfo
[
'default'
]
:
''
;
?>
<div
class=
'form-group'
>
<div
class=
'form-group'
>
{!! Form::label($settingName . "[$lang]", trans($moduleInfo['description'])) !!}
{!! Form::label($settingName . "[$lang]", trans($moduleInfo['description'])) !!}
<?php
if
(
isset
(
$dbSettings
[
$settingName
]))
:
?>
<?php
if
(
isset
(
$dbSettings
[
$settingName
]))
:
?>
<?php
$value
=
$dbSettings
[
$settingName
]
->
hasTranslation
(
$lang
)
?
$dbSettings
[
$settingName
]
->
translate
(
$lang
)
->
value
:
''
;
?>
<?php
$value
=
$dbSettings
[
$settingName
]
->
hasTranslation
(
$lang
)
?
$dbSettings
[
$settingName
]
->
translate
(
$lang
)
->
value
:
''
;
?>
{!! Form::text($settingName . "[$lang]", old($settingName . "[$lang]", $value), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::text($settingName . "[$lang]", old($settingName . "[$lang]", $value)
?: $defaultValue
, ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
else
:
?>
<?php
else
:
?>
{!! Form::text($settingName . "[$lang]", old($settingName . "[$lang]"), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::text($settingName . "[$lang]", old($settingName . "[$lang]"
, $defaultValue
), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
endif
;
?>
<?php
endif
;
?>
</div>
</div>
Modules/Setting/Resources/views/admin/fields/translatable/textarea.blade.php
View file @
7b190dcc
<?php
$defaultValue
=
isset
(
$moduleInfo
[
'default'
])
?
$moduleInfo
[
'default'
]
:
''
;
?>
<div
class=
'form-group'
>
<div
class=
'form-group'
>
{!! Form::label($settingName . "[$lang]", trans($moduleInfo['description'])) !!}
{!! Form::label($settingName . "[$lang]", trans($moduleInfo['description'])) !!}
<?php
if
(
isset
(
$dbSettings
[
$settingName
]))
:
?>
<?php
if
(
isset
(
$dbSettings
[
$settingName
]))
:
?>
<?php
$value
=
$dbSettings
[
$settingName
]
->
hasTranslation
(
$lang
)
?
$dbSettings
[
$settingName
]
->
translate
(
$lang
)
->
value
:
''
;
?>
<?php
$value
=
$dbSettings
[
$settingName
]
->
hasTranslation
(
$lang
)
?
$dbSettings
[
$settingName
]
->
translate
(
$lang
)
->
value
:
''
;
?>
{!! Form::textarea($settingName . "[$lang]", old($settingName . "[$lang]", $value), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::textarea($settingName . "[$lang]", old($settingName . "[$lang]", $value)
?: $defaultValue
, ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
else
:
?>
<?php
else
:
?>
{!! Form::textarea($settingName . "[$lang]", old($settingName . "[$lang]"), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
{!! Form::textarea($settingName . "[$lang]", old($settingName . "[$lang]"
, $defaultValue
), ['class' => 'form-control', 'placeholder' => trans($moduleInfo['description'])]) !!}
<?php
endif
;
?>
<?php
endif
;
?>
</div>
</div>
Modules/Translation/Resources/lang/page/de/pages.php
View file @
7b190dcc
...
@@ -5,7 +5,7 @@ return [
...
@@ -5,7 +5,7 @@ return [
'create page'
=>
'Seite erstellen'
,
'create page'
=>
'Seite erstellen'
,
'edit page'
=>
'Bearbeiten einer Seite'
,
'edit page'
=>
'Bearbeiten einer Seite'
,
'name'
=>
'Name'
,
'name'
=>
'Name'
,
's
lug'
=>
'Slug
'
,
's
tatus'
=>
'Status
'
,
'title'
=>
'Titel'
,
'title'
=>
'Titel'
,
'slug'
=>
'Slug'
,
'slug'
=>
'Slug'
,
'meta_title'
=>
'Meta-Titel'
,
'meta_title'
=>
'Meta-Titel'
,
...
...
Modules/Workshop/Providers/WorkshopServiceProvider.php
View file @
7b190dcc
...
@@ -21,7 +21,7 @@ use Modules\Workshop\Scaffold\Module\Generators\ValueObjectGenerator;
...
@@ -21,7 +21,7 @@ use Modules\Workshop\Scaffold\Module\Generators\ValueObjectGenerator;
use
Modules\Workshop\Scaffold\Module\ModuleScaffold
;
use
Modules\Workshop\Scaffold\Module\ModuleScaffold
;
use
Modules\Workshop\Scaffold\Theme\ThemeGeneratorFactory
;
use
Modules\Workshop\Scaffold\Theme\ThemeGeneratorFactory
;
use
Modules\Workshop\Scaffold\Theme\ThemeScaffold
;
use
Modules\Workshop\Scaffold\Theme\ThemeScaffold
;
use
Nwidart\Modules\
Repository
;
use
Nwidart\Modules\
Contracts\RepositoryInterface
;
class
WorkshopServiceProvider
extends
ServiceProvider
class
WorkshopServiceProvider
extends
ServiceProvider
{
{
...
@@ -55,7 +55,7 @@ class WorkshopServiceProvider extends ServiceProvider
...
@@ -55,7 +55,7 @@ class WorkshopServiceProvider extends ServiceProvider
});
});
app
(
'router'
)
->
bind
(
'module'
,
function
(
$module
)
{
app
(
'router'
)
->
bind
(
'module'
,
function
(
$module
)
{
return
app
(
Repository
::
class
)
->
find
(
$module
);
return
app
(
Repository
Interface
::
class
)
->
find
(
$module
);
});
});
app
(
'router'
)
->
bind
(
'theme'
,
function
(
$theme
)
{
app
(
'router'
)
->
bind
(
'theme'
,
function
(
$theme
)
{
return
app
(
ThemeManager
::
class
)
->
find
(
$theme
);
return
app
(
ThemeManager
::
class
)
->
find
(
$theme
);
...
...
Modules/Workshop/Scaffold/Module/ModuleScaffold.php
View file @
7b190dcc
...
@@ -227,6 +227,7 @@ class ModuleScaffold
...
@@ -227,6 +227,7 @@ class ModuleScaffold
$moduleJson
=
$this
->
loadProviders
(
$moduleJson
);
$moduleJson
=
$this
->
loadProviders
(
$moduleJson
);
$moduleJson
=
$this
->
setModuleOrderOrder
(
$moduleJson
);
$moduleJson
=
$this
->
setModuleOrderOrder
(
$moduleJson
);
$moduleJson
=
$this
->
setModuleVersion
(
$moduleJson
);
$moduleJson
=
$this
->
removeStartPhpFile
(
$moduleJson
);
$moduleJson
=
$this
->
removeStartPhpFile
(
$moduleJson
);
$this
->
finder
->
put
(
$this
->
getModulesPath
(
'module.json'
),
$moduleJson
);
$this
->
finder
->
put
(
$this
->
getModulesPath
(
'module.json'
),
$moduleJson
);
...
@@ -259,6 +260,16 @@ JSON;
...
@@ -259,6 +260,16 @@ JSON;
return
str_replace
(
'"order": 0,'
,
'"order": 1,'
,
$content
);
return
str_replace
(
'"order": 0,'
,
'"order": 1,'
,
$content
);
}
}
/**
* Set the module version to 1.0.0 by default
* @param string $content
* @return string
*/
private
function
setModuleVersion
(
$content
)
{
return
str_replace
(
"
\"
active
\"
"
,
"
\"
version
\"
:
\"
1.0.0
\"
,
\n\t\"
active
\"
"
,
$content
);
}
/**
/**
* Remove the start.php start file
* Remove the start.php start file
* Also removes the auto loading of that file
* Also removes the auto loading of that file
...
...
Modules/Workshop/Scaffold/Theme/stubs/themeJson.stub
View file @
7b190dcc
{
{
"name": "{{theme-name}}",
"name": "{{theme-name}}",
"description": "",
"description": "",
"type": "{{type}}"
"type": "{{type}}",
"version": "1.0.0"
}
}
Modules/Workshop/Tests/ModuleScaffoldTest.php
View file @
7b190dcc
...
@@ -553,6 +553,16 @@ class ModuleScaffoldTest extends BaseTestCase
...
@@ -553,6 +553,16 @@ class ModuleScaffoldTest extends BaseTestCase
$this
->
cleanUp
();
$this
->
cleanUp
();
}
}
/** @test */
public
function
it_add_default_version_on_module_json_file
()
{
$this
->
scaffoldModuleWithEloquent
();
$moduleFile
=
$this
->
getModuleFile
();
$this
->
assertEquals
(
'1.0.0'
,
$moduleFile
->
version
);
}
/**
/**
* Get the contents of composer.json file
* Get the contents of composer.json file
* @return string
* @return string
...
...
Modules/Workshop/Tests/ThemeScaffoldTest.php
View file @
7b190dcc
...
@@ -184,4 +184,15 @@ class ThemeScaffoldTest extends BaseTestCase
...
@@ -184,4 +184,15 @@ class ThemeScaffoldTest extends BaseTestCase
$this
->
assertTrue
(
$this
->
finder
->
isFile
(
$this
->
testThemePath
.
'/assets/js/.gitignore'
));
$this
->
assertTrue
(
$this
->
finder
->
isFile
(
$this
->
testThemePath
.
'/assets/js/.gitignore'
));
$this
->
assertTrue
(
$this
->
finder
->
isFile
(
$this
->
testThemePath
.
'/assets/images/.gitignore'
));
$this
->
assertTrue
(
$this
->
finder
->
isFile
(
$this
->
testThemePath
.
'/assets/images/.gitignore'
));
}
}
/** @test */
public
function
it_has_default_version_in_theme_json_file
()
{
$this
->
scaffold
->
setFiles
([
'themeJson'
]);
$this
->
generateFrontendTheme
();
$this
->
assertTrue
(
$this
->
finder
->
isFile
(
$this
->
testThemePath
.
'/theme.json'
));
$this
->
assertTrue
(
str_contains
(
$this
->
finder
->
get
(
$this
->
testThemePath
.
'/theme.json'
),
'"version": "1.0.0"'
));
}
}
}
Modules/Workshop/changelog.yml
View file @
7b190dcc
...
@@ -3,6 +3,9 @@ versions:
...
@@ -3,6 +3,9 @@ versions:
"
@unreleased"
:
"
@unreleased"
:
added
:
added
:
-
Laravel 5.6 compatibility
-
Laravel 5.6 compatibility
"
3.6.1"
:
changed
:
-
Fixed issue with incorrect binding to the laravel-modules Repository class
"
3.5.1"
:
"
3.5.1"
:
changed
:
changed
:
-
Fixing issue with ThemeManager caused when a theme name has the same name as project name
-
Fixing issue with ThemeManager caused when a theme name has the same name as project name
...
...
config/modules.php
View file @
7b190dcc
...
@@ -88,7 +88,7 @@ return [
...
@@ -88,7 +88,7 @@ return [
| Generator path
| Generator path
|--------------------------------------------------------------------------
|--------------------------------------------------------------------------
| Customise the paths where the folders will be generated.
| Customise the paths where the folders will be generated.
| Se the generate key to false to not generate that folder
| Se
t
the generate key to false to not generate that folder
*/
*/
'generator'
=>
[
'generator'
=>
[
'config'
=>
[
'path'
=>
'Config'
,
'generate'
=>
true
],
'config'
=>
[
'path'
=>
'Config'
,
'generate'
=>
true
],
...
...
public/modules/media/js/components/MultipleMedia.vue
0 → 100644
View file @
7b190dcc
<
template
>
<div>
<label
class=
"el-form-item__label"
>
{{
getFieldLabel
()
}}
</label>
<div
class=
"jsThumbnailImageWrapper jsSingleThumbnailWrapper"
v-if=
"hasSelectedMedia"
>
<figure
v-for=
"media in this.selectedMedia"
:key=
"media.id"
>
<img
:src=
"media.small_thumb"
alt=
""
v-if=
"media.is_image"
/>
<i
:class=
"`fa $
{media.fa_icon}`" style="font-size: 60px;" v-if="! media.is_image">
</i>
<span
v-if=
"! media.is_image"
style=
"display:block;"
>
{{
media
.
filename
}}
</span>
<span
class=
"el-icon-error remove-media"
@
click=
"unSelectMedia(media.id)"
></span>
</figure>
<div
class=
"clearfix"
></div>
</div>
<div>
<el-button
type=
"button"
@
click=
"dialogVisible = true"
>
{{
trans
(
'
media.Browse
'
)
}}
</el-button>
</div>
<el-dialog
:visible
.
sync=
"dialogVisible"
fullscreen
:before-close=
"handleClose"
>
<media-list
single-modal
:event-name=
"this.eventName"
></media-list>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
>
{{
trans
(
'
core.button.cancel
'
)
}}
</el-button>
</span>
</el-dialog>
</div>
</
template
>
<
script
>
import
axios
from
'
axios
'
;
import
UploadZone
from
'
../../../../Media/Assets/js/components/UploadZone.vue
'
;
import
MediaList
from
'
../../../../Media/Assets/js/components/MediaList.vue
'
;
import
StringHelpers
from
'
../../../../Core/Assets/js/mixins/StringHelpers.vue
'
;
export
default
{
mixins
:
[
StringHelpers
],
props
:
{
zone
:
{
type
:
String
,
required
:
true
},
entity
:
{
type
:
String
,
required
:
true
},
entityId
:
{
default
:
null
},
label
:
{
type
:
String
},
},
components
:
{
'
upload-zone
'
:
UploadZone
,
'
media-list
'
:
MediaList
,
},
watch
:
{
entityId
()
{
if
(
this
.
entityId
)
{
this
.
fetchMedia
();
}
},
},
data
()
{
return
{
dialogVisible
:
false
,
selectedMedia
:
[],
eventName
:
''
,
};
},
computed
:
{
hasSelectedMedia
()
{
return
this
.
selectedMedia
!==
undefined
&&
!
_
.
isEmpty
(
this
.
selectedMedia
);
},
},
methods
:
{
handleClose
(
done
)
{
done
();
},
unSelectMedia
(
id
)
{
this
.
selectedMedia
=
_
.
reject
(
this
.
selectedMedia
,
media
=>
media
.
id
===
id
);
this
.
$emit
(
'
fileUnselected
'
,
{
id
,
zone
:
this
.
zone
});
},
fetchMedia
()
{
axios
.
get
(
route
(
'
api.media.get-by-zone-and-entity
'
,
{
zone
:
this
.
zone
,
entity
:
this
.
entity
,
entity_id
:
this
.
entityId
,
}))
.
then
((
response
)
=>
{
this
.
selectedMedia
=
response
.
data
.
data
;
_
.
forEach
(
this
.
selectedMedia
,
(
file
)
=>
{
this
.
$emit
(
'
multipleFileSelected
'
,
{
id
:
file
.
id
,
zone
:
this
.
zone
});
});
});
},
getFieldLabel
()
{
return
this
.
label
||
this
.
ucwords
(
this
.
zone
.
replace
(
'
_
'
,
'
'
));
},
makeId
()
{
let
text
=
''
;
const
possible
=
'
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
'
;
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
text
+=
possible
.
charAt
(
Math
.
floor
(
Math
.
random
()
*
possible
.
length
));
}
return
text
;
},
},
mounted
()
{
if
(
this
.
entityId
)
{
this
.
fetchMedia
();
}
this
.
eventName
=
`fileWasSelected
${
this
.
makeId
()}${
Math
.
floor
(
Math
.
random
()
*
999999
)}
`
;
this
.
$events
.
listen
(
this
.
eventName
,
(
mediaData
)
=>
{
if
(
_
.
find
(
this
.
selectedMedia
,
mediaData
)
===
undefined
)
{
if
(
!
this
.
selectedMedia
)
this
.
selectedMedia
=
[];
this
.
selectedMedia
.
push
(
mediaData
);
this
.
$emit
(
'
multipleFileSelected
'
,
_
.
merge
(
mediaData
,
{
zone
:
this
.
zone
}));
}
});
},
};
</
script
>
<
style
>
.remove-media
{
position
:
absolute
;
top
:
5px
;
left
:
5px
;
color
:
#FA5555
;
}
</
style
>
\ No newline at end of file
public/modules/media/js/mixins/MultipleFileSelector.js
0 → 100644
View file @
7b190dcc
export
default
{
methods
:
{
selectMultipleFile
(
event
,
model
)
{
if
(
!
this
[
model
].
medias_multi
)
{
this
[
model
].
medias_multi
=
{};
}
if
(
!
this
[
model
].
medias_multi
[
event
.
zone
])
{
this
[
model
].
medias_multi
[
event
.
zone
]
=
{
files
:
[]
};
}
this
[
model
].
medias_multi
[
event
.
zone
].
files
.
push
(
event
.
id
);
},
unselectFile
(
event
,
model
)
{
if
(
!
this
[
model
].
medias_multi
)
{
this
[
model
].
medias_multi
=
{};
}
if
(
!
this
[
model
].
medias_multi
[
event
.
zone
])
{
this
[
model
].
medias_multi
[
event
.
zone
]
=
{
files
:
[]
};
if
(
this
.
$refs
[
'
multiple-media
'
]
!==
undefined
&&
this
.
$refs
[
'
multiple-media
'
].
selectedMedia
!==
undefined
&&
!
_
.
isEmpty
(
this
.
$refs
[
'
multiple-media
'
].
selectedMedia
))
{
_
.
forEach
(
this
.
$refs
[
'
multiple-media
'
].
selectedMedia
,
(
file
,
key
)
=>
{
this
[
model
].
medias_multi
[
event
.
zone
].
files
.
push
(
file
.
id
);
});
}
}
this
[
model
].
medias_multi
[
event
.
zone
].
files
=
_
.
reject
(
this
[
model
].
medias_multi
[
event
.
zone
].
files
,
media
=>
media
===
event
.
id
);
},
},
};
\ 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