Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
  • 3 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
View
2  app/views/dashboard/menu.rjs
@@ -54,7 +54,7 @@ page << "Application.rails_environment = '#{ Rails.env }';"
if current_user.is_admin?
menu_config += "{name: 'Admin', items:[
- {name: 'Pending Role Requests', tab: {id: 'pending_role_requests', title:'Pending Role Requests', url:'#{ admin_role_requests_path }'}},
+ {name: 'Pending Role Requests', tab: {id: 'pending_role_requests', title:'Pending Role Requests', url:'#{ admin_role_requests_path }', initializer: 'Talho.PendingRoleRequests'}},
{name: 'Manage Groups', tab: {id: 'manage_groups', title:'Manage Groups', url:'#{ admin_groups_path }', initializer: 'Talho.ManageGroups'}},
{name: 'Manage Users', items: [
{name: 'Add a User', tab: {id: 'add_new_user', title:'Add A User', url:'#{ new_admin_user_path }', initializer: 'Talho.AddUser'}},
View
16 config/initializers/delayed_job_override.rb
@@ -0,0 +1,16 @@
+require 'dispatcher'
+
+module DelayedJobOverride
+ module Object
+ def send_later(*args)
+ self.send(*args)
+ end
+ end
+
+ Dispatcher.to_prepare do
+ if Rails.env == "development" && ENV["DELAYED_JOB_OVERRIDE"]
+ ::Object.send(:include, DelayedJobOverride::Object)
+ end
+ end
+end
+
View
42 public/javascripts/admin/PendingRoleRequests.js
@@ -0,0 +1,42 @@
+Ext.namespace('Talho');
+
+Talho.PendingRoleRequests = Ext.extend(Ext.util.Observable, {
+ constructor: function(config) {
+ Ext.apply(this, config);
+
+ Talho.PendingRoleRequests.superclass.constructor.call(this, config);
+
+ var panel = new Ext.CenteredAjaxPanel({
+ url: this.url,
+ title: this.title,
+ itemId: this.id,
+ closable: true,
+ hideBorders: true,
+ autoScroll: true,
+ listeners: {scope: this, 'ajaxloadcomplete': this.panelLoaded}
+ });
+
+ this.getPanel = function(){ return panel; }
+ },
+
+ panelLoaded: function(panel){
+ var panelDom = Ext.getDom(panel.dom);
+ var userLink = Ext.get(Ext.DomQuery.selectNode('.requester_email a', panelDom));
+ if(userLink) userLink.removeAllListeners(); // we want to leave this as an inline link so we don't run it through the list
+ if(userLink) userLink.on('click', this.userLink_clicked, this);
+ },
+
+ userLink_clicked: function(evt, elem){
+ // open the user tab
+ var url = Ext.get(elem).getAttribute('url');
+ var user_id = url.match(/[0-9]*(?=\/profile)/);
+ Application.fireEvent('opentab', {title: 'Profile: ' + elem.textContent, user_id: user_id, id: 'user_profile_for_' + user_id, initializer: 'Talho.ShowProfile'});
+ }
+});
+
+Talho.PendingRoleRequests.initialize = function(config){
+ var alerts = new Talho.PendingRoleRequests(config);
+ return alerts.getPanel();
+};
+
+Talho.ScriptManager.reg('Talho.PendingRoleRequests', Talho.PendingRoleRequests, Talho.PendingRoleRequests.initialize);
View
1  public/javascripts/dashboard/ScriptManager.js
@@ -41,6 +41,7 @@ Ext.ns("Talho");
'Talho.AddUser': {js:'ProfileBase /javascripts/profile/DevicesControl.js /javascripts/profile/RolesControl.js /javascripts/profile/OrganizationsControl.js > /javascripts/admin/AddUser.js'},
'Talho.BatchUsers': {js:'BatchUsers ProfileBase > /javascripts/admin/BatchUsers.js'},
'Talho.EditUsers': {js:'EditUsers ProfileBase /javascripts/profile/RolesControl.js > /javascripts/admin/EditUsers.js'},
+ 'Talho.PendingRoleRequests': {js: "AjaxPanel > /javascripts/admin/PendingRoleRequests.js"},
'Talho.HelpWindow': {js:'/javascripts/dashboard/HelpWindow.js'},
'Talho.BetaWindow': {js:'/javascripts/dashboard/BetaWindow.js'}
};
View
5 public/javascripts/han/alerts.js
@@ -125,7 +125,8 @@ Talho.Alerts = Ext.extend(Ext.util.Observable, {
userLink_clicked: function(evt, elem){
// open the user tab
var url = Ext.get(elem).getAttribute('url');
- Application.fireEvent('opentab', {title: 'User Profile - ' + elem.textContent, url: url, id: 'user_profile_for_' + url.match(/[0-9]*(?=\/profile)/) });
+ var user_id = url.match(/[0-9]*(?=\/profile)/);
+ Application.fireEvent('opentab', {title: 'Profile: ' + elem.textContent, user_id: user_id, id: 'user_profile_for_' + user_id, initializer: 'Talho.ShowProfile'});
}
});
@@ -134,4 +135,4 @@ Talho.Alerts.initialize = function(config){
return alerts.getPanel();
};
-Talho.ScriptManager.reg('Talho.Alerts', Talho.Alerts, Talho.Alerts.initialize);
+Talho.ScriptManager.reg('Talho.Alerts', Talho.Alerts, Talho.Alerts.initialize);
View
2  public/javascripts/profile/ShowProfile.js
@@ -18,7 +18,6 @@ Talho.ShowProfile = Ext.extend(Ext.util.Observable, {
this.inner_panel = new Ext.Panel({
layout: 'column',
cls: 'inner-panel',
- id: 'snuffalupagus-inner',
layoutConfig: {defaultMargins:'5'}
});
@@ -28,7 +27,6 @@ Talho.ShowProfile = Ext.extend(Ext.util.Observable, {
padding: 5,
itemId: config.id,
cls: 'primary-panel',
- id: 'snuffalupagus',
closable: true,
title: this.title,
items: [{xtype: 'container', html: '&nbsp;', columnWidth:0.5}, this.inner_panel, {xtype: 'container', html: '&nbsp;', columnWidth:0.5}]

No commit comments for this range

Something went wrong with that request. Please try again.