mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-03-07 15:31:00 +08:00
Remove duplicated/empty notes stuff
This commit is contained in:
parent
ae16ef8b71
commit
ae74dda88e
@ -338,15 +338,22 @@ public class ProjectsController extends HangarController {
|
||||
return new ModelAndView("redirect:" + routeHelper.getRouteUrl("projects.show", author, slug));
|
||||
}
|
||||
|
||||
@GlobalPermission(NamedPermission.MOD_NOTES_AND_FLAGS)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/notes")
|
||||
public Object showNotes(@PathVariable Object author, @PathVariable Object slug) {
|
||||
return null; // TODO implement showNotes request controller
|
||||
public ModelAndView showNotes(@PathVariable String author, @PathVariable String slug) {
|
||||
ModelAndView mv = new ModelAndView("projects/admin/notes");
|
||||
ProjectData projectData = projectService.getProjectData(author, slug);
|
||||
mv.addObject("project", projectData.getProject());
|
||||
//TODO get real notes
|
||||
mv.addObject("notes", List.of(new Note().message("## 10/10\n* has everything\n* but also nothing").user("kneny")));
|
||||
return fillModel(mv);
|
||||
}
|
||||
|
||||
@GlobalPermission(NamedPermission.MOD_NOTES_AND_FLAGS)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/notes/addmessage")
|
||||
public Object addMessage(@PathVariable Object author, @PathVariable Object slug) {
|
||||
public ModelAndView addMessage(@PathVariable String author, @PathVariable String slug) {
|
||||
return null; // TODO implement addMessage request controller
|
||||
}
|
||||
|
||||
@ -399,18 +406,6 @@ public class ProjectsController extends HangarController {
|
||||
}
|
||||
}
|
||||
|
||||
@GlobalPermission(NamedPermission.MOD_NOTES_AND_FLAGS)
|
||||
@Secured("ROLE_USER")
|
||||
@GetMapping("/{author}/{slug}/notes")
|
||||
public ModelAndView showNotes(@PathVariable String author, @PathVariable String slug) {
|
||||
ModelAndView mv = new ModelAndView("projects/admin/notes");
|
||||
ProjectData projectData = projectService.getProjectData(author, slug);
|
||||
mv.addObject("project", projectData.getProject());
|
||||
//TODO get and save real notes
|
||||
mv.addObject("notes", List.of(new Note().message("## 10/10\n* has everything\n* but also nothing").user("kneny")));
|
||||
return fillModel(mv);
|
||||
}
|
||||
|
||||
private ModelAndView showUserGrid(String author, String slug, Integer page, String title, TriFunction<Long, Integer, Integer, Collection<UsersTable>> getUsers) {
|
||||
ProjectData projectData = projectService.getProjectData(author, slug);
|
||||
ScopedProjectData scopedProjectData = projectService.getScopedProjectData(projectData.getProject().getId());
|
||||
|
@ -63,7 +63,6 @@ public class RouteHelper {
|
||||
register("projects.showNotes", "/{author}/{slug}/notes", of("author", "slug"), of());
|
||||
register("projects.setVisible", "/{author}/{slug}/visible/{visibility}", of("author", "slug", "visibility"), of());
|
||||
register("projects.removeMember", "/{author}/{slug}/manage/members/remove", of("author", "slug"), of());
|
||||
register("projects.showNotes", "/{author}/{slug}/notes", of("author", "slug"), of());
|
||||
|
||||
register("versions.restore", "/{author}/{slug}/versions/{version}/restore", of("author", "slug", "version"), of());
|
||||
register("versions.downloadRecommendedJar", "/{author}/{slug}/versions/recommended/jar", of("author", "slug"), of("token"));
|
||||
|
Loading…
Reference in New Issue
Block a user