[Notice] Announcing the End of Demo Server [Read me]
Jihan Kim 2013-05-10
change overview history UI
@71c0caa4cf417fb88647dcad834febc98afae543
app/assets/stylesheets/less/_page.less
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
@@ -603,10 +603,10 @@
                                 .user-thumb-wrap {
                                     width: 18px;
                                     height: 18px;
-                                    .border-radius(2px);
                                     margin-right: 10px;
                                     display: block;
                                     float: left;
+                                    .border-radius(2px);
                                     img {
                                         vertical-align: top;
                                     }
@@ -1450,6 +1450,7 @@
                 width:260px; height:188px;
                 background-repeat:no-repeat;
                 background-size:cover;
+                background-position:center;
                 .border-radius(10px);
                 .inline-block;
             }
app/models/History.java
--- app/models/History.java
+++ app/models/History.java
@@ -11,6 +11,7 @@
 
     private String who;
     private String userPageUrl;
+    private String userAvatarUrl;
     private Date when;
     private String where;
     private String what;
@@ -73,6 +74,14 @@
         this.userPageUrl = userPageUrl;
     }
 
+    public void setUserAvatarUrl(String userAvatarUrl){
+    	this.userAvatarUrl = userAvatarUrl;
+    }
+    
+    public String getUserAvatarUrl(){
+    	return userAvatarUrl;
+    }
+    
     public static List<History> makeHistory(String userName, Project project, List<Commit> commits, List<Issue> issues, List<Posting> postings) {
         List<History> histories = new ArrayList<History>();
         if(commits != null) {
@@ -101,7 +110,7 @@
             issueHistory.setWhen(issue.createdDate);
             issueHistory.setWhere(project.name);
             issueHistory.setWhat("issue");
-            issueHistory.setHow(issue.title);
+            issueHistory.setHow("#" + issue.id + " " + issue.title);
             issueHistory.setUrl("/" + userName + "/" + project.name + "/issue/" + issue.id);
             histories.add(issueHistory);
         }
@@ -132,5 +141,6 @@
     private static void setUserPageUrl(History history, User user) {
         history.setWho(user.name);
         history.setUserPageUrl("/" + user.loginId);
+        history.setUserAvatarUrl(user.avatarUrl);
     }
 }
app/views/project/overview.scala.html
--- app/views/project/overview.scala.html
+++ app/views/project/overview.scala.html
@@ -1,4 +1,3 @@
-
 @(message: String, project: Project, histories: List[models.History] )
 
 @import utils.JodaDateUtil._
@@ -15,6 +14,23 @@
 		}
 	}
 }
+@userPageUrlOnHistory(history:History) = @{
+	if(history.getUserPageUrl() != null) {
+		history.getUserPageUrl()
+	} else {
+		"#"
+	}
+}
+@userAvatarUrlOnHistory(history:History) = @{
+	if(history.getUserAvatarUrl() != null){
+		history.getUserAvatarUrl()
+	} else {
+		routes.Assets.at("images/default-avatar-64.png")
+	}
+}
+@makeHistoryWho(history:History)  = {<a href="@userPageUrlOnHistory(history)" class="actor">@history.getWho()</a>}
+@makeHistoryHow(history:History)  = {<a href="@history.getUrl()"><strong class="whereis">@history.getHow()</strong></a> }
+@makeHistoryWhat(history:History) = {@Messages("project.history.type." + history.getWhat())}
 
 @main(message, project, utils.MenuType.PROJECT_HOME) {
 <div class="page">
@@ -42,7 +58,7 @@
             <header>
                 <h3>@Messages("project.info")</h3>
                 @if(isAllowed(UserApp.currentUser(), project.tagsAsResource(), Operation.UPDATE)){
-                <button type="button" class="btn btn-small" data-toggle="button" id="tag-editor-toggle">@Messages("button.edit")</button>
+                <button type="button" class="nbtn small" data-toggle="button" id="tag-editor-toggle">@Messages("button.edit")</button>
                 }
             </header>
             <ul class="infos" id="tags">
@@ -50,7 +66,7 @@
             </ul>
             <ul>
                 <input name="newTag" type="text" class="text hidden" style="margin-bottom:0px;" data-provider="typeahead" autocomplete="off"/>
-                <button id="addTag" type="button" class="btn-transparent n-btn med gray hidden">@Messages("button.add")</button>
+                <button id="addTag" type="button" class="nbtn medium hidden">@Messages("button.add")</button>
             </ul>
         </div>
         <div class="inner member-info">
@@ -74,27 +90,35 @@
         </div>
     </div>
 
-    @if(histories.size > 0) {
-        <table class="table table-hover">
-            <tbody>
-                @for(history <- histories.iterator()) {
-                    <tr>
-                        <td>@agoString(ago(history.getWhen()))</td>
-                        <td>
-                            @if(history.getUserPageUrl() != null) {
-                                <a href="@history.getUserPageUrl()">@history.getWho()</a>
-                            } else {
-                                @history.getWho()
-                            }
-                        </td>
-                        <td>@history.getWhat()</td>
-                        <td><a href="@history.getUrl()">@history.getHow()</a></td>
-                    </tr>
-                }
-            </tbody>
-        </table>
-    }
+	@if(histories.size > 0) {
+	<div class="content-container">
+		<div class="main-stream" style="width:100%;">
+			<ul class="activity-streams unstyled">
+				@for(history <- histories.iterator()) {
+				<li class="activity-stream" style="padding:10px 0;">
+					<a href="@userPageUrlOnHistory(history)" class="avatar-wrap pull-left" style="margin-right:15px;">
+						<img src="@userAvatarUrlOnHistory(history)" width="32" height="32">
+					</a>
 
+					<div class="activity-desc">
+						<p class="header-text" style="margin-bottom:5px;">
+							@Html(Messages("project.history.item",
+								makeHistoryWho(history),
+								makeHistoryWhat(history), 
+								makeHistoryHow(history)
+							))
+						</p>
+						<p class="others" style="padding-left:0;">
+							<span class="date" style="margin-left:0;">@agoString(ago(history.getWhen()))</span>
+						</p>
+					</div>
+				</li>
+				}
+			</ul>
+		</div>
+	</div>
+	}
+	
     <div class="bubble-wrap dark-gray readme">
         @if(project.readme == null) {
             <p class="default">
conf/messages.ko
--- conf/messages.ko
+++ conf/messages.ko
@@ -289,6 +289,12 @@
 project.license = 라이센스
 project.codeLanguage = 프로그래밍 언어
 
+# project.history.item: {0}=누가,{1}=무엇을,{2}=어떻게
+project.history.item = {0}님이 {1} {2}  
+project.history.type.commit = 코드를 커밋했습니다
+project.history.type.issue = 새 이슈를 등록했습니다
+project.history.type.post = 새 글을 작성했습니다
+
 #Site
 site.sidebar = 사이트 관리
 site.sidebar.setting = 설정
public/javascripts/common/hive.ui.Typeahead.js
--- public/javascripts/common/hive.ui.Typeahead.js
+++ public/javascripts/common/hive.ui.Typeahead.js
@@ -30,7 +30,7 @@
 		function _initVar(htOptions){
 			htVar.sActionURL = htOptions.sActionURL || "/users";
 			htVar.rxContentRange = /items\s+([0-9]+)\/([0-9]+)/;
-            htVar.htData = htOptions.htData;
+            htVar.htData = htOptions.htData || {};
 		}
 		
 		/**
@@ -41,9 +41,9 @@
 		function _initElement(sQuery){
 			htElement.welInput = $(sQuery);
 			htElement.welInput.typeahead({
-                source: _onTypeAhead,
-                minLength: 0,
-                items: htVar.htData.limit || 8
+                "source": _onTypeAhead,
+                "minLength": 0,
+                "items": htVar.htData.limit || 8
             });
 		}
 		
@@ -64,7 +64,7 @@
             	$hive.sendForm({
             		"sURL"		: htVar.sActionURL,
             		"htOptForm"	: {"method":"get"},
-			"htData"	: htVar.htData,
+            		"htData"	: htVar.htData,
                     "sDataType" : "json",
             		"fOnLoad"	: function(oData, oStatus, oXHR){
             			var sContentRange = oXHR.getResponseHeader('Content-Range');
public/javascripts/service/hive.project.Home.js
--- public/javascripts/service/hive.project.Home.js
+++ public/javascripts/service/hive.project.Home.js
@@ -59,8 +59,9 @@
                     _showTagEditor();
                 }
             });
+            
             new hive.ui.Typeahead(htElement.welInputAddTag, {
-		"sActionURL": htVar.sURLTags,
+            	"sActionURL": htVar.sURLTags,
                 "htData": {
                     "context": "PROJECT_TAGGING_TYPEAHEAD",
                     "project_id": htVar.nProjectId,
@@ -162,15 +163,8 @@
 		});
             };
 
-            var welDeleteButton = $('<a>')
-                .attr('href', 'javascript:void(0)')
-                .text(' x')
-                .click(fOnClickDelete);
-
-            var welTag = $('<span>')
-                .text(sName)
-                .addClass('label')
-		.append(welDeleteButton);
+            var welDeleteButton = $('<a href="javascript:void(0)">&times;</a>').click(fOnClickDelete);
+            var welTag = $('<span class="label">' + sName + '</span>').append(welDeleteButton);
 
             welTag.setRemovability = function(bFlag) {
                 if (bFlag === true) {
@@ -203,8 +197,7 @@
                 if (waChildren.length > 0) {
                     waChildren.append(_createTag(sInstanceId, htTag.name));
                 } else {
-                    newCategory = $('<li>')
-                        .addClass('info')
+                    newCategory = $('<li class="info">')
                         .attr('category', htTag.category)
                         .append($('<strong>').text(htTag.category + ' : '))
                         .append(_createTag(sInstanceId, htTag.name));
Add a comment
List