[Redizajn 1KA v2] Testiranje --> Komentarji - v delu

Na vprašanja
This commit is contained in:
tejagerjovic 2022-08-19 03:20:25 +02:00
parent 403dc448fe
commit 223141c6d8
7 changed files with 1834 additions and 1580 deletions

View File

@ -7160,7 +7160,6 @@ class SurveyAdminSettings {
// Dodajanje novega komentarja // Dodajanje novega komentarja
echo '<div id="comment_toggle_0_4" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\'0_4\')">'; echo '<div id="comment_toggle_0_4" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\'0_4\')">';
echo '<span class="faicon link-right comments"></span>';
echo $lang['srv_add_comment_toggle']; echo $lang['srv_add_comment_toggle'];
echo '</div>'; echo '</div>';
@ -7258,7 +7257,6 @@ class SurveyAdminSettings {
} }
// Dodajanje novega komentarja // Dodajanje novega komentarja
echo '<div id="comment_toggle_0_5" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\'0_5\')">'; echo '<div id="comment_toggle_0_5" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\'0_5\')">';
echo '<span class="faicon link-right comments"></span>';
echo $lang['srv_add_comment_toggle']; echo $lang['srv_add_comment_toggle'];
echo '</div>'; echo '</div>';
@ -7769,7 +7767,6 @@ class SurveyAdminSettings {
echo '<div id="comment_toggle_'.$spr_id.'" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\''.$spr_id.'\')">'; echo '<div id="comment_toggle_'.$spr_id.'" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\''.$spr_id.'\')">';
echo '<span class="faicon link-right comments"></span>';
echo $lang['srv_add_comment_toggle']; echo $lang['srv_add_comment_toggle'];
echo '</div>'; echo '</div>';
@ -7864,81 +7861,9 @@ class SurveyAdminSettings {
echo '<div class="question_comment editor">'; echo '<div class="question_comment editor">';
// komentarji urednikov
if ($row1['thread'] > 0) {
if (mysqli_num_rows($sqlt) > 0) {
echo '<div class="comment_type">';
echo $lang['srv_admin_comment'].':';
echo '</div>';
$i = 0;
while ($rowt = mysqli_fetch_array($sqlt)) {
echo '<div class="comment_box">';
echo '<div class="by">';
echo $lang['srv_comments_user'].'<span class="user">'.$f->user($rowt['uid']).'</span>'.$lang['srv_comments_user2'];
echo '</div>';
$datetime = strtotime($rowt['time']);
$datetime = date("d.m.Y G:i", $datetime);
echo '<div class="date">';
echo $datetime;
echo '</div>';
echo '<div class="content">';
echo $rowt['vsebina'];
echo '</div>';
if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) {
echo '<div class="bottom_options">';
if ($commentmarks == 1) {
echo ' <select name="ocena" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: this.value, id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});">
<option value="0"'.($rowt['ocena']==0?' selected="selected"':'').'>'.$lang['srv_undecided'].'</option>
<option value="1"'.($rowt['ocena']==1?' selected="selected"':'').'>'.$lang['srv_todo'].'</option>
<option value="2"'.($rowt['ocena']==2?' selected="selected"':'').'>'.$lang['srv_done'].'</option>
<option value="3"'.($rowt['ocena']==3?' selected="selected"':'').'>'.$lang['srv_not_relevant'].'</option>
</select>';
} else {
if ($rowt['ocena']==0) {
echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'2\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon arhiv link-right"></span>';
echo $lang['srv_comments_archive'].'</p>';
echo '<div class="reply_to">';
echo '<a href="javascript:comment_on_comment(\''.$rowt['id'].'\',\''.$f->user($rowt['uid']).'\',\''.$datetime.'\',\''.$spr_id.'\');"><span class="faicon fa-reply link-right"></span>'.$lang['srv_comment_comment'].'</a>';
echo '</div>';
}
else {
echo '<p class="archived_comment"><span class="faicon arhiv link-right"></span>'.$lang['srv_comments_archived'].'</p>';
echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'0\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon inv_sent_0 empty link-right"></span>';
echo $lang['srv_comments_unarchive'].'</p>';
}
}
echo '</div>';
}
echo '</div>';
echo '<div class="reply_to_text" id="comment_on_comment_'.$rowt['id'].'">';
echo '</div>';
}
}
}
if ($addfieldposition == '' || $addfieldposition == 0) { if ($addfieldposition == '' || $addfieldposition == 0) {
echo '<div id="comment_toggle_'.$spr_id.'_'.'4'.'" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\''.$spr_id.'_'.'4'.'\')">'; echo '<div id="comment_toggle_'.$spr_id.'_'.'4'.'" class="add_comment_toggle" onClick="toggleAddComment(\''.$spr_id.'_'.'4'.'\')">';
echo '<span class="faicon link-right comments"></span>';
echo $lang['srv_add_comment_toggle']; echo $lang['srv_add_comment_toggle'];
echo '</div>'; echo '</div>';
@ -7951,6 +7876,98 @@ class SurveyAdminSettings {
echo '</div>'; echo '</div>';
} }
// komentarji urednikov
if ($row1['thread'] > 0) {
if (mysqli_num_rows($sqlt) > 0) {
echo '<div class="comment_type">';
echo $lang['srv_admin_comment'].':';
echo '<span class="faicon pointer blue fa-sort-amount-down"></span>'; //manjka funkcija za sort in toggle za spremembo ikone
echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';
echo '</div>';
$i = 0;
while ($rowt = mysqli_fetch_array($sqlt)) {
echo '<div class="comment_box '.($rowt['ocena']==0 ? '' : 'archived').'">';
echo '<div class="by">';
$datetime = strtotime($rowt['time']);
$datetime = date("d.m.Y G:i", $datetime);
echo '<p>'.$lang['srv_comments_user'].'<span class="user">'.$f->user($rowt['uid']).'</span> ('.$datetime.')</p>';
if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) {
echo '<div class="options">';
echo '<div class="solve">';
if ($rowt['ocena']==0) {
echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'2\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-check link-right"></span>';
echo $lang['srv_comments_archive'].'</p>';
}
else {
echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'0\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-undo link-right"></span>';
echo $lang['srv_comments_unarchive'].'</p>';
}
echo '</div>';
echo '<span class="faicon pointer fa-ellipsis-h" id="dots_'.$rowt['id'].'" onClick="toggleCommentOptions(\''.$rowt['id'].'\');"></span>';
echo '<div class="options_dropdown displayNone" id="options_'.$rowt['id'].'">';
echo '<div class="line">';
echo '<a href="javascript:comment_on_comment(\''.$rowt['id'].'\',\''.$f->user($rowt['uid']).'\',\''.$datetime.'\',\''.$spr_id.'\');"><span class="faicon fa-reply link-right"></span>'.$lang['srv_comment_comment'].'</a>';
echo '</div>';
echo '<div class="line">';
echo '<span class="faicon trash link-right"></span>'; //manjka funkcija za izbris
echo $lang['srv_comment_delete'];
echo '</div>';
echo '</div>';
//Klik izven razprith nastavitev - zapremo okno
echo '<script>
$(document).mouseup(function(e){
var container = $(".options_dropdown");
if (!container.is(e.target) && container.has(e.target).length === 0){
$(".options_dropdown").addClass("displayNone");
}
});
</script>';
echo '</div>'; //options
}
echo '</div>'; //by
echo '<div class="content">';
echo $rowt['vsebina'];
echo '</div>';
echo '</div>'; //comment_box
echo '<div class="reply_to_text" id="comment_on_comment_'.$rowt['id'].'">';
echo '</div>';
}
}
}
echo '</div>'; echo '</div>';
@ -7971,7 +7988,7 @@ class SurveyAdminSettings {
if (!$sqlt) echo mysqli_error($GLOBALS['connect_db']); if (!$sqlt) echo mysqli_error($GLOBALS['connect_db']);
while ($rowt = mysqli_fetch_array($sqlt)) { while ($rowt = mysqli_fetch_array($sqlt)) {
echo '<div class="comment_box">'; echo '<div class="comment_box '.($rowt['text2']==0 ? '' : 'archived').'">';
// Ce smo slucajno pobrisali testne vnose, nimamo casa vnosa komentarja // Ce smo slucajno pobrisali testne vnose, nimamo casa vnosa komentarja
$sqlTime = sisplet_query("SELECT time_edit FROM srv_user WHERE id='".$rowt['usr_id']."'"); $sqlTime = sisplet_query("SELECT time_edit FROM srv_user WHERE id='".$rowt['usr_id']."'");
@ -7979,69 +7996,78 @@ class SurveyAdminSettings {
$rowTime = mysqli_fetch_array($sqlTime); $rowTime = mysqli_fetch_array($sqlTime);
echo '<div class="by">'; echo '<div class="by">';
echo 'Respondent '.$lang['srv_comments_user2'];
echo '</div>';
if ( strpos($rowt['text'], '__DATE__') !== false ) { if ( strpos($rowt['text'], '__DATE__') !== false ) {
$rowt['text'] = str_replace('__DATE__', $f->datetime1($rowTime['time_edit']), $rowt['text']); $rowt['text'] = str_replace('__DATE__', $f->datetime1($rowTime['time_edit']), $rowt['text']);
echo '<div class="content">'; $datetime = '-';
echo nl2br($rowt['text']);
echo '</div>';
} }
else { else {
$datetime = strtotime($rowTime['time_edit']); $datetime = strtotime($rowTime['time_edit']);
$datetime = date("d.m.Y G:i", $datetime); $datetime = date("d.m.Y G:i", $datetime);
echo '<div class="date">';
echo $datetime;
echo '</div>';
echo '<div class="content">';
echo nl2br($rowt['text']);
echo '</div>';
} }
echo '<p>Respondent ('.$datetime.')</p>';
if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) {
echo '<div class="options">';
echo '<div class="solve">';
if ($rowt['text2']==0) {
echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: (\'2\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-check link-right"></span>';
echo $lang['srv_comments_archive'].'</p>';
}
else {
echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: (\'0\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-undo link-right"></span>';
echo $lang['srv_comments_unarchive'].'</p>';
}
echo '</div>';
echo '<span class="faicon pointer fa-ellipsis-h" id="dots_'.$rowt['id'].'" onClick="toggleCommentOptions(\''.$rowt['id'].'\');"></span>';
echo '<div class="options_dropdown displayNone" id="options_'.$rowt['id'].'">';
echo '<div class="line">';
echo '<span class="faicon trash link-right"></span>'; //manjka funkcija za izbris
echo $lang['srv_comment_delete'];
echo '</div>';
echo '</div>';
//Klik izven razprith nastavitev - zapremo okno
echo '<script>
$(document).mouseup(function(e){
var container = $(".options_dropdown");
if (!container.is(e.target) && container.has(e.target).length === 0){
$(".options_dropdown").addClass("displayNone");
}
});
</script>';
echo '</div>'; //options
}
echo '</div>'; //by
} }
else{ else{
if ( strpos($rowt['text'], '__DATE__') !== false ) { if ( strpos($rowt['text'], '__DATE__') !== false ) {
$rowt['text'] = str_replace('__DATE__', '', $rowt['text']); $rowt['text'] = str_replace('__DATE__', '', $rowt['text']);
echo '<div class="content">';
echo nl2br($rowt['text']);
echo '</div>';
} }
else {
echo '<div class="content">';
echo nl2br($rowt['text']);
echo '</div>';
}
} }
if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) { echo '<div class="content">';
echo nl2br($rowt['text']);
echo '<div class="bottom_options">'; echo '</div>';
if ($commentmarks == 1) {
echo ' <select name="ocena'.$rowt['id'].'" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: this.value, id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});">
<option value="0"'.($rowt['text2']==0?' selected':'').'>'.$lang['srv_undecided'].'</option>
<option value="1"'.($rowt['text2']==1?' selected':'').'>'.$lang['srv_todo'].'</option>
<option value="2"'.($rowt['text2']==2?' selected':'').'>'.$lang['srv_done'].'</option>
<option value="3"'.($rowt['text2']==3?' selected':'').'>'.$lang['srv_not_relevant'].'</option>
</select>';
} else {
if ($rowt['text2']==0) {
echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: (\'2\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon arhiv link-right"></span>';
echo $lang['srv_comments_archive'].'</p>';
}
else {
echo '<p class="archived_comment"><span class="faicon arhiv link-right"></span>'.$lang['srv_comments_archived'].'</p>';
echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: (\'0\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon inv_sent_0 empty link-right"></span>';
echo $lang['srv_comments_unarchive'].'</p>';
}
}
echo '</div>';
}
echo '</div>'; echo '</div>';
} }

View File

@ -5656,4 +5656,8 @@ function show_gdpr_messeage(id_sporocila){
$("#general_popup").load('ajax.php?a=show_gdpr_messeage', {id_sporocila: id_sporocila, anketa: srv_meta_anketa_id}); $("#general_popup").load('ajax.php?a=show_gdpr_messeage', {id_sporocila: id_sporocila, anketa: srv_meta_anketa_id});
console.log(id_sporocila); console.log(id_sporocila);
}
function toggleCommentOptions(id) {
$("#options_"+id).toggleClass("displayNone");
} }

View File

@ -759,6 +759,7 @@ function comment_on_comment (id, user, date, spr_id) {
'<button class="medium blue" onclick="$.post(\'ajax.php?a=comment_on_comment\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;">'+lang['srv_comment_comment']+'</button>'+ '<button class="medium blue" onclick="$.post(\'ajax.php?a=comment_on_comment\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;">'+lang['srv_comment_comment']+'</button>'+
'</div>' '</div>'
); );
$(".options_dropdown").addClass("displayNone");
} }

View File

@ -4580,9 +4580,9 @@ $lang = array (
"srv_comments_link" => "Pregled komentarjev", "srv_comments_link" => "Pregled komentarjev",
"srv_comments_user" => "Uporabnik ", "srv_comments_user" => "Uporabnik ",
"srv_comments_user2" => " je komentiral:", "srv_comments_user2" => " je komentiral:",
"srv_comments_archive" => "Arhiviraj komentar", "srv_comments_archive" => "Razreši",
"srv_comments_unarchive" => "Označi kot nerešeno", "srv_comments_unarchive" => "Označi kot nerešeno",
"srv_comments_archived" => "Komentar je arhiviran", "srv_comments_archived" => "Komentar je razrešen",
"srv_comments_new" => "Komentiraj", "srv_comments_new" => "Komentiraj",
"srv_zanka_profile_all" => "Brez", "srv_zanka_profile_all" => "Brez",
"srv_zanka_profile_session" => "Za&#269;asno", "srv_zanka_profile_session" => "Za&#269;asno",
@ -4654,6 +4654,7 @@ $lang = array (
"srv_done" => "Končano", "srv_done" => "Končano",
"srv_not_relevant" => "Nerelevantno", "srv_not_relevant" => "Nerelevantno",
"srv_comment_comment" => "Odgovori", "srv_comment_comment" => "Odgovori",
"srv_comment_delete" => "Izbriši",
"srv_edit_data_title" => "Uredi podatke vprašanja", "srv_edit_data_title" => "Uredi podatke vprašanja",
"srv_edit_data_row" => "Uredi celotno anketo respondenta", "srv_edit_data_row" => "Uredi celotno anketo respondenta",
"srv_edit_data_row_quick" => "Hitro urejanje celotne ankete respondenta", "srv_edit_data_row_quick" => "Hitro urejanje celotne ankete respondenta",

View File

@ -4556,9 +4556,9 @@ $lang = array (
"srv_comments_anketa_resp" => "Respondent comments to the survey", "srv_comments_anketa_resp" => "Respondent comments to the survey",
"srv_comments_user" => "User ", "srv_comments_user" => "User ",
"srv_comments_user2" => " commented:", "srv_comments_user2" => " commented:",
"srv_comments_archive" => "Archive comment", "srv_comments_archive" => "Resolve",
"srv_comments_unarchive" => "Unarchive", "srv_comments_unarchive" => "Mark as unresolved",
"srv_comments_archived" => "Comment has already been archived", "srv_comments_archived" => "Comment has been resolved",
"srv_comments_new" => "Comment", "srv_comments_new" => "Comment",
"srv_zanka_profile_all" => "Without", "srv_zanka_profile_all" => "Without",
"srv_zanka_profile_session" => "Temporary", "srv_zanka_profile_session" => "Temporary",
@ -4629,6 +4629,7 @@ $lang = array (
"srv_done" => "Done", "srv_done" => "Done",
"srv_not_relevant" => "Not relevant", "srv_not_relevant" => "Not relevant",
"srv_comment_comment" => "Reply", "srv_comment_comment" => "Reply",
"srv_comment_delete" => "Delete",
"srv_edit_data_title" => "Edit question data", "srv_edit_data_title" => "Edit question data",
"srv_edit_data_row" => "Edit respondents survey", "srv_edit_data_row" => "Edit respondents survey",
"srv_edit_data_row_quick" => "Quick edit respondents survey", "srv_edit_data_row_quick" => "Quick edit respondents survey",

File diff suppressed because it is too large Load Diff

View File

@ -115,6 +115,15 @@ div.page_komentarji_anketa {
div.add_comment_toggle { div.add_comment_toggle {
transition: 0.3s; transition: 0.3s;
border: 1px solid $gray;
border-radius: 2px;
width: 100%;
padding: 9px 8px;
color: $very-dark-gray;
margin-bottom: 16px;
cursor: text;
} }
div.comment_wrapper { div.comment_wrapper {
@ -124,6 +133,7 @@ div.page_komentarji_anketa {
div.new_comment { div.new_comment {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: 16px;
textarea { textarea {
width: 100%; width: 100%;
@ -269,10 +279,31 @@ div.page_komentarji_anketa {
margin-right: 62px; margin-right: 62px;
} }
div.add_comment_toggle {
transition: 0.3s;
border: 1px solid $gray;
border-radius: 2px;
width: 100%;
padding: 9px 8px;
margin-bottom: 16px;
color: $very-dark-gray;
cursor: text;
}
div.comment_type { div.comment_type {
font-weight: $semi-bold; font-weight: $semi-bold;
margin-bottom: 16px; margin-bottom: 16px;
text-transform: uppercase; text-transform: uppercase;
display: flex;
flex-direction: row;
justify-content: space-between;
.fa-sort-amount-up {
display: none;
}
} }
div.comment_box { div.comment_box {
@ -284,11 +315,77 @@ div.page_komentarji_anketa {
margin-bottom: 16px; margin-bottom: 16px;
&.archived {
color: $very-dark-gray !important
}
.by { .by {
margin-bottom: 4px;
.user { .user {
font-weight: $semi-bold; font-weight: $semi-bold;
} }
p {
font-size: 14px !important;
}
display: flex;
flex-direction: row;
justify-content: space-between;
.options {
display: flex;
flex-direction: row;
.solve {
margin-right: 16px;
cursor: pointer;
}
color: $blue;
position: relative;
.options_dropdown {
position: absolute;
right:0;
top: 24px;
display: flex;
z-index: 99;
width: auto;
padding: 20px 16px;
background: $white;
border: 1px solid $gray;
box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.15);
flex-direction: column;
.line {
&:not(:last-of-type) {
margin-bottom: 12px;
}
transition: 0.2s;
&:hover{
color: $dark-blue;
}
cursor: pointer;
a {
white-space: nowrap;
text-decoration: none;
}
p {
font-size: 14px !important;
}
}
}
}
} }
.date { .date {
@ -298,6 +395,22 @@ div.page_komentarji_anketa {
.content { .content {
margin: 16px 0; margin: 16px 0;
blockquote {
font-size: 14px !important;
border-left: 1px solid $gray;
padding-left: 8px;
margin-block-start: 0;
margin-block-end: 0;
&:not(:last-of-type) {
padding-bottom: 16px;
}
&:first-of-type {
margin-top: 16px;
}
}
} }
.bottom_options { .bottom_options {
@ -354,6 +467,10 @@ div.page_komentarji_anketa {
margin-top: 8px; margin-top: 8px;
} }
} }
.new_comment {
margin-bottom: 16px;
}
} }
} }
} }