Skip to content

Commit

Permalink
플러그인 관리 페이지 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
woongbin committed Mar 20, 2019
1 parent ac6a1f4 commit 9009a9c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 23 deletions.
23 changes: 23 additions & 0 deletions assets/core/plugin/js/plugin-index.js
Expand Up @@ -22,6 +22,8 @@ window.jQuery(function ($) {
self.$makePlugin = $('.__xe_make_plugin')
self.$makeTheme = $('.__xe_make_theme')
self.$makeSkin = $('.__xe_make_skin')

self.$selfDeactive = $('.__xe_self_deactivate_plugin')
},
bindEvents: function () {
self.$checkAll.on('click', self.checkAll)
Expand All @@ -34,6 +36,8 @@ window.jQuery(function ($) {
self.$makePlugin.on('click', self.makePlugin)
self.$makeTheme.on('click', self.makeTheme)
self.$makeSkin.on('click', self.makeSkin)

self.$selfDeactive.on('click', self.selfDeactive)
},
reset: function () {
var $checked = $('.__xe_checkbox:checked')
Expand Down Expand Up @@ -129,6 +133,25 @@ window.jQuery(function ($) {
var url = self.$makeSkin.attr('href')
XE.pageModal(url)

return false
},
selfDeactive: function () {
$('.__xe_checkbox').prop('checked', false)
// $(this).parents('li').children('.list-group-item-checkbox').children('.xe-label').children('.__xe_checkbox').prop('checked', true)
$(this).parents('li').children('.list-group-item-checkbox').find('.__xe_checkbox').prop('checked', true)

var pluginIds = self.checkedList()
if (pluginIds.length === 0) {
return false
}
var options = {
'data': {
'pluginId': pluginIds.join()
}
}
var url = self.$deactivate.attr('href')
XE.pageModal(url, options)

return false
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/xe.php
Expand Up @@ -214,7 +214,7 @@
'ordering' => 200
],
'plugin.setting' => [
'title' => 'xe::settings',
'title' => 'xe::siteToken',
'display' => true,
'description' => '',
'ordering' => 300
Expand Down
20 changes: 12 additions & 8 deletions resources/lang/common.php
Expand Up @@ -762,8 +762,12 @@
'en' => 'Plugin',
],
'pluginAndUpdate' => [
'ko' => '플러그인 & 업데이트',
'en' => 'Plugin & Update',
'ko' => '플러그인',
'en' => 'Plugin',
],
'siteToken' => [
'ko' => '사이트 토큰',
'en' => 'Site token'
],
'coreUpdate' => [
'ko' => 'XE3 업데이트',
Expand Down Expand Up @@ -1633,16 +1637,16 @@
'en' => 'Contents',
],
'pluginList' => [
'ko' => '플러그인 목록',
'en' => 'Plugin list',
'ko' => '설치된 플러그인',
'en' => 'Installed plugin',
],
'pluginInstalled' => [
'ko' => '설치된 플러그인',
'en' => 'Installed Plugins',
],
'fetchedPlugin' => [
'ko' => '자료실 플러그인',
'en' => 'Fetched plugins from Market',
'ko' => '스토어 플러그인',
'en' => 'Fetched plugins from Store',
],
'selfInstalledPlugin' => [
'ko' => '직접 설치한 플러그인',
Expand Down Expand Up @@ -2347,8 +2351,8 @@
'en' => 'Install new Plugin',
],
'installPlugin' => [
'ko' => '플러그인 설치',
'en' => 'Install Plugin',
'ko' => '플러그인 추가',
'en' => 'Add Plugin',
],
'inputNewPluginId' => [
'ko' => '새로 설치할 플러그인의 아이디를 입력하세요.',
Expand Down
29 changes: 15 additions & 14 deletions resources/views/plugin/skins/default/index/item.blade.php
Expand Up @@ -7,7 +7,7 @@
</label>
</div>
<div class="left-group">
<a href="{{ route('settings.plugins.show', [$plugin->getId()]) }}" class="plugin-title">{{ $plugin->getTitle() }}</a>
<span class="plugin-title">{{ $plugin->getTitle() }}</span>
<dl>
<dt class="sr-only">version</dt>
<dd>Version {{ $plugin->getVersion() }}</dd>
Expand All @@ -21,18 +21,10 @@
</dd>
<dt class="sr-only">{{ xe_trans('xe::installPath') }}</dt>
<dd>plugins/{{ $plugin->getId() }}</dd>
<dt class="sr-only">{{ xe_trans('xe::pluginDetails') }}</dt>
<dd><a href="{{ route('settings.plugins.show', [$plugin->getId()]) }}">상세보기</a></dd>
</dl>
<p class="ellipsis">{{ $plugin->getDescription() }}</p>
{{-- component list --}}
@foreach($componentTypes as $type => $typeText)
@if(!empty($group = $plugin->getComponentList($type)))
<span class="label label-{{ $color[$type] }}" data-html="true" title="
@foreach($group as $key => $component)
{!! $loop->index > 0 ? '<br>' : '' !!}{{ $component['name'] }}
@endforeach
" data-toggle="tooltip">{{ $type }}</span>
@endif
@endforeach

@if(array_has($unresolvedComponents, $plugin->getId()))
<hr>
Expand All @@ -59,10 +51,19 @@
</form>
@endif
</div>
<div class="btn-right">
<div class="btn-right form-inline">
@if ($plugin->isActivated() == true)
<button type="button" class="xe-btn __xe_self_deactivate_plugin">비활성화</button>
@else
<form method="post" action="{{ route('settings.plugins.manage.activate') }}" class="form-inline">
{!! csrf_field() !!}
<input type="hidden" name="pluginId" value="{{ $plugin->getId() }}">
<button type="submit" class="xe-btn xe-btn-positive-outline">활성화</button>
</form>
@endif

@if($plugin->isActivated() && ($plugin->getSettingsURI() !== null) )
<a class="btn-link"
href="{{ $plugin->getSettingsURI() }}">{{ xe_trans('xe::settings') }}</a>
<a class="xe-btn xe-btn-positive-outline" href="{{ $plugin->getSettingsURI() }}">{{ xe_trans('xe::settings') }}</a>
@endif
</div>
</li>

0 comments on commit 9009a9c

Please sign in to comment.