Skip to content

Commit

Permalink
Merge branch 'release/1.0.0-rc.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Oct 23, 2015
2 parents 534fbb3 + 20dd25c commit cf08d4f
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 40 deletions.
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
# v1.0.0-rc.1
## 10/23/2015

1. [](#new)
* Redirect to non-language URL except for `pages/`
1. [](#improved)
* New language strings for new `system.yaml` fields
* Improved Russian translations
* Improved compatibility with PECL Yaml parser
1. [](#bugfix)
* Redirect to correct page if you change folder/slug
* Fix issue with Asset pipeline not being disabled in admin
* Fix for HTML in text input fields
* Fixed various icons in headers

# v0.6.2
## 10/15/2015

1. [](#improved)
* Use `title` rather than `menu` in Page listing
* Wrapped language strings in double-quotes
* New language strings for
* New language strings for new fields
1. [](#bugfix)
* Fixed issue with IE not able to save pages

Expand Down
18 changes: 12 additions & 6 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use Grav\Common\GPM\GPM;
use Grav\Common\Grav;
use Grav\Common\Language\Language;
use Grav\Common\Page\Page;
use Grav\Common\Page\Pages;
use Grav\Common\Plugin;
Expand Down Expand Up @@ -108,6 +109,10 @@ public function onPluginsInitialized()
$this->initializeAdmin();
}

// Disable Asset pipelining
$this->config->set('system.assets.css_pipeline', false);
$this->config->set('system.assets.js_pipeline', false);

// We need popularity no matter what
require_once __DIR__ . '/classes/popularity.php';
$this->popularity = new Popularity();
Expand All @@ -123,10 +128,6 @@ public function onPagesInitialized()
// Set original route for the home page.
$home = '/' . trim($this->config->get('system.home.alias'), '/');

// Disable Asset pipelining
$this->config->set('system.assets.css_pipeline', false);
$this->config->set('system.assets.js_pipeline', false);

// set the default if not set before
$this->session->expert = $this->session->expert ?: false;

Expand Down Expand Up @@ -345,8 +346,6 @@ protected function initializeAdmin()
}
}



// Decide admin template and route.
$path = trim(substr($this->uri->route(), strlen($this->base)), '/');
$this->template = 'dashboard';
Expand All @@ -357,6 +356,13 @@ protected function initializeAdmin()
$this->route = array_shift($array);
}

/** @var Language $language */
$require_language = ['pages', 'translations'];
$language = $this->grav['language'];
if ($language->isLanguageInUrl() && !in_array($this->template, $require_language)) {
$this->grav->redirect($this->uri->route());
}

// Initialize admin class.
require_once __DIR__ . '/classes/admin.php';
$this->admin = new Admin($this->grav, $this->base, $this->template, $this->route);
Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Admin Panel
version: 0.6.2
version: 1.0.0-rc.1
description: Adds an advanced administration panel to manage your site
icon: empire
author:
Expand Down
4 changes: 3 additions & 1 deletion classes/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -998,8 +998,10 @@ public function taskSave()
$obj->language($this->grav['session']->admin_lang);
}
}
$admin_route = $this->grav['config']->get('plugins.admin.route');
$redirect_url = '/' . ($multilang ? ($obj->language()) : '') . $admin_route . '/' . $this->view . $obj->route();

$this->setRedirect('/' . ($multilang ? ($obj->language()) : '') . $this->grav['uri']->route());
$this->setRedirect($redirect_url);
}

return true;
Expand Down
60 changes: 34 additions & 26 deletions languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ en:
PAGE_SUMMARY: "Page Summary"
ENABLED: "Enabled"
ENABLED_HELP: "Enable page summary (the summary returns the same as the page content)"
YES: "Yes"
NO: "No"
'YES': "Yes"
'NO': "No"
SUMMARY_SIZE: "Summary Size"
SUMMARY_SIZE_HELP: "The amount of characters of a page to use as a content summary"
FORMAT: "Format"
Expand Down Expand Up @@ -236,8 +236,8 @@ en:
FOLDER_NAME: "Folder Name"
FOLDER_NAME_HELP: "The folder name that will be stored in the filesystem for this page"
PARENT: "Parent"
DEFAULT_OPTION_ROOT: "'- Root -'"
DEFAULT_OPTION_SELECT: "'- Select -'"
DEFAULT_OPTION_ROOT: "- Root -"
DEFAULT_OPTION_SELECT: "- Select -"
DISPLAY_TEMPLATE: "Display Template"
DISPLAY_TEMPLATE_HELP: "The page type that translates into which twig template renders the page"
BODY_CLASSES: "Body Classes"
Expand Down Expand Up @@ -421,9 +421,9 @@ en:
DEFAULT_DATE_FORMAT_HELP: "Page date format used by Grav. By default, Grav attempts to guess your date format, however you can specifiy a format using PHP's date syntax (e.g.: Y-m-d H:i)"
DEFAULT_DATE_FORMAT_PLACEHOLDER: "Guess automatically if blank"
IGNORE_FILES: "Ignore files"
IGNORE_FILES_HELP: "Files to ignore when processing pages"
IGNORE_FILES_HELP: "Specific files to ignore when processing pages"
IGNORE_FOLDERS: "Ignore folders"
IGNORE_FOLDERS_HELP: "Folders to ignore when processing pages"
IGNORE_FOLDERS_HELP: "Specific folders to ignore when processing pages"
HTTP_ACCEPT_LANGUAGE: "Set language from browser"
HTTP_ACCEPT_LANGUAGE_HELP: "You can opt to try to set the language based on `http_accept_language` header tag in the browser"
OVERRIDE_LOCALE: "Override locale"
Expand All @@ -433,6 +433,12 @@ en:
PLUGIN_STATUS: "Plugin status"
INCLUDE_DEFAULT_LANG: "Include default language"
INCLUDE_DEFAULT_LANG_HELP: "This will prepend all URLs in the default language with the default language. e.g. `/en/blog/my-post`"
ALLOW_URL_TAXONOMY_FILTERS: "URL Taxonomy Filters"
ALLOW_URL_TAXONOMY_FILTERS_HELP: "Page-based collections allow you to filter via `/taxonomy:value`."
REDIRECT_DEFAULT_CODE: "Default redirect code"
REDIRECT_DEFAULT_CODE_HELP: "The HTTP status code to use for redirects"
IGNORE_HIDDEN: "Ignore hidden"
IGNORE_HIDDEN_HELP: "Ignore all files and folders that being with a DOT"
es:
PLUGIN_ADMIN:
ADMIN_BETA_MSG: "¡Está es una versión Beta! Utilízala bajo tu propio riesgo..."
Expand Down Expand Up @@ -626,8 +632,8 @@ es:
PAGE_SUMMARY: "Page Summary"
ENABLED: "Enabled"
ENABLED_HELP: "Enable page summary (the summary returns the same as the page content)"
YES: "Yes"
NO: "No"
'YES': "Yes"
'NO': "No"
SUMMARY_SIZE: "Summary Size"
SUMMARY_SIZE_HELP: "The amount of characters of a page to use as a content summary"
FORMAT: "Format"
Expand Down Expand Up @@ -671,8 +677,8 @@ es:
FOLDER_NAME: "Folder Name"
FOLDER_NAME_HELP: "The folder name that will be stored in the filesystem for this page"
PARENT: "Parent"
DEFAULT_OPTION_ROOT: "'- Root -'"
DEFAULT_OPTION_SELECT: "'- Select -'"
DEFAULT_OPTION_ROOT: "- Root -"
DEFAULT_OPTION_SELECT: "- Select -"
DISPLAY_TEMPLATE: "Display Template"
DISPLAY_TEMPLATE_HELP: "The page type that translates into which twig template renders the page"
BODY_CLASSES: "Body Classes"
Expand Down Expand Up @@ -1042,8 +1048,8 @@ it:
PAGE_SUMMARY: "Sommario pagina"
ENABLED: "Abilitato"
ENABLED_HELP: "Abilita il sommario pagina (il sommario viene preso dal contenuto della pagina)"
YES: "Si"
NO: "No"
'YES': "Si"
'NO': "No"
SUMMARY_SIZE: "Dimensione del sommario"
SUMMARY_SIZE_HELP: "Il numero di caratteri del contenuto della pagina da usare come sommario"
FORMAT: "Formato"
Expand Down Expand Up @@ -1086,8 +1092,8 @@ it:
FOLDER_NAME: "Nome Cartella"
FOLDER_NAME_HELP: "Il nome della cartella che sarà memorizzato nel filesystem per questa pagina"
PARENT: "Padre"
DEFAULT_OPTION_ROOT: "'- Root -'"
DEFAULT_OPTION_SELECT: "'- Seleziona -'"
DEFAULT_OPTION_ROOT: "- Root -"
DEFAULT_OPTION_SELECT: "- Seleziona -"
DISPLAY_TEMPLATE: "Template di visualizzazione"
DISPLAY_TEMPLATE_HELP: "Il tipo di pagina si traduce in quale template Twig genera la pagina"
BODY_CLASSES: "Classi body"
Expand Down Expand Up @@ -1474,8 +1480,8 @@ de:
PAGE_SUMMARY: "Seitenzusammenfassung"
ENABLED: "Aktiviert"
ENABLED_HELP: "Aktiviert die Seitenzusammenfasung (die Seitenzusammenfassung entspricht dem Inhalt der Seite)"
YES: "Ja"
NO: "Nein"
'YES': "Ja"
'NO': "Nein"
SUMMARY_SIZE: "Zusammenfassungslänge"
SUMMARY_SIZE_HELP: "Länge der Zusammenfassung in Buchstaben"
FORMAT: "Format"
Expand Down Expand Up @@ -1519,8 +1525,8 @@ de:
FOLDER_NAME: "Ordnername"
FOLDER_NAME_HELP: "Name des Ordners, der für diese Seite angelegt werden sollen"
PARENT: "Übergeordnet"
DEFAULT_OPTION_ROOT: "'- Ursprung -'"
DEFAULT_OPTION_SELECT: "'- Auswählen -'"
DEFAULT_OPTION_ROOT: "- Ursprung -"
DEFAULT_OPTION_SELECT: "- Auswählen -"
DISPLAY_TEMPLATE: "Template anzeigen"
DISPLAY_TEMPLATE_HELP: "Der Seitentyp der zur Wahl des richtigen Twig Templates verwendet wird."
BODY_CLASSES: "Body Klassen"
Expand Down Expand Up @@ -1889,8 +1895,8 @@ ja:
PAGE_SUMMARY: "ページ要約"
ENABLED: "有効"
ENABLED_HELP: "ページ要約を有効にします (要約はページコンテンツと同じです)"
YES: "はい"
NO: "いいえ"
'YES': "はい"
'NO': "いいえ"
SUMMARY_SIZE: "要約サイズ"
SUMMARY_SIZE_HELP: "要約する文字数"
FORMAT: "フォーマット"
Expand Down Expand Up @@ -1937,8 +1943,8 @@ ja:
FOLDER_NAME: "フォルダ名"
FOLDER_NAME_HELP: "このページが入るフォルダ名"
PARENT: ""
DEFAULT_OPTION_ROOT: "'- Root -'"
DEFAULT_OPTION_SELECT: "'- Select -'"
DEFAULT_OPTION_ROOT: "- Root -"
DEFAULT_OPTION_SELECT: "- Select -"
DISPLAY_TEMPLATE: "表示テンプレート"
DISPLAY_TEMPLATE_HELP: "ページを変換するtwigテンプレートタイプ"
BODY_CLASSES: "ボディクラス"
Expand Down Expand Up @@ -2323,8 +2329,8 @@ ru:
PAGE_SUMMARY: "Страница Резюме"
ENABLED: "Включено"
ENABLED_HELP: "Включить страницу резюме (резюме возвращает то же самое, что и содержание страницы)"
YES: "Да"
NO: "Нет"
'YES': "Да"
'NO': "Нет"
SUMMARY_SIZE: "Размер Резюме"
SUMMARY_SIZE_HELP: "Количество символов страницы, чтобы использовать в качестве резюме содержания"
FORMAT: "Формат"
Expand Down Expand Up @@ -2368,8 +2374,8 @@ ru:
FOLDER_NAME: "Имя папки"
FOLDER_NAME_HELP: "Имя папки, которое будут храниться в файловой системе для этой страницы"
PARENT: "Родитель"
DEFAULT_OPTION_ROOT: "'- Корень -'"
DEFAULT_OPTION_SELECT: "'- Выбрать -'"
DEFAULT_OPTION_ROOT: "- Корень -"
DEFAULT_OPTION_SELECT: "- Выбрать -"
DISPLAY_TEMPLATE: "Шаблон отображения"
DISPLAY_TEMPLATE_HELP: "Тип страницы, который определяет какая ветка шаблона отображает страницу"
BODY_CLASSES: "Класс Страницы"
Expand Down Expand Up @@ -2563,3 +2569,5 @@ ru:
REDIRECT: "Страница редиректа"
REDIRECT_HELP: "Введите адрес страницы или внешний URL для страницы сайта, чтобы перенаправить например, '/some/route' или 'http://somesite.com'"
PLUGIN_STATUS: "Статус плагина"
INCLUDE_DEFAULT_LANG: "Включить язык по умочанию"
INCLUDE_DEFAULT_LANG_HELP: "Это позволит добавить все URL-адреса по умолчанию, язык по умолчанию. Например, `/en/blog/my-post`"
2 changes: 1 addition & 1 deletion themes/grav/templates/forms/field.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<input
{# required attribute structures #}
name="{{ (scope ~ field.name)|fieldName }}"
value="{{ value|join(', ') }}"
value="{{ value|e('html_attr')|join(', ') }}"
{# input attribute structures #}
{% block input_attributes %}
{% if field.classes is defined %}class="{{ field.classes }}" {% endif %}
Expand Down
2 changes: 1 addition & 1 deletion themes/grav/templates/info.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="button-bar">
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
</div>
<h1><i class="fa fa-fw fa-th"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ "PLUGIN_ADMIN.PHP_INFO"|tu }}</h1>
<h1><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ "PLUGIN_ADMIN.PHP_INFO"|tu }}</h1>
{% endblock %}

{% block content_top %}
Expand Down
2 changes: 1 addition & 1 deletion themes/grav/templates/site.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> Save</button>
</div>
<h1><i class="fa fa-fw fa-th"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ "PLUGIN_ADMIN.SITE"|tu }}</h1>
<h1><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ "PLUGIN_ADMIN.SITE"|tu }}</h1>
{% endblock %}

{% block content_top %}
Expand Down
2 changes: 1 addition & 1 deletion themes/grav/templates/system.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
</div>
<h1><i class="fa fa-fw fa-th"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ "PLUGIN_ADMIN.SYSTEM"|tu }}</h1>
<h1><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ "PLUGIN_ADMIN.SYSTEM"|tu }}</h1>
{% endblock %}

{% block content_top %}
Expand Down
2 changes: 1 addition & 1 deletion themes/grav/templates/themes.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{% endif %}
{% endif %}
</div>
<h1><i class="fa fa-fw fa-plug"></i> {{ "PLUGIN_ADMIN.THEMES"|tu }}</h1>
<h1><i class="fa fa-fw fa-tint"></i> {{ "PLUGIN_ADMIN.THEMES"|tu }}</h1>
{% else %}
{% if (installed) %}
<div class="button-bar">
Expand Down

0 comments on commit cf08d4f

Please sign in to comment.