diff options
| author | Jérome Maes <jem@openerp.com> | 2015-08-11 10:17:10 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2015-09-01 20:16:09 +0200 |
| commit | 449f25463843767ba41a9a8c2adfdd4ceb2f2e5c (patch) | |
| tree | 5a45357150f4b6f1d7977badc9c84843f64d8d11 /addons/mail/static/src/less | |
| parent | a9a78ee9b6a499c29b284e1612951cc20249502f (diff) | |
[REF] mail : include real time, and replace Timeline features
This commit add instant messaging features in mail module to make it a real team collaboration tool. Lots of these new features will replace Timeleine view (which is not removed in this commit). Many files have been moved, split or created for a better structure.
- My Channels : A user can be member of channel (mail.channel). These are discussion group, but also an aggregate of notification. Setting a channel as document follower, it will receive all the message (of the chatter) in real time, as information stream.
- A new Inbox : this aims to replace the timeline view. The user will see its channels grouped by 'slot', and receive the message in real time. Jump to the form view, invite people, create private discussion group, talk directly to another employee, ... are the main features. Your message can still be starred. The 'Inbox' will only contain your needaction.
- Needaction concept : a needaction is a message calling you to do something. If you follow a document as a person, the posted message will be 'needaction' for you. It can also be a message where you are mention with a '@my_name' (this feature is not added in this commit).
- The chatter doesn't change so much. It still allow you to see the discussion about the document, to star some message, and treat your needaction.
- Chat : the only way to have a minified conversation is from the Inbox Client Action. It allow you to keep an eye on a channel when working on document.
- Compose Message : it is now common to the Inbox, and the chatter. It offers shortcode substitution, attachments management, and optional subtype.
- UI : the chat window has been clean, they have a new look now.
To do so,
- Chatter code have been completely rewrite, independently of timeline view
- Add 'bus' as mail dependency, to insure real time
- A mail.message is broadcasted on the bus channel (db, mail.channel, channel_id), and a channel header on (db, res.partner, partner_id)
- Extracting mail_thread mixin used for Chatter and ChatMailThread (Inbox client action). This uniformize the programming structure with the server side
- Clean CSS style and use LESS instead of CSS
- Define a new messafe format (message_format method in mail_message.py), compatible with fetching and broadcasting
- Apply guideline coding conventions
This commit also break the module im_livechat, since im_chat models don't exists anymore and will be fixed in the next commit.
Thanks to Thibault Delavallee (tde) for the long debates and precious advices, Richard Mathot (rim) for the support, Simon Lejeune (sle) for the client action layout, and the Usability Team (apr, lle, bst yti) for the long testing.
Conflicts:
addons/mail/models/mail_thread.py
Diffstat (limited to 'addons/mail/static/src/less')
| -rw-r--r-- | addons/mail/static/src/less/mail_chat_backend.less | 212 | ||||
| -rw-r--r-- | addons/mail/static/src/less/mail_chatter.less | 54 | ||||
| -rw-r--r-- | addons/mail/static/src/less/mail_thread.less | 184 |
3 files changed, 450 insertions, 0 deletions
diff --git a/addons/mail/static/src/less/mail_chat_backend.less b/addons/mail/static/src/less/mail_chat_backend.less new file mode 100644 index 00000000000..80fe41c541c --- /dev/null +++ b/addons/mail/static/src/less/mail_chat_backend.less @@ -0,0 +1,212 @@ + +// ------------------------------------------------------------------ +// Layout +// ------------------------------------------------------------------ +.o_mail_chat { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + height: 100%; + + @media (max-width: @screen-xs-max) { + position: static; + height: auto; + } + + .o-flex-display(); + .o-flex-flow(row, nowrap); + + .o_mail_chat_sidebar { + .o-flex(0, 0, 15%); + overflow: auto; + } + + .o_mail_chat_content { + .o-flex(0, 0, 85%); + height: 100%; + .o-flex-display(); + .o-flex-flow(column, nowrap); + @media (max-width: @screen-xs-max) { + height: auto; + } + + .o_mail_chat_messages { + .o-flex(1, 0, 0); + overflow: auto; + } + + .o_mail_chat_composer_wrapper { + .o-flex(0, 0, auto); + .o-flex-display(); + /* + > img { + .o-flex(0, 0, auto); + width: 64px; + height: 64px; + } + + > input { + .o-flex(1, 0, auto); + } + */ + } + } +} + +// ------------------------------------------------------------------ +// Style +// ------------------------------------------------------------------ +.o_mail_chat { + .o_mail_chat_sidebar { + background-color: @gray; + padding: 1%; + + > .nav-pills { + > li { + > a { + color: @odoo-brand-optional; // community compatibility: override base.css + &:hover, &:focus { + background-color: @gray-dark; + } + &.active { + background-color: @gray-dark; + } + } + + &.o_mail_chat_channel_item, &.o_mail_chat_partner_item { + > a { + color: @gray-lighter; + > .badge { + color: white; + background-color: @odoo-brand-optional; + } + + > i.fa { + padding-top: 3px; + padding-right: 3px; + + &.o_online { + color: @odoo-brand-optional; + } + } + } + } + } + } + + .o_mail_chat_channel_item.o_mail_chat_channel_unread, .o_mail_chat_partner_item.o_mail_chat_channel_unread{ + font-weight: bold; + } + + .o_mail_chat_sidebar_title { + text-transform: uppercase; + color: @gray-lighter; + margin-top: 25px; + .user-select(none); + cursor: default; + } + + .o_mail_chat_add_more_search{ + padding: @padding-base-vertical @padding-base-horizontal; + .o_mail_chat_add_more_text{ + color: @gray-lighter; + display: inline-block; + font-style: italic; + cursor: pointer; + font-size: @font-size-base; + } + .o_mail_chat_add_more_text:hover{ + text-decoration: underline; + color: white; + cursor: pointer; + } + } + + } + + .o_mail_chat_content { + background-color: white; + + .o_mail_chat_help_message{ + padding: 25px; + color: @gray-light; + } + + .o_mail_thread_date_separator{ + margin: auto; + width: 90%; + .o_mail_thread_date_wrapper { + position: relative; + height: 20px; + border-bottom: solid WhiteSmoke 2px; + margin-bottom: 15px; + .o_mail_thread_date_separator_title { + display: table; + position: relative; + top: 10px; + left: 0; + right: 0; + margin: 0 auto; + padding: 0 10px 0 10px; + font-weight: bold; + background: white; + } + } + } + + .o_mail_thread_message{ + //border-bottom: solid WhiteSmoke 1px; + } + /* + .o_mail_chat_messages { + .o_slack_message { + .o_slack_message_avatar { + > img { + + } + } + .o_slack_message_content { + .o_slack_message_author { + font-weight: bold; + .o_slack_message_time { + font-weight: normal; + color: @gray-light; + } + } + + } + } + } + */ + + .o_mail_chat_composer_wrapper { + border-top: 1px solid @gray-lighter; + background-color: @gray-lighter; + padding: 10px; + .o_mail_compose_message{ + margin-bottom: 0px; + } + /* + > img { + background-image: url(/web/static/src/img/placeholder.png); + } + > input { + padding-left: 15px; + resize: none; + border: 0; + outline: none; + } + */ + } + } +} + + +// ------------------------------------------------------------------ +// Other components +// ------------------------------------------------------------------ +.o_mail_chat_partner_invite{ + height: 50px; +} diff --git a/addons/mail/static/src/less/mail_chatter.less b/addons/mail/static/src/less/mail_chatter.less new file mode 100644 index 00000000000..1f7e9b29018 --- /dev/null +++ b/addons/mail/static/src/less/mail_chatter.less @@ -0,0 +1,54 @@ + +.o_mail_chatter{ + /* Layout for chatter header (buttons and compose message) */ + .o_mail_chatter_compose_buttons, .o_mail_chatter_compose_message_wrap{ + padding-left:15px; + margin-bottom:20px; + //background-color: lightGrey; + } + + /* Specific message style for chatter */ + .o_mail_chatter_messages{ + + .o_mail_thread_message{ + .o_mail_thread_message_type_comment{ // message comment + &:not(.o_mail_thread_message_subtype_note){ + background-color: white; + box-shadow: 0px 1px #CACACA; + } + } + .o_mail_thread_message_type_email{ // message email + background-color: white; + box-shadow: 0px 1px #CACACA; + } + .o_mail_thread_message_type_notification{ // message notification + + } + } + + .o_mail_thread_date_separator{ + .o_mail_thread_date_wrapper { + height: 20px; + .o_mail_thread_date_separator_title { + text-align: center; + font-weight: bold; + color: @gray-light; + } + } + } + } + .o_mail_chatter_show_more_message{ + text-align: center; + cursor: pointer; + } + +} + + +.o_mail_chatter_compose_message{ + .o_mail_chatter_compose_message_suggested_partners label{ + vertical-align: middle; + display: block; + line-height: 14px; + } +}
\ No newline at end of file diff --git a/addons/mail/static/src/less/mail_thread.less b/addons/mail/static/src/less/mail_thread.less new file mode 100644 index 00000000000..15cfc5cdf94 --- /dev/null +++ b/addons/mail/static/src/less/mail_thread.less @@ -0,0 +1,184 @@ +// ------------------------------------------------------------------ +// Mail Thread 'Mixin' +// ------------------------------------------------------------------ +.o_mail_thread{ + + /* Starred and Needaction on message */ + .o_mail_thread_message_star, .o_mail_thread_message_needaction { + opacity: 0.5; + color: black; + } + .o_mail_thread_message_star:hover, .o_mail_thread_message_needaction:hover{ + opacity: 1; + cursor: pointer; + } + .o_mail_thread_message_star.o_mail_message_starred{ + color: orange; + } + /* author avatar */ + .o_mail_thread_avatar{ + width: 4.5em; + max-width: 50px; + } + /* message layout */ + .o_mail_thread_message{ + margin-bottom: 10px; + } + .o_mail_thread_message_avatar{ + text-align: center; + } + .o_mail_thread_message_core{ + padding: 5px; + } + .o_mail_thread_message_info{ + margin-top: 0; + } + + /* mail redirect */ + .o_mail_redirect{ + cursor: pointer; + } +} + +// ------------------------------------------------------------------ +// Mail Compose Message +// ------------------------------------------------------------------ +.o_mail_compose_message{ + + // Emoji size in the popover + .o_mail_compose_message_emoji_img img{ + height: 26px; + } + + .o_mail_compose_message_mode_mail{ + textarea { + resize: vertical; + width: 100%; + } + } +} + +// ------------------------------------------------------------------ +// Attachment Icons (common for mail thread message and compose message) +// ------------------------------------------------------------------ + +@-webkit-keyframes oe_mail_attach_loading_anim { + 0% { background: #4BBD00 } + 50% { background: #009123 } + 100% { background: #4BBD00 } +} +@-moz-keyframes oe_mail_attach_loading_anim { + 0% { background: #4BBD00 } + 50% { background: #009123 } + 100% { background: #4BBD00 } +} +@-o-keyframes oe_mail_attach_loading_anim { + 0% { background: #4BBD00 } + 50% { background: #009123 } + 100% { background: #4BBD00 } +} +@keyframes oe_mail_attach_loading_anim { + 0% { background: #4BBD00 } + 50% { background: #009123 } + 100% { background: #4BBD00 } +} + +.o_mail_attachment{ + display: inline-block; + width: 100px; + margin: 4px 2px; + min-height: 80px; + position: relative; + border-radius: 3px; + text-align: center; + vertical-align: top; + + img { + position: absolute; + width: 48px; + height: 48px; + top: 0px; + left: 50%; + margin-left: -24px; + } + + .o_mail_attachment_name { + display: inline-block; + max-width: 100%; + padding: 1px 3px; + margin-top: 50px; + margin-bottom: 5px; + background: #F2F7FF; + overflow: hidden; + color: #4c4c4c; + text-shadow: none; + border-radius: 3px; + } + + &.o_mail_attachment_preview { + background: url( data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAJ0lEQVQYV2MsLS39z4AGLCws0IUYGIeCwrVr12J45sSJE5ieGQIKAbuZKf/EMCs7AAAAAElFTkSuQmCC ); + } + + &.o_mail_attachment_preview img { + display: block; + position: relative; + margin:0px; + width: 100px; + height: 80px; + border-radius: 1px; + border: solid 3px #FFF; + margin-left: -50px; + box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.19); + } + + .o_mail_attachment_progress_bar { + display: none; + position: absolute; + top: 18px; + left: 16px; + right: 16px; + height: 17px; + line-height: 13px; + padding: 0px; + background: #4BBD00; + color: white; + text-align: center; + border-radius: 3px; + border: solid 1px rgba(0,0,0,0.2); + box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.34); + -webkit-animation: oe_mail_attach_loading_anim 0.75s infinite linear; + -moz-animation: oe_mail_attach_loading_anim 0.75s infinite linear; + -o-animation: oe_mail_attach_loading_anim 0.75s infinite linear; + animation: oe_mail_attach_loading_anim 0.75s infinite linear; + } + + &.o_mail_uploading .o_mail_attachment_progress_bar { + display: block; + } + .o_mail_attachment_delete .fa { + display: none; + } + + .o_mail_attachment_delete .fa { + display: block; + position: absolute; + top: -7px; + right: 0px; + color: black; + text-shadow: 1px 0px white, -1px 0px white, 0px 1px white, 0px -1px white; + cursor: pointer; + opacity: 0; + -webkit-transition: opacity 0.2s linear; + -moz-transition: opacity 0.2s linear; + -o-transition: opacity 0.2s linear; + transition: opacity 0.2s linear; + } + + &:hover .o_mail_attachment_delete .fa { + opacity: 1; + -webkit-transition: opacity 0.2s linear; + -moz-transition: opacity 0.2s linear; + -o-transition: opacity 0.2s linear; + transition: opacity 0.2s linear; + } +} |
