Skip to content

Commit

Permalink
Merge pull request ansible#1255 from craig-br/sec-attendance
Browse files Browse the repository at this point in the history
Changed sql and index var to controller
  • Loading branch information
IPvSean authored Aug 16, 2021
2 parents 580141d + cf344f1 commit 2a0eb98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion roles/workshop_attendance/templates/list.php.j2
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ display_header();
$students = db_fetch_assocs("SELECT * FROM `users`");
print "<table cellpadding=3 cellspacing=0 border=1><tr><td>Name</td><td>EMail</td><td>Student</td><td>VSCode</td><td>Automation controller</td><td>Gitlab</td><td>Delete</td></tr>\n";
foreach ($students as $s) {
print '<tr><td>' . $s['name'] . '</td><td>' . $s['email'] . '</td><td>' . $s['id'] . '</td><td><a target=_blank href="' . $s['vscode'] . '">VSCode</a></td><td><a target=_blank href="' . $s['Controller'] . '">Controller</a></td><td><a target=_blank href="' . $s['gitlab'] . '">Gitlab</a></td><td align=center>' . ($s['email'] != '' ? '<form method=POST><input type=hidden name=delete value=' . $s['id'] . '><input type=submit value=Delete data-icon=delete data-iconpos=notext></a></form>' : '') . "</td></tr>\n";
print '<tr><td>' . $s['name'] . '</td><td>' . $s['email'] . '</td><td>' . $s['id'] . '</td><td><a target=_blank href="' . $s['vscode'] . '">VSCode</a></td><td><a target=_blank href="' . $s['controller'] . '">Controller</a></td><td><a target=_blank href="' . $s['gitlab'] . '">Gitlab</a></td><td align=center>' . ($s['email'] != '' ? '<form method=POST><input type=hidden name=delete value=' . $s['id'] . '><input type=submit value=Delete data-icon=delete data-iconpos=notext></a></form>' : '') . "</td></tr>\n";
}
print "</table>";

Expand Down
4 changes: 2 additions & 2 deletions roles/workshop_attendance/templates/workshop.sql.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS `users` (
`vscode` varchar(512) DEFAULT '',
`vscode_display` varchar(512) DEFAULT '',
`gitlab` varchar(512) DEFAULT '',
`tower` varchar(512) DEFAULT '',
`controller` varchar(512) DEFAULT '',
`username` varchar(128) DEFAULT '',
`password` varchar(128) DEFAULT '',
`grade` varchar(6) DEFAULT '0',
Expand All @@ -19,7 +19,7 @@ CREATE TABLE IF NOT EXISTS `users` (
{% for host in groups['control_nodes'] %}
{% if hostvars[host].student is defined and "student" + number | string == hostvars[host].student %}
{% if hostvars[host].student is defined and "student" + number | string == hostvars[host].student %}
INSERT INTO `users` (`id`, `ip`, `vscode`, `vscode_display`, `gitlab`, `tower`, `username`, `password`) VALUES ({{ number }},'{{ hostvars[host].ansible_host }}',
INSERT INTO `users` (`id`, `ip`, `vscode`, `vscode_display`, `gitlab`, `controller`, `username`, `password`) VALUES ({{ number }},'{{ hostvars[host].ansible_host }}',
{% if workshop_type == "windows" %}
'https://student{{ number }}-code.{{ ec2_name_prefix }}.{{ workshop_dns_zone }}/?folder=vscode-remote%3A%2F%2Fstudent{{ number }}-code.{{ ec2_name_prefix }}.{{ workshop_dns_zone }}%2Fhome%2Fstudent{{ number }}%2Fwindows-workshop%2Fworkshop_project',
{% else %}
Expand Down

0 comments on commit 2a0eb98

Please sign in to comment.