Skip to content

Commit

Permalink
REAMDE: Change Non-codebase project's README expression way
Browse files Browse the repository at this point in the history
If code menu is hidden by user,
project's README file considered as Posting for board.

If not, code repository's README.md file wins.
  • Loading branch information
doortts committed Jul 14, 2017
1 parent 64cd61c commit c71437d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 35 deletions.
6 changes: 6 additions & 0 deletions app/utils/TemplateHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -638,4 +638,10 @@ object TemplateHelper {
def userInfo(loginId: String) = {
Config.getContextRoot() + loginId
}

def containsInDefaultMenus(menuName: String) = {
val menus = play.Configuration.root.getString("project.creation.default.menus", "code, issue, pullRequest, review, milestone, board").replaceAll(" ", "").split(",")
menus.toStream.contains(menuName)

}
}
20 changes: 3 additions & 17 deletions app/views/project/home.scala.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
@**
* Yobi, Project Hosting SW
* Yona, 21st Century Project Hosting SW
*
* Copyright 2013 NAVER Corp.
* http://yobi.io
*
* @author Jihan Kim
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright Yona & Yobi Authors & NAVER Corp.
* https://yona.io
**@
@(message: String, project: Project, histories: List[models.History], tabId: String)
@import org.apache.commons.lang.StringUtils
Expand Down
30 changes: 12 additions & 18 deletions app/views/project/partial_readme.scala.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
@**
* Yobi, Project Hosting SW
* Yona, 21st Century Project Hosting SW
*
* Copyright 2013 NAVER Corp.
* http://yobi.io
*
* @author Jihan Kim
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright Yona & Yobi Authors & NAVER Corp.
* https://yona.io
**@
@(project: Project)
@import utils.AccessControl._
@import models.enumeration.ResourceType
@import utils.Markdown

@projectReadmePosting = @{
Posting.findREADMEPosting(project)
}

<div class="bubble-wrap gray readme">
@if(project.readme == null){
<p class="default">
Expand All @@ -45,7 +35,11 @@
<a href="@routes.BoardApp.newPostForm(project.owner, project.name)?readme=true" class="ybtn vmiddle ml5">@Messages("button.edit")</a>
}
</header>
<div class="readme-body markdown-wrap">@Html(Markdown.renderFileInReadme(project.readme, project))</div>
@if(!project.menuSetting.code && projectReadmePosting != null) {
<div class="readme-body markdown-wrap">@Html(Markdown.render(projectReadmePosting.body, project))</div>
} else {
<div class="readme-body markdown-wrap">@Html(Markdown.renderFileInReadme(project.readme, project))</div>
}
</div>
}
@common.markdown(project)
Expand Down

0 comments on commit c71437d

Please sign in to comment.