박완순 2014-04-15
Merge branch 'feature/organization-working' of doortts/yobi
from pull request 860
@d1fd3c0f3648aaee33b4b313a88a786790a0b514
app/assets/stylesheets/less/_common.less
--- app/assets/stylesheets/less/_common.less
+++ app/assets/stylesheets/less/_common.less
@@ -135,6 +135,7 @@
 /** text style **/
 .bold { font-weight:bold; }
 .gray-txt      { color:@gray-cc !important; }
+.darkgray-txt  { color:@gray-99 !important; }
 .orange-txt    { color:@orange !important; }
 .primary-txt   { color:@primary !important; }
 .secondary-txt { color:@secondary !important; }
app/assets/stylesheets/less/_page.less
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
@@ -218,7 +218,7 @@
 
 .project-header-outer {
     background-color:#ececec;
-    height:69px;
+    height:80px;
     border-bottom:1px solid #ddd;
     background-clip: padding-box;
     background-position: bottom;
@@ -1600,7 +1600,7 @@
                width:100%;
                ul {
                     display:inline-block;
-                    width:115px; max-height:71px;
+                    max-width: 920px;
                     overflow:hidden;
 
                     li {
@@ -5426,6 +5426,7 @@
                     white-space: nowrap;
                     overflow: hidden;
                     font-size: 14px;
+                    font-weight: bold;
                 }
 
                 .review-meta {
@@ -5445,3 +5446,33 @@
         }
     }
 }
+
+.group-title-head{
+  color: #00bff3;
+  .border-radius(3px);
+  font-size: 12px;
+  margin-right: 5px;
+  padding: 3px;
+}
+
+.my-list-item {
+  img {
+    width: 20px;
+    height: 20px;
+    .border-radius(3px);
+    border: 1px solid #ececec;
+    margin-right: 3px;
+  }
+  .dummy-25px {
+    width: 25px;
+    display: inline-block;
+  }
+}
+
+.dropdown-menu>li {
+  .my-list-item;
+}
+
+.margin-right-15 {
+  margin-right: 15px;
+}
app/assets/stylesheets/less/_yobiUI.less
--- app/assets/stylesheets/less/_yobiUI.less
+++ app/assets/stylesheets/less/_yobiUI.less
@@ -422,7 +422,6 @@
     display:inline-block;
     vertical-align:middle;
     overflow:hidden;
-    border: 1px solid #ccc;
     background:#ddd;
     .border-radius(3px) !important;
 
@@ -1037,7 +1036,7 @@
             > a {
                 .border-radius(3px);
                 color:#292929;
-                padding: 3px 20px 5px;
+                padding: 3px 5px 5px 15px;
                 background-color:transparent !important;
                 .transition(all 0.2s ease);
 
app/utils/TemplateHelper.scala
--- app/utils/TemplateHelper.scala
+++ app/utils/TemplateHelper.scala
@@ -142,10 +142,24 @@
     "<a href=\"" + userInfoURL + "\" class=\"usf-group\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + user.name + "\"><img src=\"" + user.avatarUrl + "\" class=\"avatar-wrap " + avatarSize + "\"></a>"
   }
 
+  def urlToProjectBG(project: Project) = {
+    models.Attachment.findByContainer(project.asResource) match {
+      case files if files.size > 0 => routes.AttachmentApp.getFile(files.head.id)
+      case _ => routes.Assets.at("images/project_default.png")
+    }
+  }
+
   def urlToProjectLogo(project: Project) = {
     models.Attachment.findByContainer(project.asResource) match {
       case files if files.size > 0 => routes.AttachmentApp.getFile(files.head.id)
-      case _ => routes.Assets.at("images/bg-default-project.jpg")
+      case _ => routes.Assets.at("images/projet_deault.png")
+    }
+  }
+
+  def hasProjectLogo(project: Project) = {
+    models.Attachment.findByContainer(project.asResource) match {
+      case files if files.size > 0 => true
+      case _ => false
     }
   }
 
@@ -233,7 +247,14 @@
   def urlToOrganizationLogo(organization: Organization) = {
     models.Attachment.findByContainer(organization.asResource) match {
       case files if files.size > 0 => routes.AttachmentApp.getFile(files.head.id)
-      case _ => routes.Assets.at("images/bg-default-project.jpg")
+      case _ => routes.Assets.at("images/group_default.png")
+    }
+  }
+
+  def hasOrganizationLogo(organization: Organization) = {
+    models.Attachment.findByContainer(organization.asResource) match {
+      case files if files.size > 0 => true
+      case _ => false
     }
   }
 
app/views/common/usermenu.scala.html
--- app/views/common/usermenu.scala.html
+++ app/views/common/usermenu.scala.html
@@ -1,4 +1,5 @@
 @(project:Project)
+@import utils.TemplateHelper._
 @orderString = @{"createdDate DESC"}
 <ul class="gnb-usermenu">
     <li>
@@ -65,8 +66,8 @@
                     <span class="numberic">@groups.size</span>
                 </li>
                 @if(groups.length > 0) {
-                    @for(g <- groups){
-                        <li><a href="@routes.OrganizationApp.organization(g.name)"><span class="bold">@g.name</span></a></li>
+                    @for(organization <- groups){
+                        <li><a href="@routes.OrganizationApp.organization(organization.name)">@if(hasOrganizationLogo(organization)){<img src="@urlToOrganizationLogo(organization)">}else{<span class="dummy-25px"> </span>} <span class="bold">@organization.name</span></a></li>
                     }
                 } else {
                     <li class="empty">@Messages("organization.is.empty")</li>
@@ -78,14 +79,14 @@
                     <span class="numberic">@visitedProjects.size</span>
                 </li>
                 @if(visitedProjects.length > 0) {
-                    @for(pv <- visitedProjects){
-                        <li><a href="@routes.ProjectApp.project(pv.project.owner, pv.project.name)"><span class="gray">@pv.project.owner / </span><span class="bold">@pv.project.name</span></a></li>
+                    @for(visited <- visitedProjects){
+                        <li><a href="@routes.ProjectApp.project(visited.project.owner, visited.project.name)">@if(hasProjectLogo(visited.project)){<img src="@urlToProjectLogo(visited.project)">} else{<span class="dummy-25px"> </span>} <span class="bold">@visited.project.name</span> <span class="darkgray-txt small-font margin-right-15">of @visited.project.owner</span></a></li>
                     }
                 } else {
                     @defining(Project.findProjectsCreatedByUser(UserApp.currentUser.loginId, orderString)) { myProjects =>
                         @if(myProjects.length > 0) {
                             @for(project <- myProjects){
-                                <li><a href="@routes.ProjectApp.project(project.owner, project.name)"><span class="gray">@project.owner / </span><span class="bold">@project.name</span></a></li>
+                                <li>@if(hasProjectLogo(project)){<img src="@urlToProjectLogo(project)">} <a href="@routes.ProjectApp.project(project.owner, project.name)"><span class="bold">@project.name</span> <span class="darkgray-txt small-font margin-right-15">of @project.owner</span></a></li>
                             }
                         } else {
                             <li class="empty">@Messages("project.is.empty")</li>
app/views/index/myOrganizationList.scala.html
--- app/views/index/myOrganizationList.scala.html
+++ app/views/index/myOrganizationList.scala.html
@@ -5,7 +5,7 @@
 @defining(Organization.findOrganizationsByUserLoginId(UserApp.currentUser.loginId)) { organizations =>
     @for(organization <- organizations){
         <li class="my-list-item" data-value="@organization.name">
-            <a href="@routes.OrganizationApp.organization(organization.name)">
+            @if(hasOrganizationLogo(organization)){<img src="@urlToOrganizationLogo(organization)">}else{<span class="dummy-25px"> </span>}<a href="@routes.OrganizationApp.organization(organization.name)">
                 <span class="bold">@organization.name</span>
             </a>
         </li>
app/views/index/myProjectList.scala.html
--- app/views/index/myProjectList.scala.html
+++ app/views/index/myProjectList.scala.html
@@ -5,26 +5,23 @@
 <ul class="tab-pane unstyled my-project-item" id="@title">
 @for(project <- projects){
     <li class="my-list-item" data-value="@if(project.owner != currentUser.loginId) {@project.owner / }@project.name">
-        @if(project.owner != currentUser.loginId) {
-        <a href="@routes.UserApp.userInfo(project.owner)">@project.owner</a> /
-        }
+    @if(hasProjectLogo(project)){<img src="@urlToProjectLogo(project)" alt="@project.name"/>} else{<span class="dummy-25px"> </span>}
         <a href="@routes.ProjectApp.project(project.owner, project.name)" class="project-name">
             <strong>@project.name @if(project.isPrivate){ <i class="yobicon-lock yobicon-small"></i> }</strong>
         </a>
+        <span class="gray-txt small-font">of <a href="@routes.UserApp.userInfo(project.owner)" >@project.owner</a></span>
     </li>
 }
 </ul>
 }
 @defining(currentUser.getVisitedProjects(10)){ visitedProjects =>
 <ul class="tab-pane unstyled my-project-item active" id="recentlyVisited">
-@for(pv <- visitedProjects){
-    <li class="my-list-item" data-value="@if(pv.project.owner != currentUser.loginId) {@pv.project.owner / }@pv.project.name">
-        @if(pv.project.owner != currentUser.loginId) {
-        <a href="@routes.UserApp.userInfo(pv.project.owner)">@pv.project.owner</a> /
-        }
-        <a href="@routes.ProjectApp.project(pv.project.owner, pv.project.name)" class="project-name">
-            <strong>@pv.project.name @if(pv.project.isPrivate){ <i class="yobicon-lock yobicon-small"></i> }</strong>
+@for(visited <- visitedProjects){
+    <li class="my-list-item" data-value="@if(visited.project.owner != currentUser.loginId) {@visited.project.owner / }@visited.project.name">
+        @if(hasProjectLogo(visited.project)){<img src="@urlToProjectLogo(visited.project)" alt="@visited.project.name"/>} else{<span class="dummy-25px"> </span>}<a href="@routes.ProjectApp.project(visited.project.owner, visited.project.name)" class="project-name">
+            <strong>@visited.project.name @if(visited.project.isPrivate){ <i class="yobicon-lock yobicon-small"></i> }</strong>
         </a>
+        <span class="gray-txt small-font">of <a href="@routes.UserApp.userInfo(visited.project.owner)" >@visited.project.owner</a></span>
     </li>
 }
 </ul>    
app/views/organization/header.scala.html
--- app/views/organization/header.scala.html
+++ app/views/organization/header.scala.html
@@ -11,7 +11,7 @@
             </div>
             <div class="project-breadcrumb-wrap">
                 <div class="project-breadcrumb">
-                    <span class="project-author"><a href="@routes.OrganizationApp.organization(org.name)">@org.name</a></span>
+                    <span class="project-author"><span class="group-title-head">group</span><a href="@routes.OrganizationApp.organization(org.name)">@org.name</a></span>
                 </div>
             </div>
         </div>
 
public/images/bg-samples/yobi_bg01.jpg (Binary) (added)
+++ public/images/bg-samples/yobi_bg01.jpg
Binary file is not shown
 
public/images/bg-samples/yobi_bg02.jpg (Binary) (added)
+++ public/images/bg-samples/yobi_bg02.jpg
Binary file is not shown
 
public/images/group_default.png (Binary) (added)
+++ public/images/group_default.png
Binary file is not shown
 
public/images/projet_deault.png (Binary) (added)
+++ public/images/projet_deault.png
Binary file is not shown
 
public/images/yobi_bg01.jpg (Binary) (added)
+++ public/images/yobi_bg01.jpg
Binary file is not shown
 
public/images/yobi_bg02.jpg (Binary) (added)
+++ public/images/yobi_bg02.jpg
Binary file is not shown
 
public/images/yobi_bg03.jpg (Binary) (added)
+++ public/images/yobi_bg03.jpg
Binary file is not shown
 
public/images/yobi_bg04.jpg (Binary) (added)
+++ public/images/yobi_bg04.jpg
Binary file is not shown
 
public/images/yobi_bg05.jpg (Binary) (added)
+++ public/images/yobi_bg05.jpg
Binary file is not shown
 
public/images/yobi_bg06.jpg (Binary) (added)
+++ public/images/yobi_bg06.jpg
Binary file is not shown
 
public/images/yobi_bg07.jpg (Binary) (added)
+++ public/images/yobi_bg07.jpg
Binary file is not shown
Add a comment
List