Browse Source

Updated uploads to give full URLs with the shortened subdomain by default.

pull/111/head
Teknikode 6 years ago
parent
commit
532d28d2d8
  1. 4
      Teknik/Areas/API/Controllers/APIv1Controller.cs
  2. 6
      Teknik/Areas/Paste/Views/Paste/Full.cshtml

4
Teknik/Areas/API/Controllers/APIv1Controller.cs

@ -107,7 +107,7 @@ namespace Teknik.Areas.API.Controllers @@ -107,7 +107,7 @@ namespace Teknik.Areas.API.Controllers
}
// Pull all the information together
string fullUrl = Url.SubRouteUrl("upload", "Upload.Download", new { file = upload.Url });
string fullUrl = Url.SubRouteUrl("u", "Upload.Download", new { file = upload.Url });
var returnData = new
{
url = (model.saveKey || string.IsNullOrEmpty(model.key)) ? fullUrl : fullUrl + "#" + model.key,
@ -169,7 +169,7 @@ namespace Teknik.Areas.API.Controllers @@ -169,7 +169,7 @@ namespace Teknik.Areas.API.Controllers
result = new
{
id = paste.Url,
url = Url.SubRouteUrl("paste", "Paste.View", new { type = "Full", url = paste.Url, password = model.password }),
url = Url.SubRouteUrl("p", "Paste.View", new { type = "Full", url = paste.Url, password = model.password }),
title = paste.Title,
syntax = paste.Syntax,
expiration = paste.ExpireDate,

6
Teknik/Areas/Paste/Views/Paste/Full.cshtml

@ -19,9 +19,9 @@ @@ -19,9 +19,9 @@
<div class="row">
<div class="col-sm-12 pull-left">
<div class="btn-group" role="group">
<a role="button" class="btn btn-default" href="@Url.SubRouteUrl("paste", "Paste.Simple", new { url = Model.Url })">Simple</a>
<a role="button" class="btn btn-default" href="@Url.SubRouteUrl("paste", "Paste.Raw", new { url = Model.Url })">Raw</a>
<a role="button" class="btn btn-default" href="@Url.SubRouteUrl("paste", "Paste.Download", new { url = Model.Url })">Download</a>
<a role="button" class="btn btn-default" href="@Url.SubRouteUrl("p", "Paste.Simple", new { url = Model.Url })">Simple</a>
<a role="button" class="btn btn-default" href="@Url.SubRouteUrl("p", "Paste.Raw", new { url = Model.Url })">Raw</a>
<a role="button" class="btn btn-default" href="@Url.SubRouteUrl("p", "Paste.Download", new { url = Model.Url })">Download</a>
<button type="button" class="btn btn-default" id="create-vault" data-paste-url="@Model.Url" data-paste-title="@((string.IsNullOrEmpty(Model.Title)) ? "Untitled" : Model.Title)">Create Vault</button>
@if (User.Identity.IsAuthenticated && Model.Vaults != null && Model.Vaults.Any())
{

Loading…
Cancel
Save