diff --git a/src/Umbraco.Web.UI.Client/src/common/services/help.service.js b/src/Umbraco.Web.UI.Client/src/common/services/help.service.js new file mode 100644 index 0000000000..6d7d341a57 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/services/help.service.js @@ -0,0 +1,70 @@ +angular.module('umbraco.services') + .factory('helpService', function ($http, $q){ + var helpTopics = {}; + + var defaultUrl = "http://our.umbraco.org/rss/help"; + var tvUrl = "http://umbraco.tv/feeds/help"; + + function getCachedHelp(url){ + if(helpTopics[url]){ + return helpTopics[cacheKey]; + }else{ + return null; + } + } + + function setCachedHelp(url, data){ + helpTopics[url] = data; + } + + function fetchUrl(url){ + var deferred = $q.defer(); + var found = getCachedHelp(url); + + if(found){ + deferred.resolve(found); + }else{ + + var proxyUrl = "dashboard/feedproxy.aspx?url=" + url; + $http.get(proxyUrl).then(function(data){ + var feed = $(data.data); + var topics = []; + + $('item', feed).each(function (i, item) { + var topic = {}; + topic.thumbnail = $(item).find('thumbnail').attr('url'); + topic.title = $("title", item).text(); + topic.link = $("guid", item).text(); + topic.description = $("description", item).text(); + topics.push(topic); + }); + + setCachedHelp(topics); + deferred.resolve(topics); + }); + } + + return deferred.promise; + } + + + + var service = { + findHelp: function (args) { + var url = service.getUrl(defaultUrl, args); + return fetchUrl(url); + }, + + findVideos: function (args) { + var url = service.getUrl(tvUrl, args); + return fetchUrl(url); + }, + + getUrl: function(url, args){ + return url + "?" + $.param(args); + } + }; + + return service; + + }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/less/main.less b/src/Umbraco.Web.UI.Client/src/less/main.less index 90b3f4b8ab..51ef4c3016 100644 --- a/src/Umbraco.Web.UI.Client/src/less/main.less +++ b/src/Umbraco.Web.UI.Client/src/less/main.less @@ -65,7 +65,6 @@ h5{ /*BUTTONS */ - .thumbnails > li.umb-plus-btn { margin: 0 10px 10px 0 } diff --git a/src/Umbraco.Web.UI.Client/src/less/navs.less b/src/Umbraco.Web.UI.Client/src/less/navs.less index cf65ff97f5..7671ab73d6 100644 --- a/src/Umbraco.Web.UI.Client/src/less/navs.less +++ b/src/Umbraco.Web.UI.Client/src/less/navs.less @@ -2,6 +2,15 @@ // Navs // -------------------------------------------------- +.list-icons li{ + padding-left: 35px; +} + +.list-icons li > i.icon{ + margin-left: -25px; + padding-right: 7px; +} + // BASE CLASS // ---------- diff --git a/src/Umbraco.Web.UI.Client/src/less/tree.less b/src/Umbraco.Web.UI.Client/src/less/tree.less index 00011cf6aa..b4ae7f008e 100644 --- a/src/Umbraco.Web.UI.Client/src/less/tree.less +++ b/src/Umbraco.Web.UI.Client/src/less/tree.less @@ -238,10 +238,10 @@ div.has-unpublished-version:before{ } div.not-allowed > i.icon,div.not-allowed > a{ - color: @grayLight; cursor: not-allowed; } + // Tree context menu // ------------------------- .umb-actions { diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.controller.js index 9de519cce0..be778d03be 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.controller.js @@ -1,7 +1,42 @@ angular.module("umbraco") - .controller("Umbraco.Dialogs.HelpController", function ($scope, $location, $routeParams) { + .controller("Umbraco.Dialogs.HelpController", function ($scope, $location, $routeParams, helpService, userService) { $scope.section = $routeParams.section; if(!$scope.section){ $scope.section ="content"; } + + var rq = {}; + rq.section = $scope.section; + + userService.getCurrentUser().then(function(user){ + + rq.usertype = user.userType; + rq.lang = user.locale; + + if($routeParams.url){ + rq.path = decodeURIComponent($routeParams.url); + + if(rq.path.indexOf(Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath) === 0){ + rq.path = rq.path.substring(Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath.length); + } + + if(rq.path.indexOf(".aspx") > 0){ + rq.path = rq.path.substring(0, rq.path.indexOf(".aspx")); + } + + }else{ + rq.path = rq.section + "/" + $routeParams.tree + "/" + $routeParams.method; + } + + helpService.findHelp(rq).then(function(topics){ + $scope.topics = topics; + }); + + helpService.findVideos(rq).then(function(videos){ + $scope.videos = videos; + }); + + }); + + }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.html index 54d649a45b..a32658aa15 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.html @@ -5,20 +5,54 @@
- This area will contain manuals, references and tutorials, downloaded from our.umbraco.org... -
+ + +- This area will contain relevant videos from umbraco.tv -
+ +