Merge branch 'develop' of https://github.com/getgrav/grav-plugin-admin into develop

This commit is contained in:
Andy Miller
2015-09-07 15:39:17 -06:00
6 changed files with 23 additions and 11 deletions

View File

@@ -18,6 +18,8 @@ var bytesToSize = function(bytes) {
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
};
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
$(function () {
jQuery.substitute = function(str, sub) {
return str.replace(/\{(.+?)\}/g, function($0, $1) {
@@ -71,7 +73,8 @@ $(function () {
startAngle: 0,
total: 100,
showLabel: false,
height: 150
height: 150,
chartPadding: !isFirefox ? 5 : 10
};
UpdatesChart = Chartist.Pie('.updates-chart .ct-chart', data, options);
@@ -436,10 +439,13 @@ $(function () {
template = el.find('[data-collection-template="new"]').html();
// make sortable
new Sortable(holder[0], { onUpdate: function () {
if (isArray)
reIndex(el);
} });
new Sortable(holder[0], {
filter: '.form-input-wrapper',
onUpdate: function () {
if (isArray)
reIndex(el);
}
});
// hook up delete
el.on('click', '[data-action="delete"]', function (e) {

View File

@@ -163,8 +163,14 @@ $(function(){
$('input[name="folder"]').on('input', function(e){
var start = this.selectionStart,
end = this.selectionEnd;
value = $(this).val().toLowerCase().replace(/\s/g, '-').replace(/[^a-z0-9_\-]/g, '');
$(this).val(value);
// restore cursor position
this.setSelectionRange(start, end);
});
childrenToggles.on('click', function () {

View File

@@ -52,7 +52,8 @@
startAngle: 0,
total: 100,
showLabel: false,
height: 150
height: 150,
chartPadding: !isFirefox ? 5 : 10
};
Chartist.Pie('.backups-chart .ct-chart', data, options);
</script>
@@ -80,7 +81,7 @@
};
var options = {
height: 164,
chartPadding:5,
chartPadding: !isFirefox ? 5 : 25,
axisX: {
showGrid: false,

View File

@@ -15,7 +15,7 @@
{% if field.value_only != true %}
<input data-grav-array-type="key" type="text" value="{{ key }}" placeholder="{{ field.placeholder_key|e|tu }}" />
{% endif %}
<input data-grav-array-type="value" type="text" name="{{ (field.name|fieldName) ~ '[' ~ key ~ ']' }}" value="{{ text|join(', ') }}" placeholder="{{ field.placeholder_value }}" />
<input data-grav-array-type="value" type="text" name="{{ (field.name|fieldName) ~ '[' ~ key ~ ']' }}" value="{{ text|join(', ') }}" placeholder="{{ field.placeholder_value|e|tu }}" />
<span data-grav-array-action="rem" class="fa fa-minus"></span>
<span data-grav-array-action="add" class="fa fa-plus"></span>
</div>

View File

@@ -11,7 +11,7 @@
{% if context.exists %}
{% set page_url = base_url ~ '/pages' ~ (context.header.routes.default ?: context.rawRoute) %}
{% set exists = true %}
{% set title = (context.exists ? "PLUGIN_ADMIN.EDIT"|tu : "PLUGIN_ADMIN.CREATE"|tu ) ~ " " ~ context.header.title %}
{% set title = (context.exists ? "PLUGIN_ADMIN.EDIT"|tu : "PLUGIN_ADMIN.CREATE"|tu ) ~ " " ~ (context.header.title ?: context.title) %}
{% else %}
{% set title = "PLUGIN_ADMIN.ADD_PAGE"|tu %}
{% endif %}
@@ -319,4 +319,3 @@
</form>
</div>
{% endblock %}

View File

@@ -23,7 +23,7 @@
<span class="gpm-version">v{{ plugin.version }}</span>
</td>
<td class="gpm-actions">
{% if (not installing and plugin.form.fields.enabled and (plugin.form.fields.enabled.type != 'hidden')) %}
{% if (not installing and (plugin.form.fields.enabled.type != 'hidden')) %}
<a class="{{ data.get('enabled') ? 'enabled' : 'disabled' }}" href="{{ base_url_relative }}/plugins/{{ slug }}/task{{ config.system.param_sep }}{{ data.get('enabled') ? 'disable' : 'enable' }}">
<i class="fa fa-fw fa-toggle-{{ data.get('enabled') ? 'on' : 'off' }}"></i>
</a>