PageRenderTime 17ms CodeModel.GetById 9ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/admin/Extensions/Themes.cshtml

#
Razor | 96 lines | 87 code | 9 blank | 0 comment | 10 complexity | 2f45047b807a3365968e533a056ca4fd MD5 | raw file
 1@using BlogEngine.Core.Packaging
 2
 3@{
 4    Page.Title = Resources.labels.themes;
 5    Layout = "~/admin/_Layout.cshtml";
 6
 7    var loaderSrc = Path.Combine(BlogEngine.Core.Utils.ApplicationRelativeWebRoot, "pics/ajax-loader.gif");
 8
 9    // disallow gallery page in child blogs.
10    var canManageThemes = BlogEngine.Core.Blog.CurrentInstance.IsPrimary;
11    
12    var tab = "1";
13    if(!string.IsNullOrEmpty(Request.QueryString["t"])){
14        tab = Request.QueryString["t"];   
15    }
16    if (tab == "2" && !canManageThemes)
17    {   
18        Response.Redirect("Themes.cshtml");
19        return;
20    }
21
22    var page = 1;
23    if(!string.IsNullOrEmpty(Request.QueryString["p"])){
24        page = int.Parse(Request.QueryString["p"]);
25    }
26}
27
28 <script type="text/javascript">
29     $(document).ready(function () {
30         $('.loader2').hide();
31         $('.page-loader').hide();
32         if (Querystring('t') == '2') {
33             GalleryGetPackages(0, 'Theme');
34         }
35     });
36</script>
37
38<div class="content-box-outer">
39    <div class="content-box-full">
40        
41        <div class="TabRow">
42            <div class="AlternatePagesDivder"></div>
43            <div class="AlternatePageDivTab">
44	            <span class="AlternatePageTab" onclick="location.href='default.cshtml'">Extensions</span>
45            </div>
46            <div class="AlternatePagesDivder"></div>
47            <div class="AlternatePageDivTab">
48	            <span class="AlternatePageTab AlternatePageTabSelected">@Resources.labels.themes</span>
49            </div>
50            <div class="AlternatePagesDivder"></div>
51            <div class="AlternatePageDivTab">
52	            <span class="AlternatePageTab" onclick="location.href='Widgets.cshtml'">Widgets</span>
53            </div>
54            <div class="TabRight">
55                @if (tab == "1"){
56                    @Resources.labels.installed
57                    if (canManageThemes)
58                    {
59                        <span>|</span> <a href="Themes.cshtml?t=2">@Resources.labels.gallery</a>
60                    }
61                }
62                else
63                {
64                    <a href="Themes.cshtml">@Resources.labels.installed</a>
65                     <span>|</span> @Resources.labels.gallery
66                }
67            </div>
68        </div>
69
70        <div>
71            @if (tab == "1")
72            {
73                @Helpers.AdminHelper.InstalledThemes()
74            }
75            else
76            {
77            <div class="gallery-options">
78                <div id="gallery-search">
79                    <input type="text" value="" id="searchGallery" />
80                    <input type="submit" id="btnGalSearch" class="btn primary" onclick="GalleryGetPackages(0, 'Theme'); return false;" value="@Resources.labels.search" />
81                </div>
82                <span>@Resources.labels.orderBy: </span>
83                <select id="gallery-sort-order" onchange="GalleryGetPackages(0, 'Theme')">
84                    <option value="Alphanumeric">@Resources.labels.alphaNumeric</option>
85                    <option value="Downloads">@Resources.labels.downloads</option>
86                    <option value="Newest" selected="selected">@Resources.labels.newest</option>
87                </select>
88                <img class="page-loader" src="@loaderSrc" alt="loader" />
89            </div>
90            <div id="Container"></div>
91            <div id="Pager"></div>
92            }
93        </div>
94        <div class="clear"></div>
95    </div>
96</div>