Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button enhancement #48

Merged
merged 6 commits into from
Oct 25, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions block_evasys_sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ public function get_content() {
'nostudents' => $nostudents,
'emailsentnotice' => $emailsentnotice,
'evaluationperiodsetnotice' => $periodsetnotice,
// Defines if an lsf course is already mapped to the moodle course.
'optional' => !empty($evasyscourses),
// Outputs a warning that there are open course when there shouldn't.
'warning' => $warning
);
Expand Down
3 changes: 2 additions & 1 deletion lang/de/block_evasys_sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
$string['direct_invite_checkbox'] = 'Evaluation sofort starten';
$string['reactivate_invite'] = 'Einladung erneut durchführen';
$string['warning_inconsistent_states'] = "Einige Umfragen sind geöffnet, aber alle Umfragen sollten geschlossen sein.";
$string['change_mapping'] = "Zugeordnete Veranstaltungen auswählen";
$string['change_mapping'] = "Weitere Veranstaltungen zuordnen";
$string['semester'] = "Semester";
$string['optional'] = "(Optional)";

// Multi allocation strings.

Expand Down
1 change: 1 addition & 0 deletions lang/en/block_evasys_sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
$string['direct_invite_checkbox'] = 'Start evaluation immediately';
$string['reactivate_invite'] = 'Invite students again';
$string['warning_inconsistent_states'] = "There are some open surveys, but all surveys should be closed.";
$string['optional'] = '(optional)';

// Multi allocation strings.

Expand Down
28 changes: 14 additions & 14 deletions templates/block.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Example context (json):
"c_participants": 8,
"surveys": [
{
"fromName": "Umfrage zur Vorlesung",
"formName": "Umfrage zur Vorlesung",
"surveystatus": "Evaluationsstatus: offen",
"amountOfCompleteForms": 3
}
Expand All @@ -34,13 +34,9 @@ Example context (json):
}
}}

<form action="{{href}}" method="post" id="evasys_block_form">
<input type="hidden" name="sesskey" value="{{sesskey}}">
<input type="hidden" name="courseid" value="{{courseid}}">
{{#startdisabled}}<input id="only_end" type="hidden" name="only_end" value="true">{{/startdisabled}}
{{#nostudents}}<span style="color: orange; ">{{# str}}syncnostudents, block_evasys_sync{{/str}}</span>{{/nostudents}}
{{#courses}}
{{#.}}
{{#nostudents}}<span style="color: orange; ">{{# str}}syncnostudents, block_evasys_sync{{/str}}</span>{{/nostudents}}
{{#courses}}
{{#.}}
<div title="{{# str}}evacourseid, block_evasys_sync{{/str}} {{evasyscourseid}}
{{# str}}evainternalid, block_evasys_sync{{/str}} {{technicalid}}">
<span class="emphasize">{{# str}}evacoursename, block_evasys_sync{{/str}}</span> {{evasyscoursetitle}}</div>
Expand All @@ -60,8 +56,15 @@ Example context (json):
{{/.}}
{{/surveys}}
</ol>
{{/.}}
{{/courses}}
{{/.}}
{{/courses}}
{{#coursemappingenabled}}
{{> block_evasys_sync/coursemapping}}
{{/coursemappingenabled}}
<form action="{{href}}" method="post" id="evasys_block_form">
<input type="hidden" name="sesskey" value="{{sesskey}}">
<input type="hidden" name="courseid" value="{{courseid}}">
{{#startdisabled}}<input id="only_end" type="hidden" name="only_end" value="true">{{/startdisabled}}
{{#warning}}<div style="color: red; ">{{# str}}warning_inconsistent_states, block_evasys_sync{{/str}}</div>{{/warning}}
{{#emailsentnotice}}<div style="color: limegreen; ">{{# str}}emailsentnotice, block_evasys_sync{{/str}}</div>{{/emailsentnotice}}
{{#evaluationperiodsetnotice}}<div style="color: limegreen; ">{{# str}}evalperiodsetnotice, block_evasys_sync{{/str}}</div>{{/evaluationperiodsetnotice}}
Expand Down Expand Up @@ -104,7 +107,4 @@ Example context (json):
<input id='evasyssubmitbutton' class="in_box_button" type="submit" value="{{# str}}planorstartevaluation, block_evasys_sync{{/str}}" {{enddisabled}}/>
{{/direct}}
{{/showcontrols}}
</form>
{{#coursemappingenabled}}
{{> block_evasys_sync/coursemapping}}
{{/coursemappingenabled}}
</form>
11 changes: 7 additions & 4 deletions templates/coursemapping.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ Example context (json):
}
}}

<form action="../blocks/evasys_sync/addcourse.php">
<input type="hidden" name="id" value="{{courseid}}">
<input type="submit" class="in_box_button" value="{{# str}}change_mapping, block_evasys_sync{{/str}}" {{#disabled}}disabled{{/disabled}}>
</form>
<div class="pl-1">
<a class="iconsmall" title="{{# str}}change_mapping, block_evasys_sync{{/str}}" href="../blocks/evasys_sync/addcourse.php?id={{courseid}}">
{{#pix}}i/edit, core{{/pix}}
{{# str}}change_mapping, block_evasys_sync{{/str}}
{{#optional}}{{# str}}optional, block_evasys_sync{{/str}}{{/optional}}
</a>
</div>