[Redizajn 1KA] - Sporočila --> Poslana sporočila - v2

This commit is contained in:
tejagerjovic 2022-03-28 23:06:03 +02:00
parent b489cbe172
commit afb3cf5064
6 changed files with 96 additions and 98 deletions

View File

@ -33,10 +33,8 @@ class Notifications {
echo '<h2>'.$lang['srv_notifications_sent'].'</h2>';
echo '</div>';
echo '<div class="sent_list">';
$this->displaySentMessages();
echo '</div>';
echo '</div>';
// obrazec za posiljanje sporocil
echo '<div class="notifications_content_right">';
@ -57,19 +55,33 @@ class Notifications {
}
// Prikazemo prejeta sporocila
else{
echo '<div class="title">';
echo '<div class="title_icon"><span class="faicon fa-inbox"></span></div>';
echo '<h2>'.$lang['srv_notifications_recieved'].'</h2>';
echo '</div>';
echo '<div class="notifications_content">';
echo '<div class="notifications_content_left">';
echo '<div class="recieved_list">';
$this->displayRecievedMessages();
echo '</div>';
echo '</div>';
echo '<div class="notifications_content_right">';
echo '<div id="message" style="display:none;"></div>';
echo '</div>';
echo '</div>';
}
}
private function displayRecievedMessages($active=0){
global $admin_type, $global_user_id, $lang;
echo '<span class="bold">'.$lang['srv_notifications_recieved'].':</span>';
// Napolnimo array prejetih sporocil
$recievedMessages = array();
@ -113,11 +125,12 @@ class Notifications {
$sentMessages[$row['id']] = $row;
}
if(count($sentMessages) > 0){
echo '<div class="sent_list">';
echo '<ul>';
if(count($sentMessages) > 0){
foreach($sentMessages as $message_id => $message){
//echo '<li '.($message['viewed'] == 0 ? ' class="unread"':'').'>';
echo '<li>';
echo '<div class="title_row">'; //sem noter pride v 2. fazi še oznaka, če je obvestilo ali sporočilo
@ -129,7 +142,7 @@ class Notifications {
echo '</div>';
echo '</div>';
$text = strip_tags((strlen($message['text']) > 76) ? substr($message['text'], 0, 76).'...' : $message['text']);
$text = strip_tags($message['text']);
echo '<div class="content">';
echo $text;
echo '</div>';
@ -144,9 +157,11 @@ class Notifications {
echo '</li>';
}
}
echo '</ul>';
echo '</div>';
}
else //Ni poslanih sporočil
echo '<p>'.$lang['srv_notifications_sent_none'].'.</p>';
}
// Obrazec za posiljanje sporocila
@ -182,8 +197,10 @@ class Notifications {
echo '</div>';
// Besedilo sporocila (editor)
echo '<label>'.$lang['srv_notifications_send_text'].':</label>';
echo $lang['srv_notifications_send_text'].':';
echo '<div class="label">';
echo '<textarea id="notification" name="notification" autocomplete="off"></textarea>';
echo '</div>';
// Avtomatsko prikaži obvestilo po prijavi
echo '<div class="auto_checkbox">';
@ -191,15 +208,16 @@ class Notifications {
echo '<label for="force_show">'.$lang['srv_notifications_force_show'].'</label>';
echo '</div>';
echo '<div class="button_holder">';
//Error notes
if($note != ''){
echo '<p class="top16">'.$note.'</p>';
}
// Gumb pošlji
echo '<div class="button_holder '.($note != '' ? 'top16' : '').'">';
echo '<button class="medium blue" onclick="sendNotification(); return false;">'.$lang['srv_notifications_send'].'</button>';
echo '</div>';
if($note != ''){
echo '<br /><br />';
echo '<span class="bold red">'.$note.'</span>';
}
echo '</div>';
// Inicializiramo editor
@ -314,7 +332,7 @@ class Notifications {
$sql = sisplet_query("INSERT INTO srv_notifications (message_id, recipient, viewed) VALUES ('".$message_id."', '".$rowU['id']."', '0')");
if(!$sql)
$note .= mysqli_error($GLOBALS['connect_db']).'<br />';
$note .= '<span class="red">'.mysqli_error($GLOBALS['connect_db']).'</span>';
}
}
// Posiljamo na specificen mail
@ -331,12 +349,12 @@ class Notifications {
// Dodamo novo sporocilo v bazo
$sql = sisplet_query("INSERT INTO srv_notifications (message_id, recipient, viewed) VALUES ('".$message_id."', '".$rowU['id']."', '0')");
if(!$sql)
$note = mysqli_error($GLOBALS['connect_db']);
$note = '<span class="red">'.mysqli_error($GLOBALS['connect_db']).'</span>';
else
$note = 'Sporočilo je bilo uspešno poslano uporabniku '.$recipient.' ('.$rowU['name'].' '.$rowU['surname'].').';
}
else{
$note = 'Vnešeni email ('.$recipient.') ne pripada nobenemu uporabniku!';
$note = '<span class="red">Vnešeni email ('.$recipient.') ne pripada nobenemu uporabniku!</span>';
}
}
@ -356,7 +374,6 @@ class Notifications {
echo '</div>';
// Refresh obrazca za posiljanje sporocil
echo '<div class="notifications_content_right">';
echo '<div class="title">';

View File

@ -1616,6 +1616,10 @@ function create_editor_notification(id) {
this.execCommand('selectAll');
});
if (id == 'notification')
CKEDITOR.config.resize_enabled = false;
CKEDITOR.config.height = 238;
editor_init = true;
}

View File

@ -7194,6 +7194,7 @@ $lang = array (
'srv_notifications' => "Sporočila",
'srv_notifications_recieved' => "Prejeta sporočila",
'srv_notifications_sent' => "Poslana sporočila",
'srv_notifications_sent_none' => "Ni poslanih sporočil",
'srv_notifications_sent_resolve' => "Razreši neprebrane",
'srv_notifications_unread' => "Neprebrana sporočila",
'srv_notifications_alert' => "Imate novo neprebrano sporočilo!",
@ -7201,7 +7202,7 @@ $lang = array (
'srv_notifications_send_reciever2' => "Prejemnik (e-pošta)",
'srv_notifications_send_reciever2' => "Prejemniki",
'srv_notifications_send_title' => "Naslov",
'srv_notifications_send_text' => "Besedilo",
'srv_notifications_send_text' => "Sporočilo",
'srv_notifications_send' => "Pošlji",
'srv_notifications_save_send' => "Shrani in pošlji",
'srv_notifications_send_all_slo' => "Vsi slovenski uporabniki",

View File

@ -7077,6 +7077,7 @@ $lang = array (
'srv_notifications' => "Notifications",
'srv_notifications_recieved' => "Received notifications",
'srv_notifications_sent' => "Sent notifications",
'srv_notifications_sent_none' => "No sent notifications",
'srv_notifications_sent_resolve' => "Resolve unread",
'srv_notifications_unread' => "Unread messages",
'srv_notifications_alert' => "You have new unread message!",

View File

@ -22508,75 +22508,61 @@ div.page_obvestila #notifications .notifications_content .notifications_content_
box-sizing: border-box;
width: 50%;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list {
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list,
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list {
overflow-y: auto;
border: solid 1px #E5E5E5;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul {
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul,
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul {
padding-left: 0;
margin-block-start: 0;
margin-block-end: 0;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li {
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li,
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul li {
box-sizing: border-box;
list-style-type: none;
margin: 0;
padding: 16px;
min-height: 58px;
min-height: 78px;
background-color: #FFFFFF;
border-bottom: solid 1px #E5E5E5;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li:last-of-type {
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li:last-of-type,
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul li:last-of-type {
border-bottom: none;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li div.title_row {
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li div.title_row,
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul li div.title_row {
display: flex;
flex-direction: row;
margin-bottom: 8px;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li div.title_row div.subject {
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li div.title_row div.subject,
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul li div.title_row div.subject {
font-weight: 600;
margin-right: 8px;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li div.title_row div.date {
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li div.title_row div.date,
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul li div.title_row div.date {
font-style: italic;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li div.content {
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li div.content,
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul li div.content {
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li.unread {
border: 1px #FF0000 solid;
background-color: #FF0000;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list {
display: inline;
float: left;
width: 470px;
min-height: 200px;
margin-right: 60px;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul {
padding-left: 0;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul li {
list-style-type: none;
margin: 5px 0;
padding: 5px 8px;
background-color: #1E88E5;
border: 1px #1E88E5 solid;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul li:hover {
cursor: pointer;
background-color: #1E88E5;
border: 1px #1E88E5 solid;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul li.unread {
border: 1px #FF0000 solid;
background-color: #FF0000;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .sent_list ul li.active,
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul li.active {
cursor: pointer;
border: 1px #1E88E5 solid;
}
div.page_obvestila #notifications .notifications_content .notifications_content_left .recieved_list ul li {
cursor: pointer;
}
div.page_obvestila #notifications .notifications_content .notifications_content_right {
display: flex;
flex-direction: column;
@ -22597,18 +22583,19 @@ div.page_obvestila #notifications .notifications_content .notifications_content_
}
div.page_obvestila #notifications .notifications_content .notifications_content_right .send_form .setting_holder .setting_item label {
margin-right: 8px;
cursor: pointer;
}
div.page_obvestila #notifications .notifications_content .notifications_content_right .send_form .setting_holder .setting_item input.text {
width: 250px;
height: 28px;
padding: 3px 5px;
margin-top: 0;
}
div.page_obvestila #notifications .notifications_content .notifications_content_right .send_form input.text {
width: 100%;
}
div.page_obvestila #notifications .notifications_content .notifications_content_right .send_form label {
margin-bottom: 4px;
cursor: text;
div.page_obvestila #notifications .notifications_content .notifications_content_right .send_form div.label {
margin-top: 4px;
}
div.page_obvestila #notifications .notifications_content .notifications_content_right .send_form textarea {
width: 100%;
@ -22621,6 +22608,9 @@ div.page_obvestila #notifications .notifications_content .notifications_content_
margin-top: 32px;
margin-bottom: 0;
}
div.page_obvestila #notifications .notifications_content .notifications_content_right .send_form div.button_holder.top16 {
margin-top: 16px;
}
div.page_obvestila #notifications .notifications_content #message {
display: inline;
float: left;

View File

@ -62,20 +62,22 @@ div.page_obvestila {
box-sizing: border-box;
width: 50%;
// Poslana sporočila
.sent_list {
// Poslana in prejeta sporočila - seznam
.sent_list,
.recieved_list {
overflow-y: auto;
border: solid 1px $gray;
ul {
padding-left: 0;
margin-block-start: 0;
margin-block-end: 0;
li {
box-sizing: border-box;
list-style-type: none;
margin: 0;
padding: 16px;
min-height: 58px;
min-height: 78px;
background-color: $white;
border-bottom: solid 1px $gray;
@ -99,41 +101,12 @@ div.page_obvestila {
div.content {
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
li.unread {
border: 1px $red solid;
background-color: $red;
}
}
}
//Prejeta sporočila - še stari styling
.recieved_list {
display: inline;
float: left;
width: 470px;
min-height: 200px;
margin-right: 60px;
ul {
padding-left: 0;
li {
list-style-type: none;
margin: 5px 0;
padding: 5px 8px;
background-color: $blue;
border: 1px $blue solid;
&:hover {
cursor: pointer;
background-color: $blue;
border: 1px $blue solid;
}
}
li.unread {
border: 1px $red solid;
background-color: $red;
}
li.active {
cursor: pointer;
border: 1px $blue solid;
@ -141,6 +114,14 @@ div.page_obvestila {
}
}
.recieved_list {
ul {
li {
cursor: pointer;
}
}
}
}
.notifications_content_right {
@ -167,12 +148,14 @@ div.page_obvestila {
label {
margin-right: 8px;
cursor: pointer;
}
input.text {
width: 250px;
height: 28px;
padding: 3px 5px;
margin-top: 0;
}
}
}
@ -181,9 +164,8 @@ div.page_obvestila {
width: 100%;
}
label {
margin-bottom: 4px;
cursor: text;
div.label {
margin-top: 4px;
}
textarea {
@ -198,6 +180,9 @@ div.page_obvestila {
div.button_holder {
margin-top: 32px;
margin-bottom: 0;
&.top16 {
margin-top: 16px;
}
}
}