Skip to content

Commit cf26e16

Browse files
author
r.tschu
committed
refactored block design to have checkbox unchecked by default
1 parent b7b4c79 commit cf26e16

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

amd/src/standardtime.js

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
define(['jquery'], function($) {
1+
define(['jquery', 'core/str'], function($, str) {
22
var init = function() {
3-
if ($('#activate_standard').length > 0) {
4-
$(document).on("change", "#activate_standard", function () {
3+
if ($('#deactivate_standard').length > 0) {
4+
$('#deactivate_standard').prop("disabled", false);
5+
$(document).on("change", "#deactivate_standard", function () {
56
if (this.checked) {
6-
$('#inputfieldset').prop("disabled", true);
7-
disable();
8-
} else {
97
$('#inputfieldset').prop("disabled", false);
8+
$('#activate_standard').prop("value", false);
9+
str.get_string('different_period', 'block_evasys_sync').done(function (s) {
10+
$('#evaluationperiod').text(s);
11+
});
1012
enable();
13+
} else {
14+
$('#inputfieldset').prop("disabled", true);
15+
$('#activate_standard').prop("value", true);
16+
str.get_string('standard_period', 'block_evasys_sync').done(function (s) {
17+
$('#evaluationperiod').text(s);
18+
});
19+
disable();
1120
}
1221
});
1322
}

lang/de/block_evasys_sync.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@
4141
$string['change_mapping'] = "Weitere Veranstaltungen zuordnen";
4242
$string['semester'] = "Semester";
4343
$string['optional'] = "(Optional)";
44-
$string['activate_nonstandard_time'] = "Vom Standard abweichenden Zeitraum verwenden.";
44+
$string['activate_nonstandard_time'] = "Evaluationszeitraum wegen Sonderveranstaltung ändern";
4545
$string['activate_standard_time'] = "Standardzeitraum verwenden";
46+
$string['standard_period'] = "Standard Evaluationszeitraum:";
47+
$string['different_period'] = "Abweichender Evaluationszeitraum:";
4648

4749
// Multi allocation strings.
4850

lang/en/block_evasys_sync.php

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
$string['reactivate_invite'] = 'Invite students again';
4242
$string['warning_inconsistent_states'] = "There are some open surveys, but all surveys should be closed.";
4343
$string['optional'] = '(optional)';
44+
$string['standard_period'] = "standard evaluationperiod:";
45+
$string['different_period'] = "non standard evaluationperiod:";
46+
$string['activate_nonstandard_time'] = "standard evaluationperiod:";
47+
$string['activate_standard_time'] = "non standard evaluationperiod:";
4448

4549
// Multi allocation strings.
4650

templates/block.mustache

+7-3
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ Example context (json):
7171
{{#evaluationperiodsetnotice}}<div style="color: limegreen; ">{{# str}}evalperiodsetnotice, block_evasys_sync{{/str}}</div>{{/evaluationperiodsetnotice}}
7272
{{#usestandardtimelayout}}
7373
<div>
74-
<input type="checkbox" id="activate_standard" name="activate_standard" checked>
75-
<label for="activate_standard">{{#str}}activate_standard_time, block_evasys_sync{{/str}}</label>
74+
<input type="hidden" id="activate_standard" name="activate_standart" value="true">
75+
<input type="checkbox" id="deactivate_standard" name="deactivate_standard" disabled>
76+
<label for="activate_standard">{{#str}}activate_nonstandard_time, block_evasys_sync{{/str}}</label>
7677
</div>
7778
{{/usestandardtimelayout}}
7879
{{#showcontrols}}
@@ -85,7 +86,10 @@ Example context (json):
8586
</label>
8687
</div>
8788
{{/startoption}}
88-
{{# str}}evaluationperiod, block_evasys_sync{{/str}}<br />
89+
{{^usestandardtimelayout}}{{# str}}evaluationperiod, block_evasys_sync{{/str}}<br />{{/usestandardtimelayout}}
90+
{{#usestandardtimelayout}}<span id="evaluationperiod">
91+
{{# str}}standard_period, block_evasys_sync{{/str}}
92+
</span><br/>{{/usestandardtimelayout}}
8993
{{#direct}}
9094
<div>
9195
<label for="direct_invite">

0 commit comments

Comments
 (0)