mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 18:29:23 +00:00
improved contact_add
This commit is contained in:
@@ -1,25 +1,10 @@
|
|||||||
{% extends "myhome_base.html" %}
|
{% extends "myhome_base.html" %}
|
||||||
|
|
||||||
{% block nav_contacts_class %}class="cur"{% endblock %}
|
{% block nav_contacts_class %}class="cur"{% endblock %}
|
||||||
{% block left_panel %}
|
|
||||||
<h3>操作</h3>
|
|
||||||
<ul class="with-bg">
|
|
||||||
<li><a href="#" id="contact-add">添加联系人</a></li>
|
|
||||||
</ul>
|
|
||||||
<form action="{% url contact_add_post %}" method="post" id="contact-add-form" class="hide">
|
|
||||||
<h4>添加联系人</h4>
|
|
||||||
{{ form.user_email.as_hidden }}
|
|
||||||
<label>邮箱:</label>{{ form.contact_email }}<br />
|
|
||||||
<label>名字(可选):</label>{{ form.contact_name }}<br />
|
|
||||||
<label>备注(可选):</label>{{ form.note }}<br />
|
|
||||||
<p class="error hide" id="contact-add-error">请输入邮箱地址。</p>
|
|
||||||
<input type="submit" value="提交" class="submit" />
|
|
||||||
</form>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block right_panel %}
|
{% block right_panel %}
|
||||||
|
|
||||||
<h3>联系人列表</h3>
|
<h3>联系人列表</h3>
|
||||||
|
<button id="contact-add">添加联系人</button>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="38%">邮箱</th>
|
<th width="38%">邮箱</th>
|
||||||
@@ -39,6 +24,16 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
<form action="{% url contact_add_post %}" method="post" id="contact-add-form" class="hide">
|
||||||
|
<h3>添加联系人</h3>
|
||||||
|
{{ form.user_email.as_hidden }}
|
||||||
|
<label>邮箱:</label><br />
|
||||||
|
{{ form.contact_email }}<br />
|
||||||
|
<label>名字(可选):</label><br />{{ form.contact_name }}<br />
|
||||||
|
<label>备注(可选):</label><br />{{ form.note }}<br />
|
||||||
|
<p class="error hide" id="contact-add-error">请输入邮箱地址。</p>
|
||||||
|
<input type="submit" value="提交" class="submit" />
|
||||||
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extra_script %}
|
{% block extra_script %}
|
||||||
@@ -58,10 +53,18 @@ $("table tr:gt(0)").hover(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$('#contact-add').click(function() {
|
$('#contact-add')
|
||||||
|
.click(function() {
|
||||||
$('#contact-add-form').modal({appendTo: '#main'});
|
$('#contact-add-form').modal({appendTo: '#main'});
|
||||||
return false;
|
})
|
||||||
});
|
.hover(
|
||||||
|
function() {
|
||||||
|
$(this).css({'background-color': '#fff', 'cursor': 'pointer'});
|
||||||
|
},
|
||||||
|
function() {
|
||||||
|
$(this).css('background-color', '#f5f5f5');
|
||||||
|
}
|
||||||
|
);
|
||||||
$('#contact-add-form').submit(function() {
|
$('#contact-add-form').submit(function() {
|
||||||
if(!$.trim($('input[name="contact_email"]').val())) {
|
if(!$.trim($('input[name="contact_email"]').val())) {
|
||||||
$('#contact-add-error').removeClass('hide')
|
$('#contact-add-error').removeClass('hide')
|
||||||
@@ -69,10 +72,8 @@ $('#contact-add-form').submit(function() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var self = $(this),
|
|
||||||
url = self.attr("action");
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: $('#contact-add-form').attr('action'),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
cache: 'false',
|
cache: 'false',
|
||||||
|
@@ -404,7 +404,8 @@ p {
|
|||||||
color: #000;
|
color: #000;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
#repo-create {
|
#repo-create,
|
||||||
|
#contact-add{
|
||||||
padding-left:21px;
|
padding-left:21px;
|
||||||
height:27px;
|
height:27px;
|
||||||
background:#f5f5f5 url('../img/add.png') scroll no-repeat 3px 48%;
|
background:#f5f5f5 url('../img/add.png') scroll no-repeat 3px 48%;
|
||||||
@@ -414,7 +415,10 @@ p {
|
|||||||
}
|
}
|
||||||
#repo-name,
|
#repo-name,
|
||||||
#repo-desc,
|
#repo-desc,
|
||||||
.repo-create-encryption .passwd {
|
.repo-create-encryption .passwd,
|
||||||
|
#id_contact_email,
|
||||||
|
#id_contact_name,
|
||||||
|
#id_note {
|
||||||
width:260px;
|
width:260px;
|
||||||
margin-bottom:5px;
|
margin-bottom:5px;
|
||||||
}
|
}
|
||||||
@@ -562,17 +566,6 @@ p {
|
|||||||
.contact-list-link:hover {
|
.contact-list-link:hover {
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
}
|
}
|
||||||
#contact-add-form h4 {
|
|
||||||
border-bottom:1px solid #ddd;
|
|
||||||
margin-bottom:12px;
|
|
||||||
}
|
|
||||||
#contact-add-form label {
|
|
||||||
width:6em;
|
|
||||||
}
|
|
||||||
#contact-add-form .error,
|
|
||||||
#contact-add-form .submit {
|
|
||||||
margin-left:6em;
|
|
||||||
}
|
|
||||||
/* group, org */
|
/* group, org */
|
||||||
.group-list {
|
.group-list {
|
||||||
margin-top:20px;
|
margin-top:20px;
|
||||||
|
@@ -43,7 +43,11 @@ $(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//repo-create-form
|
//repo-create-form
|
||||||
$('#repo-create').hover(
|
$('#repo-create')
|
||||||
|
.click(function() {
|
||||||
|
$('#repo-create-form').modal({appendTo: '#main', autoResize: true});
|
||||||
|
})
|
||||||
|
.hover(
|
||||||
function() {
|
function() {
|
||||||
$(this).css({'background-color': '#fff', 'cursor': 'pointer'});
|
$(this).css({'background-color': '#fff', 'cursor': 'pointer'});
|
||||||
},
|
},
|
||||||
@@ -51,9 +55,6 @@ $('#repo-create').hover(
|
|||||||
$(this).css('background-color', '#f5f5f5');
|
$(this).css('background-color', '#f5f5f5');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
$('#repo-create').click(function() {
|
|
||||||
$('#repo-create-form').modal({appendTo: '#main', autoResize: true});
|
|
||||||
});
|
|
||||||
$('#encrypt-switch').click(function () {
|
$('#encrypt-switch').click(function () {
|
||||||
if ($(this).attr('checked')) {
|
if ($(this).attr('checked')) {
|
||||||
$('#repo-create-form input[type="password"]').attr('disabled', false).removeClass('input-disabled');
|
$('#repo-create-form input[type="password"]').attr('disabled', false).removeClass('input-disabled');
|
||||||
|
Reference in New Issue
Block a user