Skip to content

Commit

Permalink
=
Browse files Browse the repository at this point in the history
  • Loading branch information
arikaim-repository committed Mar 6, 2020
1 parent d1a1841 commit 0c9c13e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
7 changes: 4 additions & 3 deletions copyright/copyright.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{% set current_year = currentYear() %}
{% set text_class = text_class|default('text-gray-500') %}
{% set company = company|default(labels.default) %}
<i class="icon copyright {{ icon_class }}"></i>
{% if hide_label != true %}
<span class="text-gray-500">{{ labels.label }}</span>
<span class="{{ text_class }}">{{ labels.label }}</span>
{% endif %}
<span class="text-gray-500">
<span class="{{ text_class }}">
{% if from_year is not empty and from_year < current_year %}
{{ from_year }} -
{% endif %}
{{ current_year }}
</span>
<span class="ml-2">{{ company }}</span>
<span class="ml-2 {{ text_class }}">{{ company }}</span>
12 changes: 12 additions & 0 deletions form/fields/checkbox/checkbox.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% set label = label|default(name) %}
{% set id = id|default(name) %}
<div class="field {{ class }}">
{% if field_label is not empty %}
<label>{{ field_label }}</label>
{% endif %}
<div class="ui checkbox checkbox-field {{ field_class }}">
<input type="checkbox" {{ value|ifthen(1,'checked') }} data-field-id="{{ id }}">
<input type="hidden" name="{{ name }}" value="{{ (value is empty) ? 0 : 1 }}" id="{{ id }}">
<label class="{{ label_class }}">{{ label }}</label>
</div>
</div>
14 changes: 14 additions & 0 deletions form/fields/checkbox/checkbox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use strict";

$(document).ready(function() {
$('.checkbox-field').checkbox({
onChecked: function() {
var fieldId = $(this).attr('data-field-id');
$('#' + fieldId).val(1);
},
onUnchecked: function() {
var fieldId = $(this).attr('data-field-id');
$('#' + fieldId).val(0);
}
});
});

0 comments on commit 0c9c13e

Please sign in to comment.