1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-02 07:47:32 +00:00

[msg] redesigned send-msg popup, improved topbar & user-msg page

This commit is contained in:
llj 2013-06-01 14:15:47 +08:00
parent 0857b1dd6e
commit beee5c0909
19 changed files with 894 additions and 269 deletions

View File

@ -55,14 +55,15 @@ a.normal {font-weight: normal;}
a:hover { color: #ff9933; text-decoration: underline; }
img { border:none; }
textarea {
border: 1px solid #ddd;
overflow: auto; /* rm default vertical scrollbar in ie */
resize: vertical; /* for drag */
outline:0;
}
textarea, select, input {
border: 1px solid #ddd;
}
input {
height:22px;
border: 1px solid #ddd;
margin:3px 0;
outline:0;
}
@ -154,9 +155,6 @@ td { color: #333; }
table img {
vertical-align:middle;
}
tr.bold {
font-weight:bold;
}
p {
margin:0.5em 0;
}
@ -187,6 +185,10 @@ p {
color:#808080;
font-size:12px;
}
.loading-tip { /*for img*/
display:block;
margin:1em auto;
}
.icon-plus, .icon-minus, .icon-pencil,
.icon-star-empty, .icon-star {
font-size:16px;
@ -510,50 +512,68 @@ textarea:-moz-placeholder {/* for FF */
}
/* top-bar */
#top-bar {
}
.top-bar-inner {
background:#2d2d2d;
}
.top-bar-con {
color:#fff;
font-weight:bold;
height:24px;
width:950px;
margin:0 auto;
position:relative;
}
.top-bar-con a {
color:#ddd;
font-weight:normal;
padding:0 2px;
#send-msg-popup {
width:320px;
padding:15px;
background:#fff;
border:1px solid #ddd;
box-shadow:0 0 5px #ccc;
position:absolute;
right:0;
top:24px;
z-index:100;/* for pages with jquery tabs*/
}
.top-bar-con a,
.top-bar-con span {
.top-bar-con .top-link {
display:inline-block;
height:24px;
padding:0 2px;
line-height:24px;
color:#ddd;
font-weight:normal;
}
.top-bar-con .my-info {
color:#fff;
padding-right:7px;
border-right:1px solid #aaa;
margin-right:3px;
}
.top-bar-con button {
padding:0 6px;
border-radius:2px;
line-height:16px;
margin-right:2px;
}
#add-msg.add-msg-hl {
background:#fff;
line-height:22px;
}
.top-bar-con .avatar-link {
height:16px;
vertical-align:middle;
margin-bottom:3px;
margin-bottom:2px;
*margin-bottom:0;/*for ie 7*/
}
.top-bar-con .avatar {
border-radius: 2px;
-moz-border-radius: 2px;
}
.top-bar-con a.cur {
.top-bar-con .cur {
background:#000;
border-top:2px solid #B00;
height:20px;
line-height:20px;
padding-bottom:2px;
}
.top-bar-con span {
margin-right:3px;
}
.top-bar-con a:hover {
.top-bar-con .top-link:hover {
text-decoration:none;
background:#a0a;
}
@ -589,12 +609,14 @@ textarea:-moz-placeholder {/* for FF */
#to-group a {
color:#000;
display:block;
padding:0 5px;
padding:1px 5px;
font-weight:normal;
}
#account-context-selector a:hover,
#lang-context-selector a:hover,
#to-group a:hover {
background:#eee;
text-decoration:none;
}
/* header */
@ -1614,8 +1636,7 @@ textarea:-moz-placeholder {/* for FF */
#grp-repos-commits td {
padding:6px 3px;
}
#group-reply,
.new-reply-msg-list {
.msg-panel {
width:640px;
margin-top:10px;
}
@ -1623,26 +1644,28 @@ textarea:-moz-placeholder {/* for FF */
font-size:12px;
color:#333;
}
#group-message-form {
.msg-form {
padding:6px;
width:562px;
background:#f9f9f9;
border:1px solid #c4c4c4;
border-radius:5px;
margin-left:64px;
position:relative;
}
#group-message-form .avatar {
.msg-form .avatar {
position:absolute;
left:-64px;
top:-1px;
}
#message {
.msg-input {
width:550px;
padding:3px 5px;
height:25px;
vertical-align:top;
}
.personal-msg-panel .msg-input {
width:486px;
}
.say {
position:absolute;
width:10px;
@ -1659,6 +1682,10 @@ textarea:-moz-placeholder {/* for FF */
.msg .txt {
margin-left:64px;
}
.personal-msg-panel .msg-form,
.personal-msg-panel .msg .txt {
margin-right:64px;
}
.msg a {
font-weight: normal;
}
@ -1670,9 +1697,17 @@ textarea:-moz-placeholder {/* for FF */
border-top-left-radius:3px;
border-top-right-radius:3px;
}
.personal-msg-panel .msg-main {
border-radius:3px;
}
.msg-main .say {
background-image:url('../img/say_white.png');
}
.msg-received .say {
background-image:url('../img/say_white_reverse.png');
left:auto;
right:-10px;
}
.msg-attachment {
padding-top:10px;
border-top:1px solid #e9e9e9;
@ -1768,8 +1803,8 @@ textarea:-moz-placeholder {/* for FF */
height:20px;
vertical-align:top;
}
#group-message-form .submit,
#group-message-form .cancel,
.msg-form .submit,
.msg-form .cancel,
.reply-submit,
.reply-cancel {
margin-top:6px;
@ -2079,13 +2114,6 @@ textarea:-moz-placeholder {/* for FF */
width:auto;
padding:6px 0;
}
#to-group a {
font-weight:normal;
padding:1px 5px;
}
#to-group a:hover {
text-decoration:none;
}
/*discuss to group*/
#discuss-to-group-form .checkbox-label {
display:inline-block;
@ -2343,15 +2371,11 @@ textarea:-moz-placeholder {/* for FF */
.search-results-item .time {
color:#666;
}
#plan-form {
width:260px;
}
/*send-msg-form*/
#link-send-input,
#mass_email,
#mass_msg,
#mass-msg,
#share-link,
#added-member-name,
#added-admin-name {
@ -2362,57 +2386,29 @@ textarea:-moz-placeholder {/* for FF */
#member-add-form {
width:266px;
}
#send-msg-form {
width:320px;
}
#mass_email {
#mass-msg {
width:314px;
margin-bottom:3px;
}
#mass_msg {
width:314px;
#mass-email {
width:322px;
}
#send-msg-form .share-permission-select {
width:100%;
}
/*tabs */
#tabs,
#send-msg-tabs {
#tabs {
font-size:1em;
padding:0;
border:0;
min-height:150px;
margin-bottom:75px;
}
#send-msg-tabs {
margin-bottom:0;
}
#tabs-nav,
#send-msg-tabs-nav {
#tabs-nav {
padding:0;
}
#send-msg-tabs-nav {
height:30px;
border-bottom:1px solid #ddd;
border-radius:0;
margin-bottom:10px;
}
#tabs-nav li {
float:left;
border:0;
background:none;
}
#send-msg-tabs-nav li {
display:inline-block;
border:1px solid transparent;
border-bottom:0;
background:none;
}
#send-msg-tabs-nav li a {
color:#666;
line-height:16px;
padding:6px 13px;
}
#tabs-nav .long-item {
margin-left:.4em;
}
@ -2426,49 +2422,12 @@ textarea:-moz-placeholder {/* for FF */
color:#DD4B39;
border-bottom:2px solid #DD4B39;
}
#send-msg-tabs-nav .ui-state-active {
border-color:#ddd;
border-radius:3px 3px 0 0;
background:#fff;
margin-bottom:-1px;
}
#send-msg-tabs-nav .ui-state-active a {
font-weight:bold;
}
#tabs-nav li a:hover {
color:#DD4B39;
}
#send-msg-tabs-nav li a:hover {
color:#333;
}
#tabs .ui-tabs-panel,
#send-msg-tabs .ui-tabs-panel {
#tabs .ui-tabs-panel {
padding:0;
}
#send-msg-tabs .option-list {
max-height:200px;
overflow:auto;
margin-bottom:5px;
position:relative;/* to fix ie7 'scroll position' problem */
}
#personal-message-form {
padding:6px;
width:562px;
background:#f9f9f9;
border:1px solid #c4c4c4;
border-radius:5px;
margin-left:64px;
position:relative;
}
#personal-message-form .avatar {
position:absolute;
left:-64px;
top:-1px;
}
#personal-message-form .submit,
#personal-message-form .cancel,
.reply-submit,
.reply-cancel {
margin-top:6px;

624
media/css/select2.css Normal file
View File

@ -0,0 +1,624 @@
/*
Version: 3.4.0 Timestamp: Tue May 14 08:27:33 PDT 2013
*/
.select2-container {
margin: 0;
position: relative;
display: inline-block;
/* inline-block for ie7 */
zoom: 1;
*display: inline;
vertical-align: middle;
}
.select2-container,
.select2-drop,
.select2-search,
.select2-search input{
/*
Force border-box so that % widths fit the parent
container without overlap because of margin/padding.
More Info : http://www.quirksmode.org/css/box.html
*/
-webkit-box-sizing: border-box; /* webkit */
-khtml-box-sizing: border-box; /* konqueror */
-moz-box-sizing: border-box; /* firefox */
-ms-box-sizing: border-box; /* ie */
box-sizing: border-box; /* css3 */
}
.select2-container .select2-choice {
display: block;
height: 26px;
padding: 0 0 0 8px;
overflow: hidden;
position: relative;
border: 1px solid #aaa;
white-space: nowrap;
line-height: 26px;
color: #444;
text-decoration: none;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #fff;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%);
background-image: -ms-linear-gradient(top, #ffffff 0%, #eeeeee 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
background-image: linear-gradient(top, #ffffff 0%, #eeeeee 50%);
}
.select2-container.select2-drop-above .select2-choice {
border-bottom-color: #aaa;
-webkit-border-radius:0 0 4px 4px;
-moz-border-radius:0 0 4px 4px;
border-radius:0 0 4px 4px;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
}
.select2-container.select2-allowclear .select2-choice span {
margin-right: 42px;
}
.select2-container .select2-choice span {
margin-right: 26px;
display: block;
overflow: hidden;
white-space: nowrap;
-ms-text-overflow: ellipsis;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
}
.select2-container .select2-choice abbr {
display: none;
width: 12px;
height: 12px;
position: absolute;
right: 24px;
top: 8px;
font-size: 1px;
text-decoration: none;
border: 0;
background: url('../img/select2.png') right top no-repeat;
cursor: pointer;
outline: 0;
}
.select2-container.select2-allowclear .select2-choice abbr {
display: inline-block;
}
.select2-container .select2-choice abbr:hover {
background-position: right -11px;
cursor: pointer;
}
.select2-drop-mask {
position: absolute;
left: 0;
top: 0;
z-index: 9998;
}
.select2-drop {
width: 100%;
position: absolute;
z-index: 9999;
top: 100%;
background: #fff;
color: #000;
border: 1px solid #ddd;
border-top: 0;
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
.select2-drop-auto-width {
border-top: 1px solid #aaa;
width: auto;
}
.select2-drop-auto-width .select2-search {
padding-top: 4px;
}
.select2-drop.select2-drop-above {
margin-top: 1px;
border-top: 1px solid #aaa;
border-bottom: 0;
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
-moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
}
.select2-container .select2-choice div {
display: inline-block;
width: 18px;
height: 100%;
position: absolute;
right: 0;
top: 0;
border-left: 1px solid #aaa;
-webkit-border-radius: 0 4px 4px 0;
-moz-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
background: #ccc;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%);
}
.select2-container .select2-choice div b {
display: block;
width: 100%;
height: 100%;
background: url('../img/select2.png') no-repeat 0 1px;
}
.select2-search {
display: inline-block;
width: 100%;
min-height: 26px;
margin: 0;
padding-left: 4px;
padding-right: 4px;
position: relative;
z-index: 10000;
white-space: nowrap;
}
.select2-search input {
width: 100%;
height: auto !important;
min-height: 26px;
padding: 4px 20px 4px 5px;
margin: 0;
outline: 0;
font-family: sans-serif;
font-size: 1em;
border: 1px solid #aaa;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background: #fff url('../img/select2.png') no-repeat 100% -22px;
background: url('../img/select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url('../img/select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('../img/select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('../img/select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background: url('../img/select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
background: url('../img/select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
}
.select2-drop.select2-drop-above .select2-search input {
margin-top: 4px;
}
.select2-search input.select2-active {
background: #fff url('../img/select2-spinner.gif') no-repeat 100%;
background: url('../img/select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url('../img/select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('../img/select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('../img/select2-spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background: url('../img/select2-spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
background: url('../img/select2-spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
}
.select2-container-active .select2-choice,
.select2-container-active .select2-choices {
border: 1px solid #5897fb;
outline: none;
}
.select2-dropdown-open .select2-choice {
border-bottom-color: transparent;
-webkit-box-shadow: 0 1px 0 #fff inset;
-moz-box-shadow: 0 1px 0 #fff inset;
box-shadow: 0 1px 0 #fff inset;
-webkit-border-bottom-left-radius: 0;
-moz-border-radius-bottomleft: 0;
border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
-moz-border-radius-bottomright: 0;
border-bottom-right-radius: 0;
background-color: #eee;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
}
.select2-dropdown-open.select2-drop-above .select2-choice,
.select2-dropdown-open.select2-drop-above .select2-choices {
border: 1px solid #5897fb;
border-top-color: transparent;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, white), color-stop(0.5, #eeeeee));
background-image: -webkit-linear-gradient(center top, white 0%, #eeeeee 50%);
background-image: -moz-linear-gradient(center top, white 0%, #eeeeee 50%);
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: -ms-linear-gradient(bottom, #ffffff 0%,#eeeeee 50%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
background-image: linear-gradient(bottom, #ffffff 0%,#eeeeee 50%);
}
.select2-dropdown-open .select2-choice div {
background: transparent;
border-left: none;
filter: none;
}
.select2-dropdown-open .select2-choice div b {
background-position: -18px 1px;
}
/* results */
.select2-results {
max-height: 200px;
margin: 4px;
position: relative;
overflow-x: hidden;
overflow-y: auto;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.select2-results ul.select2-result-sub {
margin: 0;
padding-left: 0;
}
.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
.select2-results li {
list-style: none;
display: list-item;
background-image: none;
}
.select2-results li.select2-result-with-children > .select2-result-label {
font-weight: bold;
}
.select2-results .select2-result-label {
padding: 3px 7px 4px;
margin: 0;
cursor: pointer;
min-height: 1em;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.select2-results .select2-highlighted {
background: #eee;
}
.select2-results li em {
background: #feffde;
font-style: normal;
}
.select2-results .select2-highlighted em {
background: transparent;
}
.select2-results .select2-highlighted ul {
background: white;
color: #000;
}
.select2-results .select2-no-results,
.select2-results .select2-searching,
.select2-results .select2-selection-limit {
background: #f4f4f4;
display: list-item;
}
/*
disabled look for disabled choices in the results dropdown
*/
.select2-results .select2-disabled.select2-highlighted {
color: #666;
background: #f4f4f4;
display: list-item;
cursor: default;
}
.select2-results .select2-disabled {
background: #f4f4f4;
display: list-item;
cursor: default;
}
.select2-results .select2-selected {
display: none;
}
.select2-more-results.select2-active {
background: #f4f4f4 url('../img/select2-spinner.gif') no-repeat 100%;
}
.select2-more-results {
background: #f4f4f4;
display: list-item;
}
/* disabled styles */
.select2-container.select2-container-disabled .select2-choice {
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container.select2-container-disabled .select2-choice div {
background-color: #f4f4f4;
background-image: none;
border-left: 0;
}
.select2-container.select2-container-disabled .select2-choice abbr {
display: none;
}
/* multiselect */
.select2-container-multi .select2-choices {
height: auto !important;
height: 1%;
position: relative;
border: 1px solid #ddd;
cursor: text;
overflow: hidden;
background-color: #fff;
}
.select2-locked {
padding: 3px 5px 3px 5px !important;
}
.select2-container-multi .select2-choices {
min-height: 26px;
}
.select2-container-multi.select2-container-active .select2-choices {
outline: none;
}
.select2-container-multi .select2-choices li {
float: left;
list-style: none;
}
.select2-container-multi .select2-choices .select2-search-field {
margin: 0;
padding: 0;
white-space: nowrap;
}
.select2-container-multi .select2-choices .select2-search-field input {
padding: 2px;
margin: 1px 0;
font-size: 100%;
color: #666;
outline: 0;
border: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background: transparent !important;
}
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
background: #fff url('../img/select2-spinner.gif') no-repeat 100% !important;
}
.select2-default {
color: #999 !important;
}
.select2-container-multi .select2-choices .select2-search-choice {
padding: 3px 5px 3px 18px;
margin: 3px 0 3px 5px;
position: relative;
line-height: 13px;
color: #333;
cursor: default;
border: 1px solid #aaaaaa;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
-moz-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0 );
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
}
.select2-container-multi .select2-choices .select2-search-choice span {
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice-focus {
background: #d4d4d4;
}
.select2-search-choice-close {
display: block;
width: 12px;
height: 13px;
position: absolute;
right: 3px;
top: 4px;
font-size: 1px;
outline: none;
background: url('../img/select2.png') right top no-repeat;
}
.select2-container-multi .select2-search-choice-close {
left: 3px;
}
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
background-position: right -11px;
}
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
background-position: right -11px;
}
/* disabled styles */
.select2-container-multi.select2-container-disabled .select2-choices{
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
padding: 3px 5px 3px 5px;
border: 1px solid #ddd;
background-image: none;
background-color: #f4f4f4;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
background:none;
}
/* end multiselect */
.select2-result-selectable .select2-match,
.select2-result-unselectable .select2-match {
text-decoration: underline;
}
.select2-offscreen, .select2-offscreen:focus {
clip: rect(0 0 0 0);
width: 1px;
height: 1px;
border: 0;
margin: 0;
padding: 0;
overflow: hidden;
position: absolute;
outline: 0;
left: 0px;
}
.select2-display-none {
display: none;
}
.select2-measure-scrollbar {
position: absolute;
top: -10000px;
left: -10000px;
width: 100px;
height: 100px;
overflow: scroll;
}
/* Retina-ize icons */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
background-image: url('select2x2.png') !important;
background-repeat: no-repeat !important;
background-size: 60px 40px !important;
}
.select2-search input {
background-position: 100% -21px !important;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
media/img/select2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

22
media/js/select2.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -55,11 +55,11 @@
{% block right_panel %}
<div id="group-reply">
<div id="group-reply" class="msg-panel">
{% if request.user.is_authenticated %}
<form id="group-message-form" action="" method="post">{% csrf_token %}
<form id="group-message-form" action="" method="post" class="msg-form">{% csrf_token %}
{% avatar request.user.username 48 %}
<textarea name="message" id="message" placeholder="{% trans "Add a discussion..." %}">{{ form.data.message }}</textarea><br />
<textarea name="message" id="message" placeholder="{% trans "Add a discussion..." %}" class="msg-input">{{ form.data.message }}</textarea><br />
{% for error in form.message.errors %}
<p class="error">{{ error|escape }}</p>
{% endfor %}

View File

@ -4,7 +4,7 @@
{% block right_panel %}
{% if group_msgs %}
<ul class="msg-list new-reply-msg-list">
<ul class="msg-list msg-panel">
{% for msg in group_msgs %}
<li class="msg w100 ovhd">
<div class="pic fleft">

View File

@ -1,6 +0,0 @@
from django import forms
class MessageForm(forms.Form):
mass_email = forms.CharField(max_length=2048)
mass_msg = forms.CharField(max_length=512)

View File

@ -3,113 +3,46 @@
{% block sub_title %}{% trans "Messages" %}{% if total_unread > 0%}({{total_unread}}){%endif%} - {% endblock %}
{% block title_panel %}
<div class="tabnav">
<ul class="tabnav-tabs">
<li class="tabnav-tab tabnav-tab-cur">{% trans "Messages" %}</li>
</ul>
</div>
{% endblock %}
{% block main_panel %}
<h3>{% trans "Messages"%}</h3>
<button id="message-send" class="add">{% trans "Add Message"%}</button>
{% if msgs %}
<table>
<tr>
<th width="5%"></th>
<th width="20%">{% trans " Email "%}</th>
<th width="60%">{% trans "Message"%}</th>
<th width="15%">{% trans "Time"%}</th>
<th width="25%">{% trans "Email"%}</th>
<th width="50%">{% trans "Message"%}</th>
<th width="20%">{% trans "Time"%}</th>
</tr>
{% for key,value in msgs %}
{% with not_read=value.not_read %}
<tr data-href="{% url 'user_msg_list' key|id_or_email %}" class="{% if not_read > 0 %}bold{% endif %}">
<td>{% avatar key 20 %}</td>
<td class="icon-container">{% avatar key 20 %}</td>
<td>{{ key }}{% if not_read > 0%}({{not_read}}){% endif %}</td>
<td> {{ value.last_msg|truncatechars:60 }} </td>
<td>{{ value.last_time|translate_seahub_time }}</td>
<td>{{ value.last_msg|truncatechars:60 }}</td>
<td>{{ value.last_time|translate_seahub_time }}</td>
</tr>
{% endwith %}
{% endfor %}
</table>
{% endif %}
<form id="send-msg-form" action="{% url 'message_send' %}" method="post" name="send-msg-form" class="hide">{% csrf_token %}
<h3>{% trans "Send message to"%}</h3>
<div id="send-msg-tabs">
<ul id="send-msg-tabs-nav">
<li><a href="#share-enter">{% trans 'Enter' %}</a></li>
<li><a href="#share-contact-options">{% trans 'Contacts' %}</a></li>
</ul>
<div id="share-enter">
<textarea id="mass_email" name="mass_email" placeholder="{% trans "Emails seperated by ','"%}"></textarea>
<p class="tip">{% trans 'Tip: You can write message under here.' %}</p>
</div>
<div id="share-contact-options" class="hide">
<ul class="option-list">
{% for contact in contacts %}
<li>
<label class="checkbox-label">
<span class="checkbox"><input type="checkbox" name="contact" value="{{ contact.contact_email }}" class="checkbox-orig" /></span>
{% avatar contact.contact_email 20 %} <span class="checkbox-option">{{ contact.contact_email }}</span>
</label>
</li>
{% endfor %}
</ul>
</div>
</div>
<div><textarea id="mass_msg" name="mass_msg" placeholder="{% trans "the message you want to send !"%}"></textarea></div>
<p class="error hide"></p>
<input type="submit" value="{% trans "Submit"%}" id="share-submit-btn" />
</form>
{% endblock %}
{% block extra_script %}
<!-- <script src="{{ MEDIA_URL }}/js/dojo.js"> -->
<!-- </script> -->
<script type="text/javascript">
$(function(){
$('*[data-href]').click(function(){
window.location = $(this).data('href');
return false;
$('tr[data-href]').click(function() {
location.href = $(this).data('href');
});
});
var share_list = [], contact_email;
{% for contact in contacts %}
contact_email = '{{ contact.contact_email }}';
share_list.push({value:contact_email, label:contact_email});
{% endfor %}
$(".add").click(function() {
$("#send-msg-form").modal({appendTo: "#main", focus:false});
$('#send-msg-tabs').tabs();
$('#simplemodal-container').css('height', 'auto');
addAutocomplete('#mass_email', '#send-msg-form', share_list);
});
//check before post
$('#share-submit-btn').click(function() {
var cur_tab_id = $('#send-msg-tabs-nav .ui-tabs-selected a').attr('href');
var post_data = '';
switch(cur_tab_id) {
case '#share-enter':
post_data = $('#mass_email').val();
break;
case '#share-contact-options':
$(cur_tab_id + ' .checkbox-checked .checkbox-orig').each(function() {
post_data += $(this).val() + ',';
});
$('#mass_email').val(post_data);
}
if (!post_data) {
apply_form_error('send-msg-form', "{% trans "Please enter emails or select some at first." %}");
return false;
}
if (!$('#mass_msg').val()) {
apply_form_error('send-msg-form', "{% trans "Message can not be empty." %}");
return false;
}
$("#send-msg-form").submit();
disable($(this));
});
</script>
{% endblock %}

View File

@ -29,13 +29,13 @@
</ul>
</div>
<div id="personal-reply">
<div id="personal-msg-panel" class="msg-panel personal-msg-panel">
{% if request.user.is_authenticated %}
{% if to_email %}
<form id="personal-message-form" action="{% url 'message_send' %}" method="post" onsubmit="return check(this)">{% csrf_token %}
<form id="personal-message-form" class="msg-form" action="{% url 'message_send' %}" method="post" onsubmit="return check(this)">{% csrf_token %}
{% avatar request.user.username 48 %}
<textarea name="mass_msg" id="message" placeholder="{% trans "Send a message..." %}"></textarea><br />
<textarea name="mass_msg" id="message" placeholder="{% trans "Send a message..." %}" class="msg-input"></textarea><br />
<input type = "hidden" value = "{{ to_email }}" name= "mass_email"/>
{% for error in form.message.errors %}
<p class="error">{{ error|escape }}</p>
@ -49,40 +49,36 @@
{% if person_msgs %}
<ul class="msg-list">
{% for msg in person_msgs.object_list %}
<li class="msg w100 ovhd">
{% if msg.to_email == request.user.email %}
<a href="{% url 'user_msg_list' msg.from_email|id_or_email %}" class="pic fleft">{% avatar msg.from_email 48 %}</a>
<li class="msg msg-received w100 ovhd">
<a href="{% url 'user_msg_list' msg.from_email|id_or_email %}" class="pic fright">{% avatar msg.from_email 48 %}</a>
<div class="txt">
<div class="msg-main" style="text-align:right;">
<div class="msg-main">
<div class="msg-hd w100 ovhd">
<a href="{% url 'user_msg_list' msg.from_email|id_or_email %}" class="author">{{ msg.from_email|email2nickname }}</a>
<span class="time">{{ msg.timestamp|translate_seahub_time }}</span>&nbsp;&nbsp;{% trans 'Say' %}:
<a class="author" href="{% url 'user_msg_list' msg.from_email|id_or_email %}">{{ msg.from_email|email2nickname }}</a>
<span class="time">{{ msg.timestamp|translate_seahub_time }}</span>
</div>
<p class="msg-con">{{ msg.message|safe|seahub_urlize|find_at|linebreaksbr }}</p>
<span class="say"></span>
</div>
</div>
</li>
{% else %}
<li class="msg w100 ovhd">
<a href="{% url 'user_msg_list' msg.from_email|id_or_email %}" class="pic fleft">{% avatar msg.from_email 48 %}</a>
<div class="txt">
<div class="msg-main">
<div class="msg-hd w100 ovhd">
<a href="{% url 'user_msg_list' msg.from_email|id_or_email %}" class="author">{% trans 'I' %}</a>
<span class="time">{{ msg.timestamp|translate_seahub_time }}</span>&nbsp;&nbsp;{% trans 'Say' %}:
<a href="{% url 'user_msg_list' msg.from_email|id_or_email %}" class="author">{{ msg.from_email|email2nickname }}</a>
<span class="time">{{ msg.timestamp|translate_seahub_time }}</span>
</div>
<p class="msg-con">{{ msg.message|safe|seahub_urlize|find_at|linebreaksbr }}</p>
<span class="say"></span>
</div>
</div>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
@ -107,7 +103,7 @@
{% endif %}
{% if person_msgs.object_list|length > 5 %}
<a href="#personal-reply" id="msg-upward" class="hide">{% trans "↑Top" %}</a>
<a href="#personal-msg-panel" id="msg-upward" class="hide">{% trans "↑Top" %}</a>
{% endif %}
{% else %}

View File

@ -19,7 +19,6 @@ from seahub.views import is_registered_user
from seahub.contacts.models import Contact
from seahub.utils.paginator import Paginator
from seahub.settings import SITE_ROOT
from forms import MessageForm
@login_required
def message_list(request):
@ -35,11 +34,8 @@ def message_list(request):
for msg in msgs:
total_unread += msg[1]['not_read']
contacts = Contact.objects.get_registered_contacts_by_user(username)
return render_to_response('message/all_msg_list.html', {
'msgs': msgs,
'contacts': contacts,
'total_unread': total_unread,
}, context_instance=RequestContext(request))
@ -105,43 +101,47 @@ def message_send(request):
if next is None:
next = SITE_ROOT
form = MessageForm(request.POST)
if not form.is_valid():
messages.error(request, 'Failed to send message, please try again later.')
mass_msg = request.POST.get('mass_msg')
mass_emails = request.POST.getlist('mass_email') # e.g: [u'1@1.com, u'2@1.com']
if not mass_msg:
messages.error(request, _(u'message is required'))
return HttpResponseRedirect(next)
if not mass_emails:
messages.error(request, _(u'contact is required'))
return HttpResponseRedirect(next)
mass_email = form.cleaned_data['mass_email']
mass_msg = form.cleaned_data['mass_msg']
email_sended = []
for to_email in mass_email.split(','):
for to_email in mass_emails:
to_email = to_email.strip()
if not to_email:
continue
if to_email == username:
messages.error(request, 'You can not send message to yourself.')
messages.error(request, _(u'You can not send message to yourself.'))
continue
if not is_registered_user(to_email):
messages.error(request, 'Failed to send message to %s, user not found.' % to_email)
messages.error(request, _(u'Failed to send message to %s, user not found.') % to_email)
continue
UserMessage.objects.add_unread_message(username, to_email, mass_msg)
email_sended.append(to_email)
if email_sended:
messages.success(request, 'Message sent successfully.')
messages.success(request, _(u'Message sent successfully.'))
return HttpResponseRedirect(next)
@login_required
def msg_count(request):
"""Count user's unread message.
"""
result = {}
if not request.is_ajax():
raise Http404
content_type = 'application/json; charset=utf-8'
username = request.user.username
count = UserMessage.objects.count_unread_messages_by_user(username)
result = {}
result['count'] = count
return HttpResponse(json.dumps(result), content_type=content_type)

View File

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% load i18n %}
{% block top_bar_sys_manager_class %} class="cur"{% endblock %}
{% block top_bar_sys_manager_class %} class="top-link cur"{% endblock %}
{% block nav %}
<ul class="nav">
{% if request.user.is_staff %}

View File

@ -10,6 +10,7 @@
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/ui-lightness/jquery-ui-1.8.16.custom.css" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/font-awesome.css" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/seahub.css?t=1369028460" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/select2.css?t=1369028460" />
<link rel="icon" type="image/x-icon" href="{{ MEDIA_URL }}img/favicon.ico?t=1369028460" />
<!--[if IE]>
<link rel="shortcut icon" href="{{ MEDIA_URL }}img/favicon.ico?t=1369028460"/>
@ -34,29 +35,42 @@
<div class="top-bar-con">
<div class="manage fleft">
{% if request.user.is_staff %}
<a href="{{ SITE_ROOT }}sys/useradmin/"{% block top_bar_sys_manager_class %}{% endblock %}>{% trans "System Admin" %}</a>
<a href="{{ SITE_ROOT }}home/my/"{% block top_bar_myaccount_class %}{% endblock %}>{% trans "Workspace" %}</a>
<a href="{{ SITE_ROOT }}sys/useradmin/"{% block top_bar_sys_manager_class %}class="top-link"{% endblock %}>{% trans "System Admin" %}</a>
<a href="{{ SITE_ROOT }}home/my/"{% block top_bar_myaccount_class %}class="top-link"{% endblock %}>{% trans "Workspace" %}</a>
{% endif %}
</div>
<div class="account fright">
{% if request.user.is_authenticated %}
<a href="{% url 'edit_profile' %}" class="avatar-link" title="{% trans 'Profile Setting' %}">{% avatar request.user 16 %}</a> <span>{{ request.user }}</span>
<a href="{% url 'message_list' %}" id="msg_count"><img src="{{ MEDIA_URL }}/img/mail.png" width="25" height="20" /></b></a>
<a href="{{ SITE_ROOT }}accounts/logout/">{% trans "Log out" %}</a>
<span class="my-info"><a href="{% url 'edit_profile' %}" class="top-link avatar-link" title="{% trans 'Profile Setting' %}">{% avatar request.user 16 %}</a> <span class="bold">{{ request.user }}</span></span>
<button class="icon-envelope" id="add-msg" title="{% trans "send a message" %}"></button>
<button data-url="{% url 'message_list' %}" id="msg-count" title="{% trans "unread messages" %}">0</button>
<a href="{{ SITE_ROOT }}accounts/logout/" class="top-link">{% trans "Log out" %}</a>
{% else %}
<a href="{{ SITE_ROOT }}accounts/login/">{% trans "Log In" %}</a>
<a href="{{ SITE_ROOT }}accounts/login/" class="top-link">{% trans "Log In" %}</a>
{% if enable_signup %}
<a href="{{ SITE_ROOT }}accounts/register/">{% trans "Signup" %}</a>
<a href="{{ SITE_ROOT }}accounts/register/" class="top-link">{% trans "Signup" %}</a>
{% endif %}
{% endif %}
<a href="#" id="lang-context" data="no-popup" data-lang="{{ LANGUAGE_CODE }}">{{ LANGUAGE_CODE|language_name_local }} <span class="tri-bg tri-down-bg"></span></a>
<a href="#" id="lang-context" data="no-popup" data-lang="{{ LANGUAGE_CODE }}" class="top-link">{{ LANGUAGE_CODE|language_name_local }} <span class="tri-bg tri-down-bg"></span></a>
<ul class="hide" id="lang-context-selector">
{% for LANG in LANGUAGES %}
<li><a href="{% url 'i18n' %}?lang={{ LANG.0 }}">{{ LANG.1 }}</a></li>
{% endfor %}
</ul>
</div>
<div id="send-msg-popup" class="hide">
<img src="{{MEDIA_URL}}img/loading-icon.gif" class="loading-tip" />
<form id="send-msg-form" action="{% url 'message_send' %}" method="post" name="send-msg-form" class="hide">{% csrf_token %}
<textarea id="mass-msg" name="mass_msg" placeholder="{% trans "message..." %}"></textarea><br/>
<select id="mass-email" name="mass_email" multiple="multiple"></select><br/>
<p class="error hide"></p>
<input type="submit" value="{% trans "Submit"%}" />
<input type="button" value="{% trans "Cancel"%}" />
</form>
</div>
</div>
</div>
</div>
@ -191,8 +205,10 @@
</div>
</div>
</div><!-- wrapper -->
<script type="text/javascript" src="{{ MEDIA_URL }}js/jq.min.js?t=1369028460"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/base.js?t=1369028460"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/select2.min.js?t=1369028460"></script>
<script type="text/javascript">
{% if request.user.is_authenticated %}
{% if request.cur_note %}
@ -219,25 +235,87 @@ $('#info-bar .close').click(function() {
});
{% endif %}
$(document).ready(function(){
$.ajax({
url: '{% url 'msg_count' %}',
dataType: 'json',
cache: 'false',
contentType: 'application/json; charset=utf-8',
beforeSend: prepareCSRFToken,
data: {
'user_email': 'user',
},
cache: false,
success: function(data) {
if (data['count']!=-1) {
var count="<b><img src='{{ MEDIA_URL }}/img/mail.png' width='25' height='20' />("+data['count']+")</b>";
$("#msg_count").html(count);
if (data['count'] != -1) {
$("#msg-count").html(data['count']);
}
}
});
});
$('#add-msg').click(function() {
var add_msg_btn = $('#add-msg'),
popup = $('#send-msg-popup');
if (!popup.hasClass('hide')) {
popup.addClass('hide');
add_msg_btn.removeClass('add-msg-hl');
return;
}
popup.removeClass('hide');
add_msg_btn.addClass('add-msg-hl');
$.ajax({
url:'{% url 'get_contacts' %}',
cache: false,
dataType: 'json',
success: function(data) {
var contacts = data['contacts'],
opts = '';
if (contacts.length > 0) {
popup.find('.loading-tip').remove();
$('#send-msg-form').removeClass('hide');
for(var i = 0, len = contacts.length; i < len; i++) {
opts += '<option value="' + contacts[i] + '">' + contacts[i] + '</option>';
}
$('#mass-email').html(opts).select2({
placeholder: "{% trans "send to: click to select contacts" %}"
});
} else {
popup.html('<p>' + "{% trans "please add contacts at first" %}" + '</p>');
}
},
error: function() {
popup.html('<p class="error">' + "{% trans "Failed to get your contacts for sending a message." %}" + '</p>');
}
});
return false;
});
/*
$(document).click(function(e) {
var target = e.target || event.srcElement,
popup = $('#send-msg-popup'),
popup_switch = $('#add-msg');
if (!popup.hasClass('hide') && !popup.is(target) && !popup.find('*').is(target) && !popup_switch.is(target)) {
popup.addClass('hide');
$('#add-msg').removeClass('add-msg-hl');
}
});
*/
$('#send-msg-form [type="button"]').click(function() {
$('#send-msg-popup').addClass('hide');
$('#add-msg').removeClass('add-msg-hl');
});
$('#send-msg-form').submit(function() {
var form_id = $(this).attr('id');
if (!$('#mass-msg').val()) {
apply_form_error(form_id, "{% trans "message is required" %}");
return false;
}
if (!$('#mass-email').val()) { // val is null or ['xx',...]
apply_form_error(form_id, "{% trans "contact is required" %}");
return false;
}
});
$('#msg-count').click(function() {
location.href = $(this).data('url');
});
{% if has_file_search %}
@ -272,9 +350,10 @@ $('#advanced-search-form').submit(function() {
}
});
$(document).click(function(e) {
var target = e.target || event.srcElement;
var popup = $('#advanced-search-form');
if (!popup.is(target) && !popup.find('*').is(target) && !$('#top-search-form .icon-caret-down').is(target)) {
var target = e.target || event.srcElement,
popup = $('#advanced-search-form'),
popup_switch = $('#top-search-form .icon-caret-down');
if (!popup.hasClass('hide') && !popup.is(target) && !popup.find('*').is(target) && !popup_switch.is(target)) {
popup.addClass('hide');
}
});
@ -321,6 +400,8 @@ $(document).click(function(e) {
{'name':'star-empty', 'con':'f006'},
{'name':'caret-down', 'con':'f0d7'},
{'name':'ok', 'con':'f00c'},
{'name':'double-angle-left', 'con':'f100'},
{'name':'double-angle-right', 'con':'f101'},
{'name':'double-angle-up', 'con':'f102'},
{'name':'double-angle-down', 'con':'f103'}
];

View File

@ -40,7 +40,7 @@
<ul class="info-item-bottom">
{% if grpmsg_list %}
<li>
{% for grp in grpmsg_list %}<a href="{% url 'group_discuss' grp.id %}" class="no-bold">{{ grp.group_name }} </a>{% endfor %}
{% for grp in grpmsg_list %}<a href="{% url 'group_discuss' grp.id %}" class="no-bold">{{ grp.group_name }}</a> {% endfor %}
{% blocktrans count counter=grpmsg_list|length %}
has new discussion
{% plural %}

View File

@ -1,7 +1,7 @@
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% block top_bar_myaccount_class %} class="cur"{% endblock %}
{% block top_bar_myaccount_class %} class="top-link cur"{% endblock %}
{% block nav %}
<ul class="nav">
<li>

View File

@ -97,6 +97,7 @@ urlpatterns = patterns('',
### Ajax ###
(r'^ajax/repo/(?P<repo_id>[-0-9a-f]{36})/dirents/$', get_dirents),
url(r'^ajax/group/(?P<group_id>\d+)/repos/$', get_group_repos, name='get_group_repos'),
url(r'^ajax/contacts/$', get_contacts, name='get_contacts'),
### Apps ###
(r'^api2/', include('seahub.api2.urls')),

View File

@ -2279,6 +2279,21 @@ def get_group_repos(request, group_id):
return HttpResponse(json.dumps(repo_list), content_type=content_type)
@login_required
def get_contacts(request):
if not request.is_ajax():
raise Http404
content_type = 'application/json; charset=utf-8'
username = request.user.username
contacts = Contact.objects.get_contacts_by_user(username)
contact_emails = []
for c in contacts:
contact_emails.append(c.contact_email)
return HttpResponse(json.dumps({"contacts":contact_emails}), content_type=content_type)
@login_required
def convert_cmmt_desc_link(request):
"""Return user to file/directory page based on the changes in commit.