(refs #115)Add button to toggle http/ssh for wiki repository url box

This commit is contained in:
takezoe
2014-03-14 10:59:42 +09:00
parent 0c683f7243
commit d1c6c763e2
8 changed files with 56 additions and 22 deletions

View File

@@ -15,6 +15,7 @@ import org.eclipse.jgit.patch._
import org.eclipse.jgit.api.errors.PatchFormatException
import scala.collection.JavaConverters._
import scala.Some
import service.RepositoryService.RepositoryInfo
object WikiService {
@@ -40,6 +41,10 @@ object WikiService {
*/
case class WikiPageHistoryInfo(name: String, committer: String, message: String, date: Date)
def httpUrl(repository: RepositoryInfo) = repository.httpUrl.replaceFirst("\\.git\\Z", ".wiki.git")
def sshUrl(repository: RepositoryInfo, settings: SystemSettingsService.SystemSettings) =
repository.sshUrl(settings.sshPort.getOrElse(SystemSettingsService.DefaultSshPort)).replaceFirst("\\.git\\Z", ".wiki.git")
}
trait WikiService {