Skip to content

Commit

Permalink
project: Fix application.context bug at recent history
Browse files Browse the repository at this point in the history
Even though the user specified application.context,
recent history links on project pages do not work properly.

This fix is feat by @sjstyle.

See: Github issue #102
  • Loading branch information
doortts committed Dec 6, 2016
1 parent fb4881a commit 21e7d5b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/models/History.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*/
package models;

import org.apache.commons.lang3.StringUtils;
import play.Configuration;
import playRepository.Commit;

import java.util.*;
Expand Down Expand Up @@ -83,7 +85,12 @@ public String getUrl() {
}

public void setUrl(String url) {
this.url = url;
String contextRoot = Configuration.root().getString("application.context");
if(StringUtils.isBlank(contextRoot)){
this.url = url;
} else {
this.url = (contextRoot + "/" + url).replaceAll("//","/");
}
}

public String getUserPageUrl() {
Expand Down
7 changes: 7 additions & 0 deletions app/utils/SecurityManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package utils;

/**
* Created by doortts on 12/5/16.
*/
public class SecurityManager {
}

This comment has been minimized.

Copy link
@doortts

doortts Dec 6, 2016

Author Collaborator

잘못 끼어 들어간 코드... 부들부들...;;;

6 changes: 6 additions & 0 deletions conf/application.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
# The name of your website
application.siteName="Yona"

# Application Context
# ~~~~~~~~~~~~~~~~~~~
# If you want your own application context root, you can set it.
# Don't miss first / (slash) letter!
# application.context = /myroot

# Anonymous access
# ~~~~~~~~~~~~~~~~
# This site allows anonymous access. (default: true)
Expand Down

0 comments on commit 21e7d5b

Please sign in to comment.