- Timestamp:
- 10/06/08 14:16:01 (3 months ago)
- Files:
-
- trunk/core/src/net/project/view/components/BlogArchives.java (modified) (7 diffs)
- trunk/core/src/net/project/view/pages/assignments/MyAssignments.java (modified) (1 diff)
- trunk/core/src/net/project/view/pages/blog/AddWebLogEntry.java (modified) (1 diff)
- trunk/core/src/net/project/view/pages/blog/ViewBlog.java (modified) (4 diffs)
- trunk/core/web/css/blog.css (modified) (2 diffs)
- trunk/core/web/html/blog/ViewBlog.html (modified) (4 diffs)
- trunk/core/web/html/resource/management/components/BlogArchives.html (modified) (1 diff)
- trunk/core/web/html/resource/management/components/BlogLayout.html (modified) (2 diffs)
- trunk/core/web/src/blogit.js (modified) (1 diff)
- trunk/core/web/src/components/blogFilter.js (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/core/src/net/project/view/components/BlogArchives.java
r18109 r18180 9 9 import java.util.Date; 10 10 import java.util.List; 11 import java.util.StringTokenizer; 11 12 12 13 import net.project.base.PnWebloggerException; … … 25 26 import org.apache.tapestry.annotations.Inject; 26 27 import org.apache.tapestry.annotations.InjectPage; 28 import org.apache.tapestry.annotations.Persist; 27 29 import org.apache.tapestry.annotations.SetupRender; 28 30 import org.apache.tapestry.ioc.services.PropertyAccess; … … 68 70 private String jSPRootURL; 69 71 70 private List<BlogArchives> archivesList ;72 private List<BlogArchives> archivesListForDaysAndPost; 71 73 72 74 private DateFormat userDateFormat; 73 75 74 76 private String monthFormatPattern; 75 77 78 private String daysTokens = "1,3,7,15,30,90"; 79 80 private String postsTokens = "20,50,100,500"; 81 82 private String commaSeparator = ""; 83 76 84 public BlogArchives() { 77 85 log = Logger.getLogger(BlogArchives.class); … … 118 126 setModuleId(viewBlog.getModuleId()); 119 127 120 if(firstEntryDate != null && lastEntryDate != null){ 121 // generating filter list 122 archivesList = generateArchiveListFilter(firstEntryDate, lastEntryDate, WeblogConstants.DATE_RANGE_FOR_ARCHIVES, 7); 123 } 124 if(archivesList != null && archivesList.size() > 0){ 125 blogArchive = archivesList.get(0); 128 if(firstEntryDate != null && lastEntryDate != null){ 129 Calendar cal1 = Calendar.getInstance(); 130 cal1.setTime(firstEntryDate); 131 cal1.set(Calendar.HOUR, 0); 132 cal1.set(Calendar.MINUTE, 0); 133 cal1.set(Calendar.SECOND, 0); 134 cal1.set(Calendar.MILLISECOND, 0); 135 136 Calendar cal2 = Calendar.getInstance(); 137 cal2.setTime(lastEntryDate); 138 cal2.set(Calendar.HOUR, 0); 139 cal2.set(Calendar.MINUTE, 0); 140 cal2.set(Calendar.SECOND, 0); 141 cal2.set(Calendar.MILLISECOND, 0); 142 cal2.add(Calendar.DATE, 1); 143 archivesListForDaysAndPost = generateArchiveListFilterForDaysAndPosts(firstEntryDate, cal2.getTime()); 144 } 145 if( archivesListForDaysAndPost != null && archivesListForDaysAndPost.size() > 0){ 146 blogArchive = archivesListForDaysAndPost.get(0); 126 147 } else { 127 archivesList = new ArrayList<BlogArchives>();148 archivesListForDaysAndPost = new ArrayList<BlogArchives>(); 128 149 blogArchive = new BlogArchives(); 129 150 blogArchive.setLinkDisplayName("No Blogs"); 130 151 blogArchive.setLinkHrefValue("0"); 131 archivesList.add(blogArchive); 132 } 133 archiveBeans = new GenericSelectModel<BlogArchives>(archivesList, BlogArchives.class, "linkDisplayName", "linkHrefValue", access); 152 archivesListForDaysAndPost.add(blogArchive); 153 } 134 154 } 135 155 … … 137 157 * @param firstEntryDate 138 158 * @param lastEntryDate 139 * @param dateRange140 * @param filterOptions141 159 * @return 142 160 */ 143 private List<BlogArchives> generateArchiveListFilter (Date firstEntryDate, Date lastEntryDate, Integer dateRange, int filterOptions){161 private List<BlogArchives> generateArchiveListFilterForDaysAndPosts(Date firstEntryDate, Date lastEntryDate){ 144 162 List<BlogArchives> filterList = new ArrayList<BlogArchives>(); 145 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy"); 146 BlogArchives linkProperty = null; 147 Calendar cal1 = Calendar.getInstance(); 148 cal1.set(Calendar.HOUR, 0); 149 cal1.set(Calendar.MINUTE, 0); 150 cal1.set(Calendar.SECOND, 0); 151 cal1.set(Calendar.MILLISECOND, 0); 152 cal1.add(Calendar.DATE, 1); 163 List<BlogArchives> filterListOfPosts = new ArrayList<BlogArchives>(); 164 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); 165 StringTokenizer token = new StringTokenizer(daysTokens,","); 166 Integer days = null; 167 while(token.hasMoreTokens()){ 168 days = Integer.valueOf(token.nextToken()); 169 Calendar cal1 = Calendar.getInstance(); 170 cal1.set(Calendar.HOUR, 0); 171 cal1.set(Calendar.MINUTE, 0); 172 cal1.set(Calendar.SECOND, 0); 173 cal1.set(Calendar.MILLISECOND, 0); 174 cal1.add(Calendar.DATE, -days); 175 if(isBlogEntriesExistBetween(cal1.getTime(),lastEntryDate)){ 176 if(filterList.size() == 0){ 177 filterList.add(addLinkProperty("all",simpleDateFormat.format(firstEntryDate)+"-"+simpleDateFormat.format(lastEntryDate),true)); 178 filterList.add(addLinkProperty(" last ","",false)); 179 } 180 filterList.add(addLinkProperty(days+"",simpleDateFormat.format(cal1.getTime())+"-"+simpleDateFormat.format(lastEntryDate),true)); 181 } 182 } 183 if(filterList != null && filterList.size() > 0){ 184 filterList.add(addLinkProperty(" days, ","0",false)); 185 } 153 186 154 Calendar cal2 = Calendar.getInstance(); 155 cal2.set(Calendar.HOUR, 0); 156 cal2.set(Calendar.MINUTE, 0); 157 cal2.set(Calendar.SECOND, 0); 158 cal2.set(Calendar.MILLISECOND, 0); 159 cal2.set(Calendar.DAY_OF_MONTH, cal1.getActualMinimum(Calendar.DAY_OF_MONTH)); 187 StringTokenizer postsToken = new StringTokenizer(postsTokens,","); 188 int prevPost = 0; 189 int curPost = 0; 190 while(postsToken.hasMoreTokens()){ 191 curPost = Integer.parseInt(postsToken.nextToken()); 192 if (userWeblogEntries != null && userWeblogEntries.size() >= prevPost){ 193 filterListOfPosts.add(addLinkProperty(curPost+"",""+curPost,true)); 194 } 195 prevPost = curPost; 196 } 197 if(filterListOfPosts != null && filterListOfPosts.size() > 0){ 198 filterListOfPosts.add(addLinkProperty(" posts","0",false)); 199 } 200 filterList.addAll(filterListOfPosts); 201 return filterList; 202 } 203 204 public BlogArchives addLinkProperty(String name,String link,boolean isLink){ 205 BlogArchives linkProperty = new BlogArchives(); 206 linkProperty.setLinkDisplayName(name); 207 linkProperty.setLinkHrefValue(link); 208 linkProperty.setIsArchivesLinks(isLink); 209 if(isLink == true && (!name.equals(daysTokens.split(",")[daysTokens.split(",").length-1]) 210 && !name.equals(postsTokens.split(",")[postsTokens.split(",").length-1]))) { 211 linkProperty.setCommaSeparator(", "); 212 } 213 return linkProperty; 214 } 160 215 161 int daysInMonth = 0;162 while(cal2.before(cal1)){163 daysInMonth ++;164 cal2.add(Calendar.DATE, 1);165 }166 if(daysInMonth < dateRange && filterOptions > 1){167 cal2.add(Calendar.DATE, -dateRange);168 if(isBlogEntriesExistBetween(cal2.getTime(), cal1.getTime())){169 Calendar lastDate = Calendar.getInstance();170 lastDate.setTime(cal2.getTime());171 Calendar now = Calendar.getInstance();172 now.setTime(cal1.getTime());173 now.add(Calendar.DATE, -1);174 if( filterList.size() == 0){175 linkProperty = new BlogArchives();176 linkProperty.setLinkDisplayName("Last 7 days");177 linkProperty.setLinkHrefValue(simpleDateFormat.format(cal2.getTime())+"/"+simpleDateFormat.format(cal1.getTime()));178 } else {179 linkProperty = getLinkProperty(cal2.getTime(), cal1.getTime());180 }181 filterList.add(linkProperty);182 filterOptions --;183 cal1.setTime(cal2.getTime());184 }185 186 }else {187 while(daysInMonth >= dateRange && filterOptions > 1){188 cal2.add(Calendar.DATE, -dateRange);189 if(isBlogEntriesExistBetween(cal2.getTime(), cal1.getTime())){190 Calendar lastDate = Calendar.getInstance();191 lastDate.setTime(cal2.getTime());192 Calendar now = Calendar.getInstance();193 now.setTime(cal1.getTime());194 now.add(Calendar.DATE, -1);195 if(lastDate.get(Calendar.DATE) - now.get(Calendar.DATE) <= dateRange && filterList.size() == 0){196 linkProperty = new BlogArchives();197 linkProperty.setLinkDisplayName("Last 7 days");198 linkProperty.setLinkHrefValue(simpleDateFormat.format(cal2.getTime())+"/"+simpleDateFormat.format(cal1.getTime()));199 } else {200 linkProperty = getLinkProperty(cal2.getTime(), cal1.getTime());201 }202 filterList.add(linkProperty);203 filterOptions --;204 cal1.setTime(cal2.getTime());205 }206 daysInMonth -= dateRange;207 }208 }209 210 SimpleDateFormat monthFormat = new SimpleDateFormat("MMMMM");211 if(filterOptions > 0 && firstEntryDate.before(cal2.getTime())){212 cal1.setTime(firstEntryDate);213 cal2.add(Calendar.MONTH, -1);214 cal2.set(Calendar.DAY_OF_MONTH, cal2.getActualMaximum(Calendar.DAY_OF_MONTH));215 Calendar calTemp1 = Calendar.getInstance();216 Calendar calTemp2 = Calendar.getInstance();217 while(filterOptions > 0 && cal1.before(cal2)){218 calTemp1.setTime(cal2.getTime());219 calTemp2.setTime(cal2.getTime());220 calTemp1.set(Calendar.DAY_OF_MONTH, cal2.getActualMinimum(Calendar.DAY_OF_MONTH));221 //calTemp2.set(Calendar.DAY_OF_MONTH, cal2.getActualMaximum(Calendar.DAY_OF_MONTH));222 if(isBlogEntriesExistBetween(calTemp1.getTime(), calTemp2.getTime())){223 linkProperty = new BlogArchives(); //= getLinkProperty(calTemp1.getTime(), calTemp2.getTime());224 linkProperty.setLinkDisplayName(monthFormat.format(calTemp1.getTime()));225 linkProperty.setLinkHrefValue(simpleDateFormat.format(calTemp1.getTime())+"/"+simpleDateFormat.format(calTemp2.getTime()));226 filterList.add(linkProperty);227 filterOptions --;228 }229 cal2.add(Calendar.MONTH, -1);230 }231 if(filterOptions == 0 && cal1.before(lastEntryDate)){232 if(isBlogEntriesExistBetween(cal1.getTime(), lastEntryDate)){233 linkProperty = new BlogArchives();234 linkProperty.setLinkDisplayName("<b>more</b>");235 linkProperty.setLinkHrefValue("more");236 }237 }238 }239 // if one or more filter options generated then only show the filter240 if(filterList != null && filterList.size() > 0){241 setIsArchivesLinks(true);242 }243 return filterList;244 }245 246 216 /** 247 217 * Method for getting dropdown list values for archives filter … … 251 221 public GenericSelectModel<BlogArchives> getArchivesModel() { 252 222 return archiveBeans; 253 }254 255 private void getArchivesLink(Date firstEntryDate, Date lastEntryDate, int dateInterval, int viewNLink) {256 archivesLink = new ArrayList<BlogArchives>();257 BlogArchives linkProperty = null;258 if (firstEntryDate != null && lastEntryDate != null) {259 // setting year260 Calendar cal = Calendar.getInstance();261 cal.setTime(firstEntryDate);262 263 cal.set(Calendar.HOUR, 0);264 cal.set(Calendar.MINUTE, 0);265 cal.set(Calendar.SECOND, 0);266 cal.set(Calendar.MILLISECOND, 0);267 firstEntryDate = cal.getTime();268 269 int firstEntryYear = cal.get(Calendar.YEAR);270 271 cal.setTime(lastEntryDate);272 cal.set(Calendar.HOUR, 0);273 cal.set(Calendar.MINUTE, 0);274 cal.set(Calendar.SECOND, 0);275 cal.set(Calendar.MILLISECOND, 0);276 lastEntryDate = cal.getTime();277 278 if (firstEntryYear == cal.get(Calendar.YEAR)) {279 setArchivesYear("" + firstEntryYear);280 } else {281 setArchivesYear("" + firstEntryYear + " - " + ("" + cal.get(Calendar.YEAR)).substring(2, 4));282 }283 cal.add(Calendar.DATE, -(dateInterval));284 if(!firstEntryDate.equals(lastEntryDate)){285 lastEntryDate = cal.getTime();286 } else {287 firstEntryDate = cal.getTime();288 Calendar calTmp = Calendar.getInstance();289 calTmp.setTime(lastEntryDate);290 calTmp.add(Calendar.DATE, 1);291 lastEntryDate = calTmp.getTime();292 }293 if (!lastEntryDate.before(firstEntryDate) && !firstEntryDate.equals(lastEntryDate)) {294 int nLink = 0;295 while (firstEntryDate.before(lastEntryDate)) {296 cal.setTime(firstEntryDate);297 cal.add(Calendar.DATE, dateInterval);298 if (nLink < viewNLink) {299 if (lastEntryDate.before(cal.getTime())) {300 if(isBlogEntriesExistBetween(firstEntryDate, lastEntryDate))301 linkProperty = getLinkProperty(firstEntryDate, lastEntryDate);302 } else {303 if(isBlogEntriesExistBetween(firstEntryDate, cal.getTime()))304 linkProperty = getLinkProperty(firstEntryDate, cal.getTime());305 }306 } else {307 setIsMore(true);308 break;309 }310 firstEntryDate = cal.getTime();311 if(linkProperty != null){312 archivesLink.add(linkProperty);313 nLink++;314 linkProperty = null;315 }316 }317 }318 // if one or more archives links generated then only show the archives319 if(archivesLink != null && archivesLink.size() > 0){320 setIsArchivesLinks(true);321 }322 }323 }324 325 private BlogArchives getLinkProperty(Date startDate, Date endDate) {326 blogArchive = new BlogArchives();327 328 Calendar calStart = Calendar.getInstance();329 Calendar calEnd = Calendar.getInstance();330 calStart.setTime(startDate);331 calEnd.setTime(endDate);332 calEnd.set(Calendar.HOUR, 0);333 calEnd.set(Calendar.MINUTE, 0);334 calEnd.set(Calendar.SECOND, 0);335 calEnd.set(Calendar.MILLISECOND, 0);336 337 /*if(calStart.getTime().compareTo(calEnd.getTime()) < 0) {338 calEnd.add(Calendar.DATE, -1);339 }*/340 341 if (calStart.get(Calendar.MONTH) == calEnd.get(Calendar.MONTH)) {342 blogArchive.setLinkDisplayName(userDateFormat.formatDate(startDate, monthFormatPattern) + " " + calStart.get(Calendar.DATE) + " - "343 + calEnd.get(Calendar.DATE));344 } else {345 blogArchive.setLinkDisplayName(userDateFormat.formatDate(endDate, monthFormatPattern) + " " + calStart.get(Calendar.DATE) + " - "346 + userDateFormat.formatDate(endDate, monthFormatPattern) + " " + calEnd.get(Calendar.DATE));347 }348 349 //String dateFormatPattern = "dd-MM-yyyy";350 SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");351 blogArchive.setLinkHrefValue(dateFormat.format(startDate) + "/" + dateFormat.format(endDate));352 //blogArchive.setLinkHrefValue( SessionManager.getJSPRootURL() + "/blog/view/"353 //userDateFormat.formatDate(startDate, dateFormatPattern) + "/" + userDateFormat.formatDate(endDate, dateFormatPattern)); // + "/"354 //+ viewBlog.getUserId() + "?module=" + viewBlog.getModuleId());355 356 return blogArchive;357 223 } 358 224 … … 542 408 this.userWeblogEntries = userWeblogEntries; 543 409 } 544 545 410 /** 546 411 * @return the moduleId 547 412 */ 413 414 public List<BlogArchives> getArchivesListForDaysAndPost() { 415 return archivesListForDaysAndPost; 416 } 417 418 public void setArchivesListForDaysAndPost( 419 List<BlogArchives> archivesListForDaysAndPost) { 420 this.archivesListForDaysAndPost = archivesListForDaysAndPost; 421 } 422 423 public String getCommaSeparator() { 424 return commaSeparator; 425 } 426 427 public void setCommaSeparator(String commaSeparator) { 428 this.commaSeparator = commaSeparator; 429 } 548 430 } trunk/core/src/net/project/view/pages/assignments/MyAssignments.java
r18170 r18180 399 399 blogEntries.setJspRootURL(JSPRootURL); 400 400 blogEntries.setUserWeblogEntries(blogViewProvider.getFormattedBlogEntries(entries, JSPRootURL, SpaceTypes.PERSONAL_SPACE)); 401 blogEntries.setLinkToPersonSpace( true);401 blogEntries.setLinkToPersonSpace(false); 402 402 blogEntries.setShowEditLink(false); 403 403 blogEntries.setShowExpandCollapseImage(false); trunk/core/src/net/project/view/pages/blog/AddWebLogEntry.java
r18170 r18180 325 325 if (pnWeblogEntry == null) { 326 326 saveBlogEntry(); 327 return new TextStreamResponse("text", " Entry Saved");327 return new TextStreamResponse("text", "true"); 328 328 //return getSavedBlogEntries(); 329 329 } else { trunk/core/src/net/project/view/pages/blog/ViewBlog.java
r18170 r18180 344 344 String startDateString = request.getParameter("startDate"); 345 345 String endDateString = request.getParameter("endDate"); 346 int post = request.getParameter("posts") == null ? 0 : Integer.parseInt(request.getParameter("posts")); 346 347 Date startDate = null; 347 348 Date endDate = null; 348 349 try { 349 startDate = userDateFormat.parseDateString(startDateString, "dd-MM-yyyy"); 350 endDate = userDateFormat.parseDateString(endDateString, "dd-MM-yyyy"); 350 if(StringUtils.isNotEmpty(startDateString) && StringUtils.isNotEmpty(endDateString)){ 351 startDate = userDateFormat.parseDateString(startDateString, "dd/MM/yyyy"); 352 endDate = userDateFormat.parseDateString(endDateString, "dd/MM/yyyy"); 353 } 351 354 setUserWeblogEntries(blogProvider.getFilteredWeblogEntries(userWeblog.getWeblogId(), 352 355 StringUtils.isNotEmpty(memberId) ? new Integer(memberId) : null, 353 356 StringUtils.isNotEmpty(objectId) ? new Integer(objectId) : null, 354 startDate, endDate, WeblogConstants.STATUS_PUBLISHED, 0, 0, null));357 startDate, endDate, WeblogConstants.STATUS_PUBLISHED, 0, post, null)); 355 358 if (spaceType.equals(Space.PERSONAL_SPACE)) { 356 359 // get blog entries from project weblogs … … 358 361 userWeblogEntries.addAll(blogProvider.getWeblogEntriesFromProjectBlogByPerson(userId, 359 362 StringUtils.isNotEmpty(objectId) ? new Integer(objectId) : null, startDate, 360 endDate, WeblogConstants.STATUS_PUBLISHED, 0, 0));363 endDate, WeblogConstants.STATUS_PUBLISHED, 0, post)); 361 364 } else { 362 365 userWeblogEntries = blogProvider.getWeblogEntriesFromProjectBlogByPerson(userId, 363 366 StringUtils.isNotEmpty(objectId) ? new Integer(objectId) : null, startDate, 364 endDate, WeblogConstants.STATUS_PUBLISHED, 0, 0);367 endDate, WeblogConstants.STATUS_PUBLISHED, 0, post); 365 368 } 366 369 } … … 380 383 setMessage("Blog entries not found"); 381 384 } else { 385 setUserWeblogEntries(blogProvider.getSortedBlogEntries(userWeblogEntries)); 386 if(post > 0 && getUserWeblogEntries().size() >= post) 387 setUserWeblogEntries(userWeblogEntries.subList(0, post)); 382 388 setMessage(getUserWeblogEntries().size() == 1 ? "1 blog entry found" : getUserWeblogEntries().size()+" blog entries found"); 383 setUserWeblogEntries(blogProvider.getSortedBlogEntries(userWeblogEntries));384 389 } 385 390 … … 410 415 } 411 416 } 412 }else if(action.equalsIgnoreCase(BlogAction.LOAD_BLOG_ENTRIES.toString())){413 blogEntriesLoadedForObject = request.getParameter("blogEntriesLoadedForObject") == null ? false414 : Boolean.parseBoolean(request.getParameter("blogEntriesLoadedForObject"));415 return loadBlogEntries();416 417 } 417 418 } 418 419 return null; 419 }420 421 /**422 * To load blog entries after page load423 * @return list of blog entries424 */425 Object loadBlogEntries() {426 if (!isBlogEntriesLoadedForObject()) {427 getBlogEntries(userDateFormat.formatDate(previousDate, startEndDateFormatPattern), userDateFormat428 .formatDate(currentDate, startEndDateFormatPattern), userId.toString());429 } else if (userWeblogEntries != null) {430 setUserWeblogEntries(blogProvider.getSortedBlogEntries(userWeblogEntries));431 setBlogEntriesLoadedForObject(false);432 }433 blogEntries.setMessage(getMessage());434 blogEntries.setUserWeblogEntries(blogViewProvider.getFormattedBlogEntries(userWeblogEntries, getJspRootURL(),435 getSpaceType()));436 blogEntries.setLinkToPersonSpace(getLinkToPersonSpace());437 blogEntries.setShowEditLink(true);438 blogEntries.setShowExpandCollapseImage(true);439 blogEntries.setShowPersonImage(true);440 blogEntries.setBlogCommentDivClass("comment-entry");441 blogEntries.setBlogPostDivClass("post-body");442 return blogEntries;443 420 } 444 421 trunk/core/web/css/blog.css
r18164 r18180 417 417 } 418 418 #loadBlogEntries { 419 margin-left: 42px;419 /*margin-left: 42px;*/ 420 420 } 421 421 #uploadScreen { … … 454 454 margin-top: 0px; 455 455 } 456 #showDaysAndPostsDiv { 457 color: #000000; 458 font-family: Arial, Helvetica, sans-serif; 459 font-size: 12px; 460 } 461 #showDaysAndPostsDiv a { 462 color: #4259cb; 463 } 464 .fieldSetCls { 465 border: 0px solid #B5B8C8; 466 padding-bottom: 5px; 467 } 468 .x-date-middle { 469 padding-top: 2px; 470 padding-bottom: 2px; 471 width: 130px; /* FF3 */ 472 } 473 trunk/core/web/html/blog/ViewBlog.html
r18170 r18180 134 134 <td> 135 135 <div id="loadBlogEntries"> 136 <font color="blue" style="font-weight: bold; size: 12px; " >Loading Blog Entries...</font>136 <font color="blue" style="font-weight: bold; size: 12px;padding-left:42px" >Loading Blog Entries...</font> 137 137 <img src="${jspRootURL}/images/default/grid/loading.gif" align="absmiddle" /> 138 138 </div> … … 164 164 var blogEntriesLoadedForObject = '${BlogEntriesLoadedForObject}'; 165 165 var openBlogEntries = blogEntryIds.split(',').length-1; 166 166 var startDate, endDate,posts; 167 167 // initializing content panel with html editor 168 169 <!-- // 168 170 function initializeContentPanel(){ 169 171 Ext.QuickTips.init(); … … 184 186 185 187 initializeContentPanel(); 186 187 var datesCombo = new Ext.form.ComboBox({188 fieldLabel: 'Dates',189 typeAhead: true,190 triggerAction: 'all',191 transform: 'archives',192 lazyRender: true,193 listClass: 'x-combo-list-small',194 editable: false,195 width: 120,196 listWidth : 120197 });198 199 var projectsCombo = null;200 var viewCombo = null;201 var teamCombo = null;202 var taskCombo = null;203 var filterForm;204 205 if(spaceType == 'project'){206 viewCombo = new Ext.form.ComboBox({207 fieldLabel: 'View',208 typeAhead: true,209 triggerAction: 'all',210 transform: 'assignmentFilter',211 lazyRender: true,212 listClass: 'x-combo-list-small',213 editable : false,214 width: 100,215 listWidth : 100216 });217 teamCombo = new Ext.form.ComboBox({218 fieldLabel: 'Team',219 typeAhead: true,220 triggerAction: 'all',221 transform: 'team',222 lazyRender: true,223 listClass: 'x-combo-list-small',224 editable : false,225 width: 130,226 listWidth : 130227 });228 taskCombo = new Ext.form.ComboBox({229 fieldLabel: 'Task',230 typeAhead: true,231 triggerAction: 'all',232 transform: 'task',233 lazyRender: true,234 listClass: 'x-combo-list-small',235 editable : false,236 width: 180,237 listWidth : 180238 });239 } else {240 projectsCombo = new Ext.form.ComboBox({241 fieldLabel: 'Projects:',242 labelAlign : 'left',243 typeAhead: true,244 triggerAction: 'all',245 transform: 'projectFilter',246 lazyRender: true,247 listClass: 'x-combo-list-small',248 editable: false,249 width: 160,250 listWidth : 160251 });252 }253 254 Ext.onReady(function(){255 256 Ext.QuickTips.init();257 258 var personFilters = [{259 layout: 'column',260 items:[{261 columnWidth:.4,262 layout: 'form',263 items: [264 datesCombo265 ]266 },{267 columnWidth:.6,268 layout: 'form',269 items: [270 projectsCombo271 ]272 }]273 }];274 275 var projectFilters = [{276 layout: 'column',277 items:[{278 columnWidth:.3,279 layout: 'form',280 items: [281 viewCombo282 ]283 },{284 columnWidth:.4,285 layout: 'form',286 items: [287 datesCombo288 ]289 },{290 columnWidth:.3,291 layout: 'form',292 items: [293 teamCombo294 ]295 }]296 }, taskCombo297 ];298 299 filterForm = new Ext.FormPanel({300 labelWidth: 60,301 frame: true,302 collapsible: true,303 collapsed: true,304 title: 'Filters',305 bodyStyle: 'padding:1px 1px 0',306 width: '650px',307 monitorResize : true,308 items: spaceType == 'person' ? personFilte
