Skip to content

Commit 84e981f

Browse files
authored
Merge pull request #1553 from MitrahSoft/LD-175
For LD-175, added a fix for the changelog reference link
2 parents 017c9ff + 1d85743 commit 84e981f

File tree

1 file changed

+50
-33
lines changed

1 file changed

+50
-33
lines changed

builders/html/templates/changelog.cfm

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,41 @@
1212
q = QueryNew("type,ref,name,introduced,sort,description");
1313
1414
function addChangeLog(q, page, ref, name, introduced, description){
15-
// systemOutput( "addChangeLog: ref=[#arguments.ref#], name=[#arguments.name#], introduced=[#arguments.introduced#]", true ); // Debug logging
16-
var r = queryAddRow(q);
17-
querySetCell(q,"type", arguments.page.getPageType());
18-
querySetCell(q,"ref", arguments.ref);
19-
querySetCell(q,"name", arguments.name);
20-
querySetCell(q,"introduced", arguments.introduced);
15+
// systemOutput( "addChangeLog: ref=[#arguments.ref#], name=[#arguments.name#], introduced=[#arguments.introduced#]", true ); // Debug logging
16+
var r = queryAddRow(q);
17+
querySetCell(q,"type", arguments.page.getPageType());
18+
19+
// Format reference based on page type
20+
var formattedRef = arguments.ref;
21+
if (arguments.page.getPageType() == "function") {
22+
if (arguments.ref contains "function-") {
23+
formattedRef = replaceNocase(arguments.ref, "function-", "functions/");
24+
} else {
25+
formattedRef = "functions/" & arguments.ref;
26+
}
27+
} else if (arguments.page.getPageType() == "tag") {
28+
if (arguments.ref contains "tag-") {
29+
formattedRef = replaceNocase(arguments.ref, "tag-", "tags/");
30+
} else {
31+
formattedRef = "tags/" & arguments.ref;
32+
}
33+
}
34+
35+
querySetCell(q,"ref", formattedRef);
36+
querySetCell(q,"name", arguments.name);
37+
querySetCell(q,"introduced", arguments.introduced);
2138
22-
var sort=[];
23-
var intro = [];
24-
loop list="#arguments.introduced#" delimiters="." item="local.v" {
25-
if (v eq "000") v = 0;
26-
arrayAppend(sort, numberFormat(v, "0000"));
27-
arrayAppend(intro, v);
28-
}
29-
querySetCell(q,"introduced", intro.toList("."));
30-
querySetCell(q,"sort", sort.toList(""));
31-
querySetCell(q,"description", arguments.description);
32-
}
39+
var sort=[];
40+
var intro = [];
41+
loop list="#arguments.introduced#" delimiters="." item="local.v" {
42+
if (v eq "000") v = 0;
43+
arrayAppend(sort, numberFormat(v, "0000"));
44+
arrayAppend(intro, v);
45+
}
46+
querySetCell(q,"introduced", intro.toList("."));
47+
querySetCell(q,"sort", sort.toList(""));
48+
querySetCell(q,"description", arguments.description);
49+
}
3350
</cfscript>
3451

3552
<cfloop collection="#pc#" key="key" value="value">
@@ -93,21 +110,21 @@
93110

94111
<ul>
95112
<cfoutput query=q group="introduced">
96-
<li>
97-
#q.introduced#
98-
<ul>
99-
<cfoutput>
100-
<li>
101-
<a href="#q.ref#.html">
102-
<cfif len(q.description)>
103-
#q.description#
104-
<cfelse>
105-
#htmlEditFormat(q.name)#
106-
</cfif>
107-
</a>
108-
</li>
109-
</cfoutput>
110-
</ul>
111-
</li>
113+
<li>
114+
#q.introduced#
115+
<ul>
116+
<cfoutput>
117+
<li>
118+
<a href="reference/#q.ref#.html">
119+
<cfif len(q.description)>
120+
#q.description#
121+
<cfelse>
122+
#htmlEditFormat(q.name)#
123+
</cfif>
124+
</a>
125+
</li>
126+
</cfoutput>
127+
</ul>
128+
</li>
112129
</cfoutput>
113130
</ul>

0 commit comments

Comments
 (0)