diff --git a/app/controllers/project/Projects.scala b/app/controllers/project/Projects.scala index a5a4f96d7..9491ede38 100755 --- a/app/controllers/project/Projects.scala +++ b/app/controllers/project/Projects.scala @@ -19,7 +19,7 @@ import db.{ModelService, ObjectReference} import discourse.OreDiscourseApi import form.OreForms import form.project.{DiscussionReplyForm, FlagForm, ProjectRoleSetBuilder} -import models.project.{Note, Page, Visibility} +import models.project.{Note, Visibility} import models.user._ import models.viewhelper.ScopedOrganizationData import ore.permission._ @@ -226,7 +226,12 @@ class Projects @Inject()(stats: StatTracker, forms: OreForms, factory: ProjectFa * @return View of project */ def show(author: String, slug: String): Action[AnyContent] = ProjectAction(author, slug).async { implicit request => - Future.successful(Redirect(routes.Pages.show(author, slug, Page.homeName))) + projects.queryProjectPages(request.project).flatMap { pages => + val pageCount = pages.size + pages.map(_._2.size).sum + this.stats.projectViewed( + Ok(views.pages.view(request.data, request.scoped, pages, request.project.homePage, None, pageCount)) + ) + } } /** diff --git a/app/controllers/project/Versions.scala b/app/controllers/project/Versions.scala index f917979ed..9635d2b89 100755 --- a/app/controllers/project/Versions.scala +++ b/app/controllers/project/Versions.scala @@ -382,7 +382,6 @@ class Versions @Inject()(stats: StatTracker, forms: OreForms, factory: ProjectFa // Found a pending project, create it with first version pendingProject.complete .flatTap { created => - created._1.homePage UserActionLogger.log(request, LoggedAction.ProjectCreated, created._1.id.value, "created", "null") } .flatTap(created => addUnstableTag(created._2, versionData.unstable)) diff --git a/app/db/impl/schema/PageSchema.scala b/app/db/impl/schema/PageSchema.scala index 67bcbe3fd..88c6d6518 100644 --- a/app/db/impl/schema/PageSchema.scala +++ b/app/db/impl/schema/PageSchema.scala @@ -18,8 +18,9 @@ class PageSchema(override val service: ModelService) this.service.find[Page]( this.modelClass, p => - p.projectId === page.projectId && p.name.toLowerCase === page.name.toLowerCase - && page.parentId.isDefined && page.parentId.fold(true: Rep[Boolean])(p.parentId.get === _) + p.projectId === page.projectId && p.name.toLowerCase === page.name.toLowerCase && page.parentId.fold( + true: Rep[Boolean] + )(p.parentId.get === _) ) } diff --git a/build.sbt b/build.sbt index 59442e730..878a4686e 100755 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,5 @@ name := "ore" -version := "1.6.16" +version := "1.6.17" lazy val `ore` = (project in file(".")).enablePlugins(PlayScala)