diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js new file mode 100644 index 0000000000..fec6a75925 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js @@ -0,0 +1,48 @@ +/** + * @ngdoc service + * @name umbraco.resources.ourPackageRepositoryResource + * @description handles data for package installations + **/ +function ourPackageRepositoryResource($q, $http, umbDataFormatter, umbRequestHelper) { + + var baseurl = "http://localhost:24292/webapi/packages/v1"; + + return { + + getDetails: function (packageId) { + + return umbRequestHelper.resourcePromise( + $http.get(baseurl + "/getdetails/" + packageId), + 'Failed to get package details'); + }, + + getCategories: function () { + + return umbRequestHelper.resourcePromise( + $http.get(baseurl + "/getcategories"), + 'Failed to query packages'); + }, + + getPopular: function (maxResults) { + + if (maxResults === undefined) { + maxResults = 10; + } + + return umbRequestHelper.resourcePromise( + $http.get(baseurl + "/GetPopular?maxResults=" + maxResults), + 'Failed to query packages'); + }, + + getLatest: function (pageIndex, pageSize, category) { + + return umbRequestHelper.resourcePromise( + $http.get(baseurl + "/GetLatest?pageIndex=" + pageIndex + "&pageSize=" + pageSize + "&category=" + category), + 'Failed to query packages'); + } + + + }; +} + +angular.module('umbraco.resources').factory('ourPackageRepositoryResource', ourPackageRepositoryResource); diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/category.html b/src/Umbraco.Web.UI.Client/src/views/packager/category.html index a012264d75..d408b21cd9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/category.html +++ b/src/Umbraco.Web.UI.Client/src/views/packager/category.html @@ -51,7 +51,7 @@ {{ package.downloads }} - {{ package.karma }} + {{ package.ownerInfo.karma }} @@ -82,7 +82,7 @@ {{ package.downloads }} - {{ package.karma }} + {{ package.ownerInfo.karma }} diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/overview.controller.js b/src/Umbraco.Web.UI.Client/src/views/packager/overview.controller.js index 487a715042..5cf6e6bc07 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/overview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packager/overview.controller.js @@ -11,22 +11,22 @@ { "name": "Packages", "icon": "icon-cloud", - "view": "views/packagesNew/views/repo.html", + "view": "views/packager/views/repo.html", "active": true }, { "name": "Installed", "icon": "icon-box", - "view": "views/packagesNew/views/installed.html" + "view": "views/packager/views/installed.html" }, { "name": "Install local", "icon": "icon-add", - "view": "views/packagesNew/views/install-local.html" + "view": "views/packager/views/install-local.html" } ]; - $timeout(function() { + $timeout(function () { navigationService.syncTree({ tree: "packager", path: "-1" }); }); diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js b/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js index a69cd3f175..61383b12bf 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js @@ -1,7 +1,7 @@ (function () { "use strict"; - function PackagesRepoController($scope, $route, $location, $timeout) { + function PackagesRepoController($scope, $route, $location, $timeout, ourPackageRepositoryResource, $q) { var vm = this; @@ -9,7 +9,8 @@ vm.loading = false; vm.pagination = { pageNumber: 1, - totalPages: 10 + totalPages: 10, + pageSize: 12 }; vm.selectCategory = selectCategory; @@ -19,221 +20,235 @@ vm.prevPage = prevPage; vm.goToPage = goToPage; + //vm.categories = [ + // { + // "id": 1, + // "icon": "icon-male-and-female", + // "name": "All", + // "active": true + // }, + // { + // "icon": "icon-male-and-female", + // "name": "Collaboration" + // }, + // { + // "id": 2, + // "icon": "icon-molecular-network", + // "name": "Backoffice extensions" + // }, + // { + // "id": 3, + // "icon": "icon-brackets", + // "name": "Developer tools" + // }, + // { + // "id": 4, + // "icon": "icon-wand", + // "name": "Starter kits" + // }, + // { + // "id": 5, + // "icon": "icon-medal", + // "name": "Umbraco Pro" + // }, + // { + // "id": 6, + // "icon": "icon-wrench", + // "name": "Website utilities" + // } + //]; - vm.categories = [ - { - "id": 1, - "icon": "icon-male-and-female", - "name": "All", - "active": true - }, - { - "icon": "icon-male-and-female", - "name": "Collaboration" - }, - { - "id": 2, - "icon": "icon-molecular-network", - "name": "Backoffice extensions" - }, - { - "id": 3, - "icon": "icon-brackets", - "name": "Developer tools" - }, - { - "id": 4, - "icon": "icon-wand", - "name": "Starter kits" - }, - { - "id": 5, - "icon": "icon-medal", - "name": "Umbraco Pro" - }, - { - "id": 6, - "icon": "icon-wrench", - "name": "Website utilities" - } - ]; + //vm.packages = [ + // { + // "id": 1, + // "name": "uSightly", + // "description": "An HTML5 audio player based on jPlayer", + // "karma": "1", + // "downloads": "1672", + // "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 2, + // "name": "Kill IE6", + // "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", + // "karma": "11", + // "downloads": "688", + // "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 3, + // "name": "Examine Media Indexer", + // "description": "CogUmbracoExamineMediaIndexer", + // "karma": "3", + // "downloads": "1329", + // "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 4, + // "name": "SVG Icon Picker", + // "description": "A picker, for picking icons from an SVG spritesheet.", + // "karma": "5", + // "downloads": "8", + // "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 5, + // "name": "Pipeline CRM", + // "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", + // "karma": "3", + // "downloads": "105", + // "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 6, + // "name": "uSightly", + // "description": "An HTML5 audio player based on jPlayer", + // "karma": "1", + // "downloads": "1672", + // "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 7, + // "name": "Kill IE6", + // "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", + // "karma": "11", + // "downloads": "688", + // "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 8, + // "name": "Examine Media Indexer", + // "description": "CogUmbracoExamineMediaIndexer", + // "karma": "3", + // "downloads": "1329", + // "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 9, + // "name": "SVG Icon Picker", + // "description": "A picker, for picking icons from an SVG spritesheet.", + // "karma": "5", + // "downloads": "8", + // "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 10, + // "name": "Pipeline CRM", + // "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", + // "karma": "3", + // "downloads": "105", + // "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" + // } + //]; - vm.packages = [ - { - "id": 1, - "name": "uSightly", - "description": "An HTML5 audio player based on jPlayer", - "karma": "1", - "downloads": "1672", - "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 2, - "name": "Kill IE6", - "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", - "karma": "11", - "downloads": "688", - "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 3, - "name": "Examine Media Indexer", - "description": "CogUmbracoExamineMediaIndexer", - "karma": "3", - "downloads": "1329", - "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 4, - "name": "SVG Icon Picker", - "description": "A picker, for picking icons from an SVG spritesheet.", - "karma": "5", - "downloads": "8", - "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 5, - "name": "Pipeline CRM", - "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", - "karma": "3", - "downloads": "105", - "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 6, - "name": "uSightly", - "description": "An HTML5 audio player based on jPlayer", - "karma": "1", - "downloads": "1672", - "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 7, - "name": "Kill IE6", - "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", - "karma": "11", - "downloads": "688", - "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 8, - "name": "Examine Media Indexer", - "description": "CogUmbracoExamineMediaIndexer", - "karma": "3", - "downloads": "1329", - "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 9, - "name": "SVG Icon Picker", - "description": "A picker, for picking icons from an SVG spritesheet.", - "karma": "5", - "downloads": "8", - "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 10, - "name": "Pipeline CRM", - "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", - "karma": "3", - "downloads": "105", - "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" - } - ]; - - vm.package = { - "name": "Merchello", - "description": "<p>Merchello is a high performance, designer friendly, open source Umbraco ecommerce package built for the store owner.</p> <p><strong>What Merchello does for you</strong></p> <p>In version 1, Merchello supports a large variety of products with options that can be attached to a single warehouse, processes orders, manages taxes and shipping, and sends out email notifications to your customers. The beauty of Merchello is that while it oversees all of your products, orders, and store settings, it allows Umbraco to maintain your content. This seamless integration gives you the flexibility to build your store in any way imagineable on a robust platform capable of handling a wide variety of store sizes.</p> <p><strong>Find out more on our website</strong></p> <p><strong><a href="https://merchello.com">https://merchello.com</a></strong></p> <p><strong>Contribute</strong></p> <p>We would love and need your help. If you want to contribute to Merchello's core, the easiest way to get started is to fork the project on https://github.com/merchello/Merchello and open src/Merchello.sln in Visual Studio. We're excited to see what you do!</p> <p><strong>Starter Kit</strong></p> <p>We have built a simple starter kit for Merchello called Bazaar, and you can download it below in the package files tab.</p>", - "compatibility": [ - { - "version": "7.4.x", - "percentage": "100" - }, - { - "version": "7.3.x", - "percentage": "86" - }, - { - "version": "7.2.x", - "percentage": "93" - }, - { - "version": "7.1.x", - "percentage": "100" - } - ], - "information": { - "owner": "Rusty Swayne", - "ownerAvatar": "https://our.umbraco.org/media/upload/d476d257-a494-46d9-9a00-56c2f94a55c8/our-profile.jpg?width=200&height=200&mode=crop", - "ownerKarma": "2673", - "contributors": [ - { - "name": "Lee" - }, - { - "name": "Jason Prothero" - } - ], - "created": "18/12/2013", - "currentVersion": "2.0.0", - "netVersion": "4.5", - "license": "MIT", - "downloads": "4198", - "karma": "53" - }, - "externalSources": [ - { - "name": "Source code", - "url": "https://github.com/merchello/Merchello" - }, - { - "name": "Issue tracker", - "url": "http://issues.merchello.com/youtrack/oauth?state=%2Fyoutrack%2FrootGo" - } - ], - "images": [ - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - } - ] - }; + //vm.package = { + // "name": "Merchello", + // "description": "<p>Merchello is a high performance, designer friendly, open source Umbraco ecommerce package built for the store owner.</p> <p><strong>What Merchello does for you</strong></p> <p>In version 1, Merchello supports a large variety of products with options that can be attached to a single warehouse, processes orders, manages taxes and shipping, and sends out email notifications to your customers. The beauty of Merchello is that while it oversees all of your products, orders, and store settings, it allows Umbraco to maintain your content. This seamless integration gives you the flexibility to build your store in any way imagineable on a robust platform capable of handling a wide variety of store sizes.</p> <p><strong>Find out more on our website</strong></p> <p><strong><a href="https://merchello.com">https://merchello.com</a></strong></p> <p><strong>Contribute</strong></p> <p>We would love and need your help. If you want to contribute to Merchello's core, the easiest way to get started is to fork the project on https://github.com/merchello/Merchello and open src/Merchello.sln in Visual Studio. We're excited to see what you do!</p> <p><strong>Starter Kit</strong></p> <p>We have built a simple starter kit for Merchello called Bazaar, and you can download it below in the package files tab.</p>", + // "compatibility": [ + // { + // "version": "7.4.x", + // "percentage": "100" + // }, + // { + // "version": "7.3.x", + // "percentage": "86" + // }, + // { + // "version": "7.2.x", + // "percentage": "93" + // }, + // { + // "version": "7.1.x", + // "percentage": "100" + // } + // ], + // "information": { + // "owner": "Rusty Swayne", + // "ownerAvatar": "https://our.umbraco.org/media/upload/d476d257-a494-46d9-9a00-56c2f94a55c8/our-profile.jpg?width=200&height=200&mode=crop", + // "ownerKarma": "2673", + // "contributors": [ + // { + // "name": "Lee" + // }, + // { + // "name": "Jason Prothero" + // } + // ], + // "created": "18/12/2013", + // "currentVersion": "2.0.0", + // "netVersion": "4.5", + // "license": "MIT", + // "downloads": "4198", + // "karma": "53" + // }, + // "externalSources": [ + // { + // "name": "Source code", + // "url": "https://github.com/merchello/Merchello" + // }, + // { + // "name": "Issue tracker", + // "url": "http://issues.merchello.com/youtrack/oauth?state=%2Fyoutrack%2FrootGo" + // } + // ], + // "images": [ + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // } + // ] + //}; function init() { vm.loading = true; - $timeout(function () { - vm.loading = false; - }, 500); + $q.all([ + ourPackageRepositoryResource.getCategories() + .then(function(cats) { + vm.categories = cats; + }), + ourPackageRepositoryResource.getPopular(10) + .then(function(pack) { + vm.popular = pack; + }), + ourPackageRepositoryResource.getLatest(vm.pagination.pageNumber - 1, vm.pagination.pageSize, "") + .then(function(pack) { + vm.packages = pack.packages; + vm.pagination.totalPages = Math.ceil(pack.total / vm.pagination.pageSize); + }) + ]) + .then(function() { + vm.loading = false; + }); } @@ -246,7 +261,12 @@ } function showPackageDetails(selectedPackage) { - vm.packageViewState = "packageDetails"; + ourPackageRepositoryResource.getDetails(selectedPackage.id) + .then(function(pack) { + vm.package = pack; + vm.packageViewState = "packageDetails"; + }); + } function setPackageViewState(state) { diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html b/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html index 0074eb8e9c..77a4ad6d33 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html +++ b/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html @@ -4,7 +4,8 @@