From 9085a9e4dc26f5e240e86558d4bd921f381a351a Mon Sep 17 00:00:00 2001
From: llj
Date: Wed, 19 Sep 2012 20:42:55 +0800
Subject: [PATCH] [file_view]redesign comment feature;modified
history_file_view
---
media/css/seahub.css | 60 +++++++++++++-
templates/file_comments.html | 16 ++++
templates/repo_view_file.html | 147 +++++++++++++++++++++-------------
urls.py | 1 +
views.py | 96 ++++++++++------------
5 files changed, 208 insertions(+), 112 deletions(-)
create mode 100644 templates/file_comments.html
diff --git a/media/css/seahub.css b/media/css/seahub.css
index 1e1105ee7e..933d658c14 100644
--- a/media/css/seahub.css
+++ b/media/css/seahub.css
@@ -956,7 +956,8 @@ ul.with-bg li {
font-size:12px;
color:#333;
}
-#message {
+#message,
+#comment-input {
font: 13px/1.5 Arial, Helvetica, sans-serif;
word-wrap: break-word;
width: 600px;
@@ -985,7 +986,8 @@ ul.with-bg li {
margin-bottom:2px;
}
.msg-hd .time,
-.msg-hd .group {
+.msg-hd .group,
+.comment-hd .time {
color: #808080;
}
.msg-hd .group {
@@ -1164,5 +1166,57 @@ ul.with-bg li {
}
/* File comment */
#file-comment {
- margin-top: 60px;
+ width:400px;
+ position:fixed;
+ right:10px;
+ bottom:40px;
+ border:1px solid #cbcbcb;
+ padding:0 15px;
+ box-shadow: 0 2px 4px rgba(0,0,0,.2);
+ -moz-box-shadow: -1px 1px 1px rgba(0,0,0,.2);
+ -webkit-box-shadow: 0 2px 4px rgba(0,0,0,.2);
+ background:#fff;
+ overflow:auto;
+}
+#comment-input {
+ width:315px;
+ padding-left:1px;
+ height:30px;
+ margin:0;
+}
+.comment {
+ width:380px;
+ padding:15px 0;
+ border-top:1px solid #e8e8e8;
+}
+.comment .txt {
+ width:318px;
+}
+#file-comment-form {
+ width:380px;
+ margin:15px 0;
+}
+.comment-bd {
+ word-wrap:break-word;
+}
+#comment-caret {
+ position:fixed;
+ right:27px;
+ bottom:26px;
+}
+#comment-outer-caret,
+#comment-inner-caret {
+ height:0;
+ width:1px;
+ border:14px solid;
+ border-color:#CBCBCB transparent;
+ border-bottom-width:0;
+ z-index:100;
+ margin:0 auto;
+}
+#comment-inner-caret {
+ border-top-color:#fff;
+ position:relative;
+ top:-15px;
+ left:-14px;
}
diff --git a/templates/file_comments.html b/templates/file_comments.html
new file mode 100644
index 0000000000..9e0a17cd7b
--- /dev/null
+++ b/templates/file_comments.html
@@ -0,0 +1,16 @@
+{% load seahub_tags avatar_tags%}
+{% load url from future %}
+
+ {% for comment in comments %}
+
+ {% endfor %}
+
diff --git a/templates/repo_view_file.html b/templates/repo_view_file.html
index 3b5501e79e..157d014d22 100644
--- a/templates/repo_view_file.html
+++ b/templates/repo_view_file.html
@@ -29,16 +29,17 @@
{% endfor %}
+ {% if not view_history %}
- {% if not view_history %}
- {% endif %}
+ {% endif %}
+ {% if not view_history %}
-
+ {% endif %}
+
{% if not view_history and request.user.is_authenticated %}
- {% if filetype == 'Text' or filetype == 'Markdown' %}
+ {% if filetype == 'Text' or filetype == 'Markdown' %}
- {% endif %}
- {% endif %}
+ {% endif %}
+ {% endif %}
+ {% if not view_history %}
+ {% endif %}
{% if filetype == 'Text' or filetype == 'Image' or filetype == 'SVG' or filetype == 'Markdown' %}
{% endif %}
@@ -74,7 +78,7 @@
-{% if not view_history %}
+ {% if not view_history %}