Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r25 - trunk/src: . Controls skins/TigrisSubview

subview
Discussion topic

Back to topic list

svn commit: r25 - trunk/src: . Controls skins/TigrisSubview

Reply

Author rayj
Full name Ray Johnson
Date 2006-09-11 05:11:18 PDT
Message Author: rayj
Date: 2006-09-11 05:11:18-0700
New Revision: 25

Added:
   trunk/src/Controls/R​evisionSortLink.cs
   trunk/src/skins/Tigr​isSubview/DirectoryV​iew.ascx
   trunk/src/skins/Tigr​isSubview/icon_doc_s​ml.gif (contents, props changed)
   trunk/src/skins/Tigr​isSubview/icon_folde​r_sml.gif (contents, props changed)
Modified:
   trunk/src/Controls/D​irectoryItemImage.cs​
   trunk/src/Controls/R​evisionView.ascx
   trunk/src/Controls/R​evisionView.ascx.cs
   trunk/src/Subview.csproj
   trunk/src/skins/Tigr​isSubview/styles.css​

Log:
A little more template work...


Modified: trunk/src/Controls/D​irectoryItemImage.cs​
Url: http://subview.tigri​s.org/source/browse/​subview/trunk/src/Co​ntrols/DirectoryItem​Image.cs?view=diff​&rev=25&p1=tru​nk/src/Controls/Dire​ctoryItemImage.cs​&p2=trunk/src/Contr​ols/DirectoryItemIma​ge.cs&r1=24&​r2=25
====================​====================​====================​==================
--- trunk/src/Controls/D​irectoryItemImage.cs​ (original)
+++ trunk/src/Controls/D​irectoryItemImage.cs​ 2006-09-11 05:11:18-0700
@@ -7,7 +7,9 @@
 using System.Web.UI.WebControls;
 using System.Web.UI.WebCon​trols.WebParts;
 using System.Web.UI.HtmlControls;
+using System.IO;
 using subview.Subversion;
+using subview.Configuration;
 
 namespace subview.Controls
 {
@@ -16,8 +18,6 @@
     // Also, need to allow for a way to use images that are not 16x16 but something else.
     public class DirectoryItemImage : Image
     {
- bool isDir;
-
         public string ImageDirUrl
         {
             set { dirHref = value; }
@@ -32,8 +32,37 @@
         }
         string fileHref = "/Images/text.gif";
 
+ private string GetImagePath(bool isDir)
+ {
+ Repository repro = Utils.PathHelpers.Ge​tCurrentRepro();
+ string imgPath = null;
+ string skinPath = null;
+ string fileName;
+
+ if (isDir)
+ fileName = dirHref;
+ else
+ fileName = fileHref;
+
+ if (repro.Skin != null)
+ {
+ skinPath = "/skins/" + repro.Skin + "/" + fileName;
+ if (File.Exists(Page.Ma​pPath(skinPath)))
+ imgPath = skinPath;
+ }
+
+ if (imgPath == null)
+ if (isDir)
+ imgPath = "/Images/dir.gif";
+ else
+ imgPath = "/Images/text.gif";
+
+ return imgPath;
+ }
+
         protected override void OnDataBinding(EventArgs e)
         {
+ bool isDir;
             RepeaterItem repeatItem = CtrlUtil.FindParentO​fType<RepeaterIte​m>(this.Parent);
             if (repeatItem != null)
             {
@@ -41,10 +70,7 @@
                 {
                     SvnList listItem = (SvnList)repeatItem.DataItem;
                     isDir = listItem.Path.EndsWith("/") ? true : false;
- if (isDir)
- this.ImageUrl = dirHref;
- else
- this.ImageUrl = fileHref;
+ this.ImageUrl = GetImagePath(isDir);
                 }
                 if (repeatItem.Parent is RevisionRepeater)
                 {
@@ -52,10 +78,7 @@
                     isDir = commitItem.Path.EndsWith("/") ? true : false;
                     if (commitItem.HasDetailedInfo)
                     {
- if (isDir)
- this.ImageUrl = dirHref;
- else
- this.ImageUrl = fileHref;
+ this.ImageUrl = GetImagePath(isDir);
                         this.Visible = true;
                     }
                     else

Added: trunk/src/Controls/R​evisionSortLink.cs
Url: http://subview.tigri​s.org/source/browse/​subview/trunk/src/Co​ntrols/RevisionSortL​ink.cs?view=auto​&rev=25
====================​====================​====================​==================
--- (empty file)
+++ trunk/src/Controls/R​evisionSortLink.cs 2006-09-11 05:11:18-0700
@@ -0,0 +1,82 @@
+using System;
+using System.Data;
+using System.Configuration;
+using System.Web;
+using System.Web.Security;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.Web.UI.WebCon​trols.WebParts;
+using System.Web.UI.HtmlControls;
+
+namespace subview.Controls
+{
+ public enum RevisionSortColumn
+ {
+ path,
+ action,
+ prop,
+ text
+ }
+
+ public class RevisionSortLink : PlaceHolder
+ {
+ string url;
+
+ public RevisionSortColumn Column
+ {
+ get
+ {
+ return column;
+ }
+ set
+ {
+ column = value;
+ }
+ }
+ RevisionSortColumn column = RevisionSortColumn.path;
+
+ protected override void OnPreRender(EventArgs e)
+ {
+ url = HttpContext.Current.​Request.Url.Absolute​Path;
+ string rev = HttpContext.Current.​Request.QueryString[​"rev"];
+ url += "?view=rev&rev=" + rev;
+
+ if (column != RevisionSortColumn.path)
+ url += "&sortby=" + column.ToString();
+
+ string sortByStr = HttpContext.Current.​Request.QueryString[​"sortby"];
+ RevisionSortColumn sortBy = RevisionSortColumn.path;
+ if (sortByStr != null)
+ sortBy = (RevisionSortColumn)​Enum.Parse(typeof(Re​visionSortColumn), sortByStr);
+
+ string sortDir = HttpContext.Current.​Request.QueryString[​"sortdir"];
+ if (sortDir != "up")
+ sortDir = "down";
+
+ if (sortBy == column)
+ {
+ if (sortDir == "down")
+ url += "&sortdir=up";
+ }
+ base.OnPreRender(e);
+ }
+
+ protected override void Render(HtmlTextWriter writer)
+ {
+ if (url != null)
+ {
+ writer.Write("<a href=\"");
+ writer.Write(url);
+ writer.Write("\">");
+ foreach (Control ctrl in this.Controls)
+ ctrl.RenderControl(writer);
+ writer.Write("</a>");
+ }
+ else
+ {
+ foreach (Control ctrl in this.Controls)
+ ctrl.RenderControl(writer);
+ }
+ }
+ }
+}

Modified: trunk/src/Controls/R​evisionView.ascx
Url: http://subview.tigri​s.org/source/browse/​subview/trunk/src/Co​ntrols/RevisionView.​ascx?view=diff&r​ev=25&p1=trunk/s​rc/Controls/Revision​View.ascx&p2=tru​nk/src/Controls/Revi​sionView.ascx&r1​=24&r2=25
====================​====================​====================​==================
--- trunk/src/Controls/R​evisionView.ascx (original)
+++ trunk/src/Controls/R​evisionView.ascx 2006-09-11 05:11:18-0700
@@ -28,16 +28,16 @@
         <table class="table" cellspacing="0" cellpadding="0" border="0">
             <tr>
                 <th id="pathHeader" runat="server">
- <a id="pathHeaderLink" runat="server">Pa​th</a>
+ <Subview:RevisionSortLink ID="pathSortLink" runat="server" Column="path">Pat​h</Subview:Revisi​onSortLink>
                 </th>
                 <th id="actionHeader" runat="server">
- <a id="actionHeaderLink" runat="server">Ac​tion</a>
+ <Subview:RevisionSortLink ID="RevisionSortLink1" runat="server" Column="action">A​ction</Subview:Re​visionSortLink>
                 </th>
                 <th id="textHeader" runat="server">
- <a id="textHeaderLink" runat="server">Text Changes</a>
+ <Subview:RevisionSortLink ID="RevisionSortLink2" runat="server" Column="text">Text Changes</Subview:​RevisionSortLink>​
                 </th>
                 <th id="propHeader" runat="server">
- <a id="propHeaderLink" runat="server">Prop Changes</a>
+ <Subview:RevisionSortLink ID="RevisionSortLink3" runat="server" Column="prop">Prop Changes</Subview:​RevisionSortLink>​
                 </th>
                 <th id="diffHeader" runat="server">
                     <a id="diffHeaderLink" runat="server">Diff with Previous</a>

Modified: trunk/src/Controls/R​evisionView.ascx.cs
Url: http://subview.tigri​s.org/source/browse/​subview/trunk/src/Co​ntrols/RevisionView.​ascx.cs?view=diff​&rev=25&p1=trun​k/src/Controls/Revis​ionView.ascx.cs&​p2=trunk/src/Control​s/RevisionView.ascx.​cs&r1=24&r2=​25
====================​====================​====================​==================
--- trunk/src/Controls/R​evisionView.ascx.cs (original)
+++ trunk/src/Controls/R​evisionView.ascx.cs 2006-09-11 05:11:18-0700
@@ -186,13 +186,13 @@
                     image.ImageUrl = "/Images/Down.gif";
                 cell.Controls.Add(image);
 
- HtmlAnchor link = (HtmlAnchor) e.Item.FindControl("​pathHeaderLink");
- link.HRef = Request.Url.AbsolutePath;
- link.HRef += BuildHeaderQuery("path", true);
+ //HtmlAnchor link = (HtmlAnchor) e.Item.FindControl("​pathHeaderLink");
+ //link.HRef = Request.Url.AbsolutePath;
+ //link.HRef += BuildHeaderQuery("path", true);
                 
- link = (HtmlAnchor) e.Item.FindControl("​actionHeaderLink");
- link.HRef = Request.Url.AbsolutePath;
- link.HRef += BuildHeaderQuery("action", true);
+ //link = (HtmlAnchor) e.Item.FindControl("​actionHeaderLink");
+ //link.HRef = Request.Url.AbsolutePath;
+ //link.HRef += BuildHeaderQuery("action", true);
 
                 if (! hasDetailedInfo)
                 {
@@ -204,13 +204,13 @@
                 }
                 else
                 {
- link = (HtmlAnchor) e.Item.FindControl("​propHeaderLink");
- link.HRef = Request.Url.AbsolutePath;
- link.HRef += BuildHeaderQuery("prop", true);
-
- link = (HtmlAnchor) e.Item.FindControl("​textHeaderLink");
- link.HRef = Request.Url.AbsolutePath;
- link.HRef += BuildHeaderQuery("text", true);
+ //link = (HtmlAnchor) e.Item.FindControl("​propHeaderLink");
+ //link.HRef = Request.Url.AbsolutePath;
+ //link.HRef += BuildHeaderQuery("prop", true);
+
+ //link = (HtmlAnchor) e.Item.FindControl("​textHeaderLink");
+ //link.HRef = Request.Url.AbsolutePath;
+ //link.HRef += BuildHeaderQuery("text", true);
                 }
             }
 

Modified: trunk/src/Subview.csproj
Url: http://subview.tigri​s.org/source/browse/​subview/trunk/src/Su​bview.csproj?view=di​ff&rev=25&p1​=trunk/src/Subview.c​sproj&p2=trunk/s​rc/Subview.csproj​&r1=24&r2=25
====================​====================​====================​==================
--- trunk/src/Subview.csproj (original)
+++ trunk/src/Subview.csproj 2006-09-11 05:11:18-0700
@@ -102,6 +102,7 @@
     <Compile Include="Controls\R​evisionLabel.cs" />
     <Compile Include="Controls\R​evisionLink.cs" />
     <Compile Include="Controls\R​evisionRepeater.cs" />
+ <Compile Include="Controls\R​evisionSortLink.cs" />
     <Compile Include="Controls\R​evisionTBButton.cs" />
     <Compile Include="Controls\R​evisionTextBox.cs" />
     <Compile Include="Controls\SizeLabel.cs" />

Added: trunk/src/skins/Tigr​isSubview/DirectoryV​iew.ascx
Url: http://subview.tigri​s.org/source/browse/​subview/trunk/src/sk​ins/TigrisSubview/Di​rectoryView.ascx?vie​w=auto&rev=25
====================​====================​====================​==================
--- (empty file)
+++ trunk/src/skins/Tigr​isSubview/DirectoryV​iew.ascx 2006-09-11 05:11:18-0700
@@ -0,0 +1,114 @@
+<%@ Import namespace="System.Co​mponentModel"%>
+<%@ Import namespace="AtlasCont​rolToolkit"%>
+<%@ Register Assembly="subview" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %>
+<%@ Register TagPrefix="Subview" NameSpace="subview.Controls" Assembly="subview" %>
+<%@ Control Language="c#" AutoEventWireup="True" Codebehind="~/Contro​ls/DirectoryView.asc​x.cs" Inherits="subview.Co​ntrols.DirectoryView​" TargetSchema="http://schemas.micro​soft.com/intellisens​e/ie5"%>
+<div class="application">
+<table class="axial">
+<tr>
+<th>Current directory</th>
+<td>
+<Subview:SvnPathRepeater ID="pathRepeaterNew" runat="server">
+ <ItemTemplate>
+ <Subview:SvnPathItemLink ID="itemLink" runat="server">​<Subview:SvnPathIte​mLabel ID="itemLabel" runat="server" /></Subview:Sv​nPathItemLink>
+ </ItemTemplate>
+ <SeparatorTemplat​e>/</Separator​Template>
+</Subview:SvnPat​hRepeater>
+</td>
+</tr>
+<tr>
+<th>Directory revision</th>
+<td>
+<Subview:RevisionTextBox ID="revTextBox" runat="server" />
+<Subview:RevisionTbButton ID="revTBButton" RevTextBoxId="revTextBox" CssClass="button" Text="Go" runat="server" />
+</td>
+</tr>
+</table>
+
+<div class="h2" id="browsesource">
+<h2>Browse source code</h2>
+<Subview:SvnDire​ctoryRepeater ID="dirRepeater" runat="server">
+ <HeaderTemplate>
+ <table class="axial">
+ <tr>
+ <th id="fileHeader" runat="server">
+ <Subview:DirectorySortLink ID="fileSortLink" Column="file" runat="server">File <Subview:DirectorySortImage ID="fileSortImg" runat="server" /></Subview:Di​rectorySortLink>
+ </th>
+ <th id="revHeader" runat="server">
+ <Subview:DirectorySortLink ID="DirectorySortLink1" Column="rev" runat="server">Revision <Subview:DirectorySortImage ID="DirectorySortImage1" Column="rev" runat="server" /></Subview:Di​rectorySortLink>
+ </th>
+ <th id="authorHeader" runat="server">
+ <Subview:DirectorySortLink ID="DirectorySortLink2" Column="author" runat="server">Author <Subview:DirectorySortImage ID="DirectorySortImage2" Column="author" runat="server" /></Subview:Di​rectorySortLink>
+ </th>
+ <th id="sizeHeader" runat="server">
+ <Subview:DirectorySortLink ID="DirectorySortLink3" Column="size" runat="server">Size <Subview:DirectorySortImage ID="DirectorySortImage3" Column="size" runat="server" /></Subview:Di​rectorySortLink>
+ </th>
+ <th id="dateHeader" runat="server">
+ <Subview:DirectorySortLink ID="DirectorySortLink4" Column="date" runat="server">Age <Subview:DirectorySortImage ID="DirectorySortImage4" Column="date" runat="server" /></Subview:Di​rectorySortLink>
+ </th>
+ <th id="propertiesHeader" runat="server">
+ Properties
+ </th>
+ </tr>
+ </HeaderTemplate>
+ <AlternatingItemTemplate>
+ <tr class="a">
+ <td>
+ <div class="leafnode">
+ <Subview:DirectoryItemLink ID="itemLink" runat="server">
+ <Subview:DirectoryItemImage ID="DirectoryItemImage1" runat="server" Height="16" Width="16" ImageDirUrl="icon_fo​lder_sml.gif" ImageFileUrl="icon_doc_sml.gif" />&nbsp;
+ <Subview:DirectoryItemLabel ID="itemLabel" runat="server" />
+ </Subview:Directo​ryItemLink>
+ </div>
+ </td>
+ <td class="num">
+ <Subview:RevisionLink ID="revisionLink" runat="server">​<Subview:RevisionLa​bel ID="revLabel" runat="server" /></Subview:Re​visionLink>
+ </td>
+ <td>
+ <Subview:AuthorLabel ID="author" runat="server" />
+ </td>
+ <td>
+ <Subview:SizeLabel ID="size" runat="server" />
+ </td>
+ <td>
+ <Subview:DateLabel ID="age" runat="server" Format="age" /></td>
+ <td>
+ <Subview:PropertyViewLink ID="propView" runat="server">Pr​operties</Subview​:PropertyViewLink​>
+ </tr>
+ </AlternatingItem​Template>
+ <ItemTemplate>
+ <tr class="b">
+ <td>
+ <div class="leafnode">
+ <Subview:DirectoryItemLink ID="itemLink" runat="server">
+ <Subview:DirectoryItemImage ID="DirectoryItemImage1" runat="server" Height="16" Width="16" ImageDirUrl="icon_fo​lder_sml.gif" ImageFileUrl="icon_doc_sml.gif" />&nbsp;
+ <Subview:DirectoryItemLabel ID="itemLabel" runat="server" />
+ </Subview:Directo​ryItemLink>
+ </div>
+ </td>
+ <td class="num">
+ <Subview:RevisionLink ID="revisionLink" runat="server">​<Subview:RevisionLa​bel ID="revLabel" runat="server" /></Subview:Re​visionLink>
+ </td>
+ <td>
+ <Subview:AuthorLabel ID="author" runat="server" />
+ </td>
+ <td>
+ <Subview:SizeLabel ID="size" runat="server" />
+ </td>
+ <td>
+ <Subview:DateLabel ID="age" runat="server" Format="age" /></td>
+ <td>
+ <Subview:PropertyViewLink ID="propView" runat="server">Pr​operties</Subview​:PropertyViewLink​>
+ </tr>
+ </ItemTemplate>
+ <FooterTemplate>
+ </table>
+ </FooterTemplate>
+</Subview:SvnDir​ectoryRepeater>
+</div>
+</div>
+<br />
+<atlas:ScriptManager id="ScriptManager1" runat="Server">​</atlas:ScriptManag​er>
+<div class="subHeadline"​>Properties for this Directory</div>
+<asp:Label ID="propertiesLabel" runat="server" Text="&nbsp;​&nbsp;&nbsp;​&nbsp;&nbsp;​&nbsp;Looking for properties...">​</asp:Label>
+<asp:PlaceHolder ID="dynamicPropHolder" runat="server" />

Added: trunk/src/skins/Tigr​isSubview/icon_doc_s​ml.gif
Url: http://subview.tigri​s.org/source/browse/​subview/trunk/src/sk​ins/TigrisSubview/ic​on_doc_sml.gif?view=​auto&rev=25
====================​====================​====================​==================
Binary file. No diff available.

Added: trunk/src/skins/Tigr​isSubview/icon_folde​r_sml.gif
Url: http://subview.tigri​s.org/source/browse/​subview/trunk/src/sk​ins/TigrisSubview/ic​on_folder_sml.gif?vi​ew=auto&rev=25
====================​====================​====================​==================
Binary file. No diff available.

Modified: trunk/src/skins/Tigr​isSubview/styles.css​
Url: http://subview.tigri​s.org/source/browse/​subview/trunk/src/sk​ins/TigrisSubview/st​yles.css?view=diff​&rev=25&p1=tru​nk/src/skins/TigrisS​ubview/styles.css​&p2=trunk/src/skins​/TigrisSubview/style​s.css&r1=24&​r2=25
====================​====================​====================​==================
--- trunk/src/skins/Tigr​isSubview/styles.css​ (original)
+++ trunk/src/skins/Tigr​isSubview/styles.css​ 2006-09-11 05:11:18-0700
@@ -102,6 +102,11 @@
 }
 
 /* Subview-Tigris look and feel */
+
+.application th, .app th {
+ background-color: #ddc;
+}
+
 .h2 h2 {
     background-color: #663;
 }
@@ -110,6 +115,37 @@
     border-left: 1px solid #663;
 }
 
+.a td, .a, #rightcol div.siteinfo .a {
+ background: #ddd;
+}
+
+.b td, .b, #rightcol div.siteinfo .b {
+ background: #efefef;
+}
+
 .axial th {
     background-color: #ddc;
+}
+
+.filebrowse .leafnode, .filebrowse .leaf {
+ padding-left: 20px;
+}
+
+.filebrowse-alt .expanded, .filebrowse-alt .collapsed, .filebrowse-alt .leaf, .filebrowse-alt .leafnode, .sortup, .sortdown {
+ /* hide from macie5\*/
+ float: left;
+ /* resume */
+ display: inline-block;
+ height: 15px;
+ width: 18px;
+ padding-left: 0 !important;
+}
+
+.filebrowse-alt .leaf, .filebrowse-alt .leafnode, .sortup, .sortdown {
+ width: 20px;
+}
+
+.filebrowse .leafnode, .filebrowse-alt .leafnode {
+ background-image: url(../images/icon_f​older_sml.gif);
+ background-repeat: no-repeat;
 }
\ No newline at end of file

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r25 - trunk/src: . Controls skins/TigrisSubview rayj Ray Johnson 2006-09-11 05:11:18 PDT
Messages per page: