Sha256: a3640f7238f714ec2dd78017fff4029cb248b1c9b245658c429a240c9f49e42c

Contents?: true

Size: 1.79 KB

Versions: 1

Compression:

Stored size: 1.79 KB

Contents

App.Views.Home = Backbone.View.extend({
	
	events: {
		"click a#reset" : "reset" 
	},
	
    initialize: function() {
 	    var domain = $('input#domain').val();
	    this.model.set('partition_type','app')
		this.model.save({
			error: function(model,resp)
			{
				if(resp.status == 422){
					 new App.Views.Index()
				}
			}
		});
		this.model.fetch({
			error: function(model,resp)
			{
				if(resp.status == 422){
					 new App.Views.Index()
				}
			}
		});
        this.render(domain);
    },  

    reset: function(){
	    var session = new Session();
		if(confirm("Are you sure you want to reset?")){
			session.reset()
		}
	},
    
    render: function(domain) {
        $('#secondary-nav').css('display','block');
		//out  = "<div class='page-header well'><h1>Home</h1></div>"
		out = "<div id='home-alert' class='alert alert-error' style='display:none'></div>"
		out += "<div class='alert alert-info' style='padding:10px 0 30px 0'>"
		//out += "<div class='container'>"
		out += "<div id='license' style='padding-left:5px' class='pull-left'></div>"
		out += "<div class='pull-right'>"
		out += "<div class='reset-status' style='display:inline;'><span class='' style='margin-right:5px'></span></div>"
		out += "<a id='reset' class='btn btn-danger'>Reset</a>"
		out += "</div></div>"
		out += "<div class='span4'>"
	    out += "<table id='source-table' class='table table-bordered'><thead><tr><th><h3>App partition sources</h3></th></tr></thead>"
		out += "</table></div>"
		out += "<div class='span4 pull-right'><h3>Sync Server URL</h3><code style='margin:0'>http://"+domain+"</code></br>";
		out += "<em style='margin-top:5px'>Paste this url into your client app configuration to sync with this RhoConnect instance.</em></div>"
        $(this.el).html(out);
        $('#main_content').html(this.el);
		return this
    }
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rhoconnect-3.2.0.beta1 lib/rhoconnect/web-console/views/home.js