PageRenderTime 20ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/admin/Extensions/Widgets.cshtml

#
Razor | 116 lines | 109 code | 7 blank | 0 comment | 7 complexity | dcf89faa294c284f793894092cc7e6b6 MD5 | raw file
  1@using BlogEngine.Core
  2@using BlogEngine.Core.Packaging
  3
  4@{
  5    Page.Title = Resources.labels.themes;
  6    Layout = "~/admin/_Layout.cshtml";
  7
  8    var loaderSrc = Path.Combine(BlogEngine.Core.Utils.ApplicationRelativeWebRoot, "pics/ajax-loader.gif");
  9    var canManagePackages = BlogEngine.Core.Blog.CurrentInstance.IsPrimary;
 10    var installedPackages = PackageRepository.LocalPackages(Constants.Widget);
 11}
 12
 13 <script type="text/javascript">
 14     $(document).ready(function () {
 15         $('.loader2').hide();
 16     });
 17</script>
 18
 19<div class="content-box-outer">
 20    <div class="content-box-full">
 21        
 22        <div class="TabRow">
 23            <div class="AlternatePagesDivder"></div>
 24            <div class="AlternatePageDivTab">
 25	            <span class="AlternatePageTab" onclick="location.href='default.cshtml'">Extensions</span>
 26            </div>
 27            <div class="AlternatePagesDivder"></div>
 28            <div class="AlternatePageDivTab">
 29	            <span class="AlternatePageTab" onclick="location.href='Themes.cshtml'">@Resources.labels.themes</span>
 30            </div>
 31            <div class="AlternatePagesDivder"></div>
 32            <div class="AlternatePageDivTab">
 33	            <span class="AlternatePageTab AlternatePageTabSelected">Widgets</span>
 34            </div>
 35            <div class="TabRight">
 36                @Resources.labels.installed
 37                @if (canManagePackages)
 38                {
 39                    <span>|</span> <a href="WidgetGallery.cshtml">@Resources.labels.gallery</a>
 40                }
 41            </div>
 42        </div>
 43
 44        <div>
 45            <h2 class="gallery-hdr">Installed Widgets</h2>   
 46            <div class="installed-widgets">
 47                <ul class="gallery">
 48                @foreach (var wdg in installedPackages)
 49                {
 50                    <li id="@wdg.Id">
 51                        <div class="Widget">
 52                            <div class="pkg-hdr"> 
 53                                <div class="pkg-img">
 54                                    <img src="@wdg.IconUrl" class="thumbnail" alt="Widget" />
 55                                </div>
 56                                <div class="prop-hdr">
 57                                    @if (!string.IsNullOrWhiteSpace(wdg.LocalVersion) && wdg.Location == "I")
 58                                    {
 59                                        <a href="@wdg.PackageUrl" target="_new">
 60                                            <h2>@wdg.Id</h2>
 61                                        </a>
 62                                        <p>Version: @wdg.LocalVersion</p>
 63                                    }
 64                                    else
 65                                    {
 66                                        <h2>@wdg.Id</h2>
 67                                    }
 68                                    @if (!string.IsNullOrWhiteSpace(wdg.Authors))
 69                                    {
 70                                        if(wdg.Website != null){
 71                                            <p class="website">@Resources.labels.author: <a target="_new" href="@wdg.Website">@wdg.Authors</a></p> 
 72                                        }
 73                                        else{
 74                                            <p>@Resources.labels.author: @wdg.Authors</p> 
 75                                        }
 76                                    }
 77                                    else
 78                                    {
 79                                    <p>@Resources.labels.author: unknown</p>
 80                                    }
 81                                    @if (Blog.CurrentInstance.IsPrimary && @wdg.Location == "I")
 82                                    {
 83                                        if (Gallery.ConvertVersion(wdg.LocalVersion) < Gallery.ConvertVersion(wdg.OnlineVersion))
 84                                        {
 85                                        <p id="upd-@wdg.Id" class="package-update local">
 86                                            <a href="" onclick="UpdatePackage('@wdg.Id'); return false;">@Resources.labels.update</a>
 87                                            <img class="loader2" src="@loaderSrc" alt="loader" />
 88                                        </p>
 89                                        }
 90                                        <p id="del-@wdg.Id" class="package-delete">
 91                                            <a href="" class="deleteAction" onclick="UninstallPackage('@wdg.Id'); return false;">@Resources.labels.delete</a>
 92                                            <img class="loader2" src="@loaderSrc" alt="loader" />
 93                                        </p>  
 94                                    }
 95                                </div>
 96                            </div>
 97                            <div class="pkg-desc">  
 98                                @if (!string.IsNullOrWhiteSpace(wdg.Description))
 99                                {
100                                <p>@wdg.Description</p>   
101                                }
102                                @if (!string.IsNullOrWhiteSpace(wdg.Tags))
103                                {
104                                <p>Tags: @wdg.Tags</p>   
105                                }
106                            </div>
107                        </div>
108                    </li>
109                }
110                </ul>
111            </div>
112
113        </div>
114        <div class="clear"></div>
115    </div>
116</div>