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

# · ASP.NET · 58 lines · 50 code · 8 blank · 0 comment · 2 complexity · c1cd82de93b052a5a1285b4e427915e1 MD5 · raw file

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