diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 5a0d79fc..dc431a55 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -178,9 +178,7 @@ var orbitDesktop = function(dom){ }) 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(); $.each(o.sectionList,function(i,section){ var tempstyle=""; - if(i==0){ + if(section._id==o.sectionId){ tempstyle = "style='display:none;'"; $("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){ if(status=="success"){ - if(result[0].success=="true") + if(result[0].success=="true"){ o.notify("Names Saved!!","success",2); + } else o.notify("Name saving failed!!","imp",2); }else{ diff --git a/app/controllers/desktop_controller.rb b/app/controllers/desktop_controller.rb index 249f9dca..70694331 100644 --- a/app/controllers/desktop_controller.rb +++ b/app/controllers/desktop_controller.rb @@ -27,7 +27,7 @@ class DesktopController< ApplicationController end def settingthemes - # @themes = Theme.count + @themes = DesktopTheme.all # raise @themes.inspect render "desktop/settings/themes", :layout => false end diff --git a/app/models/theme.rb b/app/models/desktop_theme.rb similarity index 74% rename from app/models/theme.rb rename to app/models/desktop_theme.rb index 53584bee..76886103 100644 --- a/app/models/theme.rb +++ b/app/models/desktop_theme.rb @@ -1,10 +1,9 @@ -class Theme +class DesktopTheme include Mongoid::Document include Mongoid::Timestamps field :name field :author - embedded_in :desktop end diff --git a/app/views/desktop/settings/sections.html.erb b/app/views/desktop/settings/sections.html.erb index 6b1d73e3..32db370b 100644 --- a/app/views/desktop/settings/sections.html.erb +++ b/app/views/desktop/settings/sections.html.erb @@ -3,7 +3,7 @@
-
Sections Name
+
Section Names