Skip to content

Commit

Permalink
#76 closed: "On Comments tab, we should use the same content as for t…
Browse files Browse the repository at this point in the history
…he history page."
  • Loading branch information
ignatov committed Jul 15, 2011
1 parent 9dd47d1 commit d23e1cd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 42 deletions.
1 change: 1 addition & 0 deletions src/main/scala/scala/tools/colladoc/page/Profile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Profile(rootPack: Package) extends scala.tools.colladoc.page.Template(root
<profile:change_password />
</div>
<div id="comments_tab">
<h3>Changed members</h3>
<profile:comments />
</div>
</div>
Expand Down
22 changes: 2 additions & 20 deletions src/main/scala/scala/tools/colladoc/snippet/ProfileOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package snippet

import model.mapper.{Comment, User}
import lib.DependencyFactory._
import page.Profile
import xml.{NodeSeq, Text}
import net.liftweb.util.BindHelpers._
import net.liftweb.util.DefaultDateTimeConverter._
Expand All @@ -35,6 +34,7 @@ import lib.js.JqUI.SubmitFormWithValidation
import net.liftweb.http.js.JsCmds.SetValById
import net.liftweb.http.js.JE.Str
import net.liftweb.http.js.{JsCmds, JsCmd}
import page.{History, Profile}

/**
* User profile snippet.
Expand Down Expand Up @@ -174,25 +174,7 @@ class ProfileOps {
val fullname = user.userName.is

val cmts: List[Comment] = Comment.findAll(By(Comment.user, user), By(Comment.valid, true))
val comments =
if (cmts.length == 0)
<h3>No comments by user.</h3>
else
<xml:group>
<h3>Comments by user</h3>
<ul>
{ cmts.sortBy(c => c.qualifiedName.is).map(c =>
{
val abs = "/" + c.qualifiedName.is.replace(".", "/").replace("#", "$") + ".html"
<li>
<a href={abs}>{c.qualifiedName.is}</a>:
<span class="comment">{c.comment.is}</span>
<span class="datetime" title={Comment.atomDateFormatter(c.dateTime)}>{formatDate(c.dateTime)}</span>
</li>
})
}
</ul>
</xml:group>
val comments = new History(model.vend.rootPackage).commentsToHtml(cmts)

bind("profile", profile.body,
"form" -> userForm(user),
Expand Down
30 changes: 9 additions & 21 deletions src/main/webapp/coprofile.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,6 @@
border: none;
}

.profile a {
color: #3366ff;
text-decoration: underline;
}

.profile a {
color: #3366ff;
text-decoration: underline;
}

.profile li {
list-style: disc;
list-style-position: inside;
margin: 3px 3px;
}

.profile p {
margin-bottom: 7px;
}

.form {
width: 400px;
}
Expand Down Expand Up @@ -77,4 +57,12 @@
.datetime {
color: #666;
font-size: 80%;
}
}

#comments_tab > h3 {
background-color: #333;
color: white;
font-weight: bold;
font-size: 12pt;
padding: 4px;
}
2 changes: 2 additions & 0 deletions src/main/webapp/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
<script src="/scripts/jquery.prettydate.js" type="text/javascript"/>
<script src="/scripts/cotemplate.js" type="text/javascript"/>
<script src="/scripts/coprofile.js" type="text/javascript"/>
<script src="/scripts/cohistory.js" type="text/javascript" />
<link href="/lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="/cotemplate.css" media="screen" type="text/css" rel="stylesheet"/>
<link href="/coprofile.css" media="screen" type="text/css" rel="stylesheet"/>
<link href="/cohistory.css" media="screen" type="text/css" rel="stylesheet"/>
</lift:with-resource-id>
</head>
<lift:profileOps.body />
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/scripts/cotemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function confirm(message, callback, options) {
dialogClass: 'modal-shadow'
};

$confirm = $.getOrCreateDialog('confirm');
$confirm = $.getOrCreateDialog('colladoc_confirm');
// set message
$("p", $confirm).html(message);
// init dialog
Expand Down

0 comments on commit d23e1cd

Please sign in to comment.