Skip to content

Commit

Permalink
SAK-40520 (sakaiproject#5941)
Browse files Browse the repository at this point in the history
IMPORTANT NOTES:
For "widgets" that are not tools to be included in this list, they need to have category of widget in tool config.
for widgets that have associated tools, to be added without having the tool installed they need the following property added to their configurations:
<configuration name="require.tool" value="false" type="final" />

A "custom_overview" property is now being saved to the site when Manage Overview is saved for the first time. This property stops synoptics from automatically being added when a tool is added to the site. This DOES carry over to duplicated sites.

This CAN be overwritten in Sites, by editting the custom_overview property to be anything other than true. (Plz for sanity purposes use false).

SAK-40520

revert unnecessary changes
  • Loading branch information
RyanAFinney authored and ern committed Sep 11, 2018
1 parent 75266a3 commit 7e3046b
Show file tree
Hide file tree
Showing 24 changed files with 1,135 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

<configuration name="functions.require" value="annc.read" />

<category name="widget" />

</tool>

</registration>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<configuration name="help.id" value="sakai.chat" type="final" />

<configuration name="functions.require" value="site.visit" />
<category name="widget" />

</tool>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,14 @@ public void removeTool(ToolConfiguration tool) {
}
throw new UnsupportedOperationException();
}

@Override
public void setTools(List tools){
if(sitePage != null){
sitePage.setTools(tools);
}
throw new UnsupportedOperationException();
}
@Override
public void moveUp() {
if (sitePage != null) {
Expand Down
4 changes: 4 additions & 0 deletions kernel/api/src/main/java/org/sakaiproject/site/api/Site.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ public interface Site extends Edit, Comparable, Serializable, AuthzGroup
*/
public final static String PROP_SITE_MATHJAX_ALLOWED = "mathJaxAllowed";

/**
* property name for custom overview
*/
public final static String PROP_CUSTOM_OVERVIEW = "custom_overview";
/**
* @return the user who created this.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public interface SitePage extends Edit, Serializable
*/
Collection<ToolConfiguration> getTools(String[] toolIds);

public void setTools(List tools);

/** @return the skin to use for this page. */
public String getSkin();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,6 @@ public interface ToolConfiguration extends Placement, Serializable
* @return the tool's order in the page.
*/
public int getPageOrder();

public void setPageOrder(int pos);
}
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,10 @@ else if (col == 0)
return rv;
}

public void setTools(List tools){
this.m_tools = (ResourceVector) tools;
}

/**
* @inheritDoc
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ public int getPageOrder()
return m_pageOrder;
}

public void setPageOrder(int pos){
m_pageOrder = pos;
}

/**
* {@inheritDoc}
*/
Expand Down
3 changes: 3 additions & 0 deletions library/src/morpheus-master/sass/base/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
sakai-help : ( extend : fa-question-circle ),
sakai-iframe : ( extend : fa-globe ),
sakai-iframe-site : ( extend : fa-list-ul ),
sakai-synoptic-announcement: ( extend : fa-list-ul),
sakai-synoptic-chat: ( extend : fa-list-ul),
sakai-synoptic-messagecenter: ( extend : fa-list-ul),
sakai-lessonbuildertool : ( extend : fa-leanpub ),
sakai-mailbox : ( extend : fa-envelope-o ),
sakai-mailtool : ( extend : fa-envelope-o ),
Expand Down
31 changes: 31 additions & 0 deletions library/src/morpheus-master/sass/modules/navigation/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1291,3 +1291,34 @@ body.is-logged-out{
}
}
}

@media only screen and (min-width: 801px) {
.manage-overview-link {
border: 1px solid #ccc;
color: #333 !important;
cursor: pointer;
display: inline-block;
font-family: "Open Sans", sans-serif;
font-size: 12px;
text-decoration: none !important;
-moz-appearance: none;
-webkit-appearance: none;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
padding: 5px !important; /* important needed for these two--otherwise gets overridden by hierarchy.*/
margin: 5px 30px !important;
position: absolute;
right: 0px;

span {
padding-right: 5px;
}
}
}

@media only screen and (max-width: 800px){
.manage-overview-link {
visibility: hidden;
}
}
11 changes: 11 additions & 0 deletions library/src/morpheus-master/sass/modules/navigation/_skipnav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@

a.#{$namespace}skipNav--toolName {
color: $link-color;
}
a.manage-overview-link-mobile {
color: $link-color;
cursor: pointer;
display: inline-block;
font-family: "Open Sans", sans-serif;

span {
padding-right: 5px;
}

&::after {
border-right: 0px none;
}
Expand Down
3 changes: 3 additions & 0 deletions library/src/morpheus-master/sass/modules/tool/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
@media #{$phone} { // position the buttons for mobile
margin-top: 0;
margin-bottom: -22px;
}
&.home {
top: 0px;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,4 +690,55 @@
}
}
}
// end Site Info and Worksite Setup namespaces

#dropdownMenuButton {
margin: 2px 0px 2px 4px;
line-height: 18px;
}

.form-control-label {
font-weight: bold;
color: #555;
}

td.disabled{
color: #555;
}

.manageList {
list-style: none;

a{
padding: 5px;
text-decoration: none !important; /*important used to override active/hover/etc that happens on links */
}

li.list-group-item{
border:none;

&.disabled{
background-color: #ffffff;
}
}
}

.manageTable{
thead{
background-color: #efefef;
}
a{
text-decoration: none !important;
}
td {

&.buttonCol {
width: 50px;
text-align: center;
}

&.removeCol{
width: 80px;
text-align: center;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
description="Display unread discussion and forum topic messages for all sites or a site">

<configuration name="reset.button" value="false" type="final" />

<category name="widget" />
</tool>

</registration>
1 change: 1 addition & 0 deletions portal/portal-impl/impl/src/bundle/sitenav.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ sit_autofav_description=Automatically add new sites to your favorites bar:
sit_favorite_limit_reached=Only the first {0} sites (above) will display in your favorites bar.
sit_open_menu=open attached menu

sit_manover = Manage Overview
sit_noscript_message = Sakai works much better when JavaScript is enabled. Please enable JavaScript in your Browser.
rs_enterRoleSwapWithRole = Enter {0} View
rs_exitRoleSwapWithRole = Exit View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ else if ("always".equals(showHelpGlobal))
List<Map> l = new ArrayList<Map>();

String addMoreToolsUrl = null;
String manageOverviewUrl = null;

for (Iterator i = pages.iterator(); i.hasNext();)
{

Expand All @@ -686,6 +688,9 @@ else if ("always".equals(showHelpGlobal))
addMoreToolsUrl = ToolUtils.getPageUrl(req, site, p, portalPrefix,
resetTools, effectiveSiteId, null);
addMoreToolsUrl += "?sakai_action=doMenu_edit_site_tools&panel=Shortcut";

manageOverviewUrl = ToolUtils.getPageUrl(req, site, p, portalPrefix, resetTools, effectiveSiteId, null);
manageOverviewUrl += "?sakai_action=doManageOverview";
}
}
if ( count != 1 ) {
Expand Down Expand Up @@ -727,7 +732,10 @@ else if ("always".equals(showHelpGlobal))
}
}

if ( ! siteUpdate ) addMoreToolsUrl = null;
if ( ! siteUpdate ){
addMoreToolsUrl = null;
manageOverviewUrl = null;
}

boolean legacyAddMoreToolsPropertyValue = ServerConfigurationService.getBoolean("portal.experimental.addmoretools", false);
if ( ! ServerConfigurationService.getBoolean("portal.addmoretools.enable", legacyAddMoreToolsPropertyValue) ) addMoreToolsUrl = null;
Expand Down Expand Up @@ -850,6 +858,12 @@ else if ("always".equals(showHelpGlobal))
theMap.put("pageNavCanAddMoreTools", false);
}

if(manageOverviewUrl != null){
theMap.put("manageOverviewUrl", manageOverviewUrl);
theMap.put("canManageOverview", true);
}else{
theMap.put("canManageOverview", false);
}
theMap.put("pageNavTools", l);

if ("true".equals(site.getProperties().getProperty("lessons_submenu")) && !l.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

#set($i = 0) ## Counter for directUrl ids

#set($homePage = false)
#foreach( $page in $sitePages.pageNavTools )
#if (${page.current} && ${page.pageProps.is_home_page})
#set($homePage = true)
#break
#end
#end
<!-- START VM includePageBody.vm -->

<h1 class="skip" tabindex="-1" id="tocontent">${rloader.sit_contentshead}</h1>
Expand All @@ -24,7 +31,7 @@
#set( $numberTools = $pageColumn0Tools.size() )
#end

<main id="$pageWrapperClass" class="Mrphs-mainContent #if( $numberTools > 1 )Mrphs-multipleTools #end" role="main">
<main id="$pageWrapperClass" class="Mrphs-mainContent #if( $numberTools > 1 || $homePage)Mrphs-multipleTools #end" role="main">

<div id="$pageColumnLayout" class="${columnClasses}">

Expand Down Expand Up @@ -81,8 +88,9 @@

#end ## END of IF (${tool.toolShowResetButton})

<div class="Mrphs-toolTitleNav__button_container">

<div class="Mrphs-toolTitleNav__button_container #if(${homePage})home#end">


#if (${tool.toolJSR168Edit})

<a class="Mrphs-toolTitleNav__link Mrphs-toolTitleNav__link--edit" accesskey="e" id="jsr-edit" href="${tool.toolJSR168Edit}" title="${rloader.sit_edit}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
<span class="Mrphs-breadcrumb--icon ${page.menuClass} $!{page.menuClassOverride}"></span>
<span class="Mrphs-breadcrumb--toolNameText">${page.pageTitle}</span>
</a>

#if(${sitePages.canManageOverview} && ${page.pageProps.is_home_page})
<a href="${sitePages.manageOverviewUrl}" title="$rloader.sit_manover" class="Mrphs-hierarchy-item manage-overview-link d-none d-lg-block">
<span class="fa fa-pencil"></span>$rloader.sit_manover
</a>
#end
#end
#end
</nav>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
<span class="Mrphs-breadcrumb--icon ${page.menuClass} $!{page.menuClassOverride}"></span>
<span>${page.pageTitle}</span>
</a>

#if(${sitePages.canManageOverview} && ${page.pageProps.is_home_page})
<a href="${sitePages.manageOverviewUrl}" title="$rloader.sit_manover" class="manage-overview-link-mobile">
<span class="fa fa-pencil"></span>$rloader.sit_manover
</a>
#end
#end
#end
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ java.duplicate = Duplicate Site
java.import = Import from Site
java.importFile = Import from Archive File
java.link = Link to Parent Site
manage.overview = Manage Overview
java.external = External Tools
java.userAuditEventLog=User Audit Log
java.dontperm = {0} could not be deleted. You do not have permission to remove this site.
Expand Down Expand Up @@ -1029,3 +1030,33 @@ gen.listnavselect = To operate the combo box, first press Alt+Down Arrow to open
search.label=Search
search.button=Search
search.clear=Clear Search

#manage overview
manover.header = Manage Overview for:
manover.instr = Review and modify Overview information
manover.title = Title
manover.layout = Layout:
manover.toolid = Tool Id
manover.features = Features
manover.desc = Description
manover.up = Move tool up
manover.down = Move tool down
manover.right = Move tool right
manover.left = Move tool left
manover.added = Current Widgets
manover.all = Available Widgets
manover.unavail = Unavailable Widgets
manover.move = Move
manover.layhint = Layout Hints:
manover.alert = Alert:
manover.notitle = Title cannot be blank
manover.layhintletter = Layout hints must be integers only in the format "row, column" starting with 0. Example 0,0 or 0,1
manover.notools = There are no widgets defined in this page.
manover.nowidgets = No widgets available to be added to this page.
manover.tool.unavail = These widgets are not available because they have not been installed in the site. To add the widgets to your Overview, go to "Add Tool" in the tool menu, then add the appropriate tool.
manover.remove = Remove
manover.remove.full = Remove widget from page
manover.add = Add
manover.add.full = Add widget to page
manover.save = Save
manover.can = Cancel
Loading

0 comments on commit 7e3046b

Please sign in to comment.