with connection and some save settings…

This commit is contained in:
Harry Bomrah 2012-04-26 21:30:13 +08:00
parent c2ac682787
commit c158375d02
13 changed files with 90 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
app/assets/images/gmail.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -481,6 +481,9 @@ var orbitDesktop = function(dom){
case "sections":
sections();
break;
case "connection":
connection();
break;
}
$("div#settings ul#setting_left_nav li a").removeClass('thmc1 thmtxt').data('clicked',null);
$(this).addClass('thmc1 thmtxt').data('clicked',true);
@ -684,6 +687,7 @@ var orbitDesktop = function(dom){
$(this).miniColors("value", o.rgb2hex(color));
});
}
$("div#settings div#panel_r").load("/desktop/settingthemes",function(){
$.getJSON("/desktop/get_desktop_settings",{"get":"theme","desktopid":o.desktopId},function(theme){
$('#st1 .theme_list [id='+theme+']')
@ -696,6 +700,16 @@ var orbitDesktop = function(dom){
})
})
}
var connection = function(){
var bindHandlers = function(){
}
$("div#settings div#panel_r").load("/desktop/settingconnection",function(){
bindHandlers();
})
}
$(o.contentHolder).empty().load("/desktop/"+target,function(){
bindHandlers();

View File

@ -38,6 +38,10 @@ class DesktopController< ApplicationController
render "desktop/settings/sections", :layout => false
end
def settingconnection
render "desktop/settings/connections", :layout => false
end
def journal_p
render :layout => false
end

View File

@ -5,6 +5,13 @@ class OtheraccountsController< ApplicationController
require 'net/https'
include REXML
def saveaccountinfo
@email = params['email']
@password = params['password']
@account = params['account']
OtherAccount.new(email: @email, encrypted_password: @password, type: @account)
end
def gmail
url = URI.parse("https://mail.google.com/mail/feed/atom")
req = Net::HTTP::Get.new(url.path)

View File

@ -0,0 +1,15 @@
class OtherAccount
include Mongoid::Document
include Mongoid::Timestamps
field :type
field :email
field :encrypted_password
attr_encrypted :encrypted_password, :key => 'rulingorbit.com', :encode => true
belongs_to :user
end

View File

@ -17,6 +17,7 @@ class User
has_many :managing_apps,:class_name => "AppManager"
has_one :desktop, :autosave => true, :dependent => :destroy
has_many :otheraccount, :autosave => true, :dependent => :destroy
belongs_to :role
has_and_belongs_to_many :sub_roles
accepts_nested_attributes_for :attribute_values, :allow_destroy => true

View File

@ -14,7 +14,7 @@
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Account</a></li>
<li><a href="sections" class="admtxt hh2 w2 hp" onclick='return false;'>Sections</a></li>
<li><a href="themes" class="admtxt hh2 w2 hp" onclick='return false;'>Theme</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Connection</a></li>
<li><a href="connection" class="admtxt hh2 w2 hp" onclick='return false;'>Connection</a></li>
</ul>
</div>
</div>

View File

@ -0,0 +1,35 @@
<div class="tinycanvas vp">
<div class="scrollbar sb_v vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<div class="s_title hh3">Connections</div>
<table width="100%" class="s_form">
<tr>
<td rowspan="2"><img src="assets/gmail.png" alt=""></td>
<td valign="top"><label for="s_name1">Username</label><input type="text" /></td>
</tr>
<tr>
<td><label for="s_name1">Password</label><input type="password" /></td>
</tr>
<tr>
<td rowspan="2"><img src="assets/facebook.png" alt=""></td>
<td><label for="s_name1">Username</label><input type="text" /></td>
</tr>
<tr>
<td><label for="s_name1">Password</label><input type="password" /></td>
</tr>
<tr>
<td rowspan="2"><img src="assets/twitter.png"></td>
<td><label for="s_name1">Username</label><input type="text" /></td>
</tr>
<tr>
<td><label for="s_name1">Password</label><input type="password" /></td>
</tr>
</table>
<div class="s_action">
<a href="" id="connection_save_btn" class="setting_btn thmc1 thmtxt w1 hh2 hp" onclick='return false;'>Save</a>
</div>
</div>
</div>
</div>

View File

@ -117,7 +117,10 @@ Orbit::Application.routes.draw do
match '/desktop/journal_p/'=>'desktop#journal_p'
match '/desktop/journal_p_list/'=>'desktop#journal_p_list'
match '/desktop/journal_p_add/'=>'desktop#journal_p_add'
match '/desktop/settingconnection/'=>'desktop#settingconnection'
match '/desktop/forgmail/'=>'otheraccounts#gmail'
match '/desktop/save_account_info/'=>'otheraccounts#saveaccountinfo'
match '/desktop/temp_func/'=>'desktop#temp_func'
match '/panel/:app_name/front_end/:app_action/:id' => 'pages#show_from_link', :constraints => lambda { |request|

View File

@ -42,4 +42,14 @@ var gmail = function(){
}
});
}
}
var saveaccount = function(){
var usernm = $("#gmail input[type=text]").val();
var pwd = $("#gmail input[type=password]").val();
usernm = "hr@rulingcom.com";
pwd = "hr08973";
if(usernm!="" && pwd!=""){
$.post("/desktop/save_account_info",{email:usernm,password:pwd,account:"gmail"})
}
}