[Redizajn 1KA] - Testiranje --> Komentarji - reply na vprašaja (js)

This commit is contained in:
tejagerjovic 2022-04-29 03:46:15 +02:00
parent 2f1b559e7b
commit 885c00642a
7 changed files with 65 additions and 19 deletions

View File

@ -7127,6 +7127,10 @@ class SurveyAdminSettings {
elseif ($row['ocena'] == 3) echo '<span style="color:#999999">';
else echo '<span>';*/
echo '<div class="by">';
echo 'Respondent '.$lang['srv_comments_user2'];
echo '</div>';
$datetime = strtotime($row['comment_time']);
$datetime = date("d.m.Y G:i", $datetime);
@ -7167,7 +7171,10 @@ class SurveyAdminSettings {
echo '<label for="ocena_'.$row['id'].'">'.$lang['srv_done'].'</label>'; */
if ($row['ocena']==0) {
echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_survey_comment\', ocena: (\'2\'), id: \''.$row['id'].'\', anketa: \''.$rowa['id'].'\'}, function () {window.location.reload();});"> <span class="faicon arhiv link-right"></span>';
echo $rowa['id'];
echo $row['id'];
echo 'test2';
echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_survey_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>';
}
else {
@ -7813,7 +7820,7 @@ class SurveyAdminSettings {
} else {
if ($row['ocena']==0) {
echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'2\'), id: \''.$row['id'].'\', anketa: \''.$rowa['id'].'\'}, function () {window.location.reload();});"> <span class="faicon arhiv link-right"></span>';
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>';
}
else {
@ -7821,8 +7828,8 @@ class SurveyAdminSettings {
}
}
echo '<div class="reply_to">';
echo '<a href="javascript:comment_on_comment(\''.$rowt['id'].'\');"><span class="faicon fa-reply link-right"></span>'.$lang['srv_comment_comment'].'</a>';
echo '<div class="reply_to" onClick="$(\'#comment_toggle_'.$spr_id.'_4\').toggle();">';
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>';
@ -7839,10 +7846,19 @@ class SurveyAdminSettings {
}
if ($addfieldposition == '' || $addfieldposition == 0) {
echo '<div id="comment_toggle_'.$spr_id.'_'.'4'.'" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\''.$spr_id.'_'.'4'.'\')">';
echo '<span class="faicon link-right comments"></span>';
echo $lang['srv_add_comment_toggle'];
echo '</div>';
echo '<div class="comment_wrapper" id="comment_wrapper_'.$spr_id.'_'.'4'.'">';
echo '<div class="new_comment" id="survey_comment_'.$spr_id.'_'.'4'.'">';
$ba = new BranchingAjax($this->anketa);
$ba->add_comment_field($spr_id, '1', '4', false);
echo '</div>';
echo '</div>';
}
echo '</div>';
@ -7881,6 +7897,10 @@ class SurveyAdminSettings {
$rowTime = mysqli_fetch_array($sqlTime);
echo '<div class="by">';
echo 'Respondent '.$lang['srv_comments_user2'];
echo '</div>';
if ( strpos($rowt['text'], '__DATE__') !== false ) {
$rowt['text'] = str_replace('__DATE__', $f->datetime1($rowTime['time_edit']), $rowt['text']);
echo '<div class="content">';

View File

@ -197,6 +197,8 @@ lang('srv_vrednost_correct');
lang('srv_editor_title');
lang('srv_comments_new');
lang('srv_comment_comment');
lang('edit1338');
lang('for');
//LOKACIJA

View File

@ -735,10 +735,14 @@ function get_editor_close(id) {
// prikaze field da manager doda nek komentar obstojecemu komentarju na vprasanje
function comment_on_comment (id) {
function comment_on_comment (id, user, date, spr_id) {
$('#comment_on_comment_'+id).html(
'<div class="reply_to_who"><span class="faicon fa-reply link-right"></span>'+lang['for']+': '+user+' ('+date+')</div>'+
'<textarea name="vsebina" placeholder="'+lang['srv_comment_comment']+'" id="vsebina_comment_on_comment_'+id+'"></textarea>' +
'<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 class="button_holder bottom0">'+
'<button class="medium white-blue" onclick="$(\'#comment_on_comment_'+id+'\').html(\'\'); $(\'#comment_toggle_'+spr_id+'_4\').toggle(); return false;">'+lang['edit1338']+'</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>'
);
}

View File

@ -622,6 +622,7 @@ $lang = array (
"threads" => "Tem",
"new_thread" => "Nova tema",
"reply" => "Odgovori",
"for" => "Za",
"guest" => "Gost",
"askdelforum" => "Ali ste prepri&#269;ani, da zelite izbrisati forum? Izbrisali boste tudi vse teme v tem forumu!",
"newforum" => "Nov forum",

View File

@ -609,6 +609,7 @@ $lang = array (
"threads" => "Threads",
"new_thread" => "Add thread",
"reply" => "Reply",
"for" => "For",
"guest" => "Guest",
"askdelforum" => "Are you sure you want to delete this forum? You will also delete all threads in this forum!",
"newforum" => "New forum",

View File

@ -22002,24 +22002,35 @@ div.page_komentarji ul div.question_comment_holder div.question_comment div.comm
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.comment_box .bottom_options .reply_to a {
text-decoration: none;
}
div.page_komentarji ul div.question_comment_holder div.question_comment div.reply_to_text,
div.page_komentarji ul div.question_comment_holder div.question_comment div.comment_wrapper,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.comment_wrapper {
display: none;
transition: 0.3s;
}
div.page_komentarji ul div.question_comment_holder div.question_comment div.new_comment,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.reply_to_text,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.new_comment {
div.page_komentarji ul div.question_comment_holder div.question_comment div.reply_to_text,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.new_comment,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.reply_to_text {
display: flex;
flex-direction: column;
}
div.page_komentarji ul div.question_comment_holder div.question_comment div.reply_to_text textarea,
div.page_komentarji ul div.question_comment_holder div.question_comment div.new_comment div.reply_to_who,
div.page_komentarji ul div.question_comment_holder div.question_comment div.reply_to_text div.reply_to_who,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.new_comment div.reply_to_who,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.reply_to_text div.reply_to_who {
color: #808080;
}
div.page_komentarji ul div.question_comment_holder div.question_comment div.new_comment textarea,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.reply_to_text textarea,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.new_comment textarea {
div.page_komentarji ul div.question_comment_holder div.question_comment div.reply_to_text textarea,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.new_comment textarea,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.reply_to_text textarea {
width: 100%;
height: 100px;
}
div.page_komentarji ul div.question_comment_holder div.question_comment div.reply_to_text button,
div.page_komentarji ul div.question_comment_holder div.question_comment div.new_comment button,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.reply_to_text button,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.new_comment button {
div.page_komentarji ul div.question_comment_holder div.question_comment div.reply_to_text button,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.new_comment button,
div.page_komentarji_anketa ul div.question_comment_holder div.question_comment div.reply_to_text button {
width: fit-content;
margin-top: 8px;
}

View File

@ -207,11 +207,20 @@ div.page_komentarji_anketa {
}
}
div.reply_to_text,
div.new_comment {
div.comment_wrapper {
display: none;
transition: 0.3s;
}
div.new_comment,
div.reply_to_text {
display: flex;
flex-direction: column;
div.reply_to_who {
color: $very-dark-gray2;
}
textarea {
width: 100%;
height: 100px;
@ -222,9 +231,7 @@ div.page_komentarji_anketa {
margin-top: 8px;
}
}
}
}
}
}