PageRenderTime 42ms CodeModel.GetById 37ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/trunk/Kona.Web/Views/Themes/Admin/EditPlugin.aspx

#
ASP.NET | 58 lines | 50 code | 8 blank | 0 comment | 2 complexity | c1cd82de93b052a5a1285b4e427915e1 MD5 | raw file
Possible License(s): BSD-3-Clause
 1<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Themes/Admin/Theme.Master" Inherits="System.Web.Mvc.ViewPage" %>
 2
 3<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
 4<title><%=this.SiteData().SiteName %>: Edit <%=this.SelectedPlugin().PluginName %></title>
 5    <link rel="Stylesheet" type="text/css" href="/scripts/jquery-ui.css" />
 6</asp:Content>
 7
 8
 9<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
10    <script type="text/javascript" src="/scripts/jquery-1.2.6.js"></script>
11    <script type="text/javascript" src="/scripts/jquery-ui.js"></script>
12    <script type="text/javascript" src="/scripts/edit_area/edit_area_full.js"></script>
13    <%var plug = this.SelectedPlugin();
14      string excludeProps = "Settings,Code,FilePath,PluginName";
15      string extension = System.IO.Path.GetExtension(plug.FilePath);
16    %>
17
18    <script type="text/javascript">
19        $(document).ready(function() {
20            $(".datetime").datepicker();
21            editAreaLoader.init({
22                id: "code",
23                start_highlight: true,
24                syntax: "<%= (new Dictionary<string, string>() {
25                    // Ouch, but this will do for now...
26                    {".cs", "c"},
27                    {".js", "js"},
28                    {".vb", "vb"},
29                    {".rb", "ruby"},
30                    {".py", "python"}
31                })[extension] %>"
32            });
33        });
34    </script>
35 
36 
37    <h2><a href="<%=Url.Action("Index")%>">Plugins</a> >>> Edit Plugin: <%=this.SelectedPlugin().PluginName %></h2>
38      <%using (Html.BeginForm()) {
39        System.Reflection.PropertyInfo[] props = plug.GetType().GetProperties();
40        if(props.Length>0){%>
41      
42       <h3>Properties</h3>
43       <table>
44       <%foreach (var prop in props.Where(x => !excludeProps.Contains(x.Name))) {%>
45        <tr>
46            <td><%=prop.Name %></td>
47            <td><%=Html.ForProperty(prop,plug.GetSetting(prop.Name))%></td>
48        </tr>
49        <%}%>
50    <%}%> 
51    </table>
52    <h3>Code</h3>
53        <input type=hidden name="id" value="<%=plug.PluginName%>" />
54        <textarea style="width:100%" name="code" id="code"><%=plug.Code%></textarea><br />
55        <input type=submit value="Save" />
56    <%} %>
57</asp:Content>
58