forked from joedanz/cf-project-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvnLog.cfm
117 lines (97 loc) · 4.03 KB
/
svnLog.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<cfsetting enablecfoutputonly="true">
<cfprocessingdirective pageencoding="utf-8">
<cfif not StructKeyExists(url,'p')>
<cfoutput><h2>No Project Selected!</h2></cfoutput><cfabort>
</cfif>
<cfif session.user.admin>
<cfset project = application.project.get(projectID=url.p)>
<cfelse>
<cfset project = application.project.get(session.user.userid,url.p)>
</cfif>
<cfif not session.user.admin and not project.svn eq 1>
<cfoutput><h2>You do not have permission to access the repository!!!</h2></cfoutput>
<cfabort>
</cfif>
<cfparam name="url.act" default="browse">
<cfparam name="numRevisions" default="20">
<cfparam name="url.wd" default="">
<cfset numDirs = 0>
<cfset numFiles = 0>
<cfset totalFileSize = 0>
<cfset project = application.project.get(session.user.userid,url.p)>
<!--- Loads header/footer --->
<cfmodule template="#application.settings.mapping#/tags/layout.cfm" templatename="main" title="#application.settings.app_title# » #project.name#" project="#project.name#" projectid="#url.p#" svnurl="#project.svnurl#">
<cfoutput>
<div id="container">
<cfif project.recordCount>
<!--- left column --->
<div class="left full">
<div class="main">
<div class="header">
<span class="rightmenu">
<a href="svnBrowse.cfm?p=#url.p#">Browse Repository</a> |
<span class="b g">Last #numrevisions# Revisions</span>
</span>
<h2 class="svn">Subversion Source Browsing</h2>
</div>
<div class="content">
<div class="wrapper">
<!--- show last N revisions --->
<cftry>
<cfset svn = createObject("component", "cfcs.SVNBrowser").init(project.svnurl,project.svnuser,project.svnpass)>
<cfset log = svn.getLog(numEntries=numRevisions)>
<table class="svn full">
<caption>#project.name# - Last 20 Revisions</caption>
<thead>
<tr>
<th>Rev</th>
<th>Message</th>
<th>Timestamp</th>
<th>Author</th>
<th class="tac">Changed</th>
</tr>
</thead>
<tbody>
<cfloop query="log">
<tr class="<cfif currentRow mod 2 eq 1>odd<cfelse>even</cfif>"<!---<cfif StructKeyExists(url,"r") and url.r is revision> style="background-color:##ffc;"</cfif>--->>
<td>#revision#</td>
<td><div id="r#revision#view"> #message#</div></td>
<!---<cfset dt = request.udf.DateConvertISO8601(logEntries[i].date,-getTimeZoneInfo().utcHourOffset)>--->
<td>#LSDateFormat(date,"ddd mmm d 'yy")# @ <cfif application.settings.clockHours eq 12>#LSTimeFormat(date,"h:mmtt")#<cfelse>#LSTimeFormat(date,"HH:mm")#</cfif></td>
<td>#author#</td>
<td class="tac"><a href="##" onclick="$('##files#currentRow#').toggle();return false;" class="nounder">#StructCount(path)# files</a></td>
</tr>
<tr class="files" style="display:none;" id="files#currentRow#"><td colspan="5" style="padding-left:50px;background-color:##ffc;">
<cfset thisRow = 1>
<cfloop collection="#path#" item="resource">
<cfset filebreaker = request.udf.RFind('/',resource)>
#thisRow#: <cfif filebreaker gt 1 and find('.',resource)><a href="svnResource.cfm?p=#url.p#&wd=#URLEncodedFormat(left(resource,filebreaker-1))#&f=#right(resource,len(resource)-filebreaker)#" class="nounder">#resource#</a><cfelse>#resource#</cfif><br />
<cfset thisRow = thisRow + 1>
</cfloop>
</td></tr>
</cfloop>
</tbody>
</table>
<cfcatch>
<div class="alert">There was a problem accessing the Subversion repository at #project.svnurl#</div>
<div class="fs80 g" style="margin-left:20px;">If your repository requires authentication, please ensure that your username and password are correct.</div>
</cfcatch>
</cftry>
</div>
</div>
</div>
<div class="bottom"> </div>
<div class="footer">
<cfinclude template="footer.cfm">
</div>
</div>
<!--- right column --->
<div class="right">
</div>
<cfelse>
<div class="alert">Project Not Found.</div>
</cfif>
</div>
</cfoutput>
</cfmodule>
<cfsetting enablecfoutputonly="false">