[Redizajn 1KA] - Moje ankete --> Uvoz besedila - v1

Missing: prikaz polj v preview delu.
This commit is contained in:
tejagerjovic 2022-01-03 01:54:55 +01:00
parent fb2b17c155
commit 30b95cd31d
6 changed files with 170 additions and 146 deletions

View File

@ -6154,7 +6154,7 @@ class SurveyAdminAjax {
// Preview okno
echo '<div id="preview_field_holder"><div id="preview_field">';
echo '<span class="italic">'.$lang['srv_poglejanketo2'].'</span>';
echo '<span class="caps bold">'.$lang['srv_poglejanketo2'].'</span>';
echo '</div></div>';
echo '</div>';

View File

@ -600,25 +600,28 @@ class NewSurvey{
// 1. sklop - ime ankete
echo '<div class="fieldset">';
echo '<div class="fieldset">';
// Naslov
echo '<div class="pre-title">' . $lang['srv_newSurvey_survey_from_text'] . '</div>';
echo '<div class="title">' . $lang['srv_noSurvey_settings'] . '</div>';
echo '<div class="survey_title_text_holder">';
echo '<div class="setting_horizontal_wrapper">';
// Interno ime
echo '<div class="setting survey_title_text">';
echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_list_no_data_create'] . ':</span>';
echo '<input type="text" id="novaanketa_naslov_1" name="novaanketa_naslov_1" placeholder="' . $lang['srv_novaanketa_polnoime'] . '" value="' . $lang['srv_novaanketa_polnoime'] . '" size="40" maxlength="' . ANKETA_NASLOV_MAXLENGTH . '" onfocus="if(this.value==\'' . $lang['srv_novaanketa_polnoime'] . '\') {this.value=\'\';}" />';
echo '<span id="novaanketa_naslov_1_chars">0 / ' . ANKETA_NASLOV_MAXLENGTH . '</span>';
echo '<div class="setting_holder">';
echo '<label for="novaanketa_naslov_1">' . $lang['srv_list_no_data_create'] . ':</label>';
echo '<input type="text" class="large" id="novaanketa_naslov_1" name="novaanketa_naslov_1" placeholder="' . $lang['srv_novaanketa_polnoime'] . '" value="' . $lang['srv_novaanketa_polnoime'] . '" maxlength="' . ANKETA_NASLOV_MAXLENGTH . '" onfocus="if(this.value==\'' . $lang['srv_novaanketa_polnoime'] . '\') {this.value=\'\';}" />';
echo '<span class="charalimit" id="novaanketa_naslov_1_chars">0 / ' . ANKETA_NASLOV_MAXLENGTH . '</span>';
echo '</div>';
// Objavljeno ime
echo '<div class="setting survey_title_text">';
echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_novaanketa_kratkoime'] . ':</span>';
echo '<input type="text" id="novaanketa_akronim_1" name="novaanketa_akronim_1" value="' . $lang['srv_novaanketa_ime_respondenti'] . '" placeholder="' . $lang['srv_novaanketa_ime_respondenti'] . '" size="40" maxlength="' . ANKETA_AKRONIM_MAXLENGTH . '" onfocus="$(this).attr(\'changed\',\'1\'); if(this.value==\'' . $lang['srv_novaanketa_ime_respondenti'] . '\') {this.value=\'\';}" changed="0" />';
echo '<span id="novaanketa_akronim_1_chars">0 / ' . ANKETA_AKRONIM_MAXLENGTH . '</span>';
echo '<div class="setting_holder">';
echo '<label for="novaanketa_akronim_1"">' . $lang['srv_novaanketa_kratkoime'] . ':</label>';
echo '<input type="text" class="large" id="novaanketa_akronim_1" name="novaanketa_akronim_1" value="' . $lang['srv_novaanketa_ime_respondenti'] . '" placeholder="' . $lang['srv_novaanketa_ime_respondenti'] . '" maxlength="' . ANKETA_AKRONIM_MAXLENGTH . '" onfocus="$(this).attr(\'changed\',\'1\'); if(this.value==\'' . $lang['srv_novaanketa_ime_respondenti'] . '\') {this.value=\'\';}" changed="0" />';
echo '<span class="charalimit" id="novaanketa_akronim_1_chars">0 / ' . ANKETA_AKRONIM_MAXLENGTH . '</span>';
echo '</div>';
// Ce ima uporabnik mape, lahko izbere v katero mapo se anketa uvrsti
@ -626,10 +629,10 @@ class NewSurvey{
$show_folders = UserSetting::getInstance()->getUserSetting('survey_list_folders');
$sql = sisplet_query("SELECT * FROM srv_mysurvey_folder WHERE usr_id='$global_user_id' ORDER BY naslov ASC");
if($show_folders == 1 && mysqli_num_rows($sql) > 0){
echo '<div class="setting survey_title_text">';
echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_newSurvey_survey_new_folder'] . ':</span>';
echo '<div class="setting_holder">';
echo '<label for="novaanketa_folder">' . $lang['srv_newSurvey_survey_new_folder'] . ':</label>';
echo '<select name="novaanketa_folder" id="novaanketa_folder">';
echo '<select class="dropdown large" name="novaanketa_folder" id="novaanketa_folder">';
echo '<option value="0">'.$lang['srv_newSurvey_survey_new_folder_def'].'</option>';
while($row = mysqli_fetch_array($sql)){
echo '<option value="'.$row['id'].'">'.$row['naslov'].'</option>';
@ -642,13 +645,16 @@ class NewSurvey{
echo '</div>';
echo '</div>';
// 2. sklop - uvoz iz besedila
echo '<div class="fieldset anketa_from_text">';
// Naslov
echo '<div class="title">' . $lang['srv_newSurvey_survey_from_text_title'] . ' '.Help::display('srv_create_survey_from_text').'</div>';
echo '<div class="from_text_instructions">' . $lang['srv_newSurvey_survey_from_text_text'] . '</div>';
echo '<p>' . $lang['srv_newSurvey_survey_from_text_text1'] . '</p>';
echo '<p>' . $lang['srv_newSurvey_survey_from_text_text2'] . '</p>';
echo '<p class="bottom32">' . $lang['srv_newSurvey_survey_from_text_text3'] . '</p>';
echo '<div class="from_text_sidebyside_holder">';
// Input okno za text
echo '<div id="input_field_holder"><div id="input_field">';
@ -658,19 +664,20 @@ class NewSurvey{
// Preview okno
echo '<div id="preview_field_holder"><div id="preview_field">';
echo '<span class="italic">'.$lang['srv_poglejanketo2'].'</span>';
echo '<span class="caps bold">'.$lang['srv_poglejanketo2'].'</span>';
echo '</div></div>';
echo '</div>';
echo '</div>';
echo '</div>';
// Gumba naprej in preklici
echo '<div class="noSurvey_buttons">';
echo '<a href="' . $site_url . 'admin/survey/index.php" title="' . $lang['srv_cancel'] . '"><span id="noSurvey_cancel">' . $lang['srv_cancel'] . '</span></a>';
echo '<a href="#" onclick="newAnketaFromText();" title="' . $lang['srv_create_survey'] . '"><span id="noSurvey_create">' . $lang['next1'] . '</span></a>';
echo '</div>';
echo '<div class="button_holder">';
echo '<button class="medium white-blue" onClick="window.location=\''.$site_url . 'admin/survey/index.php\';return false;" id="noSurvey_cancel">'.$lang['srv_cancel'].'</button>';
echo '<button class="medium blue" onclick="newAnketaFromText();" id="noSurvey_create">'.$lang['next1'].'</button>';
echo '</div>';
}
@ -804,7 +811,7 @@ class NewSurvey{
// Ce imamo prazno
if($text == ''){
$text = '<span class="italic">'.$lang['srv_poglejanketo2'].'</span>';
$text = '<span class="caps bold">'.$lang['srv_poglejanketo2'].'</span>';
}
else{
// Pobrisemo vmesne odvecne presledke
@ -817,7 +824,7 @@ class NewSurvey{
// Wrapamo naslove (prazna vrstica spredaj)
$text = preg_replace(
'/<br \/><br \/>([^<>]+)/',
'<br /><br /><span class="title">$1</span>',
'<br /><br /><span class="variable_title">$1</span>',
$text
);
// Wrapamo variable (vsaka v novi vrstici)
@ -829,14 +836,14 @@ class NewSurvey{
// Dodamo se textbox ce je samo vprasanje
$text = preg_replace(
'/(<span class="title">[^<>]+<\/span>)<br \/><br \/>/',
'$1<br /><input type="text" /><br /><br />',
'$1<br /><input type="text" class="large" /><br /><br />',
$text
);
// Wrapamo se prvo vrstico kot naslov
$text = preg_replace(
'/([^<>]+)<br \/>/',
'<span class="title">$1</span><br />',
'<span class="variable_title">$1</span><br />',
$text, 1
);
// Dodamo se textbox na zadnjo vrstico ce je potrebno
@ -848,7 +855,7 @@ class NewSurvey{
// Dodamo se textbox na prvo vrstico ce je potrebno
$text = preg_replace(
'/(<span class="title">[^<>]+<\/span>)<br \/><br \/>/',
'$1<br /><input type="text" /><br /><br />',
'$1<br /><input type="text" class="large" /><br /><br />',
$text, 1
);
}

View File

@ -7067,7 +7067,9 @@ $lang = array (
'srv_newSurvey_survey_archive_error2' => "Pri uvozu ankete je prišlo do napake. Zbrane datoteke ni mogoče uvoziti.",
'srv_newSurvey_survey_from_text' => "Uvoz besedila",
'srv_newSurvey_survey_from_text_title' => "Prilepi besedilo",
'srv_newSurvey_survey_from_text_text' => "Med vprašanji mora biti prazna vrstica.<br><br>Za vsako vprašanje morajo biti kategorije odgovorov v svoji vrstici. V primeru tabele je v svoji vrstici vsako vprašanje.<br><br>Ostale vidike se uredi v urejanju (npr. sprememba vprašanja v tabelo podvprašanj, sprememba radio gumbov v checbox).",
'srv_newSurvey_survey_from_text_text1' => "Za vsako vprašanje morajo biti kategorije odgovorov v svoji vrstici. V primeru tabele je v svoji vrstici vsako vprašanje.",
'srv_newSurvey_survey_from_text_text2' => "Med vprašanji mora biti prazna vrstica.",
'srv_newSurvey_survey_from_text_text3' => "Ostale podrobnosti se lahko uredi po uvozu ankete (npr. sprememba vprašanja v tabelo podvprašanj, sprememba radio gumbov v checkbox).",
'srv_newSurvey_survey_from_text_example' => "Naslov vprašanja 1\r\nVrednost 1\r\nVrednost 2\r\nVrednost 3\r\n\r\nNaslov vprašanja 2\r\nVrednost 1\r\nVrednost 2\r\nVrednost 3",

View File

@ -6953,7 +6953,9 @@ $lang = array (
'srv_newSurvey_survey_archive_error2' => "Import error. Selected .1ka file cannot be imported.",
'srv_newSurvey_survey_from_text' => "Import text",
'srv_newSurvey_survey_from_text_title' => "Paste text",
'srv_newSurvey_survey_from_text_text' => "There must be a blank line between the questions.<br><br>For each question, the answer categories must be in their own line. In the case of a table, each question is in its own row.<br><br>Other aspects are edited in editing (e.g. changing a question to a subquery table, changing radio buttons to a checbox).",
'srv_newSurvey_survey_from_text_text1' => "For each question, the answer categories must be in their own line. In the case of a table, each question is in its own row.",
'srv_newSurvey_survey_from_text_text2' => "There must be a blank line between the questions.",
'srv_newSurvey_survey_from_text_text3' => "Other details can be edited after importing the survey (e.g. changing a question to a subquery table, changing radio buttons to a checbox).",
'srv_newSurvey_survey_from_text_example' => "Question 1 title\r\nValue 1\r\nValue 2\r\nValue 3\r\n\r\nQuestion 2 title\r\nValue 1\r\nValue 2\r\nValue 3",
'srv_export_no_chart' => "No chart available",

View File

@ -14418,75 +14418,79 @@ and open the template in the editor.
height: auto;
overflow: auto;
}
#new_anketa_div #right_content .anketa_from_text .from_text_instructions {
line-height: 14px;
margin-bottom: 10px;
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder {
display: flex;
flex-direction: row;
}
#new_anketa_div #right_content .anketa_from_text #input_field_holder {
float: left;
width: 50%;
height: 400px;
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #input_field_holder {
box-sizing: border-box;
padding: 20px;
flex-shrink: 0;
}
#new_anketa_div #right_content .anketa_from_text #input_field_holder #input_field {
width: 100%;
height: 100%;
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #input_field_holder #input_field {
margin-right: 32px;
}
#new_anketa_div #right_content .anketa_from_text #input_field_holder #input_field textarea {
width: 100%;
height: 100%;
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #input_field_holder #input_field textarea {
width: 469px;
height: 509px;
box-sizing: border-box;
resize: none;
padding: 20px;
border: 1px #1E88E5 solid !important;
border-color: #E5E5E5;
margin-top: 0;
padding: 16px;
}
#new_anketa_div #right_content .anketa_from_text #input_field_holder #input_field textarea:focus::-webkit-input-placeholder {
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #input_field_holder #input_field textarea:focus::-webkit-input-placeholder {
color: transparent;
}
#new_anketa_div #right_content .anketa_from_text #input_field_holder #input_field textarea:focus::-moz-placeholder {
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #input_field_holder #input_field textarea:focus::-moz-placeholder {
color: transparent;
}
#new_anketa_div #right_content .anketa_from_text #preview_field_holder {
float: right;
width: 50%;
height: 400px;
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #preview_field_holder {
box-sizing: border-box;
padding: 20px;
flex-shrink: 0;
}
#new_anketa_div #right_content .anketa_from_text #preview_field_holder #preview_field {
width: 100%;
height: 100%;
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #preview_field_holder #preview_field {
width: 469px;
height: 509px;
box-sizing: border-box;
overflow: auto;
padding: 20px;
background-color: #1E88E5;
border: 1px #1E88E5 solid;
padding: 16px;
border: 1px #E5E5E5 solid;
border-radius: 2px;
}
#new_anketa_div #right_content .anketa_from_text #preview_field_holder #preview_field span.title {
font-size: 18px;
line-height: 30px;
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #preview_field_holder #preview_field span.variable_title {
margin-top: 16px;
}
#new_anketa_div #right_content .anketa_from_text #preview_field_holder #preview_field span.variable {
font-size: 15px;
font-weight: 400;
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #preview_field_holder #preview_field span.variable_title:first-of-type {
margin-top: 0px;
}
#new_anketa_div #right_content .anketa_from_text #preview_field_holder #preview_field span.variable input[type=radio] {
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #preview_field_holder #preview_field span.variable_title input[type=text] {
border: 1px solid #C4C4C4;
box-sizing: border-box;
border-radius: 2px;
width: 245px;
margin-top: 4px;
font-family: Source Sans Pro, sans-serif;
}
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #preview_field_holder #preview_field span.variable_title input[type=text].large {
height: 40px;
font-size: 16px;
padding: 9px 7px;
}
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #preview_field_holder #preview_field span.variable {
color: #333333 !important;
margin-top: 8px;
}
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #preview_field_holder #preview_field span.variable input[type=radio] {
display: none !important;
}
#new_anketa_div #right_content .anketa_from_text #preview_field_holder #preview_field span.variable input[type=radio] + span.enka-checkbox-radio:before {
#new_anketa_div #right_content .anketa_from_text .from_text_sidebyside_holder #preview_field_holder #preview_field span.variable input[type=radio] + span.enka-checkbox-radio:before {
font-family: "Font Awesome 5 Free";
content: "\f111";
display: inline-block;
font-size: 14px;
color: #F8F8F8;
color: #C4C4C4;
letter-spacing: 8px;
font-weight: 400;
}
#new_anketa_div #right_content .anketa_from_text #preview_field_holder #preview_field span.variable input[type=radio]:checked + span.enka-checkbox-radio:before {
content: "\f192";
color: #777777;
}
input[type=radio] + span.enka-checkbox-radio {
color: #1E88E5;

View File

@ -439,87 +439,96 @@ $skin_selector: $red;
.anketa_from_text{
height: auto;
overflow: auto;
.from_text_instructions{
line-height: 14px;
margin-bottom: 10px;
}
#input_field_holder{
float: left;
width: 50%;
height: 400px;
box-sizing: border-box;
padding: 20px;
#input_field{
width: 100%;
height: 100%;
.from_text_sidebyside_holder {
display:flex;
flex-direction: row;
#input_field_holder{
box-sizing: border-box;
flex-shrink: 0;
textarea{
width: 100%;
height: 100%;
box-sizing: border-box;
#input_field{
margin-right: 32px;
resize: none;
padding: 20px;
border: 1px $blue solid !important;
&:focus::-webkit-input-placeholder{
color: transparent;
}
&:focus::-moz-placeholder{
color: transparent;
textarea{
width: 469px;
height: 509px;
box-sizing: border-box;
border-color: $gray;
margin-top: 0;
padding: 16px;
&:focus::-webkit-input-placeholder{
color: transparent;
}
&:focus::-moz-placeholder{
color: transparent;
}
}
}
}
}
#preview_field_holder{
float: right;
width: 50%;
height: 400px;
box-sizing: border-box;
padding: 20px;
#preview_field{
width: 100%;
height: 100%;
#preview_field_holder{
box-sizing: border-box;
overflow: auto;
flex-shrink: 0;
padding: 20px;
background-color: $blue;
border: 1px $blue solid;
span.title{
font-size: 18px;
line-height: 30px;
}
span.variable{
font-size: 15px;
font-weight: 400;
#preview_field{
width: 469px;
height: 509px;
box-sizing: border-box;
overflow: auto;
input[type="radio"]{
display: none !important;
padding: 16px;
border: 1px $gray solid;
border-radius: 2px;
span.variable_title{
margin-top: 16px;
&:first-of-type{
margin-top: 0px;
}
input[type="text"]{
border: 1px solid $dark-gray;
box-sizing: border-box;
border-radius: 2px;
width: 245px;
margin-top: 4px;
font-family: $font_family;
&.large {
height: 40px;
font-size: 16px;
padding: 9px 7px;
}
}
}
input[type="radio"] + span.enka-checkbox-radio:before{
font-family: $fontawesome;
content: "\f111";
display: inline-block;
font-size: 14px;
color: $light-gray;
letter-spacing: 8px;
font-weight: 400;
}
input[type="radio"]:checked + span.enka-checkbox-radio:before{
content: "\f192";
color: $very-dark-gray;
span.variable{
color: $black !important;
margin-top: 8px;
input[type="radio"]{
display: none !important;
}
input[type="radio"] + span.enka-checkbox-radio:before{
font-family: $fontawesome;
content: "\f111";
display: inline-block;
font-size: 14px;
color: $dark-gray;
letter-spacing: 8px;
font-weight: 400;
}
}
}
}