-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchives_index.cfm
60 lines (55 loc) · 2.14 KB
/
archives_index.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
<cfimport prefix="mango" taglib="../../tags/mango">
<cfimport prefix="mangox" taglib="../../tags/mangoextras">
<cfimport prefix="template" taglib=".">
<cfset monthList = "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec" />
<cfset yearList = ""/>
<cfloop from="#year(now())#" to="2013" step="-1" index="y">
<cfset yearList = listAppend(yearList, y)/>
</cfloop>
<cfset variables.prevYear = "" />
<cfset archivesActive = StructNew() />
<mango:Archives type="month">
<mango:Archive>
<cfsavecontent variable="variables.currYear"><mango:ArchiveProperty title dateformat="yyyy"/></cfsavecontent>
<!--- make sure there's an array to store our active months for the current year --->
<cfif not structKeyExists(archivesActive, variables.currYear)>
<cfset variables.archivesActive[variables.currYear] = arrayNew(1)/>
</cfif>
<cfsavecontent variable="variables.currActiveMonth"><mango:ArchiveProperty title dateformat="MMM"/></cfsavecontent>
<cfset arrayAppend(variables.archivesActive[variables.currYear], variables.currActiveMonth) />
</mango:Archive>
</mango:Archives>
<template:layout title="Entries Index • CounterMarch Blog">
<div class="post">
<h1>By date:</h1>
<table id="archivesList">
<cfoutput>
<cfloop list="#variables.yearList#" index="y">
<tr>
<th>#y#:</th>
<cfloop list="#variables.monthList#" index="m">
<cfif structKeyExists(variables.archivesActive, y) and arrayFindNoCase(variables.archivesActive[y], m)>
<cfset link = dateformat(parseDateTime(m & ' 01 ' & y), "YYYY/MM/")/>
<td><a class="btn btn-danger" href="/archives/date/#variables.link#">#m#</a></td>
<cfelse>
<td><a class="btn btn-default disabled" disabled="disabled">#m#</a></td>
</cfif>
</cfloop>
</tr>
</cfloop>
</cfoutput>
</table>
<br/>
<h1>By Topic, Tag Cloud:</h1>
<mangox:categorycloud />
<br/><br/>
<h1>By Topic, Alphabetical:</h1>
<div id="archiveTopics">
<mango:Categories>
<mango:Category>
<a class="btn btn-danger" href="<mango:CategoryProperty link />"><mango:CategoryProperty title /></a>
</mango:Category>
</mango:Categories>
</div>
</div>
</template:layout>