Skip to content

Commit

Permalink
Show message flagged status in message view (#5080)
Browse files Browse the repository at this point in the history
for Larry and Elastic
  • Loading branch information
alecpl committed May 25, 2018
1 parent 9d3d600 commit 3ede8e5
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ CHANGELOG Roundcube Webmail
- Support additional connect parameters in PostgreSQL database wrapper
- Use UI dialogs instead of confirm() and alert() where possible
- Display value of the SMTP message size limit in the error message (#6032)
- Show message flagged status in message view (#5080)
- Skip redundant INSERT query on successful logon when using PHP7
- Replace display_version with display_product_version (#5904)
- Extend disabled_actions config so it accepts also button names (#5903)
Expand Down
7 changes: 7 additions & 0 deletions program/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ function rcube_webmail()
parent.rcmail.show_contentframe(true);
}

if ($.inArray('flagged', this.env.message_flags) >= 0) {
$(document.body).addClass('status-flagged');
}

// initialize drag-n-drop on attachments, so they can e.g.
// be dropped into mail compose attachments in another window
if (this.gui_objects.attachments)
Expand Down Expand Up @@ -3343,13 +3347,16 @@ function rcube_webmail()
this.toggle_flagged_status = function(flag, a_uids)
{
var i, len = a_uids.length,
win = this.env.contentframe ? this.get_frame_window(this.env.contentframe) : window,
post_data = this.selection_post_data({_uid: this.uids_to_list(a_uids), _flag: flag}),
lock = this.display_message('markingmessage', 'loading');

// mark all message rows as flagged/unflagged
for (i=0; i<len; i++)
this.set_message(a_uids[i], 'flagged', (flag == 'flagged' ? true : false));

$(win.document.body)[flag == 'flagged' ? 'addClass' : 'removeClass']('status-flagged');

this.http_post('mark', post_data, lock);
};

Expand Down
9 changes: 4 additions & 5 deletions program/steps/mail/show.inc
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,23 @@ if ($uid) {

$OUTPUT->set_pagetitle(abbreviate_string($MESSAGE->subject, 128, '...', true));

// set message environment
// set environment
$OUTPUT->set_env('uid', $msg_id);
$OUTPUT->set_env('safemode', $MESSAGE->is_safe);
$OUTPUT->set_env('message_context', $MESSAGE->context);
$OUTPUT->set_env('message_flags', array_keys(array_change_key_case((array) $MESSAGE->headers->flags)));
$OUTPUT->set_env('sender', $MESSAGE->sender['string']);
$OUTPUT->set_env('mailbox', $mbox_name);
$OUTPUT->set_env('username', $RCMAIL->get_user_name());
$OUTPUT->set_env('permaurl', $RCMAIL->url(array('_action' => 'show', '_uid' => $msg_id, '_mbox' => $mbox_name)));
$OUTPUT->set_env('has_writeable_addressbook', $_SESSION['writeable_abook']);
$OUTPUT->set_env('delimiter', $RCMAIL->storage->get_hierarchy_delimiter());
$OUTPUT->set_env('mimetypes', rcmail_supported_mimetypes());

if ($MESSAGE->headers->get('list-post', false)) {
$OUTPUT->set_env('list_post', true);
}

// set environment
$OUTPUT->set_env('delimiter', $RCMAIL->storage->get_hierarchy_delimiter());
$OUTPUT->set_env('mimetypes', rcmail_supported_mimetypes());

// set configuration
$RCMAIL->set_env_config(array('delete_junk', 'flag_for_deletion', 'read_when_deleted',
'skip_deleted', 'display_next', 'forward_attachment'));
Expand Down
9 changes: 9 additions & 0 deletions skins/elastic/styles/widgets/mail.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
font-size: 1.5rem;
font-weight: bold;
white-space: nowrap;

body.status-flagged &:before {
&:extend(.font-icon-class);
display: inline;
float: none;
content: @fa-var-flag;
font-size: 1em;
color: @color-error;
}
}

.short-header {
Expand Down
12 changes: 12 additions & 0 deletions skins/larry/mail.css
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,18 @@ div.message-partheaders .headers-table td.header {
padding-right: 0;
}

.subject .flag-icon {
display: none;
}

body.status-flagged .flag-icon {
display: inline-block;
background: url(images/listicons.png) 0 -1038px no-repeat;
width: 20px;
height: 16px;
vertical-align: text-top;
}


/*** message composition ***/

Expand Down
2 changes: 1 addition & 1 deletion skins/larry/templates/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h2 id="aria-label-countcontrols" class="voice"><roundcube:label name="arialabel
</div>
<roundcube:endif />

<h2 class="subject"><span onmouseover="rcube_webmail.long_subject_title(this)"><span class="voice"><roundcube:label name="subject" />: </span><roundcube:object name="messageHeaders" valueOf="subject" /></span></h2>
<h2 class="subject"><span class="flag-icon"></span><span onmouseover="rcube_webmail.long_subject_title(this)"><span class="voice"><roundcube:label name="subject" />: </span><roundcube:object name="messageHeaders" valueOf="subject" /></span></h2>
<div class="message-headers">
<roundcube:object name="messageHeaders" class="headers-table" addicon="/images/addcontact.png" exclude="subject" max="20" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion skins/larry/templates/messagepreview.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h2 id="aria-label-messagetoolbar" class="voice"><roundcube:label name="arialabe
<roundcube:endif />
</div>

<h3 class="subject"><span onmouseover="rcube_webmail.long_subject_title(this)"><span class="voice"><roundcube:label name="subject" />: </span><roundcube:object name="messageHeaders" valueOf="subject" /></span></h3>
<h3 class="subject"><span class="flag-icon"></span><span onmouseover="rcube_webmail.long_subject_title(this)"><span class="voice"><roundcube:label name="subject" />: </span><roundcube:object name="messageHeaders" valueOf="subject" /></span></h3>

<a href="#details" id="previewheaderstoggle" class="moreheaderstoggle" aria-expanded="false"><span class="iconlink" title="<roundcube:label name='togglemoreheaders' />"></span></a>
<div id="contactphoto"><roundcube:object name="contactphoto" /></div>
Expand Down

0 comments on commit 3ede8e5

Please sign in to comment.