mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Done #135 We are including the application version number in the directory.
This commit is contained in:
parent
6392ee0bde
commit
67df79bcca
9 changed files with 78 additions and 61 deletions
|
@ -30,7 +30,7 @@ using Newtonsoft.Json;
|
|||
|
||||
namespace PlexRequests.Core.SettingModels
|
||||
{
|
||||
public sealed class LandingPageSettings : Settings
|
||||
public class LandingPageSettings : Settings
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
public bool BeforeLogin { get; set; }
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#endregion
|
||||
namespace PlexRequests.Core.SettingModels
|
||||
{
|
||||
public sealed class ScheduledJobsSettings : Settings
|
||||
public class ScheduledJobsSettings : Settings
|
||||
{
|
||||
public ScheduledJobsSettings()
|
||||
{
|
||||
|
|
|
@ -116,10 +116,12 @@ namespace PlexRequests.UI
|
|||
var settings = new SettingsServiceV2<PlexRequestSettings>(new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider()));
|
||||
var assetLocation = settings.GetSettings().BaseUrl;
|
||||
nancyConventions.StaticContentsConventions.Add(
|
||||
StaticContentConventionBuilder.AddDirectory($"{assetLocation}/Content", "Content")
|
||||
StaticContentConventionBuilder.AddDirectory($"{assetLocation}/Content_{AssemblyHelper.GetProductVersion()}", "Content")
|
||||
);
|
||||
|
||||
nancyConventions.StaticContentsConventions.AddDirectory($"{assetLocation}/docs", "swagger-ui");
|
||||
|
||||
nancyConventions.StaticContentsConventions.AddDirectory($"{assetLocation}/fonts", "Content/fonts");
|
||||
}
|
||||
|
||||
protected override DiagnosticsConfiguration DiagnosticsConfiguration => new DiagnosticsConfiguration { Password = @"password" };
|
||||
|
|
4
PlexRequests.UI/Content/font-awesome.css
vendored
4
PlexRequests.UI/Content/font-awesome.css
vendored
|
@ -6,8 +6,8 @@
|
|||
* -------------------------- */
|
||||
@font-face {
|
||||
font-family: 'FontAwesome';
|
||||
src: url('../Content/fonts/fontawesome-webfont.eot?v=4.5.0');
|
||||
src: url('../Content/fonts/fontawesome-webfont.eot?#iefix&v=4.5.0') format('embedded-opentype'), url('../Content/fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2'), url('../Content/fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'), url('../Content/fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'), url('../Content/fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');
|
||||
src: url('../fonts/fontawesome-webfont.eot?v=4.5.0');
|
||||
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.5.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// ************************************************************************/
|
||||
#endregion
|
||||
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Nancy;
|
||||
using Nancy.ViewEngines.Razor;
|
||||
|
@ -45,6 +44,20 @@ namespace PlexRequests.UI.Helpers
|
|||
}
|
||||
private static ICacheProvider Cache { get; }
|
||||
private static ServiceLocator Locator { get; }
|
||||
private static string _Assembly;
|
||||
|
||||
// We don't need to call the AssemblyHelper every time, the value will never change in the application life cycle.
|
||||
private static string Assembly
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(_Assembly))
|
||||
{
|
||||
_Assembly = AssemblyHelper.GetProductVersion();
|
||||
}
|
||||
return _Assembly;
|
||||
}
|
||||
}
|
||||
|
||||
public static IHtmlString LoadAssets(this HtmlHelpers helper)
|
||||
{
|
||||
|
@ -60,24 +73,44 @@ namespace PlexRequests.UI.Helpers
|
|||
if (settings.ThemeName == "PlexBootstrap.css") settings.ThemeName = Themes.PlexTheme;
|
||||
if (settings.ThemeName == "OriginalBootstrap.css") settings.ThemeName = Themes.OriginalTheme;
|
||||
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/bootstrap.css\" type=\"text/css\"/>");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/font-awesome.css\" type=\"text/css\"/>");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/pace.min.css\" type=\"text/css\"/>");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/awesome-bootstrap-checkbox.css\" type=\"text/css\"/>");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/base.css\" type=\"text/css\"/>");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/Themes/{settings.ThemeName}\" type=\"text/css\"/>");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/datepicker.min.css\" type=\"text/css\"/>");
|
||||
var startUrl = $"{content}/Content_{Assembly}";
|
||||
|
||||
sb.AppendLine($"<script src=\"{content}/Content/jquery-2.2.1.min.js\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content/app/app.js\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content/handlebars.min.js\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content/bootstrap.min.js\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content/bootstrap-notify.min.js\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content/site-1.7.js\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content/pace.min.js\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content/jquery.mixitup.js\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content/moment.min.js\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content/bootstrap-datetimepicker.min.js\"></script>");
|
||||
var styleAssets = new List<string>
|
||||
{
|
||||
$"<link rel=\"stylesheet\" href=\"{startUrl}/bootstrap.css\" type=\"text/css\"/>",
|
||||
$"<link rel=\"stylesheet\" href=\"{startUrl}/font-awesome.css\" type=\"text/css\"/>",
|
||||
$"<link rel=\"stylesheet\" href=\"{startUrl}/pace.min.css\" type=\"text/css\"/>",
|
||||
$"<link rel=\"stylesheet\" href=\"{startUrl}/awesome-bootstrap-checkbox.css\" type=\"text/css\"/>",
|
||||
$"<link rel=\"stylesheet\" href=\"{startUrl}/base.css\" type=\"text/css\"/>",
|
||||
$"<link rel=\"stylesheet\" href=\"{startUrl}/Themes/{settings.ThemeName}\" type=\"text/css\"/>",
|
||||
$"<link rel=\"stylesheet\" href=\"{startUrl}/datepicker.min.css\" type=\"text/css\"/>"
|
||||
};
|
||||
|
||||
|
||||
var scriptAssets = new List<string>
|
||||
{
|
||||
$"<script src=\"{startUrl}/jquery-2.2.1.min.js\"></script>",
|
||||
$"<script src=\"{startUrl}/app/app.js\"></script>",
|
||||
$"<script src=\"{startUrl}/handlebars.min.js\"></script>",
|
||||
$"<script src=\"{startUrl}/bootstrap.min.js\"></script>",
|
||||
$"<script src=\"{startUrl}/bootstrap-notify.min.js\"></script>",
|
||||
$"<script src=\"{startUrl}/site.js\"></script>",
|
||||
$"<script src=\"{startUrl}/pace.min.js\"></script>",
|
||||
$"<script src=\"{startUrl}/jquery.mixitup.js\"></script>",
|
||||
$"<script src=\"{startUrl}/moment.min.js\"></script>",
|
||||
$"<script src=\"{startUrl}/bootstrap-datetimepicker.min.js\"></script>"
|
||||
};
|
||||
|
||||
|
||||
foreach (var a in styleAssets)
|
||||
{
|
||||
sb.AppendLine(a);
|
||||
}
|
||||
|
||||
foreach (var a in scriptAssets)
|
||||
{
|
||||
sb.AppendLine(a);
|
||||
}
|
||||
|
||||
|
||||
return helper.Raw(sb.ToString());
|
||||
|
@ -90,7 +123,7 @@ namespace PlexRequests.UI.Helpers
|
|||
|
||||
var content = GetContentUrl(assetLocation);
|
||||
|
||||
sb.AppendLine($"<script src=\"{content}/Content/search-1.7.js\" type=\"text/javascript\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content_{Assembly}/search.js\" type=\"text/javascript\"></script>");
|
||||
|
||||
return helper.Raw(sb.ToString());
|
||||
}
|
||||
|
@ -102,7 +135,7 @@ namespace PlexRequests.UI.Helpers
|
|||
|
||||
var content = GetContentUrl(assetLocation);
|
||||
|
||||
sb.AppendLine($"<script src=\"{content}/Content/requests-1.7.js\" type=\"text/javascript\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content_{Assembly}/requests.js\" type=\"text/javascript\"></script>");
|
||||
|
||||
return helper.Raw(sb.ToString());
|
||||
}
|
||||
|
@ -114,7 +147,7 @@ namespace PlexRequests.UI.Helpers
|
|||
|
||||
var content = GetContentUrl(assetLocation);
|
||||
|
||||
sb.AppendLine($"<script src=\"{content}/Content/issues.js\" type=\"text/javascript\"></script>");
|
||||
sb.AppendLine($"<script src=\"{content}/Content_{Assembly}/issues.js\" type=\"text/javascript\"></script>");
|
||||
|
||||
return helper.Raw(sb.ToString());
|
||||
}
|
||||
|
@ -124,7 +157,7 @@ namespace PlexRequests.UI.Helpers
|
|||
var assetLocation = GetBaseUrl();
|
||||
var content = GetContentUrl(assetLocation);
|
||||
|
||||
var asset = $"<script src=\"{content}/Content/issue-details.js\" type=\"text/javascript\"></script>";
|
||||
var asset = $"<script src=\"{content}/Content_{Assembly}/issue-details.js\" type=\"text/javascript\"></script>";
|
||||
|
||||
return helper.Raw(asset);
|
||||
}
|
||||
|
@ -136,8 +169,8 @@ namespace PlexRequests.UI.Helpers
|
|||
|
||||
var content = GetContentUrl(assetLocation);
|
||||
|
||||
sb.AppendLine($"<script src=\"{content}/Content/datatables.min.js\" type=\"text/javascript\"></script>");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" type=\"text/css\" href=\"{content}/Content/dataTables.bootstrap.css\" />");
|
||||
sb.AppendLine($"<script src=\"{content}/Content_{Assembly}/datatables.min.js\" type=\"text/javascript\"></script>");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" type=\"text/css\" href=\"{content}/Content_{Assembly}/dataTables.bootstrap.css\" />");
|
||||
|
||||
return helper.Raw(sb.ToString());
|
||||
}
|
||||
|
@ -153,68 +186,50 @@ namespace PlexRequests.UI.Helpers
|
|||
var assetLocation = GetBaseUrl();
|
||||
var content = GetContentUrl(assetLocation);
|
||||
|
||||
var asset = $"<script src=\"{content}/Content/analytics.js\" type=\"text/javascript\"></script>";
|
||||
var asset = $"<script src=\"{content}/Content_{Assembly}/analytics.js\" type=\"text/javascript\"></script>";
|
||||
|
||||
return helper.Raw(asset);
|
||||
}
|
||||
|
||||
public static IHtmlString GetSidebarUrl(this HtmlHelpers helper, NancyContext context, string url, string title)
|
||||
{
|
||||
var returnString = string.Empty;
|
||||
var content = GetLinkUrl(GetBaseUrl());
|
||||
if (!string.IsNullOrEmpty(content))
|
||||
{
|
||||
url = $"/{content}{url}";
|
||||
}
|
||||
if (context.Request.Path == url)
|
||||
{
|
||||
returnString = $"<a class=\"list-group-item active\" href=\"{url}\">{title}</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
returnString = $"<a class=\"list-group-item\" href=\"{url}\">{title}</a>";
|
||||
}
|
||||
var returnString = context.Request.Path == url
|
||||
? $"<a class=\"list-group-item active\" href=\"{url}\">{title}</a>"
|
||||
: $"<a class=\"list-group-item\" href=\"{url}\">{title}</a>";
|
||||
|
||||
return helper.Raw(returnString);
|
||||
}
|
||||
|
||||
public static IHtmlString GetNavbarUrl(this HtmlHelpers helper, NancyContext context, string url, string title, string fontIcon)
|
||||
{
|
||||
var returnString = string.Empty;
|
||||
var content = GetLinkUrl(GetBaseUrl());
|
||||
if (!string.IsNullOrEmpty(content))
|
||||
{
|
||||
url = $"/{content}{url}";
|
||||
}
|
||||
if (context.Request.Path == url)
|
||||
{
|
||||
returnString = $"<li class=\"active\"><a href=\"{url}\"><i class=\"fa fa-{fontIcon}\"></i> {title}</a></li>";
|
||||
}
|
||||
else
|
||||
{
|
||||
returnString = $"<li><a href=\"{url}\"><i class=\"fa fa-{fontIcon}\"></i> {title}</a></li>";
|
||||
}
|
||||
var returnString = context.Request.Path == url ?
|
||||
$"<li class=\"active\"><a href=\"{url}\"><i class=\"fa fa-{fontIcon}\"></i> {title}</a></li>"
|
||||
: $"<li><a href=\"{url}\"><i class=\"fa fa-{fontIcon}\"></i> {title}</a></li>";
|
||||
|
||||
return helper.Raw(returnString);
|
||||
}
|
||||
|
||||
public static IHtmlString GetNavbarUrl(this HtmlHelpers helper, NancyContext context, string url, string title, string fontIcon, string extraHtml)
|
||||
{
|
||||
var returnString = string.Empty;
|
||||
var content = GetLinkUrl(GetBaseUrl());
|
||||
if (!string.IsNullOrEmpty(content))
|
||||
{
|
||||
url = $"/{content}{url}";
|
||||
}
|
||||
|
||||
if (context.Request.Path == url)
|
||||
{
|
||||
returnString = $"<li class=\"active\"><a href=\"{url}\"><i class=\"fa fa-{fontIcon}\"></i> {title} {extraHtml}</a></li>";
|
||||
}
|
||||
else
|
||||
{
|
||||
returnString = $"<li><a href=\"{url}\"><i class=\"fa fa-{fontIcon}\"></i> {title} {extraHtml}</a></li>";
|
||||
}
|
||||
var returnString = context.Request.Path == url
|
||||
? $"<li class=\"active\"><a href=\"{url}\"><i class=\"fa fa-{fontIcon}\"></i> {title} {extraHtml}</a></li>"
|
||||
: $"<li><a href=\"{url}\"><i class=\"fa fa-{fontIcon}\"></i> {title} {extraHtml}</a></li>";
|
||||
|
||||
return helper.Raw(returnString);
|
||||
}
|
||||
|
|
|
@ -452,10 +452,10 @@
|
|||
<DependentUpon>pace.css</DependentUpon>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\requests-1.7.js">
|
||||
<Content Include="Content\requests.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\site-1.7.js">
|
||||
<Content Include="Content\site.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="app.config" />
|
||||
|
@ -675,7 +675,7 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\search-1.7.js">
|
||||
<Content Include="Content\search.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue