Skip to content
Browse files

Manage default view in project

  • Loading branch information...
1 parent 2f63d6f commit 0bd36f33190dd4d74a168b8fdaf210d8c828ce9e @vbarrier vbarrier committed May 6, 2012
View
6 grails-app/controllers/org/icescrum/web/presentation/security/LoginController.groovy
@@ -55,8 +55,6 @@ class LoginController {
*/
def grailsApplication
- def menuBarSupport
-
/**
* Default action; redirects to 'defaultTargetUrl' if logged in, /username/auth otherwise.
*/
@@ -181,9 +179,7 @@ class LoginController {
def ajaxSuccess = {
User u = (User)springSecurityService.currentUser
if (u.preferences.lastProductOpened){
- def firstMenu = u.preferences.menu.find{ it.value == '1' }?.key
- def url = grailsApplication.config.grails.serverURL+'/p/'+u.preferences.lastProductOpened+'#'
- url = firstMenu && menuBarSupport.permissionDynamicBar(url+firstMenu) ? (url + firstMenu) : url+'project'
+ def url = grailsApplication.config.grails.serverURL+'/p/'+u.preferences.lastProductOpened
render(status:200, contentType: 'application/json', text:[url:url] as JSON)
}else{
render(status:200, text:'')
View
2 grails-app/views/scrumOS/_navigation.gsp
@@ -168,7 +168,7 @@
<g:if test="${productFilteredsList}">
<g:each var="curProduct" in="${productFilteredsList}">
<li id='product-${curProduct.id}' class="projects ${(curProduct.owner.id == user?.id) ? 'owner' : ''}"><g:link class="${(product?.id == curProduct.id) ? 'active' : ''}" controller="scrumOS"
- fragment="project" params="[product:curProduct.pkey]"
+ params="[product:curProduct.pkey]"
onClick="${(product?.id == curProduct.id) ? is.notice(text:g.message(code:'is.ui.alreadyOpen', args:[g.message(code:'is.product')]))+'return false;' : ''}">
<is:truncated encodedHTML="true" size="25">${curProduct.name.encodeAsHTML()}</is:truncated>
</g:link>
View
25 web-app/js/icescrum/jquery.icescrum.js
@@ -61,14 +61,6 @@ var autoCompleteCache = {}, autoCompleteLastXhr;
}
this.o = jQuery.extend({}, this.defaults, icescrum);
- if (this.o.widgetsList.length > 0) {
- var tmp = this.o.widgetsList;
- this.o.widgetsList = [];
- for (i = 0; i < tmp.length; i++) {
- this.addToWidgetBar(tmp[i]);
- }
- }
-
$.datepicker.setDefaults($.datepicker.regional[this.o.locale]);
if (!$.getUrlVar('ref')){
var url = location.hash.replace(/^.*#/, '');
@@ -78,6 +70,23 @@ var autoCompleteCache = {}, autoCompleteLastXhr;
}
$.icescrum.initHistory();
+ var currentWindow = location.hash.replace(/^.*#/, '');
+ if ($.icescrum.o.baseUrlProduct && !currentWindow && $('li.menubar:first a')){
+ var window = $('li.menubar:first a').attr('href').replace(/^.*#/, '');
+ document.location.hash = window;
+ this.o.widgetsList = $.grep($.icescrum.o.widgetsList, function(value) {
+ return value != window;
+ });
+ }
+
+ if (this.o.widgetsList.length > 0) {
+ var tmp = this.o.widgetsList;
+ this.o.widgetsList = [];
+ for (i = 0; i < tmp.length; i++) {
+ this.addToWidgetBar(tmp[i]);
+ }
+ }
+
if (this.o.push.enable){
$.icescrum.listenServer();
}

0 comments on commit 0bd36f3

Please sign in to comment.
Something went wrong with that request. Please try again.