From cf7e3472dc689d631b3f7769c8a26783788274aa Mon Sep 17 00:00:00 2001 From: MiniDigger Date: Sun, 23 Aug 2020 11:53:35 +0200 Subject: [PATCH] misc stuff --- .../papermc/hangar/controller/ProjectsController.java | 10 +++++----- .../templates/projects/pages/modalPageCreate.ftlh | 1 - src/main/resources/templates/projects/pages/view.ftlh | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/papermc/hangar/controller/ProjectsController.java b/src/main/java/io/papermc/hangar/controller/ProjectsController.java index 3583bf479..3763b9325 100644 --- a/src/main/java/io/papermc/hangar/controller/ProjectsController.java +++ b/src/main/java/io/papermc/hangar/controller/ProjectsController.java @@ -1,6 +1,7 @@ package io.papermc.hangar.controller; import io.papermc.hangar.config.hangar.HangarConfig; +import io.papermc.hangar.db.dao.GeneralDao; import io.papermc.hangar.db.dao.HangarDao; import io.papermc.hangar.db.dao.ProjectDao; import io.papermc.hangar.db.dao.UserDao; @@ -92,11 +93,12 @@ public class ProjectsController extends HangarController { private final TemplateHelper templateHelper; private final HangarDao userDao; private final HangarDao projectDao; + private final HangarDao generalDao; private final HttpServletRequest request; @Autowired - public ProjectsController(HangarConfig hangarConfig, RouteHelper routeHelper, UserService userService, OrgService orgService, FlagService flagService, ProjectService projectService, ProjectFactory projectFactory, PagesSerivce pagesSerivce, RoleService roleService, NotificationService notificationService, UserActionLogService userActionLogService, ProjectFiles projectFiles, TemplateHelper templateHelper, HangarDao userDao, HangarDao projectDao, HttpServletRequest request) { + public ProjectsController(HangarConfig hangarConfig, RouteHelper routeHelper, UserService userService, OrgService orgService, FlagService flagService, ProjectService projectService, ProjectFactory projectFactory, PagesSerivce pagesSerivce, RoleService roleService, NotificationService notificationService, UserActionLogService userActionLogService, ProjectFiles projectFiles, TemplateHelper templateHelper, HangarDao userDao, HangarDao projectDao, HangarDao generalDao, HttpServletRequest request) { this.hangarConfig = hangarConfig; this.routeHelper = routeHelper; this.userService = userService; @@ -112,6 +114,7 @@ public class ProjectsController extends HangarController { this.templateHelper = templateHelper; this.userDao = userDao; this.projectDao = projectDao; + this.generalDao = generalDao; this.request = request; } @@ -161,10 +164,7 @@ public class ProjectsController extends HangarController { } // refresh home page - // service - // .runDbCon(SharedQueries.refreshHomeView.run) - // .runAsync(TaskUtils.logCallback("Failed to refresh home page", logger)) - // .to[F] + generalDao.get().refreshHomeProjects(); return new ModelAndView("redirect:" + routeHelper.getRouteUrl("projects.show", project.getOwnerName(), project.getSlug())); } diff --git a/src/main/resources/templates/projects/pages/modalPageCreate.ftlh b/src/main/resources/templates/projects/pages/modalPageCreate.ftlh index 86c82ecb3..780ff41f5 100644 --- a/src/main/resources/templates/projects/pages/modalPageCreate.ftlh +++ b/src/main/resources/templates/projects/pages/modalPageCreate.ftlh @@ -20,7 +20,6 @@