Skip to content

Commit

Permalink
LSNBLDR-739; in edit page, show actual current CSS, even if it's a de…
Browse files Browse the repository at this point in the history
  • Loading branch information
clhedrick authored Dec 22, 2016
1 parent 633ec02 commit 978fa29
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3220,7 +3220,7 @@ else if(questionStatus == Status.FAILED)
createSubpageDialog(tofill, currentPage);
}

createDialogs(tofill, currentPage, pageItem);
createDialogs(tofill, currentPage, pageItem, cssLink);
}

public void makeCsrf(UIContainer tofill, String rsfid) {
Expand All @@ -3229,11 +3229,11 @@ public void makeCsrf(UIContainer tofill, String rsfid) {
UIInput.make(tofill, rsfid, "simplePageBean.csrfToken", sessionToken.toString());
}

public void createDialogs(UIContainer tofill, SimplePage currentPage, SimplePageItem pageItem) {
public void createDialogs(UIContainer tofill, SimplePage currentPage, SimplePageItem pageItem, ContentResource cssLink) {
createEditItemDialog(tofill, currentPage, pageItem);
createAddMultimediaDialog(tofill, currentPage);
createEditMultimediaDialog(tofill, currentPage);
createEditTitleDialog(tofill, currentPage, pageItem);
createEditTitleDialog(tofill, currentPage, pageItem, cssLink);
createNewPageDialog(tofill, currentPage, pageItem);
createRemovePageDialog(tofill, currentPage, pageItem);
createImportCcDialog(tofill);
Expand Down Expand Up @@ -4393,7 +4393,7 @@ private void createMovieDialog(UIContainer tofill, SimplePage currentPage) {
UICommand.make(form, "movie-cancel", messageLocator.getMessage("simplepage.cancel"), null);
}

private void createEditTitleDialog(UIContainer tofill, SimplePage page, SimplePageItem pageItem) {
private void createEditTitleDialog(UIContainer tofill, SimplePage page, SimplePageItem pageItem, ContentResource cssLink) {
if (pageItem.getType() == SimplePageItem.STUDENT_CONTENT)
UIOutput.make(tofill, "edit-title-dialog").decorate(new UIFreeAttributeDecorator("title", messageLocator.getMessage("simplepage.editTitle")));
else
Expand Down Expand Up @@ -4469,8 +4469,11 @@ private void createEditTitleDialog(UIContainer tofill, SimplePage page, SimplePa
}
}

// cssLink is set above to the actual CSS resource that's active for the page
String currentCss = (cssLink == null ? null : cssLink.getId());

UIOutput.make(form, "cssDropdownLabel", messageLocator.getMessage("simplepage.css-dropdown-label"));
UISelect.make(form, "cssDropdown", options, labels, "#{simplePageBean.dropDown}", page.getCssSheet());
UISelect.make(form, "cssDropdown", options, labels, "#{simplePageBean.dropDown}", currentCss);

UIOutput.make(form, "cssDefaultInstructions", messageLocator.getMessage("simplepage.css-default-instructions"));
UIOutput.make(form, "cssUploadLabel", messageLocator.getMessage("simplepage.css-upload-label"));
Expand Down

0 comments on commit 978fa29

Please sign in to comment.