mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-03-07 15:31:00 +08:00
Implement linkout
This commit is contained in:
parent
af8b5c52e9
commit
183e506dd6
@ -0,0 +1,18 @@
|
||||
package me.minidigger.hangar.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
public class LinkoutController {
|
||||
@GetMapping(path = "/linkout", params = "remoteUrl")
|
||||
public String linkout(@RequestParam("remoteUrl") String remoteUrl, Model model) {
|
||||
model.addAttribute("remoteUrl", remoteUrl);
|
||||
return "linkout";
|
||||
}
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
@import controllers.sugar.Requests.OreRequest
|
||||
@import ore.OreConfig
|
||||
@(remoteUrl: String)(implicit messages: Messages, request: OreRequest[_], config: OreConfig, flash: Flash, assetsFinder: AssetsFinder)
|
||||
|
||||
<#import "/spring.ftl" as spring />
|
||||
<#import "../utils/hangar.ftlh" as hangar />
|
||||
|
||||
@layout.base(messages("general.linkout.title")) {
|
||||
<#import "utils/hangar.ftlh" as hangar />
|
||||
<#import "*/layout/base.ftlh" as base />
|
||||
|
||||
<#assign message><@spring.message "general.linkout.title" /></#assign>
|
||||
<@base.base title="${message}">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="panel panel-default">
|
||||
@ -16,11 +13,11 @@
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p><@spring.messageArgs "general.linkout.warning" remoteUrl /></p>
|
||||
<p><@spring.messageArgs "general.linkout.warning", [remoteUrl] /></p>
|
||||
<a class="pull-left link-go-back">
|
||||
<i class="fas fa-arrow-left"></i> <@spring.message "project.back" />
|
||||
</a>
|
||||
<a href="@remoteUrl">
|
||||
<a href="${remoteUrl}">
|
||||
<button class="pull-right btn btn-primary">
|
||||
<@spring.message "general.continue" />
|
||||
</button>
|
||||
@ -29,5 +26,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
}
|
||||
</@base.base>
|
@ -9,3 +9,7 @@
|
||||
<#nested>
|
||||
</#if>
|
||||
</#macro>
|
||||
|
||||
<#macro linkout url>
|
||||
/linkout?remoteUrl=${url}
|
||||
</#macro>
|
||||
|
Loading…
Reference in New Issue
Block a user