mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-24 14:24:47 +08:00
FlagReason values
This commit is contained in:
parent
86240f98ed
commit
c501281625
@ -23,4 +23,10 @@ public enum FlagReason {
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
private static final FlagReason[] VALUES = values();
|
||||
|
||||
public static FlagReason[] getValues() {
|
||||
return VALUES;
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
package io.papermc.hangar.service.project;
|
||||
|
||||
import io.papermc.hangar.db.dao.FlagDao;
|
||||
import io.papermc.hangar.model.viewhelpers.ProjectFlag;
|
||||
import io.papermc.hangar.db.dao.HangarDao;
|
||||
import io.papermc.hangar.db.model.ProjectFlagsTable;
|
||||
import io.papermc.hangar.model.FlagReason;
|
||||
import io.papermc.hangar.model.viewhelpers.ProjectFlag;
|
||||
import io.papermc.hangar.service.HangarService;
|
||||
import io.papermc.hangar.service.UserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -17,12 +16,10 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class FlagService extends HangarService {
|
||||
|
||||
private final UserService userService;
|
||||
private final HangarDao<FlagDao> flagDao;
|
||||
|
||||
@Autowired
|
||||
public FlagService(UserService userService, HangarDao<FlagDao> flagDao) {
|
||||
this.userService = userService;
|
||||
public FlagService(HangarDao<FlagDao> flagDao) {
|
||||
this.flagDao = flagDao;
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ Base template for Project overview.
|
||||
<#assign Visibility=@helper["io.papermc.hangar.model.Visibility"]>
|
||||
<#assign Permission=@helper["io.papermc.hangar.model.Permission"]>
|
||||
<#assign FlagReason=@helper["io.papermc.hangar.model.FlagReason"]>
|
||||
<#-- @ftlvariable name="FlagReason" type="io.papermc.hangar.model.FlagReason" -->
|
||||
<#macro view p sp active noButtons=false additionalScripts="" additionalStyling="">
|
||||
<#-- @ftlvariable name="p" type="io.papermc.hangar.model.viewhelpers.ProjectData" -->
|
||||
<#-- @ftlvariable name="sp" type="io.papermc.hangar.model.viewhelpers.ScopedProjectData" -->
|
||||
@ -133,7 +134,7 @@ Base template for Project overview.
|
||||
<@csrf.formField />
|
||||
<div class="modal-body">
|
||||
<ul class="list-group list-flags">
|
||||
<#list FlagReason.values() as reason>
|
||||
<#list FlagReason.getValues() as reason>
|
||||
<#-- @ftlvariable name="reason" type="io.papermc.hangar.model.FlagReason" -->
|
||||
<li class="list-group-item">
|
||||
<span>${reason.title}</span>
|
||||
|
Loading…
Reference in New Issue
Block a user