Sha256: ce90a4927b42c0d2ef70bd8b28612f722fe9b64944868aef9908577b9f1f9cbe

Contents?: true

Size: 1.53 KB

Versions: 35

Compression:

Stored size: 1.53 KB

Contents

App.Views.ShowUser = Backbone.View.extend({
	
	events: {
		"click a#delete-user" : "delete_user",
	},
	
    initialize: function() {
	    var name = this.model.get('name');
		this.render(name);
		client = new Client();
		client.get_clients(name);
		source = new Source();
		source.set('partition_type','all');
		source.set('user_id',name);
		source.set('doctype','source');
		source.fetch();
    },

    delete_user: function(e) {
		e.preventDefault();
		this.model.delete_user();
	},
    
    render: function(name) {
        $('#secondary-nav').css('display','block');
		out  = "<div class='page-header'><div style='font-size:24px;font-weight:bold;display:inline'>User: "+name+"</div><div class='pull-right' style='display:inline'>";
		out += "<a id='delete-user' class='btn btn-danger'>Delete User</a><a href='#user/newping/"+name+"' class='btn' style='margin-left:10px'>Ping User</a></div></div>";
		out += "<div id='showuser-alert' class='alert alert-error' style='display:none'></div>";
	    out += "<table id='source-table' class='table table-bordered'>";
	    out += "<tr><th><h3>Sources</h3></th></tr>";
	    out += "<tr class='remove-tr-user'><td colspan='2' style='text-align:center'>Loading...</td></tr>"
	    out += "</table>";
		out += "<table id='device-table' class='table table-bordered'><tr><th><h3>Registered Devices</h3></th></tr>";
		out += "<tr class='remove-tr-device'><td colspan='2' style='text-align:center'>Loading...</td></tr>"
		out += "</table>"
	   
        $(this.el).html(out);
        $('#main_content').html(this.el);
    }
});

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
rhoconnect-7.6.0 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-7.5.1 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-7.4.1 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-7.1.17 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-6.2.0 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-6.0.11 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-5.5.18 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-5.5.17 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-5.5.15 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-5.5.0.22 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-5.5.2 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-5.5.0.7 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-5.5.0.3 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-5.5.0 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-5.1.1 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-4.0.4 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-4.0.3 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-4.0.2 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-4.0.1 lib/rhoconnect/web-console/views/show_user.js
rhoconnect-4.0.0 lib/rhoconnect/web-console/views/show_user.js