Themes from db fixed..

This commit is contained in:
Harry Bomrah 2012-04-23 21:04:02 +08:00
parent 8c42f6bb7c
commit 670ec2a40e
5 changed files with 12 additions and 15 deletions

View File

@ -178,9 +178,7 @@ var orbitDesktop = function(dom){
}) })
newpostitions.push(groupone); newpostitions.push(groupone);
}); });
$.post("/desktop/newpositions",{"sectionid":o.sectionId,"newpos":newpostitions,"groupids":groupids},function(){ $.post("/desktop/newpositions",{"sectionid":o.sectionId,"newpos":newpostitions,"groupids":groupids})
})
} }
} }
}); });
@ -268,7 +266,7 @@ var orbitDesktop = function(dom){
$("div#desktop ul#section_list").empty(); $("div#desktop ul#section_list").empty();
$.each(o.sectionList,function(i,section){ $.each(o.sectionList,function(i,section){
var tempstyle=""; var tempstyle="";
if(i==0){ if(section._id==o.sectionId){
tempstyle = "style='display:none;'"; tempstyle = "style='display:none;'";
$("div#desktop span#section_heading").text(section.name); $("div#desktop span#section_heading").text(section.name);
} }
@ -507,8 +505,9 @@ var orbitDesktop = function(dom){
}) })
$.post("/desktop/save_desktop_settings",{"save":"desktopnames","desktopid":o.desktopId,"desktopnms":desktopnm},function(result,status){ $.post("/desktop/save_desktop_settings",{"save":"desktopnames","desktopid":o.desktopId,"desktopnms":desktopnm},function(result,status){
if(status=="success"){ if(status=="success"){
if(result[0].success=="true") if(result[0].success=="true"){
o.notify("Names Saved!!","success",2); o.notify("Names Saved!!","success",2);
}
else else
o.notify("Name saving failed!!","imp",2); o.notify("Name saving failed!!","imp",2);
}else{ }else{

View File

@ -27,7 +27,7 @@ class DesktopController< ApplicationController
end end
def settingthemes def settingthemes
# @themes = Theme.count @themes = DesktopTheme.all
# raise @themes.inspect # raise @themes.inspect
render "desktop/settings/themes", :layout => false render "desktop/settings/themes", :layout => false
end end

View File

@ -1,10 +1,9 @@
class Theme class DesktopTheme
include Mongoid::Document include Mongoid::Document
include Mongoid::Timestamps include Mongoid::Timestamps
field :name field :name
field :author field :author
embedded_in :desktop
end end

View File

@ -3,7 +3,7 @@
<div class="scrollbar sb_v vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div> <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="viewport">
<div class="overview"> <div class="overview">
<div class="s_title hh3">Sections Name</div> <div class="s_title hh3">Section Names</div>
<ul class="s_form" id="desktop_names"> <ul class="s_form" id="desktop_names">
<li><label for="s_name1">Section 1</label><input id="s_name1" type="text" value=""></li> <li><label for="s_name1">Section 1</label><input id="s_name1" type="text" value=""></li>
<li><label for="s_name2">Section 2</label><input id="s_name2" type="text" value=""></li> <li><label for="s_name2">Section 2</label><input id="s_name2" type="text" value=""></li>

View File

@ -11,14 +11,13 @@
<div class="overview"> <div class="overview">
<div id="st1" class="st_c"> <div id="st1" class="st_c">
<div class="theme_list ssl"> <div class="theme_list ssl">
<div id="4f8d3f493b67fcd05f086359" class="ssl_item"><div class="theme_thumb"><img src="assets/sample_theme.jpg" alt="" width="120" height="96"></div><span class="theme_name ssl_des">Default</span></div> <% @themes.each do |theme| %>
<div id="4f8d3f673b67fcd05f08635c" class="ssl_item"><div class="theme_thumb"><img src="assets/sample_theme.jpg" alt="" width="120" height="96"></div><span class="theme_name ssl_des">Snake</span></div> <div id="<%= theme.id %>" class="ssl_item"><div class="theme_thumb"><img src="assets/sample_theme.jpg" alt="" width="120" height="96"></div><span class="theme_name ssl_des"><%= theme.name %></span></div>
<div id="4f8d3f5d3b67fcd05f08635b" class="ssl_item"><div class="theme_thumb"><img src="assets/sample_theme.jpg" alt="" width="120" height="96"></div><span class="theme_name ssl_des">Sexy</span></div> <% end %>
<div id="4f8d3f783b67fcd05f08635d" class="ssl_item"><div class="theme_thumb"><img src="assets/sample_theme.jpg" alt="" width="120" height="96"></div><span class="theme_name ssl_des">Vintage</span></div>
<div id="4f8d3f533b67fcd05f08635a" class="ssl_item"><div class="theme_thumb"><img src="assets/sample_theme.jpg" alt="" width="120" height="96"></div><span class="theme_name ssl_des">Natural</span></div>
<div id="4f8d3f3c3b67fcd05f086358" class="ssl_item"><div class="theme_thumb"><img src="assets/sample_theme.jpg" alt="" width="120" height="96"></div><span class="theme_name ssl_des">Chris</span></div>
</div> </div>
</div> </div>
<div id="st2" class="st_c"> <div id="st2" class="st_c">
<div class="s_title hh3">Preview</div> <div class="s_title hh3">Preview</div>
<div class="theme_preview vp thmbgc" style="background-color: #000;" id="theme_preview_area"> <div class="theme_preview vp thmbgc" style="background-color: #000;" id="theme_preview_area">