You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by mf...@apache.org on 2012/04/20 23:07:50 UTC
svn commit: r1328500 - in
/rave/branches/bootstrap/rave-portal-resources/src/main/webapp:
WEB-INF/jsp/layouts/person_profile.jsp WEB-INF/jsp/views/personProfile.jsp
script/rave_person_profile.js
Author: mfranklin
Date: Fri Apr 20 21:07:49 2012
New Revision: 1328500
URL: http://svn.apache.org/viewvc?rev=1328500&view=rev
Log:
Updated modernizer location to follow pattern of similar script includes (RAVE-477)
Modified:
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/person_profile.jsp
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp
rave/branches/bootstrap/rave-portal-resources/src/main/webapp/script/rave_person_profile.js
Modified: rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/person_profile.jsp
URL: http://svn.apache.org/viewvc/rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/person_profile.jsp?rev=1328500&r1=1328499&r2=1328500&view=diff
==============================================================================
--- rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/person_profile.jsp (original)
+++ rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/person_profile.jsp Fri Apr 20 21:07:49 2012
@@ -17,20 +17,22 @@
specific language governing permissions and limitations
under the License.
--%>
-<div id="personProfileSubPages">
- <ul>
+<div class="row-fluid" id="personProfileSubPages">
+ <ul class="nav nav-tabs outlined">
<!-- first render the tabs -->
<c:forEach var="subPage" items="${page.subPages}" varStatus="subPageStatus">
- <li><a href="#subpage-${subPage.entityId}"><c:out value="${subPage.name}"/></a></li>
+ <li><a href="#tab-${subPage.entityId}" data-toggle="tab"><c:out value="${subPage.name}"/></a></li>
</c:forEach>
</ul>
<!-- now render the sub page bodies -->
+ <div class="tab-content outlined">
<c:forEach var="subPage" items="${page.subPages}" varStatus="subPageStatus">
- <div id="subpage-${subPage.entityId}">
+ <div class="tab-pane" id="tab-${subPage.entityId}">
<c:forEach var="subPageRegion" items="${subPage.regions}" varStatus="subPageRegionStatus">
<rave:region region="${subPageRegion}" regionIdx="${subPageRegionStatus.count}" />
</c:forEach>
<div class="clear-float"> </div>
</div>
</c:forEach>
+ </div>
</div>
\ No newline at end of file
Modified: rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp
URL: http://svn.apache.org/viewvc/rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp?rev=1328500&r1=1328499&r2=1328500&view=diff
==============================================================================
--- rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp (original)
+++ rave/branches/bootstrap/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp Fri Apr 20 21:07:49 2012
@@ -41,7 +41,6 @@
<!-- get the title of contact information -->
<fmt:message key="page.personProfile.contact.info" var="contactInfo"/>
-
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
@@ -50,7 +49,16 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
- <span class="brand">${pageTitle}</span>
+ <span class="brand">
+ <fmt:message key="page.home.welcome">
+ <fmt:param>
+ <c:choose>
+ <c:when test="${not empty page.owner.displayName}"><c:out value="${page.owner.displayName}"/></c:when>
+ <c:otherwise><c:out value="${page.owner.username}"/></c:otherwise>
+ </c:choose>
+ </fmt:param>
+ </fmt:message>
+ </span>
<div class="nav-collapse">
<ul class="nav pull-right">
<li>
@@ -81,85 +89,102 @@
</div>
</div>
-<div id="person-profile-left">
- <div id="personProfileContent">
- <form:form id="editAccountForm" commandName="userProfile" action="person?referringPageId=${referringPageId}" method="POST">
- <!-- Display personal information of user-->
- <h2><fmt:message key="page.profile.personal.info" /></h2>
- <fieldset>
- <p>
- <label for="givenNameField"><fmt:message key="page.profile.first.name"/></label>
- <label id="givenName" class="profile-info-visible"><c:out value="${userProfile.givenName}"/></label>
- <form:input id="givenNameField" path="givenName" class="profile-info-hidden" value="${userProfile.givenName}" />
- </p>
- <br>
- <p>
- <label for="familyNameField"><fmt:message key="page.profile.last.name"/></label>
- <label id="familyName" class="profile-info-visible"><c:out value="${userProfile.familyName}"/></label>
- <form:input id="familyNameField" path="familyName" class="profile-info-hidden" value="${userProfile.familyName}"/>
- </p>
- <p>
- <label for="displayNameField" class="profile-info-hidden"><fmt:message key="page.profile.display.name"/></label>
- <form:input id="displayNameField" path="displayName" class="profile-info-hidden" value="${userProfile.displayName}"/>
- </p>
- </fieldset>
-
- <!-- Display basic information of user -->
- <h2><fmt:message key="page.profile.basic.info" /></h2>
- <fieldset>
- <p>
- <label for="aboutMeField"><fmt:message key="page.profile.about.me"/></label>
- <label id="aboutMe" class="profile-info-visible"><c:out value=" ${userProfile.aboutMe}"/></label>
- <form:textarea id="aboutMeField" path="aboutMe" class="profile-info-hidden" value="${userProfile.aboutMe}" />
- </p>
- <br>
- <p>
- <label for="statusField"><fmt:message key="page.profile.status"/></label>
- <label id="status" class="profile-info-visible"><c:out value=" ${userProfile.status}"/></label>
- <form:input id="statusField" path="status" class="profile-info-hidden" value="${userProfile.status}" />
- </p>
- </fieldset>
-
- <!-- Display contact information of user -->
- <h2><fmt:message key="page.profile.contact.info" /></h2>
- <fieldset>
- <p>
- <label for="emailField"><fmt:message key="page.profile.email"/></label>
- <label id="email" class="profile-info-visible"><c:out value=" ${userProfile.email}"/></label>
- <form:input id="emailField" path="email" class="profile-info-hidden" value="${userProfile.email}" />
- </p>
- </fieldset>
- <%-- only display the edit profile button if the current logged in user matches the profile being viewed --%>
- <c:set var="currentUsername"><sec:authentication property="principal.username" htmlEscape="false" /></c:set>
- <c:if test="${currentUsername == userProfile.username}">
- <fieldset>
- <p>
- <input type="hidden" id="profileInfo" value="profile-info" />
- <button type="button" id="profileEdit" class="profile-info-visible"><fmt:message key="page.profile.edit"/></button>
- <fmt:message key="page.profile.save" var="save"/>
- <input type="submit" class="profile-info-hidden" value="${save}"/>
- <button type="button" class="profile-info-hidden" id="cancelEdit"><fmt:message key="page.profile.cancel"/></button>
- </p>
- </fieldset>
- </c:if>
- </form:form>
- </div>
+<div class="container-fluid navbar-spacer">
+ <div class="row-fluid">
+ <div class="span9">
+ <div id="personProfileContent" class="row-fluid">
+ <form:form id="editAccountForm" commandName="userProfile" action="person?referringPageId=${referringPageId}" method="POST">
+ <!-- Display personal information of user-->
+ <h2><fmt:message key="page.profile.personal.info" /></h2>
+ <fieldset>
+ <div class="span12">
+ <p>
+ <label for="givenNameField"><fmt:message key="page.profile.first.name"/></label>
+ <label id="givenName" class="profile-info-visible"><c:out value="${userProfile.givenName}"/></label>
+ <form:input id="givenNameField" path="givenName" class="profile-info-hidden" value="${userProfile.givenName}" />
+ </p>
+ </div>
+ <div class="span12">
+ <p>
+ <label for="familyNameField"><fmt:message key="page.profile.last.name"/></label>
+ <label id="familyName" class="profile-info-visible"><c:out value="${userProfile.familyName}"/></label>
+ <form:input id="familyNameField" path="familyName" class="profile-info-hidden" value="${userProfile.familyName}"/>
+ </p>
+ </div>
+ <div class="span12">
+ <p>
+ <label for="displayNameField" class="profile-info-hidden"><fmt:message key="page.profile.display.name"/></label>
+ <form:input id="displayNameField" path="displayName" class="profile-info-hidden" value="${userProfile.displayName}"/>
+ </p>
+ </div>
+ </fieldset>
+
+ <!-- Display basic information of user -->
+ <h2><fmt:message key="page.profile.basic.info" /></h2>
+ <fieldset>
+ <div class="span12">
+ <p>
+ <label for="aboutMeField"><fmt:message key="page.profile.about.me"/></label>
+ <label id="aboutMe" class="profile-info-visible"><c:out value=" ${userProfile.aboutMe}"/></label>
+ <form:textarea id="aboutMeField" path="aboutMe" class="profile-info-hidden" value="${userProfile.aboutMe}" />
+ </p>
+ </div>
+ <div class="span12">
+ <p>
+ <label for="statusField"><fmt:message key="page.profile.status"/></label>
+ <label id="status" class="profile-info-visible"><c:out value=" ${userProfile.status}"/></label>
+ <form:input id="statusField" path="status" class="profile-info-hidden" value="${userProfile.status}" />
+ </p>
+ </div>
+ </fieldset>
+
+ <!-- Display contact information of user -->
+ <h2><fmt:message key="page.profile.contact.info" /></h2>
+ <fieldset>
+ <div class="span12">
+ <p>
+ <label for="emailField"><fmt:message key="page.profile.email"/></label>
+ <label id="email" class="profile-info-visible"><c:out value=" ${userProfile.email}"/></label>
+ <form:input id="emailField" path="email" class="profile-info-hidden" value="${userProfile.email}" />
+ </p>
+ </div>
+ </fieldset>
+ <%-- only display the edit profile button if the current logged in user matches the profile being viewed --%>
+ <c:set var="currentUsername"><sec:authentication property="principal.username" htmlEscape="false" /></c:set>
+ <c:if test="${currentUsername == userProfile.username}">
+ <fieldset>
+ <div class="span12">
+ <p>
+ <input type="hidden" id="profileInfo" value="profile-info" />
+ <button type="button" id="profileEdit" class="btn btn-primary profile-info-visible"><fmt:message key="page.profile.edit"/></button>
+ <fmt:message key="page.profile.save" var="save"/>
+ <input type="submit" class="btn btn-primary profile-info-hidden" value="${save}"/>
+ <button type="button" class="btn profile-info-hidden" id="cancelEdit"><fmt:message key="page.profile.cancel"/></button>
+ </p>
+ </div>
+ </fieldset>
+ </c:if>
+ </form:form>
+ </div>
+
+ <%--render the sub pages --%>
+ <div>
- <%--render the sub pages --%>
- <div id="pageContent" class="person-profile-page-content">
- <div class="regions">
- <%-- insert the region layout template --%>
- <tiles:insertTemplate template="${layout}"/>
+ <%-- insert the region layout template --%>
+ <tiles:insertTemplate template="${layout}"/>
+
+ <div class="clear-float"> </div>
+ </div>
</div>
- <div class="clear-float"> </div>
- </div>
-</div>
-<div id="person-profile-right">
- <div>
- <%-- render the person profile parent page region/widgets --%>
- <c:forEach var="region" items="${page.regions}" varStatus="status">
- <rave:region region="${region}" regionIdx="${status.count}" />
- </c:forEach>
+ <div class="span3">
+ <div>
+ <%-- render the person profile parent page region/widgets --%>
+ <c:forEach var="region" items="${page.regions}" varStatus="status">
+ <rave:region region="${region}" regionIdx="${status.count}" />
+ </c:forEach>
+ </div>
+ </div>
+ <div class="clear-float"> </div>
</div>
</div>
<div class="clear-float"> </div>
Modified: rave/branches/bootstrap/rave-portal-resources/src/main/webapp/script/rave_person_profile.js
URL: http://svn.apache.org/viewvc/rave/branches/bootstrap/rave-portal-resources/src/main/webapp/script/rave_person_profile.js?rev=1328500&r1=1328499&r2=1328500&view=diff
==============================================================================
--- rave/branches/bootstrap/rave-portal-resources/src/main/webapp/script/rave_person_profile.js (original)
+++ rave/branches/bootstrap/rave-portal-resources/src/main/webapp/script/rave_person_profile.js Fri Apr 20 21:07:49 2012
@@ -21,31 +21,27 @@ var rave = rave || {};
rave.personprofile = rave.personprofile || (function() {
// map of [subpage id, boolean] tracking whether or not a sub page has been viewed at least once
var subPagesViewedStatus = {};
-
- function initSubPages() {
- // setup the sub page tabs
- $("#personProfileSubPages").tabs({
- select: function(event, ui) {
- // refresh the widgets on the sub page when selected to ensure proper sizing
- var subPageId = ui.panel.id;
- if (subPagesViewedStatus[subPageId] == false) {
- $("#" + subPageId + " .widget-wrapper").each(function(){
- var regionWidget = rave.getRegionWidgetById(rave.getObjectIdFromDomId(this.id));
- regionWidget.restore();
- });
- // mark that this sub page has been viewed at least once and there is no need to refresh
- // the widgets in future views
- subPagesViewedStatus[subPageId] = true;
- }
- }
+ function initSubPages() {
+ //Make first tab active (Twitter Bootstrap)
+ $('.nav-tabs a:first').tab('show');
+ $('#personProfileSubPages a[data-toggle="tab"]').on('shown', function(event, ui) {
+ // refresh the widgets on the sub page when selected to ensure proper sizing
+ var subPageId = $( $(this).attr("href") ).attr("id");
+ if (subPagesViewedStatus[subPageId] == false) {
+ $("#" + subPageId + " .widget-wrapper").each(function(){
+ var regionWidget = rave.getRegionWidgetById(rave.getObjectIdFromDomId(this.id));
+ regionWidget.restore();
+ });
+ // mark that this sub page has been viewed at least once and there is no need to refresh
+ // the widgets in future views
+ subPagesViewedStatus[subPageId] = true;
}
- );
-
+ });
// build the subPageViewedStatus map to track if a given sub page has been viewed yet to determine if we need
// to refresh the widgets upon first viewing to ensure they are sized properly. Set the default active tab to
// true since it will be rendered and sized properly as part of the initial page load
- var activeSubPageId = $("#personProfileSubPages .ui-tabs-panel:not(.ui-tabs-hide)")[0].id;
- $("#personProfileSubPages .ui-tabs-panel").each(function(){
+ var activeSubPageId = $("#personProfileSubPages .tab-pane.active")[0].id;
+ $("#personProfileSubPages .tab-pane").each(function(){
subPagesViewedStatus[this.id] = (this.id == activeSubPageId);
});
}