Kawai Wiki

Rev

Rev 54 | Rev 56 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 54 Rev 55
Line 79... Line 79...
79
                height: 450,
79
                height: 450,
80
                modal: true,
80
                modal: true,
81
                title: 'Pages:',
81
                title: 'Pages:',
82
                buttons: [
82
                buttons: [
83
                          {
83
                          {
84
                                text: "Update",
-
 
-
 
84
                                text: "FrontPage",
-
 
85
                                click: function() { $('#editPageForm').submit(); }
-
 
86
                          },
-
 
87
                          {
-
 
88
                                text: "Delete",
85
                                click: function() { $('#editPageForm').submit(); }
89
                                click: function() { $('#editPageForm').submit(); }
86
                          },
90
                          },
87
                          {
91
                          {
88
                                text: "Close",
92
                                text: "Close",
89
                                click: function() { $(this).dialog("close"); }
93
                                click: function() { $(this).dialog("close"); }
Line 117... Line 121...
117
121
118
            $.getJSON('<mtw:contextPath />/Page.list.mtw', function(data) {
122
            $.getJSON('<mtw:contextPath />/Page.list.mtw', function(data) {
119
123
120
                tableData = '';
124
                tableData = '';
121
                tableData += '<tr>';
125
                tableData += '<tr>';
-
 
126
                tableData += '<th>&nbsp;</th>';
122
                tableData += '<th>Name</th>';
127
                tableData += '<th>Name</th>';
123
                tableData += '<th>Language</th>';
128
                tableData += '<th>Language</th>';
124
                tableData += '<th>Front Page</th>';
-
 
125
                tableData += '<th>System Page</th>';
-
 
126
                tableData += '<th>Created By</th>';
129
                tableData += '<th>Created By</th>';
127
                tableData += '<th>Modified By</th>';
130
                tableData += '<th>Modified By</th>';
128
                tableData += '<th>&nbsp;</th>';
131
                tableData += '<th>&nbsp;</th>';
129
                tableData += '</tr>';
132
                tableData += '</tr>';
130
133
131
                $.each(data.pages, function(i,page) {
134
                $.each(data.pages, function(i,page) {
-
 
135
                
-
 
136
                	pageName = page.name;
132
137
133
                    modifiedBy = '';
138
                    modifiedBy = '';
134
                    if (page.modifiedById > 0) {
139
                    if (page.modifiedById > 0) {
135
                        modifiedBy = page.modifiedBy.username;
140
                        modifiedBy = page.modifiedBy.username;
136
                    }
141
                    }
137
142
138
                    systemPage = '';
-
 
139
                    if (page.systemPage == true) {
143
                    if (page.systemPage == true) {
140
                        systemPage = 'X';
-
 
-
 
144
                        pageName = '*' + pageName;
141
                    }
145
                    }
142
146
143
                    frontPage = '';
-
 
144
                    if (page.frontPage == true) {
147
                    if (page.frontPage == true) {
145
                        frontPage = 'X';
-
 
-
 
148
                        pageName = '[' + pageName + ']';
146
                    }
149
                    }
147
                    
150
                    
148
                    modifiedOnTitle = '';
151
                    modifiedOnTitle = '';
149
                    if (page.formattedModifiedOn != null) {
152
                    if (page.formattedModifiedOn != null) {
150
                    	modifiedOnTitle = ' title="' + page.formattedModifiedOn + '"';
153
                    	modifiedOnTitle = ' title="' + page.formattedModifiedOn + '"';
Line 153... Line 156...
153
                    createdOnTitle = '';
156
                    createdOnTitle = '';
154
                    if (page.formattedCreatedOn != null) {
157
                    if (page.formattedCreatedOn != null) {
155
                    	createdOnTitle = ' title="' + page.formattedCreatedOn + '"';
158
                    	createdOnTitle = ' title="' + page.formattedCreatedOn + '"';
156
                    }
159
                    }
157
                    
160
                    
-
 
161
                    radioCell = '&nbsp;';
158
                    viewCell = '&nbsp;';
162
                    viewCell = '&nbsp;';
159
                    if (page.CSS == false) {
-
 
160
                    	viewCell = '<a href="<mtw:contextPath/>/Page.mtw?name=' + page.name + '&lang=' + page.lang + '">View</a>';
-
 
-
 
163
                    if (page.CSS == false && page.systemPage == false) {
-
 
164
                    	viewCell = '<a href="<mtw:contextPath/>/Page.mtw?name=' + page.name + '&lang=' + page.lang + '"><img src="<mtw:contextPath/>/images/view.png" /></a>';
-
 
165
                    	if (page.frontPage == false) {
-
 
166
                    		radioCell = '<input type="radio" name="pageId" id="pageId" value="' + page.id + '" />';
-
 
167
                    	}
161
                    }
168
                    }
162
                    
169
                    
163
                    nameTitle = '';
170
                    nameTitle = '';
164
                    if (page.title != null && page.title != '') {
171
                    if (page.title != null && page.title != '') {
165
                    	nameTitle = ' title="' + page.title + '"';
172
                    	nameTitle = ' title="' + page.title + '"';
166
                    }
173
                    }
167
174
168
                    tableData += '<tr>';
175
                    tableData += '<tr>';
169
                    tableData += '<td' + nameTitle + '>' + page.name + '</td>';
-
 
-
 
176
                    tableData += '<td>' + radioCell + '</td>';
-
 
177
                    tableData += '<td' + nameTitle + '>' + pageName + '</td>';
170
                    tableData += '<td align="center">' + page.language + '</td>';
178
                    tableData += '<td align="center">' + page.language + '</td>';
171
                    tableData += '<td align="center">' + frontPage + '</td>';
-
 
172
                    tableData += '<td align="center">' + systemPage + '</td>';
-
 
173
                    tableData += '<td align="center"' + createdOnTitle + '>' + page.createdBy.username + '</td>';
179
                    tableData += '<td align="center"' + createdOnTitle + '>' + page.createdBy.username + '</td>';
174
                    tableData += '<td align="center"' + modifiedOnTitle + '>' + modifiedBy + '</td>';
180
                    tableData += '<td align="center"' + modifiedOnTitle + '>' + modifiedBy + '</td>';
175
                    tableData += '<td align="center">' + viewCell + '</td>';
181
                    tableData += '<td align="center">' + viewCell + '</td>';
176
                    tableData += '</tr>';
182
                    tableData += '</tr>';
177
                });
183
                });