Author: carlucci
Date: Mon Apr 16 17:57:36 2012
New Revision: 1326701
URL: http://svn.apache.org/viewvc?rev=1326701&view=rev
Log:
RAVE-538: Bootstrap Widget Store. Applying patch submitted by Jacob Hilker.
Modified:
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/css/default.css
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/script/rave_store.js
Modified:
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
URL:
http://svn.apache.org/viewvc/rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp?rev=1326701&r1=1326700&r2=1326701&view=diff
==============================================================================
---
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
(original)
+++
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
Mon Apr 16 17:57:36 2012
@@ -57,285 +57,273 @@
<div class="container-fluid navbar-spacer">
-<section class="span8">
-<c:choose>
- <c:when test="${empty searchTerm and (empty widgets or
widgets.totalResults eq 0)}">
- <%-- Empty db --%>
- <fmt:message key="page.store.list.noresult" var="listheader"/>
- </c:when>
- <c:when test="${empty searchTerm}">
- <fmt:message key="page.store.list.result.x.to.y" var="listheader">
- <fmt:param value="${widgets.offset + 1}"/>
- <fmt:param value="${widgets.offset +
fn:length(widgets.resultSet)}"/>
- <fmt:param value="${widgets.totalResults}"/>
- </fmt:message>
- </c:when>
- <c:when test="${not empty searchTerm and widgets.totalResults eq 0}">
- <fmt:message key="page.store.list.search.noresult" var="listheader">
- <fmt:param><c:out value="${searchTerm}"/></fmt:param>
- </fmt:message>
- </c:when>
- <c:otherwise>
- <fmt:message key="page.store.list.search.result.x.to.y"
var="listheader">
- <fmt:param value="${widgets.offset + 1}"/>
- <fmt:param value="${widgets.offset +
fn:length(widgets.resultSet)}"/>
- <fmt:param value="${widgets.totalResults}"/>
- <fmt:param><c:out value="${searchTerm}"/></fmt:param>
- </fmt:message>
- </c:otherwise>
-</c:choose>
-<h2>${listheader}</h2>
-<%--@elvariable id="widgets"
type="org.apache.rave.portal.model.util.SearchResult"--%>
-<c:if test="${widgets.totalResults gt 0}">
- <c:if test="${widgets.numberOfPages gt 1}">
- <div>
- <ul class="pagination">
- <c:forEach var="i" begin="1" end="${widgets.numberOfPages}">
- <c:url var="pageUrl" value="">
- <c:param name="referringPageId"
value="${referringPageId}"/>
- <c:param name="searchTerm" value="${searchTerm}"/>
- <c:param name="offset" value="${(i - 1) *
widgets.pageSize}"/>
- </c:url>
+ <div class="row-fluid">
+ <section class="span8">
+ <c:choose>
+ <c:when test="${empty searchTerm and (empty widgets or
widgets.totalResults eq 0)}">
+ <%-- Empty db --%>
+ <fmt:message key="page.store.list.noresult" var="listheader"/>
+ </c:when>
+ <c:when test="${empty searchTerm}">
+ <fmt:message key="page.store.list.result.x.to.y"
var="listheader">
+ <fmt:param value="${widgets.offset + 1}"/>
+ <fmt:param value="${widgets.offset +
fn:length(widgets.resultSet)}"/>
+ <fmt:param value="${widgets.totalResults}"/>
+ </fmt:message>
+ </c:when>
+ <c:when test="${not empty searchTerm and widgets.totalResults eq
0}">
+ <fmt:message key="page.store.list.search.noresult"
var="listheader">
+ <fmt:param><c:out value="${searchTerm}"/></fmt:param>
+ </fmt:message>
+ </c:when>
+ <c:otherwise>
+ <fmt:message key="page.store.list.search.result.x.to.y"
var="listheader">
+ <fmt:param value="${widgets.offset + 1}"/>
+ <fmt:param value="${widgets.offset +
fn:length(widgets.resultSet)}"/>
+ <fmt:param value="${widgets.totalResults}"/>
+ <fmt:param><c:out value="${searchTerm}"/></fmt:param>
+ </fmt:message>
+ </c:otherwise>
+ </c:choose>
+ <h2>${listheader}</h2>
+ <%--@elvariable id="widgets"
type="org.apache.rave.portal.model.util.SearchResult"--%>
+ <c:if test="${widgets.totalResults gt 0}">
+ <c:if test="${widgets.numberOfPages gt 1}">
+ <div>
+ <ul class="pagination">
+ <c:forEach var="i" begin="1"
end="${widgets.numberOfPages}">
+ <c:url var="pageUrl" value="">
+ <c:param name="referringPageId"
value="${referringPageId}"/>
+ <c:param name="searchTerm"
value="${searchTerm}"/>
+ <c:param name="offset" value="${(i - 1) *
widgets.pageSize}"/>
+ </c:url>
+ <c:choose>
+ <c:when test="${i eq widgets.currentPage}">
+ <li class="active"><a
href="#">${i}</a></li>
+ </c:when>
+ <c:otherwise>
+ <li><a href="<c:out
value="${pageUrl}"/>">${i}</a></li>
+ </c:otherwise>
+ </c:choose>
+
+ </c:forEach>
+ </ul>
+ </div>
+
+ </c:if>
+ <ul class="storeItems">
+ <%--@elvariable id="widget"
type="org.apache.rave.portal.model.Widget"--%>
+ <c:forEach var="widget" items="${widgets.resultSet}">
+ <%--@elvariable id="widgetsStatistics"
type="org.apache.rave.portal.model.util.WidgetStatistics"--%>
+ <c:set var="widgetStatistics"
value="${widgetsStatistics[widget.entityId]}"/>
<c:choose>
- <c:when test="${i eq widgets.currentPage}">
- <li class="active"><a href="#">${i}</a></li>
+ <c:when test='${widget.featured == "true"}'>
+ <li class="storeItem storeItemFeatured">
</c:when>
<c:otherwise>
- <li><a href="<c:out
value="${pageUrl}"/>">${i}</a></li>
+ <li class="storeItem">
</c:otherwise>
</c:choose>
- </c:forEach>
- </ul>
- </div>
-
- </c:if>
- <ul class="storeItems">
- <%--@elvariable id="widget"
type="org.apache.rave.portal.model.Widget"--%>
- <c:forEach var="widget" items="${widgets.resultSet}">
- <%--@elvariable id="widgetsStatistics"
type="org.apache.rave.portal.model.util.WidgetStatistics"--%>
- <c:set var="widgetStatistics"
value="${widgetsStatistics[widget.entityId]}"/>
- <c:choose>
- <c:when test='${widget.featured == "true"}'>
- <li class="storeItem storeItemFeatured">
- </c:when>
- <c:otherwise>
- <li class="storeItem">
- </c:otherwise>
- </c:choose>
-
- <div class="storeItemLeft">
- <c:if test="${not empty widget.thumbnailUrl}">
- <img class="storeWidgetThumbnail"
src="${widget.thumbnailUrl}"
- title="<c:out value="${widget.title}"/>" alt=""
- width="120" height="60"/>
- </c:if>
-
- <div id="widgetAdded_${widget.entityId}" class="storeButton">
- <button class="btn btn-small btn-primary"
id="addWidget_${widget.entityId}"
- onclick="rave.api.rpc.addWidgetToPage({widgetId:
${widget.entityId}, pageId: ${referringPageId}, buttonId: this.id});">
- <fmt:message key="page.widget.addToPage"/>
- </button>
- </div>
-
- </div>
+ <div class="storeItemLeft">
+ <c:if test="${not empty widget.thumbnailUrl}">
+ <img class="storeWidgetThumbnail"
src="${widget.thumbnailUrl}"
+ title="<c:out value="${widget.title}"/>"
alt=""
+ width="120" height="60"/>
+ </c:if>
+
+ <div id="widgetAdded_${widget.entityId}"
class="storeButton">
+ <button class="btn btn-small btn-primary"
id="addWidget_${widget.entityId}"
+
onclick="rave.api.rpc.addWidgetToPage({widgetId: ${widget.entityId}, pageId:
${referringPageId}, buttonId: this.id});">
+ <fmt:message key="page.widget.addToPage"/>
+ </button>
+ </div>
- <div class="storeItemCenter">
-
- <a id="widget-${widget.entityId}-title"
- class="secondaryPageItemTitle"
- href="<spring:url
value="/app/store/widget/${widget.entityId}"
/>?referringPageId=${referringPageId}">
- <c:out value="${widget.title}"/>
- </a>
- <c:if test="${widget.disableRendering}">
- <div class="storeWidgetDisabled">
- <span class="widget-disabled-icon-store
ui-icon ui-icon-alert"
- title="<fmt:message
key="widget.chrome.disabled"/>"></span>
- <c:out value="${widget.disableRenderingMessage}"
escapeXml="true"/>
</div>
- </c:if>
- <c:if test="${not empty widget.author}">
- <div class="storeWidgetAuthor"><fmt:message
key="widget.author"/>: <c:out
- value="${widget.author}"/></div>
- </c:if>
- <c:if test="${not empty widget.description}">
- <div class="storeWidgetDesc"><c:out
- value="${fn:substring(widget.description, 0,
200)}..."/></div>
- </c:if>
- <div class="widgetRating">
- <fmt:message key="page.widget.rate"/>
-
- <div id="rating-${widget.entityId}" class="ratingButtons">
- <form>
- <input type="hidden" id="rate-${widget.entityId}"
value="${widgetsStatistics[widget.entityId]!=null?widgetsStatistics[widget.entityId].userRating:"-1"}">
- </form>
- <input type="radio" id="like-${widget.entityId}"
class="widgetLikeButton"
-
name="rating-${widget.entityId}"${widgetsStatistics[widget.entityId].userRating==10?"
checked='true'":""}>
- <label for="like-${widget.entityId}"></label>
- <input type="radio" id="dislike-${widget.entityId}"
class="widgetDislikeButton"
-
name="rating-${widget.entityId}"${widgetsStatistics[widget.entityId].userRating==0?"
checked='true'":""}>
- <label for="dislike-${widget.entityId}"> </label>
-
- <!-- Displaying the likes and dislikes rating along
with total votes -->
+ <div class="storeItemCenter">
+ <a id="widget-${widget.entityId}-title"
+ class="secondaryPageItemTitle"
+ href="<spring:url
value="/app/store/widget/${widget.entityId}"
/>?referringPageId=${referringPageId}">
+ <c:out value="${widget.title}"/>
+ </a>
+ <c:if test="${widget.disableRendering}">
+ <div class="storeWidgetDisabled">
+ <span
class="widget-disabled-icon-store ui-icon ui-icon-alert"
+ title="<fmt:message
key="widget.chrome.disabled"/>"></span>
+ <c:out
value="${widget.disableRenderingMessage}" escapeXml="true"/>
+ </div>
+ </c:if>
+ <c:if test="${not empty widget.author}">
+ <div class="storeWidgetAuthor"><fmt:message
key="widget.author"/>: <c:out
+ value="${widget.author}"/></div>
+ </c:if>
+ <c:if test="${not empty widget.description}">
+ <div class="storeWidgetDesc"><c:out
+ value="${fn:substring(widget.description,
0, 200)}..."/></div>
+ </c:if>
+ <div class="widgetRating">
+ <fmt:message key="page.widget.rate"/>
+ <form class="hidden">
+ <input type="hidden"
id="rate-${widget.entityId}"
+
value="${widgetsStatistics[widget.entityId]!=null?widgetsStatistics[widget.entityId].userRating:"-1"}">
+ </form>
+ <div id="rating-${widget.entityId}"
class="ratingButtons btn-group" data-toggle="buttons-radio">
+ <button id="like-${widget.entityId}"
class="widgetLikeButton btn btn-small
${widgetsStatistics[widget.entityId].userRating==10? 'active btn-success':''}"
+
${widgetsStatistics[widget.entityId].userRating==10 ? " checked='true'":""}
+ name="rating-${widget.entityId}"><i
class="icon-plus"></i></button>
+ <button id="dislike-${widget.entityId}"
class="widgetDislikeButton btn btn-small
${widgetsStatistics[widget.entityId].userRating==0? 'active btn-danger':''}"
+
${widgetsStatistics[widget.entityId].userRating==0 ? " checked='true'":""}
+ name="rating-${widget.entityId}"><i
class="icon-minus"></i></button>
+ <!-- Displaying the likes and dislikes rating
along with total votes -->
+ </div>
+ </div>
+ <c:if test="${not empty widget.tags}">
+ <table class="widgetTags">
+ <tr>
+ <td>
+ <fmt:message
key="page.widget.tags.title"/>
+ </td>
+ <c:forEach var="tag"
items="${widget.tags}">
+ <td class="storeWidgetDesc"><c:out
value="${tag.tag.keyword}"/></td>
+ </c:forEach>
+ </tr>
+ </table>
+ </c:if>
+ <c:if test="${not empty widget.categories}">
+ <table class="widgetCategories">
+ <tr>
+ <td>
+ <fmt:message key="widget.categories"/>
+ </td>
+ <c:forEach var="category"
items="${widget.categories}">
+ <td class="storeWidgetDesc"><c:out
value="${category.text}"/></td>
+ </c:forEach>
+ </tr>
+ </table>
+ </c:if>
+ <span class="widgetLikeCount">
+ <c:set var="widgetLikes">
+
${widgetsStatistics[widget.entityId]!=null?widgetsStatistics[widget.entityId].totalLike:"0"}
+ </c:set>
+ <span><fmt:message
key="page.widget.rate.likes"/></span>
+ <span id="totalLikes-${widget.entityId}"
data-rave-widget-likes="${widgetLikes}">
+ ${widgetLikes}
+ </span>
+ </span>
+ <span class="widgetDislikeCount">
+ <c:set var="widgetDislikes">
+
${widgetsStatistics[widget.entityId]!=null?widgetsStatistics[widget.entityId].totalDislike:"0"}
+ </c:set>
+ <span><fmt:message
key="page.widget.rate.dislikes"/></span>
+ <span id="totalDislikes-${widget.entityId}"
data-rave-widget-dislikes="${widgetDislikes}">
+ ${widgetDislikes}
+ </span>
+ </span>
+
+ <span class="widgetUserCount">
+ <c:set var="widgetUserCountGreaterThanZero"
+ value="${widgetStatistics != null &&
widgetStatistics.totalUserCount > 0}"/>
+ <c:if test="${widgetUserCountGreaterThanZero}">
+ <a href="javascript:void(0);"
onclick="rave.displayUsersOfWidget(${widget.entityId});">
+ </c:if>
+ <fmt:formatNumber groupingUsed="true"
+
value="${widgetStatistics!=null?widgetStatistics.totalUserCount:0}"/> <fmt:message
key="page.widget.usercount"/>
+ <c:if
test="${widgetUserCountGreaterThanZero}"></a></c:if>
+ </span>
</div>
- </div>
- <c:if test="${not empty widget.tags}">
- <table class="widgetTags">
- <tr>
- <td>
- <fmt:message key="page.widget.tags.title"/>
- </td>
- <c:forEach var="tag" items="${widget.tags}">
- <td class="storeWidgetDesc"><c:out
value="${tag.tag.keyword}"/></td>
- </c:forEach>
- </tr>
- </table>
- </c:if>
- <c:if test="${not empty widget.categories}">
- <table class="widgetCategories">
- <tr>
- <td>
- <fmt:message key="widget.categories"/>
- </td>
- <c:forEach var="category"
items="${widget.categories}">
- <td class="storeWidgetDesc"><c:out
value="${category.text}"/></td>
- </c:forEach>
- </tr>
- </table>
- </c:if>
- <ul class="horizontal-list">
- <!-- display total likes -->
- <li>
- <c:set var="widgetLikes">
-
${widgetsStatistics[widget.entityId]!=null?widgetsStatistics[widget.entityId].totalLike:"0"}
- </c:set>
- <fmt:message key="page.widget.rate.likes"/><label
id="totalLikes-${widget.entityId}"
-
data-rave-widget-likes="${widgetLikes}">${widgetLikes}</label>
- </li>
- <!-- display total dislikes -->
- <li>
- <c:set var="widgetDislikes">
-
${widgetsStatistics[widget.entityId]!=null?widgetsStatistics[widget.entityId].totalDislike:"0"}
- </c:set>
- <fmt:message key="page.widget.rate.dislikes"/><label
- id="totalDislikes-${widget.entityId}"
-
data-rave-widget-dislikes="${widgetDislikes}">${widgetDislikes}</label>
- </li>
- <li class="widgetUserCount">
- <c:set var="widgetUserCountGreaterThanZero"
- value="${widgetStatistics != null &&
widgetStatistics.totalUserCount > 0}"/>
- <c:if test="${widgetUserCountGreaterThanZero}"><a
href="javascript:void(0);"
-
onclick="rave.displayUsersOfWidget(${widget.entityId});"></c:if>
- <fmt:formatNumber groupingUsed="true"
-
value="${widgetStatistics!=null?widgetStatistics.totalUserCount:0}"/> <fmt:message
- key="page.widget.usercount"/>
- <c:if
test="${widgetUserCountGreaterThanZero}"></a></c:if>
- </li>
- </ul>
- </div>
-
- <div class="clear-float"></div>
- </li>
- </c:forEach>
- </ul>
-
- <c:if test="${widgets.numberOfPages gt 1}">
-
- <div >
- <ul class="pagination">
- <c:forEach var="i" begin="1" end="${widgets.numberOfPages}">
- <c:url var="pageUrl" value="">
- <c:param name="referringPageId"
value="${referringPageId}"/>
- <c:param name="searchTerm" value="${searchTerm}"/>
- <c:param name="offset" value="${(i - 1) *
widgets.pageSize}"/>
- </c:url>
-
-
- <c:choose>
- <c:when test="${i eq widgets.currentPage}">
- <li class="active"><a href="#">${i}</a></li>
- </c:when>
- <c:otherwise>
- <li > <a href="<c:out
value="${pageUrl}"/>">${i}</a></li>
- </c:otherwise>
- </c:choose>
+ <div class="clear-float"></div>
+ </li>
</c:forEach>
</ul>
- </div>
-
- </c:if>
-</c:if>
-</section>
-<section class="span5">
- <form class="form-horizontal" action="<c:url value="/app/store/search"/>"
method="GET">
- <fieldset>
- <input type="hidden" name="referringPageId"
value="${referringPageId}">
- <legend><fmt:message key="page.store.search"/></legend>
- <div class="control-group">
- <input class="search-query" type="search" id="searchTerm"
name="searchTerm" value="<c:out value="${searchTerm}"/>"/>
- <fmt:message key="page.store.search.button"
var="searchButtonText"/>
- <button class="btn btn-primary" type="submit"
value="${searchButtonText}">${searchButtonText}</button>
- </div>
- <c:if test="${not empty searchTerm}">
- <div class="control-group">
-
- <a class="btn btn-warning" href="<spring:url
value="/app/store?referringPageId=${referringPageId}"/>">
- <fmt:message key="admin.clearsearch"/></a>
- </div>
- </c:if>
- <c:if test="${not empty tags}">
- <div class="control-group">
- <fmt:message key="page.store.list.widgets.tag"/>
- <select name="tagList" id="tagList"
style="min-width:100px">
- <option value=" "></option>
- <c:forEach var="tag" items="${tags}">
+ <c:if test="${widgets.numberOfPages gt 1}">
+ <div >
+ <ul class="pagination">
+ <c:forEach var="i" begin="1"
end="${widgets.numberOfPages}">
+ <c:url var="pageUrl" value="">
+ <c:param name="referringPageId"
value="${referringPageId}"/>
+ <c:param name="searchTerm"
value="${searchTerm}"/>
+ <c:param name="offset" value="${(i - 1) *
widgets.pageSize}"/>
+ </c:url>
<c:choose>
- <c:when test="${selectedTag==tag.keyword}">
- <option selected>
+ <c:when test="${i eq widgets.currentPage}">
+ <li class="active"><a
href="#">${i}</a></li>
</c:when>
<c:otherwise>
- <option>
+ <li> <a href="<c:out
value="${pageUrl}"/>">${i}</a></li>
</c:otherwise>
</c:choose>
- <c:out value="${tag.keyword}"/>
- </option>
</c:forEach>
- </select>
+ </ul>
</div>
- </c:if>
- <c:if test="${not empty categories}">
- <div class="control-group">
- <label cssClass="control-label"
for="categoryList"><fmt:message key="page.store.list.widgets.category"/></label>
- <select name="categoryList" id="categoryList"
style="min-width:100px">
- <option value="0"></option>
- <c:forEach var="category" items="${categories}">
- <c:choose>
- <c:when
test="${selectedCategory==category.entityId}">
- <option value="${category.entityId}"
selected>
- </c:when>
- <c:otherwise>
- <option value="${category.entityId}">
- </c:otherwise>
- </c:choose>
- <c:out value="${category.text}"/>
- </option>
- </c:forEach>
- </select>
- </div>
</c:if>
- </fieldset>
- </form>
-
- <a class="btn btn-info" href="<spring:url
value="/app/store/mine?referringPageId=${referringPageId}"/>"><fmt:message
key="page.store.list.widgets.mine"/></a>
-
- <a class="btn btn-info" href="<spring:url
value="/app/store?referringPageId=${referringPageId}"/>"><fmt:message
key="page.store.list.widgets.all"/></a>
-
-</section>
-
+ </c:if>
+ </section>
+ <section class="span4">
+ <form class="form-horizontal" action="<c:url
value="/app/store/search"/>" method="GET">
+ <fieldset>
+ <input type="hidden" name="referringPageId"
value="${referringPageId}">
+ <legend><fmt:message key="page.store.search"/></legend>
+ <div class="control-group">
+ <input class="search-query" type="search"
id="searchTerm" name="searchTerm" value="<c:out value="${searchTerm}"/>"/>
+ <fmt:message key="page.store.search.button"
var="searchButtonText"/>
+ <button class="btn btn-primary" type="submit"
value="${searchButtonText}">${searchButtonText}</button>
+ </div>
+ <c:if test="${not empty searchTerm}">
+ <div class="control-group">
+ <a class="btn btn-warning" href="<spring:url
value="/app/store?referringPageId=${referringPageId}"/>"><fmt:message
key="admin.clearsearch"/></a>
+ </div>
+ </c:if>
+ <c:if test="${not empty tags}">
+ <div class="control-group">
+ <fmt:message key="page.store.list.widgets.tag"/>
+ <select name="tagList" id="tagList"
style="min-width:100px">
+ <option value=" "></option>
+ <c:forEach var="tag" items="${tags}">
+ <c:choose>
+ <c:when
test="${selectedTag==tag.keyword}">
+ <option selected>
+ </c:when>
+ <c:otherwise>
+ <option>
+ </c:otherwise>
+ </c:choose>
+ <c:out value="${tag.keyword}"/>
+ </option>
+ </c:forEach>
+ </select>
+ </div>
+ </c:if>
+
+ <c:if test="${not empty categories}">
+ <div class="control-group">
+ <label cssClass="control-label"
for="categoryList"><fmt:message key="page.store.list.widgets.category"/></label>
+ <select name="categoryList" id="categoryList"
style="min-width:100px">
+ <option value="0"></option>
+ <c:forEach var="category"
items="${categories}">
+ <c:choose>
+ <c:when
test="${selectedCategory==category.entityId}">
+ <option
value="${category.entityId}" selected>
+ </c:when>
+ <c:otherwise>
+ <option
value="${category.entityId}">
+ </c:otherwise>
+ </c:choose>
+ <c:out value="${category.text}"/>
+ </option>
+ </c:forEach>
+ </select>
+ </div>
+ </c:if>
+ </fieldset>
+ </form>
+ <a class="btn btn-info" href="<spring:url
value="/app/store/mine?referringPageId=${referringPageId}"/>"><fmt:message
key="page.store.list.widgets.mine"/></a>
+ <a class="btn btn-info" href="<spring:url
value="/app/store?referringPageId=${referringPageId}"/>"><fmt:message
key="page.store.list.widgets.all"/></a>
+ </section>
+ </div>
</div>
<portal:register-init-script location="${'AFTER_RAVE'}">
Modified:
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/css/default.css
URL:
http://svn.apache.org/viewvc/rave/branches/bootstrap/rave-portal-resources/src/main/webapp/css/default.css?rev=1326701&r1=1326700&r2=1326701&view=diff
==============================================================================
---
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/css/default.css
(original)
+++
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/css/default.css
Mon Apr 16 17:57:36 2012
@@ -545,6 +545,14 @@ ul.storeItems li {
margin: 1em 0;
}
+.widgetDislikeCount {
+ padding: 0 10px;
+}
+
+.widgetUserCount {
+ float: right;
+}
+
.secondaryPageItemTitle {
font-size: 1.2em;
}
Modified:
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/script/rave_store.js
URL:
http://svn.apache.org/viewvc/rave/branches/bootstrap/rave-portal-resources/src/main/webapp/script/rave_store.js?rev=1326701&r1=1326700&r2=1326701&view=diff
==============================================================================
---
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/script/rave_store.js
(original)
+++
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/script/rave_store.js
Mon Apr 16 17:57:36 2012
@@ -18,87 +18,84 @@
*/
var rave = rave || {};
rave.store = rave.store || (function() {
-
+
function initRatings() {
- $(".ratingButtons").buttonset();
+ $('.ratingButtons').button();
+ $('.widgetLikeButton').click(function() {
+ // If not already active
+ if (!$(this).hasClass('active')){
+ //retrieve widget id
+ var widgetId = this.id.substring("like-".length);
- $(".widgetLikeButton").button( {
- icons: {primary: "ui-icon-plus"}
- }).click(function() {
-
- //check if like radio button is not checked already
- if(this.getAttribute("checked") != "true") {
-
- //retrieve widget id
- var widgetId = this.id.substring("like-".length);
-
- //update the widget score in database
+ //update the widget score in database
rave.api.rest.updateWidgetRating({widgetId: widgetId,
score: 10});
-
- //call update widget rating handler function
- var widgetRating = {
- widgetId: widgetId,
- widgetLikeButton: this,
- widgetDislikeButton:
$("#dislike-"+widgetId),
- isLike: true
- };
-
- //update the widget ratings on web page
- rave.api.handler.widgetRatingHandler(widgetRating);
-
- }
+
+ //call update widget rating handler function
+ var widgetRating = {
+ widgetId: widgetId,
+ widgetLikeButton: this,
+ widgetDislikeButton: $("#dislike-" + widgetId),
+ isLike: true
+ };
+
+ //update the widget ratings on web page
+ rave.api.handler.widgetRatingHandler(widgetRating);
+
+ $(this).addClass('btn-success');
+ $(this).siblings('.btn').removeClass('btn-danger');
+ }
});
- $(".widgetDislikeButton").button( {
- icons: {primary: "ui-icon-minus"}
- }).click(function() {
-
- //check if dislike radio button is not checked already
- if(this.getAttribute("checked") != "true") {
-
- //retrieve widget id
- var widgetId = this.id.substring("dislike-".length);
-
- //update the widget score in database
- rave.api.rest.updateWidgetRating({widgetId: widgetId,
score: 0});
-
- //call update widget rating handler function
- var widgetRating = {
- widgetId: widgetId,
- widgetLikeButton:
$("#like-"+widgetId),
- widgetDislikeButton: this,
- isLike: false
- };
-
- //update the widget ratings on web page
- rave.api.handler.widgetRatingHandler(widgetRating);
- }
+ $('.widgetDislikeButton').click(function() {
+ // If not already active
+ if (!$(this).hasClass('active')){
+ //retrieve widget id
+ var widgetId = this.id.substring("dislike-".length);
+
+ //update the widget score in database
+ rave.api.rest.updateWidgetRating({widgetId: widgetId, score:
0});
+
+ //call update widget rating handler function
+ var widgetRating = {
+ widgetId: widgetId,
+ widgetLikeButton: $("#like-" + widgetId),
+ widgetDislikeButton: this,
+ isLike: false
+ };
+
+ //update the widget ratings on web page
+ rave.api.handler.widgetRatingHandler(widgetRating);
+
+ $(this).addClass('btn-danger');
+ $(this).siblings('.btn').removeClass('btn-success');
+
+ }
});
}
-
+
function initComments() {
-
+
$(".commentNewButton").button( {
icons: {primary: "ui-icon-disk"},
text: false
}).click(function() {
var widgetId = this.id.substring("comment-new-".length);
- rave.api.rest.createWidgetComment({widgetId: widgetId,
+ rave.api.rest.createWidgetComment({widgetId: widgetId,
text:
$("#newComment-"+widgetId).get(0).value,
successCallback: function() {
window.location.reload(); }});
});
-
+
$(".commentDeleteButton").button( {
icons: {primary: "ui-icon-close"},
text: false
}).click(function() {
var commentId = this.id.substring("comment-delete-".length);
var widgetId = this.getAttribute('data-widgetid');
- rave.api.rest.deleteWidgetComment({widgetId: widgetId,
+ rave.api.rest.deleteWidgetComment({widgetId: widgetId,
commentId: commentId,
successCallback: function() {
window.location.reload(); }});
});
-
+
$(".commentEditButton").button( {
icons: {primary: "ui-icon-pencil"},
text: false
@@ -197,5 +194,5 @@ rave.store = rave.store || (function() {
init: init,
initTags: initTags
};
-
-}());
\ No newline at end of file
+
+}());