Skip to content

Commit

Permalink
SAK-32672 Initial commit of Noodle site members widget (sakaiproject#…
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianfish authored Aug 21, 2017
1 parent c774419 commit 74f53a4
Show file tree
Hide file tree
Showing 16 changed files with 797 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.#{$namespace}sakai-sitemembers{

/* apply to an element with a background image to make rounded and centred */
.rounded {
width: 70px;
height: 70px;
display: inline-block;
background-size: auto 100%;
background-position: 50%;
border-radius: 50%;
position: relative;
margin-top: 0;
}

.my-connections-cell {
position: relative;
text-align: center;
width: 160px;
padding-top: 20px;
vertical-align: top;
}

nav.#{$namespace}toolTitleNav, div.#{$namespace}toolBody>nav.#{$namespace}toolTitleNav {
border: 1px solid #e0e0e0;
background-color: #f0f0f0;
text-align: center;
box-sizing: border-box;
}

nav.#{$namespace}toolTitleNav>h2.#{$namespace}toolTitleNav__title, div.#{$namespace}toolBody>nav.#{$namespace}toolTitleNav>h2.#{$namespace}toolTitleNav__title {
color: #333;
font-weight: bold;
font-size: 1em;
}

div.#{$namespace}toolBody--sakai-sitemembers>h3 {
text-align: center;
}

div.#{$namespace}toolBody--sakai-sitemembers>div>table {
margin: 0 auto;
}

div.online-status {
display: block;
height: 16px;
width: 16px;
position: absolute;
left: 61%;
top: 80px;
border-radius: 8px;
}

div.online-status.online {
background-color: yellowgreen;
}
div.online-status.away {
background-color: gold;
}
}
1 change: 1 addition & 0 deletions library/src/morpheus-master/sass/tool.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
@import "modules/tool/pasystem/pasystem";
@import "modules/tool/signup/signup";
@import "modules/tool/sitesetup/sitesetup";
@import "modules/tool/sitemembers/sitemembers";
@import "modules/tool/dropbox/dropbox";
@import "modules/tool/sitestats/sitestats";
@import "modules/tool/syllabus/syllabus";
Expand Down
85 changes: 85 additions & 0 deletions sitemembers/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>Site Members</name>
<groupId>org.sakaiproject.sitemembers</groupId>
<artifactId>sitemembers</artifactId>
<parent>
<groupId>org.sakaiproject</groupId>
<artifactId>master</artifactId>
<version>12-SNAPSHOT</version>
<relativePath>../master/pom.xml</relativePath>
</parent>
<packaging>war</packaging>
<dependencies>
<!-- third party dependencies -->
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket</artifactId>
<version>6.26.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-spring</artifactId>
<version>6.26.0</version>
</dependency>
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-extensions</artifactId>
<version>6.26.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-component-manager</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-util</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<scope>provided</scope> <!-- to satisfy EB and eclipse -->
</dependency>
<dependency>
<groupId>org.sakaiproject.profile2</groupId>
<artifactId>profile2-api</artifactId>
<scope>provided</scope>
<version>12-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<resources>
<!-- include everything except the Java source -->
<resource>
<directory>src/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<!-- include our log4j.properties -->
<resource>
<directory>src/resources</directory>
<includes>
<include>*.properties</include>
</includes>
</resource>
</resources>
</build>
</project>
32 changes: 32 additions & 0 deletions sitemembers/src/java/org/sakaiproject/sitemembers/SiteRole.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.sakaiproject.sitemembers;

/**
* Represents the roles used in the site. Users are categorised to one of these.
*
* @author Steve Swinsburg ([email protected])
*
*/
public enum SiteRole {

// Note that these strings are actually the *permission* that determines whether the user
// has the given role. Not all schools call these roles "student", "ta", "instructor", but
// the underlying permission cannot be changed
STUDENT("section.role.student"),
TA("section.role.ta"),
INSTRUCTOR("section.role.instructor");

private String permissionName;

SiteRole(final String permissionName) {
this.permissionName = permissionName;
}

/**
* Get the Sakai permissionName for the role
*
* @return
*/
public String getPermissionName() {
return this.permissionName;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package org.sakaiproject.sitemembers;

import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.Url;
import org.apache.wicket.request.resource.UrlResourceReference;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
import org.sakaiproject.sitemembers.ui.WidgetPage;

/**
* App class for My Connections widget
*
* @author Steve Swinsburg ([email protected])
*
*/
public class WidgetApplication extends WebApplication {

@Override
public void init() {

super.init();

// Configure for Spring injection
getComponentInstantiationListeners().add(new SpringComponentInjector(this));

// Don't throw an exception if we are missing a property, just fallback
getResourceSettings().setThrowExceptionOnMissingResource(false);

// Remove the wicket specific tags from the generated markup
getMarkupSettings().setStripWicketTags(true);

// Don't add any extra tags around a disabled link (default is <em></em>)
getMarkupSettings().setDefaultBeforeDisabledLink(null);
getMarkupSettings().setDefaultAfterDisabledLink(null);

// On Wicket session timeout, redirect to main page
getApplicationSettings().setPageExpiredErrorPage(getHomePage());

// cleanup the HTML
getMarkupSettings().setStripWicketTags(true);
getMarkupSettings().setStripComments(true);
getMarkupSettings().setCompressWhitespace(true);

// Suppress internal javascript references
// When rendered inline, the URLs these generate are incorrect - the context path is /page/ instead of the webapp name.
// However it is cleaner if we just handle this manually in the page
getJavaScriptLibrarySettings().setJQueryReference(new UrlResourceReference(Url.parse("/sitemembers/scripts/wicket/empty.js")));
getJavaScriptLibrarySettings().setWicketEventReference(new UrlResourceReference(Url.parse("/sitemembers/scripts/wicket/empty.js")));

// to put this app into deployment mode, see web.xml
}

/**
* The main page for our app
*
* @see org.apache.wicket.Application#getHomePage()
*/
@Override
public Class<WidgetPage> getHomePage() {
return WidgetPage.class;
}

/**
* Constructor
*/
public WidgetApplication() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
app.title=Roster
course.heading.instructor=Instructor
course.heading.ta=Teaching Assistant
other.heading.instructor=Maintainer
other.heading.ta=Assistant
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" >

<head>
<title><wicket:message key="app.title" /></title>
<script language="javascript">
$(document).ready(function () {
profile.attachPopups($('td.my-connections-cell a'));
});
</script>
</head>
<body>

<wicket:enclosure>
<nav class="Mrphs-toolTitleNav Mrphs-container Mrphs-container--toolTitleNav">
<h2 class="Mrphs-toolTitleNav__title"><wicket:message key="app.title" /></h2>
<div class="Mrphs-toolTitleNav__button_container"></div>
</nav>
<div wicket:id="roster">
</div>
</wicket:enclosure>

</body>
</html>
Loading

0 comments on commit 74f53a4

Please sign in to comment.