Skip to content

Commit

Permalink
LSNBLDR-761; show release and hidden in index of pages (sakaiproject#…
Browse files Browse the repository at this point in the history
  • Loading branch information
clhedrick authored Dec 28, 2016
1 parent 98fe40a commit 8555693
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3401,7 +3401,8 @@ public String getReleaseString(SimplePageItem i, Locale locale) {
return null;
if (page.isHidden())
return messageLocator.getMessage("simplepage.hiddenpage");
if (page.getReleaseDate() != null && page.getReleaseDate().after(new Date())) {
// for index of pages we need to show even out of date release dates
if (page.getReleaseDate() != null) { // && page.getReleaseDate().after(new Date())) {
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, locale);
TimeZone tz = TimeService.getLocalTimeZone();
df.setTimeZone(tz);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public class PageEntry {
String title;
int level;
boolean toplevel;
boolean hidden;
Date releaseDate;
}

public void setSimplePageBean(SimplePageBean simplePageBean) {
Expand Down Expand Up @@ -159,9 +161,9 @@ public void findAllPages(SimplePageItem pageItem, List<PageEntry>entries, Map<Lo
return;
}

SimplePage page = simplePageToolDao.getPage(pageId);
// implement hidden.
if (! canEditPage) {
SimplePage page = simplePageToolDao.getPage(pageId);
if (page.isHidden())
return;
if (page.getReleaseDate() != null && page.getReleaseDate().after(new Date()))
Expand Down Expand Up @@ -204,6 +206,8 @@ public void findAllPages(SimplePageItem pageItem, List<PageEntry>entries, Map<Lo
entry.title = pageItem.getName();
entry.level = level;
entry.toplevel = toplevel;
entry.hidden = page.isHidden();
entry.releaseDate = page.getReleaseDate();

// add entry
entries.add(entry);
Expand Down Expand Up @@ -281,7 +285,7 @@ public void fillComponents(UIContainer tofill, ViewParameters viewparams, Compon
}

UIOutput.make(tofill, "html").decorate(new UIFreeAttributeDecorator("lang", localeGetter.get().getLanguage()))
.decorate(new UIFreeAttributeDecorator("xml:lang", localeGetter.get().getLanguage()));
.decorate(new UIFreeAttributeDecorator("xml:lang", localeGetter.get().getLanguage()));

boolean canEditPage = (simplePageBean.getEditPrivs() == 0);

Expand Down Expand Up @@ -425,7 +429,7 @@ else if (summaryPage && entry.itemId != null) {
if (level > 5)
level = 5;
String imagePath = "/lessonbuilder-tool/images/";
SimplePageItem item = simplePageBean.findItem(entry.itemId);

SimplePageLogEntry logEntry = simplePageBean.getLogEntry(entry.itemId);
String note = null;
if (logEntry != null && logEntry.isComplete()) {
Expand Down Expand Up @@ -560,8 +564,21 @@ else if (summaryPage && entry.itemId != null) {

}

if (canEditPage && entry != null && entry.pageId != null && sharedPages.contains(entry.pageId)) {
UIOutput.make(row, "shared");

if (canEditPage && entry != null && entry.pageId != null) {
String text = null;
if (sharedPages.contains(entry.pageId))
text = messageLocator.getMessage("simplepage.sharedpage");
SimplePageItem item = simplePageBean.findItem(entry.itemId);
String released = simplePageBean.getReleaseString(item, localeGetter.get());
if (released != null) {
if (text != null)
text = text + released;
else
text = released;
}
if (text != null)
UIOutput.make(row, "shared", text);
}

// debug code for development. this will be removed at some point
Expand Down
2 changes: 1 addition & 1 deletion lessonbuilder/tool/src/webapp/templates/PagePicker.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h4 rsf:id="heading" style="margin:10px -8px 10px;width:80%" ></h4>
<input type="radio" rsf:id="select" />
<input type="checkbox" rsf:id="select-for-deletion" class="deletebox"/>
<img class="status-image" alt="" rsf:id="status-image" height="18" width="18" style="" />
<a href="#" rsf:id="link"><span rsf:id="link-note" class="offscreen"></span><span rsf:id="link-text"></span></a><span rsf:id="shared" class="page-picker-note"><span rsf:id="msg=simplepage.sharedpage"> </span></span><span rsf:id="page1">page1</span><span rsf:id="page2">page2</span><span rsf:id="item1">item1</span><span rsf:id="item2">item2</span>
<a href="#" rsf:id="link"><span rsf:id="link-note" class="offscreen"></span><span rsf:id="link-text"></span></a><span rsf:id="shared" class="page-picker-note"></span><span rsf:id="page1">page1</span><span rsf:id="page2">page2</span><span rsf:id="item1">item1</span><span rsf:id="item2">item2</span>
<span rsf:id="item-list-toggle"><a href="#" class="itemListToggle"><img src="/library/image/sakai/icon-dropdn.gif" height="15"/></a></span>
<div rsf:id="itemListContainer" class="itemListContainer">
<ul rsf:id="itemList" class="itemList" role="menu">
Expand Down

0 comments on commit 8555693

Please sign in to comment.