Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
fix #30
Browse files Browse the repository at this point in the history
  • Loading branch information
kimbtech committed Jan 2, 2020
1 parent d7e7c78 commit a3ad799
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 23 deletions.
5 changes: 4 additions & 1 deletion core/Poll.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ public function showPollForm( $template ){
foreach( $this->pollsub->getValue( [$id] ) as $user){
$names[] = Utilities::optimizeOutputString( $user['name'] );
}
$anzval = '<ul class="list-group"><li class="list-group-item">' . implode( '</li><li class="list-group-item">', $names ). '</li></ul>';
$anzval = Utilities::getCollapseHtml(
LanguageManager::getTranslation("Teilnehm"),
'<ul class="list-group"><li class="list-group-item">' . implode( '</li><li class="list-group-item">', $names ). '</li></ul>'
);
}
else{
$anzval = '';
Expand Down
5 changes: 4 additions & 1 deletion core/PollAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ private function showInfo(){
"ANZAHL" => ($i-1) . $maxanz,
"HINWEISE" => Utilities::optimizeOutputString( $values["des"] ),
"TERMINID" => "termin_" . $id,
"TEILNEHMER" => implode( '</li><li class="list-group-item">', $submiss )
"TEILNEHMER" => Utilities::getCollapseHtml(
LanguageManager::getTranslation("Teilnehm"),
'<ul class="list-group"><li class="list-group-item">' . implode( '</li><li class="list-group-item">', $submiss ) . '</li></ul>'
)
);

$terminmeta["termin_" . $id] = array( $values["bez"], $values["anz"], $values["des"] );
Expand Down
11 changes: 10 additions & 1 deletion core/Utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Utilities{
/**
* The system's Version
*/
const SYS_VERSION = 'v1.1.2';
const SYS_VERSION = 'v1.1.3';

/**
* Possible chars for:
Expand Down Expand Up @@ -82,6 +82,15 @@ public static function randomCode( $len, $chars ){
public static function getRowHtml($first, $second, $clF = '', $clS = ''){
return '<div class="alert" role="alert"><div class="row"><div class="col-sm '. $clF .'">' . $first .'</div><div class="col-sm '. $clS .'">'. $second .'</div></div></div>';
}

public static function getCollapseHtml($name, $content){
$id = uniqid();
$html = '<div class="card collapseContent">';
$html .= '<div class="card-header">&#x25bc; ' . $name . '</div>';
$html .= '<div class="card-text">'. $content .'</div>';
$html .= '</div>';
return $html;
}
}

?>
10 changes: 3 additions & 7 deletions core/templates/admin_de.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ <h3>Termine</h3>
Hinweise zu den Terminen
</div>
</div>
<div class="alert alert-dark" role="alert">
<div class="container">
<!--MULTIPLE-Termin-BEGIN-->
<div class="row">
<div class="row admin-row">
<div class="col-sm">
<div class="form-group">
<p>
Expand All @@ -87,11 +87,7 @@ <h3>Termine</h3>
</div>
<div class="col-sm col-sm-10">
Ergebnisse für diesen Termin:
<ul class="list-group">
<li class="list-group-item">
%%TEILNEHMER%%
</li>
</ul>
%%TEILNEHMER%%
</div>
</div>
<!--MULTIPLE-Termin-END-->
Expand Down
10 changes: 3 additions & 7 deletions core/templates/admin_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ <h3>Options</h3>
Notes for each option
</div>
</div>
<div class="alert alert-dark" role="alert">
<div class="container">
<!--MULTIPLE-Termin-BEGIN-->
<div class="row">
<div class="row admin-row">
<div class="col-sm">
<div class="form-group">
<p>
Expand All @@ -87,11 +87,7 @@ <h3>Options</h3>
</div>
<div class="col-sm col-sm-10">
Submissions for this option:
<ul class="list-group">
<li class="list-group-item">
%%TEILNEHMER%%
</li>
</ul>
%%TEILNEHMER%%
</div>
</div>
<!--MULTIPLE-Termin-END-->
Expand Down
1 change: 1 addition & 0 deletions core/templates/main_de.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<link rel="stylesheet" href="%%HOST%%/load/bootstrap/bootstrap-%%THEMETYPE%%.min.css?%%VERSION%%">
<link rel="stylesheet" href="%%HOST%%/load/jquery-ui.min.css?%%VERSION%%">
<link rel="stylesheet" href="%%HOST%%/load/jquery-ui-%%THEMETYPE%%.theme.min.css?%%VERSION%%">
<link rel="stylesheet" href="%%HOST%%/load/main.css?%%VERSION%%">

<title>%%PAGENAME%%</title>

Expand Down
1 change: 1 addition & 0 deletions core/templates/main_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<link rel="stylesheet" href="%%HOST%%/load/bootstrap/bootstrap-%%THEMETYPE%%.min.css?%%VERSION%%">
<link rel="stylesheet" href="%%HOST%%/load/jquery-ui.min.css?%%VERSION%%">
<link rel="stylesheet" href="%%HOST%%/load/jquery-ui-%%THEMETYPE%%.theme.min.css?%%VERSION%%">
<link rel="stylesheet" href="%%HOST%%/load/main.css?%%VERSION%%">

<title>%%PAGENAME%%</title>

Expand Down
4 changes: 2 additions & 2 deletions core/templates/poll_de.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ <h3>Termine</h3>
Hinweise zum Termin
</div>
</div>
<div class="alert alert-light" role="alert">
<div class="container termin-container">
<!--MULTIPLE-Termin-BEGIN-->
<div class="row">
<div class="row termin-row">
<div class="col-sm col-sm-1">
<div class="form-group text-center">
<input type="checkbox" name="%%TERMINID%%" class="terminwahl form-check-input" value="yes" %%DISABLE%%>
Expand Down
4 changes: 2 additions & 2 deletions core/templates/poll_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ <h3>Options</h3>
Notes regarding the option
</div>
</div>
<div class="alert alert-light" role="alert">
<div class="container termin-container">
<!--MULTIPLE-Termin-BEGIN-->
<div class="row">
<div class="row termin-row">
<div class="col-sm col-sm-1">
<div class="form-group text-center">
<input type="checkbox" name="%%TERMINID%%" class="terminwahl form-check-input" value="yes" %%DISABLE%%>
Expand Down
3 changes: 2 additions & 1 deletion data/translation_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"TooManyPolls": "Diese Instanz von KIMB-Forms l\u00e4sst keine weitern Umfragen zu.",
"TooManySubmiss": "Diese Umfrage hat die maximale Anzahl an Antworten erreicht.",
"HelfFin": "Helfer finden",
"TermFin": "Termin finden"
"TermFin": "Termin finden",
"Teilnehm": "Teilnehmende"
}
3 changes: 2 additions & 1 deletion data/translation_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"TooManyPolls": "This instance of KIMB-Forms has reached the limit of polls.",
"TooManySubmiss": "This poll has reached the limit of submissions.",
"HelfFin": "Coordinate volunteers",
"TermFin": "Schedule meetings"
"TermFin": "Schedule meetings",
"Teilnehm" : "attendees"
}
20 changes: 20 additions & 0 deletions load/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.termin-container .termin-row {
margin-bottom: 5px;
border: 1px solid var(--secondary);
border-radius: .25rem;
padding: 2px;
}
.termin-container .termin-row .form-check-input {
margin-left: initial;
}
.termin-container .termin-row .terminwahl {
box-shadow: 5px 5px 2px var(--danger);
}
.termin-container .termin-row .terminwahl:checked {
box-shadow: 5px 5px 2px var(--success);
}
.container .admin-row {
margin-top: 5px;
border-top: 1px solid var(--secondary);
}

12 changes: 12 additions & 0 deletions load/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ $( function (){
*/
function template_main(){
$(document).tooltip();
if( $( ".collapseContent" ).length > 0 ){
$( ".collapseContent .card-header" ).click( function() {
var el = $(this).parent().find(".card-text");
if( el.css('display') == 'none' ){
el.show("blind", 250);
}
else{
el.hide("blind", 250);
}
});
$( ".collapseContent .card-text" ).hide("blind", 1);
}
$("div.parseasmarkdown").each( (k,v) =>{
$( v ).html( md_parser( $( v ).text().trim() ) );
});
Expand Down

0 comments on commit a3ad799

Please sign in to comment.