Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,9 @@ else if (eq.length > 2)

if (values.length > 0)
{
out.print("<tr><td class=\"metadataFieldLabel\">");
String field_class = field.replace('.', '-').replace("*","star" );

out.print("<tr class='" + field_class + "'> <td class=\"metadataFieldLabel\">");

String label = null;
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
Expand All @@ -20,6 +22,8 @@
import org.dspace.app.webui.util.JSPManager;
import org.dspace.app.webui.util.UIUtil;
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.DSpaceObject;
import org.dspace.core.Constants;
import org.dspace.core.Context;
import org.dspace.core.LogManager;

Expand Down Expand Up @@ -212,4 +216,18 @@ protected void doDSPost(Context context, HttpServletRequest request,
// indicate that POST is not supported by this servlet.
super.doGet(request, response);
}

protected void setDSpaceObjectAndHandle(Context context, HttpServletRequest request, DSpaceObject dso) throws SQLException {
if (dso != null && request.getAttribute("dspaceObject") == null) {
request.setAttribute("dspaceObject", dso);
List<String> handles = new ArrayList<String>();
while (dso != null) {
if (dso.getType() != Constants.ITEM){
handles.add(dso.getHandle());
}
dso = dso.getParentObject();
}
request.setAttribute("dspaceObject.parents.handles", handles);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ protected void doDSGet(Context context, HttpServletRequest request,
return;
}

setDSpaceObjectAndHandle(context, request, dso);

if("/statistics".equals(extraPathInfo))
{
// Check configuration properties, auth, etc.
Expand Down
4 changes: 2 additions & 2 deletions dspace-jspui/src/main/webapp/collection-home.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<p class="copyrightText"><%= copyright %></p>

<%-- Browse --%>
<div class="panel panel-primary">
<div class="panel panel-primary browse-buttons">
<div class="panel-heading">
<fmt:message key="jsp.general.browse"/>
</div>
Expand All @@ -143,7 +143,7 @@
{
String key = "browse.menu." + bis[i].getName();
%>
<form method="get" class="btn-group" action="<%= request.getContextPath() %>/handle/<%= collection.getHandle() %>/browse">
<form method="get" class="btn-group <%= bis[i].getName() %>" action="<%= request.getContextPath() %>/handle/<%= collection.getHandle() %>/browse">
<input type="hidden" name="type" value="<%= bis[i].getName() %>"/>
<%-- <input type="hidden" name="collection" value="<%= collection.getHandle() %>" /> --%>
<input type="submit" class="btn btn-default" name="submit_browse" value="<fmt:message key="<%= key %>"/>"/>
Expand Down
6 changes: 3 additions & 3 deletions dspace-jspui/src/main/webapp/community-home.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
</div>

<%-- Browse --%>
<div class="panel panel-primary">
<div class="panel panel-primary browse-buttons">
<div class="panel-heading"><fmt:message key="jsp.general.browse"/></div>
<div class="panel-body">
<%-- Insert the dynamic list of browse options --%>
Expand All @@ -211,10 +211,10 @@
{
String key = "browse.menu." + bis[i].getName();
%>
<form method="get" action="<%= request.getContextPath() %>/handle/<%= community.getHandle() %>/browse">
<form method="get" class="btn-group <%= bis[i].getName() %>" action="<%= request.getContextPath() %>/handle/<%= community.getHandle() %>/browse">
<input type="hidden" name="type" value="<%= bis[i].getName() %>"/>
<%-- <input type="hidden" name="community" value="<%= community.getHandle() %>" /> --%>
<input class="btn btn-default col-md-3" type="submit" name="submit_browse" value="<fmt:message key="<%= key %>"/>"/>
<input class="btn btn-default " type="submit" name="submit_browse" value="<fmt:message key="<%= key %>"/>"/>
</form>
<%
}
Expand Down
20 changes: 18 additions & 2 deletions dspace-jspui/src/main/webapp/layout/header-default.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@
String dsVersion = Util.getSourceVersion();
String generator = dsVersion == null ? "DSpace" : "DSpace "+dsVersion;
String analyticsKey = ConfigurationManager.getProperty("jspui.google.analytics.key");

// use handles of parents as classes on main div
// Grab parents from the attributes - these should have been picked up
// by the HandleServlet
String main_classes = "";
{

if (null != request.getAttribute("dspaceObject.parents.handles")) {
List<String> handles = (List<String>) request.getAttribute("dspaceObject.parents.handles");

for (String hdl : handles) {
main_classes = main_classes + " hdl-" + hdl.replace('/', '-');
}
}
}
%>

<!DOCTYPE html>
Expand Down Expand Up @@ -144,8 +159,9 @@
%>
</header>

<main id="content" role="main">
<div class="container banner">
<main id="content" role="main" class="<%= main_classes%>">

<div class="container banner">
<div class="row">
<div class="col-md-9 brand">
<h1><fmt:message key="jsp.layout.header-default.brand.heading" /></h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,69 @@ span.batchimport-error-tab {

span.batchimport-error-caused {
font-weight:bold;
}
}


/*
The main HTML element on pages that relate to the display of an item, collection, or community
is annotated with classes that correspond to the handles of the enclosing collection and community/communities.
Handles are 'turned' into classes by prefixing them with 'hdl-' and by replacing '/' with '-'; for example
the handle 123456789/abcd becomes the CSS class hdl-123456789-abcd
*/

/* hide all browse buttons on a small collection/community by using the class for its handle */
/* hdl-123456789-3876 corresponds to the handle 123456789/3876 */
/*
.hdl-123456789-3874 .browse-buttons {
display: none;
}
*/

/* hide the subject browse button on the page for the community with handle 123456789/3883,
as well as the pages of its collections */
/*
.hdl-123456789-3883 .browse-buttons .subject {
display: none;
}
*/

/* by default: hide the graduation browse button everywhwre */
/* show the graduation browse button in the senior thesis community with handle 123456789/3875 */
/*
.browse-buttons .graduation {
display: none;
}

.hdl-123456-3875 .browse-buttons .graduation {
display: block;
}
*/

/* Item pages annotate the table rows for metadata values with matching classes:
dc.title matches the class dc-title
dc.contributor.* matches the class dc-contributor-star
...
the convention is to replace '.' by '-' and '*' by 'star'
*/

/* style all itemDisplay pages to show author values followed by semicolons and without line breaks */
/*
.itemDisplayTable .dc-contributor-star .metadataFieldValue br {
display: none;
}
.itemDisplayTable .dc-contributor-star .metadataFieldValue a::after {
content: "; ";
}
*/

/* to style selected metadata values for items in a given collections / communities,
prefix CSS rules with the class matching the handle of the collection/community
*/
/*
.hdl-123456789-4028 .itemDisplayTable .dc-relation-isformatof .metadataFieldValue,
.hdl-123456789-4028 .itemDisplayTable .dc-title .metadataFieldValue {
background-color: #f5f5f5;
background-image: linear-gradient(to bottom, #e8e8e8 0px, #f5f5f5 100%);
background-repeat: repeat-x;
}
*/