Skip to content

Commit 31b4589

Browse files
schrejDaneEveritt
authored andcommitted
Contribution to feature/new-theme (pterodactyl#254)
* add translation to navigation * redesign base.api.index view add translations * remove license derp * translate never in base.api.index view * simplify user drop down for now add translations
1 parent 515e543 commit 31b4589

File tree

5 files changed

+149
-21
lines changed

5 files changed

+149
-21
lines changed

resources/lang/en/base.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
'header_sub' => 'Servers you own and have access to.',
88
'list' => 'Server List',
99
],
10+
'api' => [
11+
'index' => [
12+
'header' => 'API Access',
13+
'header_sub' => 'Manage your API access keys.',
14+
'list' => 'API Keys',
15+
'create_new' => 'Create new API key'
16+
],
17+
],
1018
'account' => [
1119
'header' => 'Your Account',
1220
'header_sub' => 'Manage your account details.',

resources/lang/en/navigation.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
return [
4+
'home' => 'Home',
5+
'account' => [
6+
'header' => 'ACCOUNT MANAGEMENT',
7+
'my_account' => 'My Account',
8+
'security_controls' => 'Security Controls',
9+
'api_access' => 'API Access',
10+
'my_servers' => 'My Servers'
11+
],
12+
'server' => [
13+
'header' => 'SERVER MANAGEMENT',
14+
'console' => 'Console',
15+
'file_management' => 'File Management',
16+
'file_browser' => 'File Browser',
17+
'create_file' => 'Create File',
18+
'upload_files' => 'Upload Files',
19+
'subusers' => 'Subusers',
20+
'task_management' => 'Task Management',
21+
'configuration' => 'Configuration',
22+
'port_allocations' => 'Port Allocations',
23+
'sftp_settings' => 'SFTP Settings',
24+
'startup_parameters' => 'Startup Parameters',
25+
'databases' => 'Databases'
26+
],
27+
];

resources/lang/en/strings.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,12 @@
2828
'configuration' => 'Configuration',
2929
'sftp' => 'SFTP',
3030
'databases' => 'Databases',
31+
'memo' => 'Memo',
32+
'created' => 'Created',
33+
'expires' => 'Expires',
34+
'public_key' => 'Public key',
35+
'api_access' => 'Api Access',
36+
'never' => 'never',
37+
'sign_out' => 'Sign out',
38+
'admin_control' => 'Admin Control'
3139
];
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
2+
3+
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
4+
{{-- of this software and associated documentation files (the "Software"), to deal --}}
5+
{{-- in the Software without restriction, including without limitation the rights --}}
6+
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
7+
{{-- copies of the Software, and to permit persons to whom the Software is --}}
8+
{{-- furnished to do so, subject to the following conditions: --}}
9+
10+
{{-- The above copyright notice and this permission notice shall be included in all --}}
11+
{{-- copies or substantial portions of the Software. --}}
12+
13+
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
14+
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
15+
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
16+
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
17+
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
18+
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
19+
{{-- SOFTWARE. --}}
20+
@extends('layouts.master')
21+
22+
@section('title')
23+
{{ trans('base.api.index.header') }}
24+
@endsection
25+
26+
@section('content-header')
27+
<h1>{{ trans('base.api.index.header') }}<small>{{ trans('base.api.index.header_sub')}}</small></h1>
28+
<ol class="breadcrumb">
29+
<li><a href="{{ route('index') }}">{{ trans('strings.home') }}</a></li>
30+
<li class="active">{{ trans('strings.api_access') }}</li>
31+
</ol>
32+
@endsection
33+
34+
@section('content')
35+
<div class="row">
36+
<div class="col-xs-12">
37+
<div class="box">
38+
<div class="box-header">
39+
<h3 class="box-title">{{ trans('base.api.index.list')}}</h3>
40+
</div>
41+
<div class="box-body table-responsive no-padding">
42+
<table class="table table-hover">
43+
<tbody>
44+
<tr>
45+
<th>{{ trans('strings.public_key') }}</th>
46+
<th>{{ trans('strings.memo') }}</th>
47+
<th class="text-center hidden-sm hidden-xs">{{ trans('strings.created') }}</th>
48+
<th class="text-center hidden-sm hidden-xs">{{ trans('strings.expires') }}</th>
49+
<th></th>
50+
</tr>
51+
@foreach ($keys as $key)
52+
<tr>
53+
<td><code>{{ $key->public }}</code></td>
54+
<td>{{ $key->memo }}</td>
55+
<td class="text-center hidden-sm hidden-xs">
56+
{{ (new Carbon($key->created_at))->toDayDateTimeString() }}
57+
</td>
58+
<td class="text-center hidden-sm hidden-xs">
59+
@if(is_null($key->expires_at))
60+
<span class="label label-default">@lang('strings.never')</span>
61+
@else
62+
{{ (new Carbon($key->expires_at))->toDayDateTimeString() }}
63+
@endif
64+
</td>
65+
<td class="text-center">
66+
<a href="#delete" class="text-danger" data-action="delete" data-attr="{{ $key->public}}"><i class="fa fa-trash"></i></a>
67+
</td>
68+
</tr>
69+
@endforeach
70+
</tbody>
71+
</table>
72+
</div>
73+
<div class="box-footer">
74+
<a href="{{ route('account.api.new') }}">
75+
<button class="btn btn-sm btn-success">{{ trans('base.api.index.create_new') }}</button>
76+
</a>
77+
</div>
78+
</div>
79+
</div>
80+
</div>
81+
@endsection

resources/themes/pterodactyl/layouts/master.blade.php

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,16 @@
5555
</a>
5656
<div class="navbar-custom-menu">
5757
<ul class="nav navbar-nav">
58-
<li class="dropdown user user-menu">
58+
<li class="dropdown user-menu">
5959
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
6060
<img src="https://www.gravatar.com/avatar/{{ md5(Auth::user()->email) }}?s=160" class="user-image" alt="User Image">
61-
<span class="hidden-xs">{{ Auth::user()->name_first }} {{ Auth::user()->name_last }}</span>
61+
<span class="hidden-xs">{{ Auth::user()->name_first }} {{ Auth::user()->name_last }}</span> <span class="caret"></span>
6262
</a>
63-
<ul class="dropdown-menu">
63+
<ul class="dropdown-menu" role="menu">
64+
<li><a href="{{ route('admin.index') }}">@lang('strings.admin_control')</a></li>
65+
<li><a href="{{ route('auth.logout') }}">@lang('strings.sign_out')</a></li>
66+
</ul>
67+
{{-- <ul class="dropdown-menu">
6468
<li class="user-header">
6569
<p>
6670
<small>Member since Nov. 2012</small>
@@ -87,7 +91,7 @@
8791
<a href="{{ route('auth.logout') }}" class="btn btn-default btn-flat">Sign out</a>
8892
</div>
8993
</li>
90-
</ul>
94+
</ul> --}}
9195
</li>
9296
<li>
9397
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears" style="margin-top:4px;padding-bottom:2px;"></i></a>
@@ -107,46 +111,46 @@
107111
</div>
108112
@endif
109113
<ul class="sidebar-menu">
110-
<li class="header">ACCOUNT MANAGEMENT</li>
114+
<li class="header">{{ trans('navigation.account.header') }}</li>
111115
<li class="{{ Route::currentRouteName() !== 'account' ?: 'active' }}">
112116
<a href="{{ route('account')}}">
113-
<i class="fa fa-user"></i> <span>My Account</span>
117+
<i class="fa fa-user"></i> <span>{{ trans('navigation.account.my_account') }}</span>
114118
</a>
115119
</li>
116120
<li class="{{ Route::currentRouteName() !== 'account.security' ?: 'active' }}">
117121
<a href="{{ route('account.security')}}">
118-
<i class="fa fa-lock"></i> <span>Security Controls</span>
122+
<i class="fa fa-lock"></i> <span>{{ trans('navigation.account.security_controls') }}</span>
119123
</a>
120124
</li>
121125
<li class="{{ Route::currentRouteName() !== 'account.api' ?: 'active' }}">
122126
<a href="{{ route('account.api')}}">
123-
<i class="fa fa-code"></i> <span>API Access</span>
127+
<i class="fa fa-code"></i> <span>{{ trans('navigation.account.api_access') }}</span>
124128
</a>
125129
</li>
126130
<li class="{{ Route::currentRouteName() !== 'index' ?: 'active' }}">
127131
<a href="{{ route('index')}}">
128-
<i class="fa fa-server"></i> <span>My Servers</span>
132+
<i class="fa fa-server"></i> <span>{{ trans('navigation.account.my_servers') }}</span>
129133
</a>
130134
</li>
131135
@if (isset($server->name) && isset($node->name))
132-
<li class="header">SERVER MANAGEMENT</li>
136+
<li class="header">{{ trans('navigation.server.header') }}</li>
133137
<li class="{{ Route::currentRouteName() !== 'server.index' ?: 'active' }}">
134138
<a href="{{ route('server.index', $server->uuidShort) }}">
135-
<i class="fa fa-terminal"></i> <span>Console</span>
139+
<i class="fa fa-terminal"></i> <span>{{ trans('navigation.server.console') }}</span>
136140
</a>
137141
</li>
138142
<li class="treeview {{ Route::currentRouteName() !== 'server.files.index' ?: 'active' }}">
139143
<a href="#">
140144
<i class="fa fa-files-o"></i>
141-
<span>File Management</span>
145+
<span>{{ trans('navigation.server.file_management') }}</span>
142146
<span class="pull-right-container">
143147
<i class="fa fa-angle-left pull-right"></i>
144148
</span>
145149
</a>
146150
<ul class="treeview-menu">
147-
<li><a href="{{ route('server.files.index', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> File Browser</a></li>
148-
<li><a href="{{ route('server.files.add', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> Create File</a></li>
149-
<li><a href=""><i class="fa fa-angle-right"></i> Upload Files</a></li>
151+
<li><a href="{{ route('server.files.index', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> {{ trans('navigation.server.file_browser') }}</a></li>
152+
<li><a href="{{ route('server.files.add', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> {{ trans('navigation.server.create_file') }}</a></li>
153+
<li><a href=""><i class="fa fa-angle-right"></i> {{ trans('navigation.server.upload_files') }}</a></li>
150154
</ul>
151155
</li>
152156
<li>
@@ -156,7 +160,7 @@
156160
</li>
157161
<li>
158162
<a href="{{ route('server.tasks', $server->uuidShort)}}">
159-
<i class="fa fa-clock-o"></i> <span>Task Management</span>
163+
<i class="fa fa-clock-o"></i> <span>{{ trans('navigation.server.task_management') }}</span>
160164
<span class="pull-right-container">
161165
<span class="label label-primary pull-right">4</span>
162166
</span>
@@ -169,16 +173,16 @@
169173
">
170174
<a href="#">
171175
<i class="fa fa-gears"></i>
172-
<span>Configuration</span>
176+
<span>{{ trans('navigation.server.configuration') }}</span>
173177
<span class="pull-right-container">
174178
<i class="fa fa-angle-left pull-right"></i>
175179
</span>
176180
</a>
177181
<ul class="treeview-menu">
178-
<li><a href=""><i class="fa fa-angle-right"></i> Port Allocations</a></li>
179-
<li class="{{ Route::currentRouteName() !== 'server.settings.sftp' ?: 'active' }}"><a href="{{ route('server.settings.sftp', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> SFTP Settings</a></li>
180-
<li><a href=""><i class="fa fa-angle-right"></i> Startup Parameters</a></li>
181-
<li class="{{ Route::currentRouteName() !== 'server.settings.databases' ?: 'active' }}"><a href="{{ route('server.settings.databases', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> Databases</a></li>
182+
<li><a href=""><i class="fa fa-angle-right"></i> {{ trans('navigation.server.port_allocations') }}</a></li>
183+
<li class="{{ Route::currentRouteName() !== 'server.settings.sftp' ?: 'active' }}"><a href="{{ route('server.settings.sftp', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> {{ trans('navigation.server.sftp_settings') }}</a></li>
184+
<li><a href=""><i class="fa fa-angle-right"></i> {{ trans('navigation.server.startup_parameters') }}</a></li>
185+
<li class="{{ Route::currentRouteName() !== 'server.settings.databases' ?: 'active' }}"><a href="{{ route('server.settings.databases', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> {{ trans('navigation.server.databases') }}</a></li>
182186
</ul>
183187
</li>
184188
@endif

0 commit comments

Comments
 (0)