Remove Marketplace completely
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
using System;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc;
|
||||
using our;
|
||||
using uProject.Models;
|
||||
using uProject.Services;
|
||||
using uProject.uVersion;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace uProject.Controllers
|
||||
@@ -21,7 +20,7 @@ namespace uProject.Controllers
|
||||
new VersionCompatibilityReportModel
|
||||
{
|
||||
VersionCompatibilities = compatReport.GetCompatibilityReport(projectId),
|
||||
CurrentMemberHasDownloaded = currentMember != null && uProject.library.HasDownloaded(currentMember.Id, projectId),
|
||||
CurrentMemberHasDownloaded = currentMember != null && Utils.HasMemberDownloadedPackage(currentMember.Id, projectId),
|
||||
CurrentMemberIsLoggedIn = currentMember != null,
|
||||
FileId = fileId,
|
||||
ProjectId = projectId,
|
||||
|
||||
@@ -5,12 +5,11 @@ using System.Web;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using umbraco.cms.businesslogic;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using Marketplace.Providers;
|
||||
using our;
|
||||
using Marketplace.Providers.MediaFile;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using OurUmbraco.Wiki.BusinessLogic;
|
||||
using UmbracoVersion = Marketplace.Umbraco.BusinessLogic.UmbracoVersion;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace uProject
|
||||
{
|
||||
@@ -51,20 +50,19 @@ namespace uProject
|
||||
}
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(userguid) && !string.IsNullOrEmpty(projectguid) && !string.IsNullOrEmpty(fileType) && !string.IsNullOrEmpty(fileName)) {
|
||||
|
||||
var provider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var p = provider.GetListing(new Guid(projectguid));
|
||||
if (!string.IsNullOrEmpty(userguid) && !string.IsNullOrEmpty(projectguid) && !string.IsNullOrEmpty(fileType) && !string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
var nodeListingProvider = new OurUmbraco.MarketPlace.NodeListing.NodeListingProvider();
|
||||
var p = nodeListingProvider.GetListing(new Guid(projectguid));
|
||||
Member mem = new Member(new Guid(userguid));
|
||||
|
||||
if (p.Vendor != null && p.Vendor.Member.Id == mem.Id || Utils.IsProjectContributor(mem.Id, p.Id))
|
||||
if (p.Vendor != null && p.VendorId == mem.Id || Utils.IsProjectContributor(mem.Id, p.Id))
|
||||
{
|
||||
|
||||
var fileProvider = (IMediaProvider)MarketplaceProviderManager.Providers["MediaProvider"];
|
||||
var mediaProvider = new OurUmbraco.MarketPlace.Providers.MediaProvider();
|
||||
|
||||
var packageFileType = (FileType)Enum.Parse(typeof(FileType), (string)fileType , true);
|
||||
|
||||
fileProvider.CreateFile(fileName, p.Version, mem.UniqueId, file, packageFileType, v, dotNetVersion, trust);
|
||||
mediaProvider.CreateFile(fileName, p.Version, mem.UniqueId, file, packageFileType, v, dotNetVersion, trust);
|
||||
|
||||
} else {
|
||||
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, 0, "wrong type or not a owner");
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Marketplace.Providers;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using uProject.Models;
|
||||
using uProject.uVersion;
|
||||
using Umbraco.Core;
|
||||
@@ -37,8 +35,8 @@ namespace uProject.Services
|
||||
public IEnumerable<VersionCompatibility> GetCompatibilityReport(int projectId)
|
||||
{
|
||||
var uVersions = UVersion.GetAllVersions();
|
||||
var projectProvider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var project = projectProvider.GetListing(projectId, false);
|
||||
var projectProvider = new OurUmbraco.MarketPlace.NodeListing.NodeListingProvider();
|
||||
var project = projectProvider.GetListing(projectId, true);
|
||||
|
||||
var compatList = new List<VersionCompatibility>();
|
||||
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Marketplace.Providers;
|
||||
using umbraco;
|
||||
using our;
|
||||
using System.Text.RegularExpressions;
|
||||
using umbraco.NodeFactory;
|
||||
using System.Globalization;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
|
||||
namespace uProject
|
||||
{
|
||||
[XsltExtension("deli.library")]
|
||||
public class library
|
||||
{
|
||||
|
||||
public static bool HasVendorAccess(int pageId)
|
||||
{
|
||||
var page = new umbraco.NodeFactory.Node(pageId);
|
||||
|
||||
if (page.GetProperty("vendorOnly") != null)
|
||||
{
|
||||
var memberProvider = (IMemberProvider)MarketplaceProviderManager.Providers["MemberProvider"];
|
||||
var member = memberProvider.GetCurrentMember();
|
||||
|
||||
var vendorOnly = page.GetProperty("vendorOnly").Value == "1" ? true : false;
|
||||
if (vendorOnly)
|
||||
{
|
||||
if (member.IsDeliVendor)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public static string ShortenText(string text)
|
||||
{
|
||||
text = Utils.StripHTML(text).Replace(" ", "");
|
||||
if (text.Length > 210)
|
||||
{
|
||||
|
||||
text = text.Substring(0, 210);
|
||||
text = text.Substring(0, text.LastIndexOf(' '));
|
||||
}
|
||||
|
||||
text = Regex.Replace(text, @"[^a-zA-Z0-9\s.?!&;]", ""); //strip all crap from the listing such as ======================================= !!!!
|
||||
return text.Trim();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static string GetTagsAsCSV(IEnumerable<IProjectTag> tagList)
|
||||
{
|
||||
var tags = string.Empty;
|
||||
int counter = 0;
|
||||
|
||||
foreach (var t in tagList)
|
||||
{
|
||||
tags += t.Text + ", ";
|
||||
counter++;
|
||||
|
||||
if (counter > 3)
|
||||
break;
|
||||
}
|
||||
|
||||
if (tags.Length > 0)
|
||||
{
|
||||
tags = tags.Substring(0, tags.Length - 2);
|
||||
}
|
||||
return tags;
|
||||
}
|
||||
|
||||
public static string GetCategoryName(int projectId)
|
||||
{
|
||||
var node = new Node(projectId);
|
||||
return node.Parent.Name;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static string GetDefaultScreenshot(string prop)
|
||||
{
|
||||
return !String.IsNullOrEmpty(prop) ? "/umbraco/imagegen.ashx?image=" + prop + "&pad=true&width=50&height=50;" : "/css/img/package2.png";
|
||||
}
|
||||
|
||||
public static string GetManufacturerName(IVendor vendor)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(vendor.VendorCompanyName))
|
||||
{
|
||||
return vendor.VendorCompanyName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return vendor.Member.Name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static string GetCountry(string code)
|
||||
{
|
||||
|
||||
|
||||
foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
|
||||
{
|
||||
|
||||
RegionInfo ri = new RegionInfo(ci.LCID);
|
||||
if (ri.TwoLetterISORegionName.ToLowerInvariant() == code)
|
||||
return ri.EnglishName;
|
||||
}
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Check to see if member has reported on compatibility for a package regardless of version of the package
|
||||
/// </summary>
|
||||
/// <param name="memberId">The members Id</param>
|
||||
/// <param name="packageId">The package Id</param>
|
||||
/// <returns></returns>
|
||||
public static bool HasDownloaded(int memberId, int packageId)
|
||||
{
|
||||
return Utils.GetProjectMemberVotes(packageId, memberId) > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,25 +114,6 @@
|
||||
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Marketplace.BusinessLogic, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\dependencies\MarketPlace\Marketplace.BusinessLogic.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Marketplace.Presentation, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\dependencies\MarketPlace\Marketplace.Presentation.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Marketplace.Providers, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\dependencies\MarketPlace\Marketplace.Providers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Marketplace.Umbraco, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\dependencies\MarketPlace\Marketplace.Umbraco.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MarketPlace.Webservices">
|
||||
<HintPath>..\dependencies\MarketPlace\MarketPlace.Webservices.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.2.8-build103\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@@ -286,7 +267,6 @@
|
||||
<Compile Include="Extensions.cs" />
|
||||
<Compile Include="Helpers\ExtensionMethods.cs" />
|
||||
<Compile Include="Helpers\Helper.cs" />
|
||||
<Compile Include="library.cs" />
|
||||
<Compile Include="Models\ProjectContributor.cs" />
|
||||
<Compile Include="Models\ProjectForum.cs" />
|
||||
<Compile Include="Models\VersionCompatibilityReportModel.cs" />
|
||||
@@ -308,13 +288,6 @@
|
||||
<Compile Include="usercontrols\Deli\Package\Steps\Complete.ascx.designer.cs">
|
||||
<DependentUpon>Complete.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="usercontrols\Deli\Package\Steps\Licenses.ascx.cs">
|
||||
<DependentUpon>Licenses.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="usercontrols\Deli\Package\Steps\Licenses.ascx.designer.cs">
|
||||
<DependentUpon>Licenses.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="usercontrols\Deli\Package\Steps\Screenshots.ascx.cs">
|
||||
<DependentUpon>Screenshots.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -355,7 +328,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="usercontrols\Deli\Package\Steps\Complete.ascx" />
|
||||
<Content Include="usercontrols\Deli\Package\Steps\Licenses.ascx" />
|
||||
<Content Include="usercontrols\Deli\Package\Steps\Screenshots.ascx" />
|
||||
<Content Include="usercontrols\Deli\Package\Steps\Details.ascx" />
|
||||
<Content Include="usercontrols\Deli\Package\Editor.ascx" />
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using umbraco.IO;
|
||||
using Marketplace.BusinessLogic.ListingCreator;
|
||||
using Marketplace.BusinessLogic.ListingCreator.StepDefinitions;
|
||||
using Marketplace.Providers;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using our;
|
||||
using OurUmbraco.MarketPlace.BusinessLogic.ListingCreator;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using OurUmbraco.MarketPlace.NodeListing;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using umbraco.IO;
|
||||
using uProject.usercontrols.Deli.Package.Steps;
|
||||
using Umbraco.Web.UI.Controls;
|
||||
using Complete = OurUmbraco.MarketPlace.BusinessLogic.ListingCreator.StepDefinitions.Complete;
|
||||
using Files = OurUmbraco.MarketPlace.BusinessLogic.ListingCreator.StepDefinitions.Files;
|
||||
using Screenshots = OurUmbraco.MarketPlace.BusinessLogic.ListingCreator.StepDefinitions.Screenshots;
|
||||
|
||||
namespace uProject.usercontrols.Deli.Package
|
||||
{
|
||||
public partial class Editor : System.Web.UI.UserControl
|
||||
public partial class Editor : UmbracoUserControl
|
||||
{
|
||||
private string _currentStep = "";
|
||||
private static IVendor _vendor;
|
||||
private static IListingItem _project;
|
||||
public string _currentStepClass = "current";
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace uProject.usercontrols.Deli.Package
|
||||
}
|
||||
|
||||
|
||||
protected void Page_Load(object sender, System.EventArgs e)
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
StepNavigation.DataSource = ListingSteps().Values;
|
||||
StepNavigation.DataBind();
|
||||
@@ -44,10 +44,10 @@ namespace uProject.usercontrols.Deli.Package
|
||||
private void loadContent(ListingCreatorStep currentStep)
|
||||
{
|
||||
StepPlaceHolder.Controls.Clear();
|
||||
var controlToLoad = new System.Web.UI.UserControl().LoadControl(IOHelper.ResolveUrl(currentStep.UserControl));
|
||||
var controlToLoad = new UserControl().LoadControl(IOHelper.ResolveUrl(currentStep.UserControl));
|
||||
|
||||
if (currentStep.Alias == "details")
|
||||
((uProject.usercontrols.Deli.Package.Steps.Details)controlToLoad).IsDeliVendor = _vendor.Member.IsDeliVendor;
|
||||
((Details)controlToLoad).IsDeliVendor = false;
|
||||
|
||||
StepPlaceHolder.Controls.Add(controlToLoad);
|
||||
Step.Value = currentStep.Alias;
|
||||
@@ -62,7 +62,7 @@ namespace uProject.usercontrols.Deli.Package
|
||||
|
||||
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
|
||||
{
|
||||
ListingCreatorStep i = (ListingCreatorStep)e.Item.DataItem;
|
||||
var i = (ListingCreatorStep)e.Item.DataItem;
|
||||
|
||||
if (!i.HideFromNavigation)
|
||||
{
|
||||
@@ -92,7 +92,7 @@ namespace uProject.usercontrols.Deli.Package
|
||||
public void GotoNextStep(string currentStep, int projectId)
|
||||
{
|
||||
ListingSteps().Get(currentStep).Completed = true;
|
||||
ListingCreatorStep _s = ListingSteps().GotoNextStep(currentStep);
|
||||
var _s = ListingSteps().GotoNextStep(currentStep);
|
||||
Response.Redirect("edit?editorStep=" + _s.Alias + "&id=" + projectId);
|
||||
}
|
||||
|
||||
@@ -109,17 +109,16 @@ namespace uProject.usercontrols.Deli.Package
|
||||
InitializeComponent();
|
||||
base.OnInit(e);
|
||||
|
||||
|
||||
|
||||
_vendor = ((IVendorProvider)MarketplaceProviderManager.Providers["VendorProvider"]).GetVendorById(Member.GetCurrentMember().Id);
|
||||
|
||||
if (_projectId != null)
|
||||
{
|
||||
_project = ((IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"]).GetListing((int)_projectId);
|
||||
|
||||
var nodeListingProvider = new NodeListingProvider();
|
||||
_project = nodeListingProvider.GetListing((int)_projectId);
|
||||
|
||||
//check security to make sure the project belongs to the vendor
|
||||
if (!((_project.Vendor.Member.Id == _vendor.Member.Id) || Utils.IsProjectContributor(_vendor.Member.Id, (int)_projectId)))
|
||||
var currentMemberId = Members.GetCurrentMemberId();
|
||||
var vendorIsCurrentMember = (_project.VendorId == currentMemberId);
|
||||
var isProjectContributor = Utils.IsProjectContributor(currentMemberId, (int)_projectId);
|
||||
if ((vendorIsCurrentMember || isProjectContributor) == false)
|
||||
{
|
||||
//this project does not belong to this member so kick them back to the project list in their profile.
|
||||
Response.Redirect("~/member/profile/projects/");
|
||||
@@ -147,21 +146,16 @@ namespace uProject.usercontrols.Deli.Package
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
private static ListingCreatorStepCollection ListingSteps()
|
||||
{
|
||||
ListingCreatorStepCollection lcs = new ListingCreatorStepCollection();
|
||||
lcs.Add(new Details(), _vendor.Member.IsDeliVendor);
|
||||
lcs.Add(new Files(), _vendor.Member.IsDeliVendor);
|
||||
lcs.Add(new Screenshots(), _vendor.Member.IsDeliVendor);
|
||||
|
||||
//only add the licensing step is the project is commercial
|
||||
if (_project != null)
|
||||
lcs.Add(new Licenses(), (_project.ListingType == ListingType.commercial && _vendor.Member.IsDeliVendor));
|
||||
|
||||
lcs.Add(new Complete(), _vendor.Member.IsDeliVendor);
|
||||
var lcs = new ListingCreatorStepCollection
|
||||
{
|
||||
{ new OurUmbraco.MarketPlace.BusinessLogic.ListingCreator.StepDefinitions.Details(), false },
|
||||
{ new Files(), false },
|
||||
{ new Screenshots(), false },
|
||||
{ new Complete(), false }
|
||||
};
|
||||
return lcs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Marketplace.Providers;
|
||||
using Marketplace.BusinessLogic;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using OurUmbraco.MarketPlace.NodeListing;
|
||||
using uProject.Helpers;
|
||||
|
||||
namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
public partial class Complete : System.Web.UI.UserControl
|
||||
public partial class Complete : UserControl
|
||||
{
|
||||
public string NotificationClass;
|
||||
|
||||
@@ -22,7 +16,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Request["id"]))
|
||||
{
|
||||
_projectId = Int32.Parse(Request["id"]);
|
||||
_projectId = int.Parse(Request["id"]);
|
||||
}
|
||||
return _projectId;
|
||||
}
|
||||
@@ -36,9 +30,9 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
var provider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var nodeListingProvider = new NodeListingProvider();
|
||||
|
||||
IListingItem project = provider.GetListing((int)ProjectId);
|
||||
var project = nodeListingProvider.GetListing((int)ProjectId);
|
||||
ProjectName.Text = project.Name;
|
||||
|
||||
Live.Checked = project.Live;
|
||||
@@ -49,10 +43,10 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
|
||||
protected void Complete_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ProjectsProvider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var project = ProjectsProvider.GetListing((int)ProjectId);
|
||||
var nodeListingProvider = new NodeListingProvider();
|
||||
var project = nodeListingProvider.GetListing((int)ProjectId);
|
||||
project.Live = Live.Checked;
|
||||
ProjectsProvider.SaveOrUpdate(project);
|
||||
nodeListingProvider.SaveOrUpdate(project);
|
||||
Response.Redirect(project.NiceUrl);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,15 +3,11 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Marketplace.Providers;
|
||||
using Marketplace.Providers.Listing;
|
||||
using Marketplace.Providers.ListingItem;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using umbraco;
|
||||
using uProject.Helpers;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web.UI.Controls;
|
||||
using Member = umbraco.cms.businesslogic.member.Member;
|
||||
|
||||
namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
@@ -81,7 +77,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
private void SetupTags()
|
||||
{
|
||||
string taglist = string.Empty;
|
||||
var tagProvider = ((IProjectTagProvider)MarketplaceProviderManager.Providers["TagProvider"]);
|
||||
var tagProvider = new OurUmbraco.MarketPlace.Providers.UmbracoProjectTagProvider();
|
||||
var tags = tagProvider.GetAllTags();
|
||||
foreach(var t in tags)
|
||||
{
|
||||
@@ -99,7 +95,8 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
|
||||
private void BindCategories()
|
||||
{
|
||||
var Categories = ((ICategoryProvider)MarketplaceProviderManager.Providers["CategoryProvider"]).GetAllCategories().Where(x => !x.HQOnly);
|
||||
var categoryProvider = new OurUmbraco.MarketPlace.Providers.UmbracoCategoryProvider();
|
||||
var Categories = categoryProvider.GetAllCategories().Where(x => !x.HQOnly);
|
||||
Category.DataSource = Categories;
|
||||
Category.DataValueField = "Id";
|
||||
Category.DataTextField = "Name";
|
||||
@@ -108,8 +105,8 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
|
||||
protected void LoadProject()
|
||||
{
|
||||
var ProjectsProvider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var project = ProjectsProvider.GetListing((int)ProjectId);
|
||||
var nodeListingProvider = new OurUmbraco.MarketPlace.NodeListing.NodeListingProvider();
|
||||
var project = nodeListingProvider.GetListing((int)ProjectId);
|
||||
|
||||
Title.Text = project.Name;
|
||||
Description.Text = project.Description;
|
||||
@@ -128,7 +125,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
Collab.Checked = project.OpenForCollab;
|
||||
Terms.Checked = project.TermsAgreementDate != new DateTime();
|
||||
|
||||
var tagProvider = ((IProjectTagProvider)MarketplaceProviderManager.Providers["TagProvider"]);
|
||||
var tagProvider = new OurUmbraco.MarketPlace.Providers.UmbracoProjectTagProvider();
|
||||
var projectTags = tagProvider.GetTagsByProjectId((int)ProjectId).ToList();
|
||||
|
||||
if (projectTags.Any())
|
||||
@@ -151,7 +148,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
|
||||
protected void SaveStep(object sender, EventArgs e)
|
||||
{
|
||||
var nodeListingProvider = new OurUmbraco.MarketPlace.NodeLising.NodeListingProvider();
|
||||
var nodeListingProvider = new OurUmbraco.MarketPlace.NodeListing.NodeListingProvider();
|
||||
var project = (_editMode) ? nodeListingProvider.GetListing((int)ProjectId) : new OurUmbraco.MarketPlace.ListingItem.ListingItem(null,null);
|
||||
|
||||
project.Name = Title.Text;
|
||||
@@ -174,13 +171,12 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
|
||||
project.TermsAgreementDate = DateTime.Now.ToUniversalTime();
|
||||
|
||||
var ProjectsProvider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
ProjectsProvider.SaveOrUpdate(project);
|
||||
nodeListingProvider.SaveOrUpdate(project);
|
||||
ProjectId = project.Id;
|
||||
|
||||
if (Request["projecttags[]"] != null)
|
||||
{
|
||||
ProjectsProvider.SaveOrUpdate(project);
|
||||
nodeListingProvider.SaveOrUpdate(project);
|
||||
|
||||
var tags = new List<string>();
|
||||
foreach (var tag in Request["projecttags[]"].Split(','))
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Marketplace.Providers;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using our;
|
||||
using Marketplace.BusinessLogic;
|
||||
using Marketplace.Umbraco.BusinessLogic;
|
||||
using Marketplace.Providers.Helpers;
|
||||
using uProject.Helpers;
|
||||
using Marketplace.Providers.MediaFile;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using OurUmbraco.MarketPlace.NodeListing;
|
||||
using OurUmbraco.MarketPlace.Providers;
|
||||
using OurUmbraco.Wiki.BusinessLogic;
|
||||
using OurUmbraco.Wiki.Extensions;
|
||||
using umbraco;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using uProject.Helpers;
|
||||
|
||||
namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
public partial class Files : System.Web.UI.UserControl
|
||||
public partial class Files : UserControl
|
||||
{
|
||||
|
||||
public string MemberGuid = "";
|
||||
@@ -50,8 +47,8 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
//called after upload.
|
||||
private void RebindFiles()
|
||||
{
|
||||
var fileProvider = (IMediaProvider)MarketplaceProviderManager.Providers["MediaProvider"];
|
||||
var files = fileProvider.GetMediaFilesByProjectId((int)ProjectId).Where(x => x.FileType != FileType.screenshot);
|
||||
var mediaProvider = new MediaProvider();
|
||||
var files = mediaProvider.GetMediaFilesByProjectId((int)ProjectId).Where(x => x.FileType != FileType.screenshot.FileTypeAsString());
|
||||
if (string.IsNullOrEmpty(_defaultFile))
|
||||
{
|
||||
var defaultFile = files.OrderByDescending(x => x.CreateDate).FirstOrDefault();
|
||||
@@ -61,7 +58,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
MarkFileAsCurrent(defaultFile.Id.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
rp_packagefiles.DataSource = files;
|
||||
rp_packagefiles.Visible = (files.Count() > 0);
|
||||
@@ -71,33 +68,33 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
|
||||
protected void DeleteFile(object sender, CommandEventArgs e)
|
||||
{
|
||||
var fileProvider = (IMediaProvider)MarketplaceProviderManager.Providers["MediaProvider"];
|
||||
var f = fileProvider.GetFileById(int.Parse(e.CommandArgument.ToString()));
|
||||
|
||||
var mediaProvider = new MediaProvider();
|
||||
var f = mediaProvider.GetFileById(int.Parse(e.CommandArgument.ToString()));
|
||||
|
||||
var mem = Member.GetCurrentMember();
|
||||
|
||||
if (f.CreatedBy == mem.Id || Utils.IsProjectContributor(mem.Id, (int)ProjectId))
|
||||
|
||||
//if the file is the default file we need to clear it out of the system to stop it showing as the default download
|
||||
if (f.Id.ToString() == _defaultFile)
|
||||
{
|
||||
_defaultFile = string.Empty;
|
||||
var listingProvider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var project = listingProvider.GetListing((int)ProjectId);
|
||||
project.CurrentReleaseFile = _defaultFile;
|
||||
listingProvider.SaveOrUpdate(project);
|
||||
//if the file is the default file we need to clear it out of the system to stop it showing as the default download
|
||||
if (f.Id.ToString() == _defaultFile)
|
||||
{
|
||||
_defaultFile = string.Empty;
|
||||
var nodeListingProvider = new NodeListingProvider();
|
||||
var project = nodeListingProvider.GetListing((int)ProjectId);
|
||||
project.CurrentReleaseFile = _defaultFile;
|
||||
nodeListingProvider.SaveOrUpdate(project);
|
||||
|
||||
}
|
||||
fileProvider.Remove(f);
|
||||
}
|
||||
|
||||
mediaProvider.Remove(f);
|
||||
|
||||
RebindFiles();
|
||||
}
|
||||
|
||||
protected void ArchiveFile(object sender, CommandEventArgs e)
|
||||
{
|
||||
|
||||
var fileProvider = (IMediaProvider)MarketplaceProviderManager.Providers["MediaProvider"];
|
||||
var f = fileProvider.GetFileById(int.Parse(e.CommandArgument.ToString()));
|
||||
var mediaProvider = new MediaProvider();
|
||||
var f = mediaProvider.GetFileById(int.Parse(e.CommandArgument.ToString()));
|
||||
|
||||
if (e.CommandName == "Unarchive")
|
||||
{
|
||||
@@ -108,7 +105,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
f.Archived = true;
|
||||
}
|
||||
|
||||
fileProvider.SaveOrUpdate(f);
|
||||
mediaProvider.SaveOrUpdate(f);
|
||||
RebindFiles();
|
||||
}
|
||||
|
||||
@@ -116,7 +113,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
|
||||
{
|
||||
IMediaFile f = (IMediaFile)e.Item.DataItem;
|
||||
WikiFile f = (WikiFile)e.Item.DataItem;
|
||||
Literal _name = (Literal)e.Item.FindControl("lt_name");
|
||||
Literal _date = (Literal)e.Item.FindControl("lt_date");
|
||||
Button _delete = (Button)e.Item.FindControl("bt_delete");
|
||||
@@ -127,7 +124,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
Literal _currentRelease = (Literal)e.Item.FindControl("lt_currentRelease");
|
||||
|
||||
Button _defaultPackageFile = (Button)e.Item.FindControl("bt_default");
|
||||
if (f.FileType == FileType.package)
|
||||
if (f.FileType == FileType.package.FileTypeAsString())
|
||||
{
|
||||
if (f.Id.ToString() == _defaultFile)
|
||||
{
|
||||
@@ -146,13 +143,13 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
_defaultPackageFile.Visible = false;
|
||||
_currentRelease.Visible = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Button _archive = (Button)e.Item.FindControl("bt_archive");
|
||||
_archive.CommandArgument = f.Id.ToString();
|
||||
|
||||
|
||||
|
||||
if (f.Archived)
|
||||
{
|
||||
@@ -165,40 +162,20 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
_archive.CommandName = "Archive";
|
||||
}
|
||||
|
||||
if (f.FileType == FileType.screenshot)
|
||||
if (f.FileType == FileType.screenshot.FileTypeAsString())
|
||||
{
|
||||
_archive.Visible = false;
|
||||
}
|
||||
|
||||
if (f.UmbVersion != null)
|
||||
_version.Text = f.UmbVersion.ToVersionString();
|
||||
if (f.Versions != null)
|
||||
_version.Text = f.Versions.ToVersionString();
|
||||
|
||||
if (f.DotNetVersion != null)
|
||||
_dotNetVersion.Text = f.DotNetVersion;
|
||||
|
||||
_trustLevel.Text = (f.SupportsMediumTrust)?"Medium":"Full";
|
||||
_trustLevel.Text = (f.SupportsMediumTrust) ? "Medium" : "Full";
|
||||
|
||||
|
||||
switch (f.FileType)
|
||||
{
|
||||
case FileType.screenshot:
|
||||
_type.Text = "Screenshot";
|
||||
break;
|
||||
case FileType.package:
|
||||
_type.Text = "Package";
|
||||
break;
|
||||
case FileType.hotfix:
|
||||
_type.Text = "Hot Fix";
|
||||
break;
|
||||
case FileType.docs:
|
||||
_type.Text = "Document";
|
||||
break;
|
||||
case FileType.source:
|
||||
_type.Text = "Source";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
_type.Text = f.FileType;
|
||||
|
||||
_name.Text = "<a href='" + f.Path + "'>" + f.Name + "</a>";
|
||||
_date.Text = f.CreateDate.ToShortDateString() + " - " + f.CreateDate.ToShortTimeString();
|
||||
@@ -216,10 +193,10 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
|
||||
private void MarkFileAsCurrent(string releaseFile)
|
||||
{
|
||||
var provider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
IListingItem project = provider.GetListing((int)ProjectId);
|
||||
var nodeListingProvider = new NodeListingProvider();
|
||||
IListingItem project = nodeListingProvider.GetListing((int)ProjectId);
|
||||
project.CurrentReleaseFile = releaseFile;
|
||||
provider.SaveOrUpdate(project);
|
||||
nodeListingProvider.SaveOrUpdate(project);
|
||||
_defaultFile = project.CurrentReleaseFile;
|
||||
}
|
||||
|
||||
@@ -227,25 +204,25 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
|
||||
|
||||
if (umbraco.library.IsLoggedOn() && ProjectId != null)
|
||||
if (library.IsLoggedOn() && ProjectId != null)
|
||||
{
|
||||
var provider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var nodeListingProvider = new NodeListingProvider();
|
||||
Member mem = Member.GetCurrentMember();
|
||||
IListingItem project = provider.GetListing((int)ProjectId);
|
||||
IListingItem project = nodeListingProvider.GetListing((int)ProjectId);
|
||||
_defaultFile = project.CurrentReleaseFile;
|
||||
|
||||
|
||||
|
||||
|
||||
if ((project.Vendor.Member.Id == mem.Id) ||
|
||||
if ((project.VendorId == mem.Id) ||
|
||||
Utils.IsProjectContributor(mem.Id, (int)ProjectId))
|
||||
{
|
||||
holder.Visible = true;
|
||||
RebindFiles();
|
||||
|
||||
umbraco.library.RegisterJavaScriptFile("swfUpload", "/scripts/swfupload/SWFUpload.js");
|
||||
umbraco.library.RegisterJavaScriptFile("swfUpload_cb", "/scripts/swfupload/callbacks.js");
|
||||
umbraco.library.RegisterJavaScriptFile("swfUpload_progress", "/scripts/swfupload/fileprogress.js");
|
||||
library.RegisterJavaScriptFile("swfUpload", "/scripts/swfupload/SWFUpload.js");
|
||||
library.RegisterJavaScriptFile("swfUpload_cb", "/scripts/swfupload/callbacks.js");
|
||||
library.RegisterJavaScriptFile("swfUpload_progress", "/scripts/swfupload/fileprogress.js");
|
||||
|
||||
MemberGuid = mem.UniqueId.ToString();
|
||||
ProjectGuid = project.ProjectGuid.ToString();
|
||||
@@ -253,7 +230,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
string defaultVersion = UmbracoVersion.DefaultVersion().Version;
|
||||
string umboptions = "";
|
||||
|
||||
foreach (UmbracoVersion uv in UmbracoVersion.AvailableVersions().Values)
|
||||
foreach (OurUmbraco.Wiki.BusinessLogic.UmbracoVersion uv in UmbracoVersion.AvailableVersions().Values)
|
||||
{
|
||||
string selected = "checked='true'";
|
||||
if (uv.Version != defaultVersion)
|
||||
@@ -263,8 +240,8 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
|
||||
lt_versions.Text = umboptions;
|
||||
|
||||
|
||||
string[] dotnetversions = {"2.0","3.5","4.0", "4.5"};
|
||||
|
||||
string[] dotnetversions = { "2.0", "3.5", "4.0", "4.5" };
|
||||
string dotnetoptions = string.Empty;
|
||||
|
||||
foreach (var opt in dotnetversions)
|
||||
@@ -294,7 +271,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
lt_trustlevels.Text = trustoptions;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +282,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
protected void SaveStep(object sender, EventArgs e)
|
||||
{
|
||||
//move to the file upload step
|
||||
ProjectCreatorHelper.MoveToNextStep(this,(int)ProjectId);
|
||||
ProjectCreatorHelper.MoveToNextStep(this, (int)ProjectId);
|
||||
}
|
||||
protected void MoveLast(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Licenses.ascx.cs" Inherits="uProject.usercontrols.Deli.Package.Steps.Licenses" %>
|
||||
<asp:PlaceHolder ID="holder" runat="server" Visible="false">
|
||||
<div class="form simpleForm" id="registrationForm">
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="EditForm" Visible="false">
|
||||
<fieldset>
|
||||
<legend>Edit License Type</legend>
|
||||
<p>
|
||||
<label class="inputLabel">License Type</label>
|
||||
|
||||
<asp:TextBox runat="server" Enabled="false" ID="EditLicenseType" CssClass="title" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label class="inputLabel">Price (format 0.00) minium price 49.00</label>
|
||||
<asp:textbox runat="server" ID="EditLicensePrice" CssClass="required title minPrice"/>
|
||||
</p>
|
||||
|
||||
<div class="buttons">
|
||||
<asp:button runat="server" text="Update License" id="UpdateLicense" OnClick="UpdateLicense_Click" class="submitButton" />
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
</asp:PlaceHolder>
|
||||
|
||||
|
||||
<asp:Repeater ID="rp_licenses" OnItemDataBound="OnLicenseBound" Visible="false" runat="server">
|
||||
|
||||
<HeaderTemplate>
|
||||
<table class="dataTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>License Type</th>
|
||||
<th class="money">Price</th>
|
||||
<th class="right"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Literal ID="lt_type" runat="server" />
|
||||
</td>
|
||||
<td class="money">
|
||||
<asp:Literal ID="lt_price" runat="server" />
|
||||
</td>
|
||||
<td class="right">
|
||||
<asp:Button runat="server" ID="bt_edit" OnCommand="EditLicense" Text="Edit" CssClass="actionButton cancel" />
|
||||
<asp:Button ID="bt_disableEnable" runat="server" OnCommand="DisableEnableLicense" Text="Disable" CssClass="actionButton cancel" />
|
||||
<asp:Button Visible="false" ID="bt_delete" runat="server" OnClientClick="return confirm('Are you sure you want to delete this license?')" OnCommand="DeleteLicense" Text="Delete" CssClass="actionButton cancel" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
</tbody>
|
||||
</table>
|
||||
</FooterTemplate>
|
||||
</asp:Repeater>
|
||||
<small>NOTE: Only licenses types that have not been purchased by users can be deleted. If a license has been purchased you may disable it.</small>
|
||||
<asp:PlaceHolder runat="server" ID="CreateForm">
|
||||
<fieldset>
|
||||
<legend>Create License Type</legend>
|
||||
<p>
|
||||
<label class="inputLabel">Choose License Type</label>
|
||||
|
||||
<asp:DropDownList runat="server" id="licenseTypes" cssclass="title">
|
||||
<asp:ListItem Value="Domain" Text="Domain"/>
|
||||
<asp:ListItem Value="IP" Text="IP"/>
|
||||
<asp:ListItem Value="Unlimited" Text="Unlimited"/>
|
||||
<asp:ListItem Value="SourceCode" Text="Source Code"/>
|
||||
</asp:DropDownList>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label class="inputLabel">Price (format 0.00) minium price 49.00</label>
|
||||
<asp:textbox runat="server" ID="price" CssClass="required title minPrice" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<asp:button runat="server" text="Create License" id="btn_SaveLicense" OnClick="SaveLicense_Click" CssClass="submitButton" />
|
||||
</p>
|
||||
|
||||
<div class="deliNotification">
|
||||
<h3>Your Vendor Key</h3>
|
||||
<asp:PlaceHolder runat="server" ID="GenKeyPlaceHolder" Visible ="false">
|
||||
<asp:linkButton runat="server" ID="GenKey" OnClick="GenKey_Click">Generate your project key</asp:linkButton>. This will generate a unique key for your project. This step can only be done once so click wisely.
|
||||
</asp:PlaceHolder>
|
||||
<asp:PlaceHolder runat="server" ID="DownloadKeyPlaceHolder" Visible ="false">
|
||||
<asp:linkButton runat="server" ID="DownloadKey" OnClick="DownloadKey_Click">Download your Vendor Key for your project</asp:linkButton>. This License Key file is used in your code when you implement Deli Licensing in your project.
|
||||
</asp:PlaceHolder>
|
||||
<h3 style="margin-top:10px">Your Packages Unique Deli Id</h3>
|
||||
<p><asp:Literal runat="server" ID="uniqueId" /></p>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<asp:linkbutton runat="server" Text="Previous" ID="MovePrevious" OnClick="MoveLast" class="cancel" />
|
||||
<asp:Button runat="server" Text="Next" ID="MoveNext" OnClick="SaveStep" CssClass="submitButton cancel" />
|
||||
</div>
|
||||
</fieldset>
|
||||
</asp:PlaceHolder>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
var form = $("form");
|
||||
|
||||
jQuery.validator.addMethod("minPrice", function (value, element) { return value >= 49.00 }, "Please enter a price greater than equal to 49.00");
|
||||
|
||||
form.validate({
|
||||
onsubmit: false,
|
||||
invalidHandler: function (f, v) {
|
||||
var errors = v.numberOfInvalids();
|
||||
if (errors.length > 0) {
|
||||
validator.focusInvalid();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(".submitButton").click(function (evt) {
|
||||
// Validate the form and retain the result.
|
||||
var isValid = $("form").valid();
|
||||
|
||||
// If the form didn't validate, prevent the
|
||||
// form submission.
|
||||
if (!isValid)
|
||||
evt.preventDefault();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</asp:PlaceHolder>
|
||||
@@ -1,99 +0,0 @@
|
||||
using System;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using uProject.Helpers;
|
||||
|
||||
namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
public partial class Licenses : UserControl
|
||||
{
|
||||
private Guid _projectGuid;
|
||||
|
||||
|
||||
private bool _editMode
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Request["projectId"]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private int? _projectId;
|
||||
public int? ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Request["id"]))
|
||||
{
|
||||
_projectId = Int32.Parse(Request["id"]);
|
||||
}
|
||||
return _projectId;
|
||||
}
|
||||
set
|
||||
{
|
||||
_projectId = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void ReBindLicenses()
|
||||
{
|
||||
}
|
||||
|
||||
protected void EditLicense(object sender, CommandEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
protected void UpdateLicense_Click(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
protected void DeleteLicense(object sender, CommandEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
protected void DisableEnableLicense(object sender, CommandEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
protected void OnLicenseBound(object sender, RepeaterItemEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void SaveLicense_Click(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
protected void GenKey_Click(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
protected void DownloadKey_Click(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
protected void SaveStep(object sender, EventArgs e)
|
||||
{
|
||||
//move to the license step
|
||||
ProjectCreatorHelper.MoveToNextStep(this, (int)ProjectId);
|
||||
}
|
||||
|
||||
protected void MoveLast(object sender, EventArgs e)
|
||||
{
|
||||
//move to the screenshots step
|
||||
ProjectCreatorHelper.MoveToPreviousStep(this, (int)ProjectId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace uProject.usercontrols.Deli.Package.Steps {
|
||||
|
||||
|
||||
public partial class Licenses {
|
||||
|
||||
/// <summary>
|
||||
/// holder control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder holder;
|
||||
|
||||
/// <summary>
|
||||
/// EditForm control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder EditForm;
|
||||
|
||||
/// <summary>
|
||||
/// EditLicenseType control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox EditLicenseType;
|
||||
|
||||
/// <summary>
|
||||
/// EditLicensePrice control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox EditLicensePrice;
|
||||
|
||||
/// <summary>
|
||||
/// UpdateLicense control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button UpdateLicense;
|
||||
|
||||
/// <summary>
|
||||
/// rp_licenses control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater rp_licenses;
|
||||
|
||||
/// <summary>
|
||||
/// CreateForm control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder CreateForm;
|
||||
|
||||
/// <summary>
|
||||
/// licenseTypes control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList licenseTypes;
|
||||
|
||||
/// <summary>
|
||||
/// price control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox price;
|
||||
|
||||
/// <summary>
|
||||
/// btn_SaveLicense control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btn_SaveLicense;
|
||||
|
||||
/// <summary>
|
||||
/// GenKeyPlaceHolder control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder GenKeyPlaceHolder;
|
||||
|
||||
/// <summary>
|
||||
/// GenKey control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton GenKey;
|
||||
|
||||
/// <summary>
|
||||
/// DownloadKeyPlaceHolder control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder DownloadKeyPlaceHolder;
|
||||
|
||||
/// <summary>
|
||||
/// DownloadKey control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton DownloadKey;
|
||||
|
||||
/// <summary>
|
||||
/// uniqueId control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal uniqueId;
|
||||
|
||||
/// <summary>
|
||||
/// MovePrevious control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton MovePrevious;
|
||||
|
||||
/// <summary>
|
||||
/// MoveNext control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button MoveNext;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Marketplace.Providers;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using our;
|
||||
using Marketplace.Umbraco.BusinessLogic;
|
||||
using Marketplace.Providers.Helpers;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using OurUmbraco.MarketPlace.NodeListing;
|
||||
using OurUmbraco.MarketPlace.Providers;
|
||||
using OurUmbraco.Wiki.BusinessLogic;
|
||||
using umbraco;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using uProject.Helpers;
|
||||
using Umbraco.Web.UI.Controls;
|
||||
|
||||
namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
public partial class Screenshots : System.Web.UI.UserControl
|
||||
public partial class Screenshots : UmbracoUserControl
|
||||
{
|
||||
|
||||
public string MemberGuid = "";
|
||||
@@ -46,8 +45,8 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
|
||||
private void RebindFiles()
|
||||
{
|
||||
var fileProvider = (IMediaProvider)MarketplaceProviderManager.Providers["MediaProvider"];
|
||||
var files = fileProvider.GetMediaFilesByProjectId((int)ProjectId).Where(x=>x.FileType == FileType.screenshot);
|
||||
var mediaProvider = new MediaProvider();
|
||||
var files = mediaProvider.GetMediaFilesByProjectId((int)ProjectId).Where(x=>x.FileType == FileType.screenshot.FileTypeAsString());
|
||||
|
||||
if (string.IsNullOrEmpty(_defaultFile))
|
||||
{
|
||||
@@ -67,31 +66,28 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
|
||||
protected void DeleteFile(object sender, CommandEventArgs e)
|
||||
{
|
||||
var fileProvider = (IMediaProvider)MarketplaceProviderManager.Providers["MediaProvider"];
|
||||
var f = fileProvider.GetFileById(int.Parse(e.CommandArgument.ToString()));
|
||||
var mediaProvider = new MediaProvider();
|
||||
var f = mediaProvider.GetFileById(int.Parse(e.CommandArgument.ToString()));
|
||||
_defaultFile = string.Empty;
|
||||
|
||||
//update the project
|
||||
var provider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
IListingItem project = provider.GetListing((int)ProjectId);
|
||||
var nodeListingProvider = new NodeListingProvider();
|
||||
IListingItem project = nodeListingProvider.GetListing((int)ProjectId);
|
||||
project.DefaultScreenshot = _defaultFile;
|
||||
provider.SaveOrUpdate(project);
|
||||
|
||||
|
||||
|
||||
nodeListingProvider.SaveOrUpdate(project);
|
||||
|
||||
var mem = Member.GetCurrentMember();
|
||||
|
||||
if (f.CreatedBy == mem.Id || Utils.IsProjectContributor(mem.Id, (int)ProjectId))
|
||||
fileProvider.Remove(f);
|
||||
mediaProvider.Remove(f);
|
||||
|
||||
RebindFiles();
|
||||
}
|
||||
|
||||
protected void ArchiveFile(object sender, CommandEventArgs e)
|
||||
{
|
||||
|
||||
var fileProvider = (IMediaProvider)MarketplaceProviderManager.Providers["MediaProvider"];
|
||||
var f = fileProvider.GetFileById(int.Parse(e.CommandArgument.ToString()));
|
||||
var mediaProvider = new MediaProvider();
|
||||
var f = mediaProvider.GetFileById(int.Parse(e.CommandArgument.ToString()));
|
||||
|
||||
if (e.CommandName == "Unarchive")
|
||||
{
|
||||
@@ -102,7 +98,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
f.Archived = true;
|
||||
}
|
||||
|
||||
fileProvider.SaveOrUpdate(f);
|
||||
mediaProvider.SaveOrUpdate(f);
|
||||
RebindFiles();
|
||||
}
|
||||
|
||||
@@ -110,7 +106,7 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
|
||||
{
|
||||
IMediaFile f = (IMediaFile)e.Item.DataItem;
|
||||
WikiFile f = (WikiFile)e.Item.DataItem;
|
||||
Image _image = (Image)e.Item.FindControl("img_image");
|
||||
Literal _date = (Literal)e.Item.FindControl("lt_date");
|
||||
Button _delete = (Button)e.Item.FindControl("bt_delete");
|
||||
@@ -147,10 +143,10 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
|
||||
private void MarkFileAsCurrent(string defaultScreenshot)
|
||||
{
|
||||
var provider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
IListingItem project = provider.GetListing((int)ProjectId);
|
||||
var nodeListingProvider = new NodeListingProvider();
|
||||
IListingItem project = nodeListingProvider.GetListing((int)ProjectId);
|
||||
project.DefaultScreenshot = defaultScreenshot;
|
||||
provider.SaveOrUpdate(project);
|
||||
nodeListingProvider.SaveOrUpdate(project);
|
||||
_defaultFile = project.DefaultScreenshot;
|
||||
}
|
||||
|
||||
@@ -158,23 +154,23 @@ namespace uProject.usercontrols.Deli.Package.Steps
|
||||
{
|
||||
|
||||
|
||||
if (umbraco.library.IsLoggedOn() && ProjectId != null)
|
||||
if (library.IsLoggedOn() && ProjectId != null)
|
||||
{
|
||||
var provider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var nodeListingProvider = new NodeListingProvider();
|
||||
Member mem = Member.GetCurrentMember();
|
||||
IListingItem project = provider.GetListing((int)ProjectId);
|
||||
IListingItem project = nodeListingProvider.GetListing((int)ProjectId);
|
||||
_defaultFile = project.DefaultScreenshot;
|
||||
|
||||
|
||||
if ((project.Vendor.Member.Id == mem.Id) ||
|
||||
if ((project.VendorId == mem.Id) ||
|
||||
Utils.IsProjectContributor(mem.Id, (int)ProjectId))
|
||||
{
|
||||
holder.Visible = true;
|
||||
RebindFiles();
|
||||
|
||||
umbraco.library.RegisterJavaScriptFile("swfUpload", "/scripts/swfupload/SWFUpload.js");
|
||||
umbraco.library.RegisterJavaScriptFile("swfUpload_cb", "/scripts/swfupload/callbacks.js");
|
||||
umbraco.library.RegisterJavaScriptFile("swfUpload_progress", "/scripts/swfupload/fileprogress.js");
|
||||
library.RegisterJavaScriptFile("swfUpload", "/scripts/swfupload/SWFUpload.js");
|
||||
library.RegisterJavaScriptFile("swfUpload_cb", "/scripts/swfupload/callbacks.js");
|
||||
library.RegisterJavaScriptFile("swfUpload_progress", "/scripts/swfupload/fileprogress.js");
|
||||
|
||||
MemberGuid = mem.UniqueId.ToString();
|
||||
ProjectGuid = project.ProjectGuid.ToString();
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Marketplace.Providers;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using OurUmbraco.MarketPlace.NodeListing;
|
||||
using Umbraco.Web.UI.Controls;
|
||||
|
||||
namespace uProject.usercontrols.Deli.Profile
|
||||
{
|
||||
public partial class MyProjects : System.Web.UI.UserControl
|
||||
public partial class MyProjects : UmbracoUserControl
|
||||
{
|
||||
public int edit { get; set; }
|
||||
public int forum { get; set; }
|
||||
@@ -27,18 +23,15 @@ namespace uProject.usercontrols.Deli.Profile
|
||||
forumUrl = umbraco.library.NiceUrl(forum);
|
||||
licenseUrl = umbraco.library.NiceUrl(licenses);
|
||||
teamUrl = umbraco.library.NiceUrl(team);
|
||||
|
||||
var nodeListingProvider = new NodeListingProvider();
|
||||
var memberId = Members.GetCurrentMemberId();
|
||||
|
||||
|
||||
var memberProvider = (IMemberProvider)MarketplaceProviderManager.Providers["MemberProvider"];
|
||||
var member = memberProvider.GetCurrentMember();
|
||||
var provider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
|
||||
|
||||
var projects = provider.GetListingsByVendor(member.Id, true, true).OrderBy(x=> x.Name);
|
||||
var projects = nodeListingProvider.GetListingsByVendor(memberId, true, true).OrderBy(x=> x.Name);
|
||||
myProjects.DataSource = projects;
|
||||
myProjects.DataBind();
|
||||
|
||||
var contribProjects = provider.GetListingsForContributor(member.Id);
|
||||
var contribProjects = nodeListingProvider.GetListingsForContributor(memberId);
|
||||
myTeamProjects.DataSource = contribProjects;
|
||||
myTeamProjects.DataBind();
|
||||
}
|
||||
|
||||
@@ -141,12 +141,6 @@
|
||||
<Reference Include="MarkdownSharp">
|
||||
<HintPath>..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Marketplace.Providers">
|
||||
<HintPath>..\dependencies\MarketPlace\Marketplace.Providers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Marketplace.Umbraco">
|
||||
<HintPath>..\dependencies\MarketPlace\Marketplace.Umbraco.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.2.8-build103\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@@ -458,9 +452,6 @@
|
||||
<Content Include="macroScripts\GoogleDevGroupRSS.cshtml" />
|
||||
<Content Include="macroScripts\Releases-GetAllReleases.cshtml" />
|
||||
<Content Include="macroScripts\Releases-ReleaseList.cshtml" />
|
||||
<Content Include="macroScripts\repository-popularpackages.cshtml" />
|
||||
<Content Include="macroScripts\repository-view-category.cshtml" />
|
||||
<Content Include="macroScripts\repository-view-project.cshtml" />
|
||||
<Content Include="macroScripts\testWikiFile.cshtml" />
|
||||
<Content Include="masterpages\AttachFile.master" />
|
||||
<Content Include="masterpages\Authentication.master" />
|
||||
@@ -4341,25 +4332,20 @@
|
||||
<Content Include="usercontrols\Deli\Dashboard\VendorBIOverview.ascx" />
|
||||
<Content Include="usercontrols\Deli\Dashboard\VendorProjectBI.ascx" />
|
||||
<Content Include="usercontrols\Deli\EditPackage.ascx" />
|
||||
<Content Include="usercontrols\Deli\FeaturedProject.ascx" />
|
||||
<Content Include="usercontrols\Deli\HQStaffPickProjects.ascx" />
|
||||
<Content Include="usercontrols\Deli\License\Member\MyLicenses.ascx" />
|
||||
<Content Include="usercontrols\Deli\License\Vendor\ProjectLicenses.ascx" />
|
||||
<Content Include="usercontrols\Deli\ListPagination.ascx" />
|
||||
<Content Include="usercontrols\Deli\NewestProjects.ascx" />
|
||||
<Content Include="usercontrols\Deli\Package\Editor.ascx" />
|
||||
<Content Include="usercontrols\Deli\Package\Steps\Complete.ascx" />
|
||||
<Content Include="usercontrols\Deli\Package\Steps\Details.ascx" />
|
||||
<Content Include="usercontrols\Deli\Package\Steps\Files.ascx" />
|
||||
<Content Include="usercontrols\Deli\Package\Steps\Licenses.ascx" />
|
||||
<Content Include="usercontrols\Deli\Package\Steps\Screenshots.ascx" />
|
||||
<Content Include="usercontrols\Deli\Payout\VendorPayout.ascx" />
|
||||
<Content Include="usercontrols\Deli\Payout\VendorPayoutHistory.ascx" />
|
||||
<Content Include="usercontrols\Deli\PopularProjects.ascx" />
|
||||
<Content Include="usercontrols\Deli\Profile\MemberDataLookup.ascx" />
|
||||
<Content Include="usercontrols\Deli\Profile\MyProjects.ascx" />
|
||||
<Content Include="usercontrols\Deli\Profile\Signup.ascx" />
|
||||
<Content Include="usercontrols\Deli\ProjectsList.ascx" />
|
||||
<Content Include="usercontrols\Deli\ProjectView.ascx" />
|
||||
<Content Include="usercontrols\Deli\Purchase\PayPalConfirm.ascx" />
|
||||
<Content Include="usercontrols\Deli\Purchase\PayPalPayment.ascx" />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using Marketplace.Interfaces
|
||||
@using Marketplace.Providers
|
||||
@using System.Configuration
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Forum.Services
|
||||
@{
|
||||
@@ -22,10 +21,21 @@
|
||||
|
||||
var roles = member.GetRoles();
|
||||
|
||||
var provider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var projects = provider.GetListingsByVendor(member.Id, true, true).OrderByDescending(x => x.CreateDate);
|
||||
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
|
||||
var content = umbracoHelper.TypedContent(int.Parse(ConfigurationManager.AppSettings["deliProjectRoot"]));
|
||||
IEnumerable<IPublishedContent> projects = new List<IPublishedContent>();
|
||||
var contribProjects = new List<IPublishedContent>();
|
||||
if (content != null)
|
||||
{
|
||||
projects = content.Descendants().Where(c => c.DocumentTypeAlias == "Project").Where(m => m.GetPropertyValue<int>("owner") == member.Id).Where(p => p.GetPropertyValue<bool>("projectLive"));
|
||||
const string sql = @"SELECT * FROM projectContributors WHERE memberId=@memberId";
|
||||
var contribPackageIds = UmbracoContext.Application.DatabaseContext.Database.Fetch<int>(sql, new { memberId });
|
||||
foreach (var contribPackageId in contribPackageIds)
|
||||
{
|
||||
contribProjects.Add(umbracoHelper.TypedContent(contribPackageId));
|
||||
}
|
||||
}
|
||||
|
||||
var contribProjects = provider.GetListingsForContributor(member.Id).OrderByDescending(x => x.CreateDate);
|
||||
var currentMember = Members.GetCurrentMember();
|
||||
var reputationCurrent = member.GetPropertyValue<int>("reputationCurrent");
|
||||
|
||||
@@ -124,24 +134,24 @@
|
||||
<div class="col-md-12">
|
||||
<div class="package-forum-activity">
|
||||
<h3>Packages created</h3>
|
||||
@foreach (var project in projects.Where(x => x.Live))
|
||||
@foreach (var project in projects.Where(x => x.GetPropertyValue<bool>("projectLive")).OrderByDescending(x => x.CreateDate))
|
||||
{
|
||||
<a href="@project.NiceUrl" class="forum-thread">
|
||||
<a href="@project.Url" class="forum-thread">
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
@if (string.IsNullOrWhiteSpace(project.DefaultScreenshot.Trim()))
|
||||
@if (string.IsNullOrWhiteSpace(project.GetPropertyValue<string>("defaultScreenshotPath").Trim()))
|
||||
{
|
||||
<i class="icon-Box" style="font-size: 30px; padding-top: 5px; display: inline-block; color: black;"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img src="@our.Utils.GetScreenshotPath(project.DefaultScreenshot)?width=100&height=100&mode=crop" alt="@project.Name">
|
||||
<img src="@our.Utils.GetScreenshotPath(project.GetPropertyValue<string>("defaultScreenshotPath"))?width=100&height=100&mode=crop" alt="@project.Name">
|
||||
}
|
||||
</div>
|
||||
<div class="col-xs-10">
|
||||
<div class="forum-thread-text">
|
||||
<h3>@project.Name</h3>
|
||||
<p>@Umbraco.StripHtml(Umbraco.Truncate(project.Description, 120))</p>
|
||||
<p>@Umbraco.StripHtml(Umbraco.Truncate(project.GetPropertyValue<string>("description"), 120))</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -157,24 +167,24 @@
|
||||
<div class="col-md-12">
|
||||
<div class="package-forum-activity">
|
||||
<h2>Packages contributed to</h2>
|
||||
@foreach (var project in contribProjects.Where(x => x.Live))
|
||||
@foreach (var project in contribProjects.Where(x => x.GetPropertyValue<bool>("projectLive")).OrderByDescending(x => x.CreateDate))
|
||||
{
|
||||
<a href="@project.NiceUrl" class="forum-thread">
|
||||
<a href="@project.Url" class="forum-thread">
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
@if (string.IsNullOrWhiteSpace(project.DefaultScreenshot.Trim()))
|
||||
@if (string.IsNullOrWhiteSpace(project.GetPropertyValue<string>("defaultScreenshotPath").Trim()))
|
||||
{
|
||||
<i class="icon-Box" style="font-size: 30px; padding-top: 5px; display: inline-block; color: black;"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img src="@our.Utils.GetScreenshotPath(project.DefaultScreenshot)?width=100&height=100&mode=crop" alt="@project.Name">
|
||||
<img src="@our.Utils.GetScreenshotPath(project.GetPropertyValue<string>("defaultScreenshotPath"))?width=100&height=100&mode=crop" alt="@project.Name">
|
||||
}
|
||||
</div>
|
||||
<div class="col-xs-10">
|
||||
<div class="forum-thread-text">
|
||||
<h3>@project.Name</h3>
|
||||
<p>@Umbraco.StripHtml(Umbraco.Truncate(project.Description, 120))</p>
|
||||
<p>@Umbraco.StripHtml(Umbraco.Truncate(project.GetPropertyValue<string>("description"), 120))</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
@using Marketplace.Interfaces
|
||||
@using Marketplace.Providers
|
||||
@using System.Xml;
|
||||
@using System.Xml.XPath;
|
||||
@using OurUmbraco.Powers.Library
|
||||
@using Umbraco.Core
|
||||
|
||||
@{
|
||||
var projectsProvider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var take = 30;
|
||||
|
||||
var wrapperClass = "notLoggedIn";
|
||||
|
||||
var qs = Request.RawUrl.Substring( Request.RawUrl.IndexOf('?')+1 );
|
||||
|
||||
var version = "v45";
|
||||
if(Request.QueryString["version"] != null){
|
||||
version = Request.QueryString["version"].ToLower();
|
||||
}
|
||||
|
||||
const string uniqueWhatever = "E295637E-E957-4CCA-92CE-BF5D58F9FF59";
|
||||
var cacheKey = uniqueWhatever + "[" + version + "]";
|
||||
var cache = ApplicationContext.Current.ApplicationCache.RuntimeCache;
|
||||
IEnumerable<IListingItem> projects = (IEnumerable<IListingItem>) cache.GetCacheItem(cacheKey, () =>
|
||||
{
|
||||
return projectsProvider
|
||||
.GetListingsByKarma(0, take, true, false)
|
||||
.Where(x => !x.NotAPackage &&
|
||||
(string.Join("", x.UmbracoVerionsSupported).Contains("nan") ||
|
||||
string.Join("", x.UmbracoVerionsSupported).Contains(version)));
|
||||
}, TimeSpan.FromMinutes(10));
|
||||
//var projects = projectsProvider
|
||||
// .GetListingsByKarma(0, take, true, false)
|
||||
// .Where(x => !x.NotAPackage &&
|
||||
// (string.Join("",x.UmbracoVerionsSupported).Contains("nan") ||
|
||||
// string.Join("",x.UmbracoVerionsSupported).Contains(version) ) );
|
||||
|
||||
var pUrl = "/repo_viewproject?" + qs + "&project_id=";
|
||||
var favs = new List<IListingItem>();
|
||||
|
||||
|
||||
if(umbraco.library.IsLoggedOn()){
|
||||
wrapperClass = "loggedIn";
|
||||
|
||||
var memId = umbraco.cms.businesslogic.member.Member.GetCurrentMember().Id;
|
||||
|
||||
var iterator = Xslt.ItemsVotedFor(memId, "powersproject").Current.Select("//id");
|
||||
while (iterator.MoveNext() && iterator.CurrentPosition < 20)
|
||||
{
|
||||
var node = (IHasXmlNode)iterator.Current;
|
||||
|
||||
if(node != null){
|
||||
string id = umbraco.xmlHelper.GetNodeValue(node.GetNode());
|
||||
|
||||
if(id != null){
|
||||
try{
|
||||
var project = projectsProvider.GetListing(int.Parse(id), false);
|
||||
if(project != null){
|
||||
favs.Add(project);
|
||||
}
|
||||
}catch{
|
||||
//do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
favs = favs.Where(x => !x.NotAPackage && (string.Join("",x.UmbracoVerionsSupported).Contains("nan") || string.Join("",x.UmbracoVerionsSupported).Contains(version) )).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
<div class="@wrapperClass">
|
||||
|
||||
<div class="projectDiv">
|
||||
<h1>Popular Packages</h1>
|
||||
<p>The most popular packages, based on karma and downloads</p>
|
||||
<ul class="projects">
|
||||
@foreach(var project in projects)
|
||||
{
|
||||
<li class="clearfix">
|
||||
<div class="deliPackage">
|
||||
|
||||
<div class="brief">
|
||||
|
||||
@{
|
||||
var screenShot = project.DefaultScreenshot;
|
||||
var image = string.IsNullOrEmpty(screenShot) == false ? screenShot + "?width=50&height=50&bgcolor=fff" : "/css/img/package2.png";
|
||||
}
|
||||
<a href="@pUrl@project.Id" class="packageIcon" style="background: url('@image') no-repeat top left;">Package</a>
|
||||
|
||||
<h3><a rel="@project.ProjectGuid" href="@pUrl@project.Id">@project.Name</a></h3>
|
||||
|
||||
<div class="category">@uProject.library.GetCategoryName((int)project.Id)</div>
|
||||
</div>
|
||||
|
||||
<div class="hiLite">
|
||||
<p><a rel="@project.ProjectGuid" title="@project.Name" href="@pUrl@project.Id">@uProject.library.ShortenText(project.Description)</a></p>
|
||||
</div>
|
||||
|
||||
<div class="popularity">
|
||||
<div class="karma">
|
||||
@project.Karma
|
||||
<small>Karma</small>
|
||||
</div>
|
||||
<div class="downloads">
|
||||
@project.Downloads
|
||||
<small>Downloads</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@if(favs.Count() > 0){
|
||||
<div class="favsDiv">
|
||||
<h1>Your favorites</h1>
|
||||
<p>This is your favourites, based on your karma votes and downloads</p>
|
||||
<ul class="projects">
|
||||
@foreach(var project in @favs)
|
||||
{
|
||||
<li class="clearfix">
|
||||
<div class="deliPackage">
|
||||
|
||||
<div class="brief">
|
||||
|
||||
@{
|
||||
var screenShot = project.DefaultScreenshot;
|
||||
var image = string.IsNullOrEmpty(screenShot) == false ? screenShot + "?width=50&height=50&bgcolor=fff" : "/css/img/package2.png";
|
||||
}
|
||||
<a href="@pUrl@project.Id" class="packageIcon" style="background: url('@image') no-repeat top left;">Package</a>
|
||||
|
||||
<h3><a rel="@project.ProjectGuid" href="@pUrl@project.Id">@project.Name</a></h3>
|
||||
|
||||
<div class="category">@uProject.library.GetCategoryName((int)project.Id)</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="hiLite">
|
||||
<p><a rel="@project.ProjectGuid" title="@project.Name" href="@pUrl@project.Id">@uProject.library.ShortenText(project.Description)</a></p>
|
||||
</div>
|
||||
|
||||
<div class="popularity">
|
||||
<div class="karma">
|
||||
@project.Karma
|
||||
<small>Karma</small>
|
||||
</div>
|
||||
<div class="downloads">
|
||||
@project.Downloads
|
||||
<small>Downloads</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}else{
|
||||
<a href="#" id="loginToSeeFavs" class="rounded">Log in to see your favourites</a>
|
||||
}
|
||||
</div>
|
||||
@@ -1,91 +0,0 @@
|
||||
@using Marketplace.Interfaces
|
||||
@using Marketplace.Providers
|
||||
@using Umbraco.Core
|
||||
|
||||
@{
|
||||
|
||||
var id = int.Parse(Request.QueryString["category_id"]);
|
||||
var categoryProvider = (ICategoryProvider)MarketplaceProviderManager.Providers["CategoryProvider"];
|
||||
var category = categoryProvider.GetCategory(id);
|
||||
var fullversion = Request.QueryString["fullversion"];
|
||||
|
||||
var version = "v45";
|
||||
if (Request.QueryString["version"] != null)
|
||||
{
|
||||
version = Request.QueryString["version"].ToLower();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(fullversion) && fullversion.Substring(0, 1) == "7")
|
||||
{
|
||||
version = "v7";
|
||||
}
|
||||
|
||||
var ProjectsProvider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var qs = Request.RawUrl.Substring(Request.RawUrl.IndexOf('?') + 1).Replace("&category_id=" + id, "");
|
||||
|
||||
const string uniqueWhatever = "254D2E95-4E57-4777-AC01-2F45B28E942C";
|
||||
var cacheKey = uniqueWhatever + "[" + category.Id + "]";
|
||||
var cache = ApplicationContext.Current.ApplicationCache.RuntimeCache;
|
||||
IEnumerable<IListingItem> projects = (IEnumerable<IListingItem>) cache.GetCacheItem(cacheKey, () =>
|
||||
ProjectsProvider
|
||||
.GetListingsByCategory(category, true, true)
|
||||
.Where(x => !x.NotAPackage && x.Approved &&
|
||||
(string.Join("", x.UmbracoVerionsSupported).Contains("nan") ||
|
||||
string.Join("", x.UmbracoVerionsSupported).Contains(version))),
|
||||
TimeSpan.FromMinutes(10));
|
||||
|
||||
var pUrl = "/repo_viewproject?" + qs + "&project_id=";
|
||||
}
|
||||
|
||||
<ul id="breadcrumb">
|
||||
<li><a href="/repo?@qs">Repository</a> →</li>
|
||||
<li>@category.Name</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="category">
|
||||
<h1>@category.Name</h1>
|
||||
|
||||
<ul class="projects">
|
||||
@foreach (var project in projects)
|
||||
{
|
||||
<li class="clearfix">
|
||||
<div class="deliPackage">
|
||||
|
||||
<div class="brief">
|
||||
@{
|
||||
var screenShot = project.DefaultScreenshot;
|
||||
var image = string.IsNullOrEmpty(screenShot) == false ? screenShot + "?width=50&height=50&bgcolor=fff" : "/css/img/package2.png";
|
||||
}
|
||||
<a rel="@project.ProjectGuid" href="@pUrl@project.Id" class="packageIcon" style="background: url('@image') no-repeat top left;">Package</a>
|
||||
|
||||
<h3><a href="@pUrl@project.Id">@project.Name</a></h3>
|
||||
|
||||
<div class="category">@uProject.library.GetCategoryName((int)project.Id)</div>
|
||||
|
||||
|
||||
<div class='commercialIndicator @project.ListingType'>@project.ListingType</div>
|
||||
</div>
|
||||
|
||||
<div class="hiLite">
|
||||
|
||||
<p><a rel="@project.ProjectGuid" title="@project.Name" href="@pUrl@project.Id">@uProject.library.ShortenText(project.Description)</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="popularity">
|
||||
<div class="karma">
|
||||
@project.Karma
|
||||
<small>Karma</small>
|
||||
</div>
|
||||
<div class="downloads">
|
||||
@project.Downloads
|
||||
<small>Downloads</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -1,150 +0,0 @@
|
||||
@using Marketplace.Interfaces
|
||||
@using Marketplace.Providers
|
||||
|
||||
@{
|
||||
var ProjectsProvider = (IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"];
|
||||
var projectId = int.Parse(Request.QueryString["project_id"]);
|
||||
|
||||
var qs = Request.RawUrl.Substring( Request.RawUrl.IndexOf('?')+1 ).Replace("&project_id=" + projectId, "");
|
||||
var callback = Request.QueryString["callback"];
|
||||
|
||||
var Project = ProjectsProvider.GetListing(projectId, false);
|
||||
var parentId = new umbraco.NodeFactory.Node(projectId).Parent.Id;
|
||||
|
||||
var pUrl = "repo/project?id=";
|
||||
|
||||
string descCssClass = "noWrap";
|
||||
string ProjectCompatitbleWithUmbraco = "4.0";
|
||||
string ProjectCompatitbleWithDotNet = "4.0";
|
||||
string ProjectCompatitbleWithMediumTrust = "No";
|
||||
|
||||
if(Project.Description.Length > 2000){
|
||||
descCssClass = "wrap";}
|
||||
|
||||
var file = Project.PackageFile.Where(x => x.Id == Int32.Parse(Project.CurrentReleaseFile)).FirstOrDefault();
|
||||
if (file != null)
|
||||
{
|
||||
var ct = "This project is compaitible with ";
|
||||
var c = file.UmbVersion.Count;
|
||||
|
||||
var coms = file.UmbVersion;
|
||||
|
||||
if (c > 2)
|
||||
{
|
||||
coms = file.UmbVersion.Take(2).ToList();
|
||||
}
|
||||
|
||||
foreach (var com in coms)
|
||||
{
|
||||
|
||||
ct += com.Name + ", ";
|
||||
}
|
||||
|
||||
ct = ct.Trim().TrimEnd(',');
|
||||
|
||||
if (c > 2)
|
||||
{
|
||||
ct += " and " + (c - 2) + " other versions.";
|
||||
}
|
||||
|
||||
|
||||
ProjectCompatitbleWithUmbraco= ct;
|
||||
ProjectCompatitbleWithDotNet= file.DotNetVersion;
|
||||
ProjectCompatitbleWithMediumTrust= (file.SupportsMediumTrust) ? "Yes" : "No";
|
||||
}
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery("#projectDescriptionText a").click(function(event){event.preventDefault(); });
|
||||
</script>
|
||||
|
||||
|
||||
<ul id="breadcrumb">
|
||||
<li><a href="/repo?@qs">Repository</a> →</li>
|
||||
<li><a href="/repo_category?@qs&category_id=@parentId">@uProject.library.GetCategoryName((int)Project.Id)</a> →</li>
|
||||
<li>@Project.Name</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="project">
|
||||
|
||||
<h1 class="projectName"><span>@Project.Name</span>
|
||||
<a href="#" title="@Project.Name" rel="@Project.ProjectGuid" class="btn">Install package</a>
|
||||
</h1>
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<div class="box">
|
||||
|
||||
<dl class="projetProps summary">
|
||||
<dt>Project owner:</dt>
|
||||
<dd>@Project.Vendor.Member.Name</dd>
|
||||
|
||||
<dt>Package downloads</dt>
|
||||
<dd>@Project.Downloads</dd>
|
||||
|
||||
<dt>Package karma</dt>
|
||||
<dd>@Project.Karma</dd>
|
||||
|
||||
|
||||
<dt>Compatibility:</dt>
|
||||
<dd>
|
||||
@ProjectCompatitbleWithUmbraco<br />
|
||||
.NET Version: @ProjectCompatitbleWithDotNet<br />
|
||||
Supports Medium Trust: @ProjectCompatitbleWithMediumTrust
|
||||
</dd>
|
||||
<dt>Created:</dt>
|
||||
<dd>
|
||||
@Project.CreateDate.ToString("D")
|
||||
</dd>
|
||||
|
||||
|
||||
@if(Project.Stable){
|
||||
<dt>Is Stable:</dt>
|
||||
<dd>
|
||||
<span class="green">Project is stable</span>
|
||||
</dd>
|
||||
}
|
||||
|
||||
<dt>Current version</dt>
|
||||
<dd>
|
||||
@Project.CurrentVersion
|
||||
</dd>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Project.LicenseName))
|
||||
{
|
||||
<dt>License</dt>
|
||||
<dd>
|
||||
<a target="_blank" href="@Project.LicenseUrl">@Project.LicenseName</a>
|
||||
</dd>
|
||||
}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<div id="projectDescriptionText" class="@descCssClass" >
|
||||
@Html.Raw(Project.Description)
|
||||
</div>
|
||||
|
||||
<div class="divider" style="clear:left;"></div>
|
||||
|
||||
@if(Project.ScreenShots.Count() > 0){
|
||||
|
||||
<div id="projectScreenshots">
|
||||
<h2>Screenshots</h2>
|
||||
@foreach(var image in Project.ScreenShots){
|
||||
<a href="@image.Path" class="projectscreenshot" rel="shadowbox[gallery]">
|
||||
<img src="@image.Path?width=100&height=100&bgcolor=fff" style="border:0;"/>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="divider" style="clear:left;"></div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -1,51 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FeaturedProject.ascx.cs" Inherits="Marketplace.usercontrols.Deli.FeaturedProject" %>
|
||||
<%@ Import Namespace="Marketplace.Interfaces" %>
|
||||
<%@ Import Namespace="Marketplace.Providers.Helpers" %>
|
||||
<asp:repeater runat="server" ID="ProjectList">
|
||||
<ItemTemplate>
|
||||
<a href="<%# Eval("NiceUrl") %>"><img src="<%= FeatureImage %>" alt="Featured Pakcage Titie" /></a>
|
||||
|
||||
|
||||
<div class="featuredLinks">
|
||||
|
||||
<a href="/FileDownload?id=<%# Eval("CurrentReleaseFile") %>&release=1" class="download">Download</a>
|
||||
|
||||
<p>Or <a href="<%# Eval("NiceUrl") %>">find out more</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="deliPackage">
|
||||
|
||||
<div class="brief">
|
||||
<a href="<%# Eval("NiceUrl") %>" class="packageIcon" style="background:url(<%# uProject.library.GetDefaultScreenshot((string)Eval("DefaultScreenShot")) %>) no-repeat top left;">Package</a>
|
||||
|
||||
<h3><a href="<%#Eval("NiceUrl") %>">
|
||||
<%# Eval("Name") %>
|
||||
</a></h3>
|
||||
|
||||
<div class="category"><%# uProject.library.GetCategoryName((int)Eval("Id")) %></div>
|
||||
|
||||
|
||||
<div class='commercialIndicator <%# Eval("ListingType")%>'><%# Eval("ListingType")%></div>
|
||||
</div>
|
||||
|
||||
<div class="hiLite">
|
||||
|
||||
<p><a href="<%# Eval("NiceUrl") %>"><%# uProject.library.ShortenText(Eval("Description").ToString())%></a></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="popularity">
|
||||
<div class="karma">
|
||||
<%# Eval("Karma") %>
|
||||
<small>Karma</small>
|
||||
</div>
|
||||
<div class="downloads">
|
||||
<%# Eval("Downloads") %>
|
||||
<small>Downloads</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:repeater>
|
||||
@@ -1,79 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="NewestProjects.ascx.cs" Inherits="Marketplace.usercontrols.Deli.NewestProjects" %>
|
||||
<%@ Import Namespace="Marketplace.Interfaces" %>
|
||||
<%@ Import Namespace="Marketplace.Providers.Helpers" %>
|
||||
<%@ Register Src="~/usercontrols/Deli/ListPagination.ascx" TagPrefix="deli" TagName="paging" %>
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="ListingOpen">
|
||||
<div class="deliPromoArea">
|
||||
</asp:PlaceHolder>
|
||||
<div class="deliPromoBox new clearfix">
|
||||
<asp:PlaceHolder runat="server" ID="WidgetTitle"><h2>Latest Projects</h2></asp:PlaceHolder>
|
||||
|
||||
<ul class="promoOptions">
|
||||
<li><a href="?nplt=free" id="newfree" class="newnav <%= (ListingType == "free")?"on":"" %>">Free</a></li>
|
||||
<li><a href="?nplt=commercial" id="newcommercial" class="newnav <%= (ListingType == "commercial")?"on":"" %>">Commercial</a></li>
|
||||
<li><a href="<%= Request.Url.GetLeftPart(UriPartial.Path) %>" id="newboth" class="newnav <%= (String.IsNullOrEmpty(ListingType) || ListingType != "free" && ListingType != "commercial")?"on":"" %>">Both</a></li>
|
||||
</ul>
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="WidgetFeatures">
|
||||
<a href="<%= Request.Url + "/newest" %>" class="viewAll">All new</a>
|
||||
<div id="newest-loading" class="deli-loader"><img src="/images/custom/loadanim2.gif" alt="loading newest projects" /></div>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="ProjectCounter">
|
||||
<p class="viewAll">Showing <%= PageStartListingNumber %> - <%=PageEndListingNumber %> of <%=TotalListings %> Projects</p>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
|
||||
<asp:Repeater runat="server" ID="Listing">
|
||||
<HeaderTemplate><ul id="newest-projects"></HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<li class="clearfix">
|
||||
<div class="deliPackage">
|
||||
|
||||
<div class="brief">
|
||||
<a href="<%# Eval("NiceUrl") %>" class="packageIcon" style="background:url(<%# uProject.library.GetDefaultScreenshot((string)Eval("DefaultScreenShot")) %>) no-repeat top left;">Package</a>
|
||||
|
||||
<h3><a href="<%# Eval("NiceUrl") %>">
|
||||
<%# Eval("Name") %>
|
||||
</a></h3>
|
||||
|
||||
<div class="category"><%# uProject.library.GetCategoryName((int)Eval("Id")) %></div>
|
||||
|
||||
|
||||
<div class='commercialIndicator <%# Eval("ListingType")%>'><%# Eval("ListingType")%></div>
|
||||
</div>
|
||||
|
||||
<div class="hiLite">
|
||||
|
||||
<p><a href="<%# Eval("NiceUrl") %>"><%# uProject.library.ShortenText(Eval("Description").ToString())%></a></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="popularity">
|
||||
<div class="karma">
|
||||
<%# Eval("Karma") %>
|
||||
<small>Karma</small>
|
||||
</div>
|
||||
<div class="downloads">
|
||||
<%# Eval("Downloads") %>
|
||||
<small>Downloads</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate></ul></FooterTemplate>
|
||||
</asp:Repeater>
|
||||
</div>
|
||||
<asp:PlaceHolder runat="server" ID="ListingClose">
|
||||
</div>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="NoListings" Visible="false">
|
||||
<div class="noListingMessage clearfix">
|
||||
<p>There are no listings that meet your filter criteria</p>
|
||||
</div>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
<deli:paging runat="server" ID="paging" />
|
||||
@@ -1,137 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Licenses.ascx.cs" Inherits="uProject.usercontrols.Deli.Package.Steps.Licenses" %>
|
||||
<asp:PlaceHolder ID="holder" runat="server" Visible="false">
|
||||
<div class="form simpleForm" id="registrationForm">
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="EditForm" Visible="false">
|
||||
<fieldset>
|
||||
<legend>Edit License Type</legend>
|
||||
<p>
|
||||
<label class="inputLabel">License Type</label>
|
||||
|
||||
<asp:TextBox runat="server" Enabled="false" ID="EditLicenseType" CssClass="title" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label class="inputLabel">Price (format 0.00) minium price 49.00</label>
|
||||
<asp:textbox runat="server" ID="EditLicensePrice" CssClass="required title minPrice"/>
|
||||
</p>
|
||||
|
||||
<div class="buttons">
|
||||
<asp:button runat="server" text="Update License" id="UpdateLicense" OnClick="UpdateLicense_Click" class="submitButton" />
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
</asp:PlaceHolder>
|
||||
|
||||
|
||||
<asp:Repeater ID="rp_licenses" OnItemDataBound="OnLicenseBound" Visible="false" runat="server">
|
||||
|
||||
<HeaderTemplate>
|
||||
<table class="dataTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>License Type</th>
|
||||
<th class="money">Price</th>
|
||||
<th class="right"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Literal ID="lt_type" runat="server" />
|
||||
</td>
|
||||
<td class="money">
|
||||
<asp:Literal ID="lt_price" runat="server" />
|
||||
</td>
|
||||
<td class="right">
|
||||
<asp:Button runat="server" ID="bt_edit" OnCommand="EditLicense" Text="Edit" CssClass="actionButton cancel" />
|
||||
<asp:Button ID="bt_disableEnable" runat="server" OnCommand="DisableEnableLicense" Text="Disable" CssClass="actionButton cancel" />
|
||||
<asp:Button Visible="false" ID="bt_delete" runat="server" OnClientClick="return confirm('Are you sure you want to delete this license?')" OnCommand="DeleteLicense" Text="Delete" CssClass="actionButton cancel" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
</tbody>
|
||||
</table>
|
||||
</FooterTemplate>
|
||||
</asp:Repeater>
|
||||
<small>NOTE: Only licenses types that have not been purchased by users can be deleted. If a license has been purchased you may disable it.</small>
|
||||
<asp:PlaceHolder runat="server" ID="CreateForm">
|
||||
<fieldset>
|
||||
<legend>Create License Type</legend>
|
||||
<p>
|
||||
<label class="inputLabel">Choose License Type</label>
|
||||
|
||||
<asp:DropDownList runat="server" id="licenseTypes" cssclass="title">
|
||||
<asp:ListItem Value="Domain" Text="Domain"/>
|
||||
<asp:ListItem Value="IP" Text="IP"/>
|
||||
<asp:ListItem Value="Unlimited" Text="Unlimited"/>
|
||||
<asp:ListItem Value="SourceCode" Text="Source Code"/>
|
||||
</asp:DropDownList>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label class="inputLabel">Price (format 0.00) minium price 49.00</label>
|
||||
<asp:textbox runat="server" ID="price" CssClass="required title minPrice" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<asp:button runat="server" text="Create License" id="btn_SaveLicense" OnClick="SaveLicense_Click" CssClass="submitButton" />
|
||||
</p>
|
||||
|
||||
<div class="deliNotification">
|
||||
<h3>Your Vendor Key</h3>
|
||||
<asp:PlaceHolder runat="server" ID="GenKeyPlaceHolder" Visible ="false">
|
||||
<asp:linkButton runat="server" ID="GenKey" OnClick="GenKey_Click">Generate your project key</asp:linkButton>. This will generate a unique key for your project. This step can only be done once so click wisely.
|
||||
</asp:PlaceHolder>
|
||||
<asp:PlaceHolder runat="server" ID="DownloadKeyPlaceHolder" Visible ="false">
|
||||
<asp:linkButton runat="server" ID="DownloadKey" OnClick="DownloadKey_Click">Download your Vendor Key for your project</asp:linkButton>. This License Key file is used in your code when you implement Deli Licensing in your project.
|
||||
</asp:PlaceHolder>
|
||||
<h3 style="margin-top:10px">Your Packages Unique Deli Id</h3>
|
||||
<p><asp:Literal runat="server" ID="uniqueId" /></p>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<asp:linkbutton runat="server" Text="Previous" ID="MovePrevious" OnClick="MoveLast" class="cancel" />
|
||||
<asp:Button runat="server" Text="Next" ID="MoveNext" OnClick="SaveStep" CssClass="submitButton cancel" />
|
||||
</div>
|
||||
</fieldset>
|
||||
</asp:PlaceHolder>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
var form = $("form");
|
||||
|
||||
jQuery.validator.addMethod("minPrice", function (value, element) { return value >= 49.00 }, "Please enter a price greater than equal to 49.00");
|
||||
|
||||
form.validate({
|
||||
onsubmit: false,
|
||||
invalidHandler: function (f, v) {
|
||||
var errors = v.numberOfInvalids();
|
||||
if (errors.length > 0) {
|
||||
validator.focusInvalid();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(".submitButton").click(function (evt) {
|
||||
// Validate the form and retain the result.
|
||||
var isValid = $("form").valid();
|
||||
|
||||
// If the form didn't validate, prevent the
|
||||
// form submission.
|
||||
if (!isValid)
|
||||
evt.preventDefault();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</asp:PlaceHolder>
|
||||
@@ -1,83 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PopularProjects.ascx.cs" Inherits="Marketplace.usercontrols.Deli.PopularProjects" %>
|
||||
<%@ Import Namespace="Marketplace.Interfaces" %>
|
||||
<%@ Import Namespace="Marketplace.Providers.Helpers" %>
|
||||
<%@ Register Src="~/usercontrols/Deli/ListPagination.ascx" TagPrefix="deli" TagName="paging" %>
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="ListingOpen">
|
||||
<div class="deliPromoArea">
|
||||
</asp:PlaceHolder>
|
||||
<div class="deliPromoBox popular clearfix">
|
||||
<asp:PlaceHolder runat="server" ID="WidgetTitle"><h2>Popular Projects</h2></asp:PlaceHolder>
|
||||
|
||||
<ul class="promoOptions">
|
||||
<li><a href="?pplt=free" id="popfree" class="popnav <%= (ListingType == "free")?"on":"" %>">Free</a></li>
|
||||
<li><a href="?pplt=commercial" id="popcommercial" class="popnav <%= (ListingType == "commercial")?"on":"" %>">Commercial</a></li>
|
||||
<li><a href="<%= Request.Url.GetLeftPart(UriPartial.Path) %>" id="popboth" class="popnav <%= (String.IsNullOrEmpty(ListingType) || ListingType != "free" && ListingType != "commercial")?"on":"" %>">Both</a></li>
|
||||
</ul>
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="WidgetFeatures">
|
||||
<a href="<%= Request.Url + "/popular" %>" class="viewAll">All popular</a>
|
||||
<div id="popular-loading" class="deli-loader"><img src="/images/custom/loadanim2.gif" alt="loading popular projects" /></div>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="ProjectCounter">
|
||||
<p class="viewAll">Showing <%= PageStartListingNumber %> - <%=PageEndListingNumber %> of <%=TotalListings %> Projects</p>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
<asp:Repeater runat="server" ID="Listing">
|
||||
<HeaderTemplate>
|
||||
<ul id="popular-projects">
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<li class="clearfix">
|
||||
<div class="deliPackage">
|
||||
|
||||
<div class="brief">
|
||||
<a href="<%# Eval("NiceUrl") %>" class="packageIcon" style="background:url(<%# uProject.library.GetDefaultScreenshot((string)Eval("DefaultScreenShot")) %>) no-repeat top left;">Package</a>
|
||||
|
||||
<h3><a href="<%# Eval("NiceUrl") %>">
|
||||
<%# Eval("Name") %>
|
||||
</a></h3>
|
||||
|
||||
<div class="category"><%# uProject.library.GetCategoryName((int)Eval("Id")) %></div>
|
||||
|
||||
|
||||
<div class='commercialIndicator <%# Eval("ListingType")%>'><%# Eval("ListingType")%></div>
|
||||
</div>
|
||||
|
||||
<div class="hiLite">
|
||||
|
||||
<p><a href="<%# Eval("NiceUrl") %>"><%# uProject.library.ShortenText(Eval("Description").ToString())%></a></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="popularity">
|
||||
<div class="karma">
|
||||
<%# Eval("Karma") %>
|
||||
<small>Karma</small>
|
||||
</div>
|
||||
<div class="downloads">
|
||||
<%# Eval("Downloads") %>
|
||||
<small>Downloads</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
</ul>
|
||||
</FooterTemplate>
|
||||
</asp:Repeater>
|
||||
</div>
|
||||
<asp:PlaceHolder runat="server" ID="ListingClose">
|
||||
</div>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="NoListings" Visible="false">
|
||||
<div class="noListingMessage clearfix">
|
||||
<p>There are no listings that meet your filter criteria</p>
|
||||
</div>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
<deli:paging runat="server" ID="paging" />
|
||||
@@ -1,62 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="ProjectsList.ascx.cs" Inherits="Marketplace.usercontrols.Deli.ProjectsList" %>
|
||||
<%@ Import Namespace="Marketplace.Interfaces" %>
|
||||
<%@ Import Namespace="Marketplace.Providers.Helpers" %>
|
||||
<%@ Register Src="~/usercontrols/Deli/ListPagination.ascx" TagPrefix="deli" TagName="paging" %>
|
||||
|
||||
<div class="deliPromoArea">
|
||||
<div class="deliPromoBox clearfix">
|
||||
<ul class="promoOptions">
|
||||
<li><a href="?filter=free" id="filterfree" class="filternav <%= (ListingType == "free")?"on":"" %>">Free</a></li>
|
||||
<li><a href="?filter=commercial" id="filtercommercial" class="filternav <%= (ListingType == "commercial")?"on":"" %>">Commercial</a></li>
|
||||
<li><a href="<%= Request.Url.GetLeftPart(UriPartial.Path) %>" id="filterboth" class="filternav <%= (String.IsNullOrEmpty(ListingType) || ListingType != "free" && ListingType != "commercial")?"on":"" %>">Both</a></li>
|
||||
</ul>
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="ProjectCounter">
|
||||
<p class="viewAll">Showing <%= PageStartListingNumber %> - <%=PageEndListingNumber %> of <%=TotalListings %> Projects</p>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
<asp:Repeater runat="server" ID="Listing">
|
||||
<HeaderTemplate>
|
||||
<ul class="summary projectsTagged" id="projectList">
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<li class="clearfix">
|
||||
<div class="deliPackage">
|
||||
|
||||
<div class="brief">
|
||||
<a href="<%# Eval("NiceUrl") %>" class="packageIcon" style="background:url(<%# uProject.library.GetDefaultScreenshot((string)Eval("DefaultScreenShot")) %>) no-repeat top left;">Package</a>
|
||||
<h3><a href="<%# Eval("NiceUrl") %>"><%# Eval("Name") %></a></h3>
|
||||
<div class="category"><%# uProject.library.GetCategoryName((int)Eval("Id")) %></div>
|
||||
<div class='commercialIndicator <%# Eval("ListingType")%>'><%# Eval("ListingType")%></div>
|
||||
</div>
|
||||
<div class="hiLite">
|
||||
<p><a href="<%# Eval("NiceUrl") %>"><%# uProject.library.ShortenText(Eval("Description").ToString())%></a></p>
|
||||
</div>
|
||||
<div class="popularity">
|
||||
<div class="karma">
|
||||
<%# Eval("Karma") %>
|
||||
<small>Karma</small>
|
||||
</div>
|
||||
<div class="downloads">
|
||||
<%# Eval("Downloads") %>
|
||||
<small>Downloads</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
</ul>
|
||||
</FooterTemplate>
|
||||
</asp:Repeater>
|
||||
|
||||
<asp:PlaceHolder runat="server" ID="NoListings" Visible="false">
|
||||
<div class="noListingMessage clearfix">
|
||||
<p>There are no listings that meet your filter criteria</p>
|
||||
</div>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<deli:paging runat="server" id="paging" />
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
|
||||
namespace OurUmbraco.MarketPlace.BusinessLogic.ListingCreator
|
||||
{
|
||||
public abstract class ListingCreatorStep : IListingCreatorStep
|
||||
{
|
||||
public abstract string Alias { get; }
|
||||
public abstract string Name { get; }
|
||||
public abstract string UserControl { get; }
|
||||
public virtual int Index { get; set; }
|
||||
|
||||
public virtual bool MoveToNextStepAutomaticly { get; set; }
|
||||
|
||||
public virtual bool HideFromNavigation
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public virtual bool CommercialOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Completed { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace OurUmbraco.MarketPlace.BusinessLogic.ListingCreator
|
||||
{
|
||||
public class ListingCreatorStepCollection : Dictionary<string, ListingCreatorStep>
|
||||
{
|
||||
public void Add(ListingCreatorStep step, bool isDeliVendor)
|
||||
{
|
||||
step.Index = this.Count;
|
||||
|
||||
if (!step.CommercialOnly)
|
||||
Add(step.Alias, step);
|
||||
else if (step.CommercialOnly && isDeliVendor)
|
||||
Add(step.Alias, step);
|
||||
}
|
||||
|
||||
public ListingCreatorStep Get(string key)
|
||||
{
|
||||
return this.First(item => item.Key == key).Value;
|
||||
}
|
||||
|
||||
public bool StepExists(string key)
|
||||
{
|
||||
return ContainsKey(key);
|
||||
}
|
||||
|
||||
public ListingCreatorStep GotoNextStep(string key)
|
||||
{
|
||||
var s = this[key];
|
||||
|
||||
foreach (var listingCreatorStep in Values)
|
||||
{
|
||||
if (listingCreatorStep.Index > s.Index && !listingCreatorStep.Completed)
|
||||
return listingCreatorStep;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ListingCreatorStep GotoPreviousStep(string key)
|
||||
{
|
||||
var s = this[key];
|
||||
if (s.Index <= 0)
|
||||
return null;
|
||||
|
||||
foreach (var listingCreatorStep in Values)
|
||||
{
|
||||
if (listingCreatorStep.Index == (s.Index - 1))
|
||||
return listingCreatorStep;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ListingCreatorStep FirstAvailableStep()
|
||||
{
|
||||
return this.First(item => item.Value.Completed == false).Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace OurUmbraco.MarketPlace.BusinessLogic.ListingCreator.StepDefinitions
|
||||
{
|
||||
public class Complete : ListingCreatorStep
|
||||
{
|
||||
public override string Alias
|
||||
{
|
||||
get { return "complete"; }
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Creation Complete"; }
|
||||
}
|
||||
|
||||
public override string UserControl
|
||||
{
|
||||
get { return "~/usercontrols/deli/package/steps/complete.ascx"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace OurUmbraco.MarketPlace.BusinessLogic.ListingCreator.StepDefinitions
|
||||
{
|
||||
public class Details : ListingCreatorStep
|
||||
{
|
||||
public override string Alias
|
||||
{
|
||||
get { return "details"; }
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Package Details"; }
|
||||
}
|
||||
|
||||
public override string UserControl
|
||||
{
|
||||
get { return "~/usercontrols/deli/package/steps/details.ascx"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace OurUmbraco.MarketPlace.BusinessLogic.ListingCreator.StepDefinitions
|
||||
{
|
||||
public class Files : ListingCreatorStep
|
||||
{
|
||||
public override string Alias
|
||||
{
|
||||
get { return "files"; }
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Package Files"; }
|
||||
}
|
||||
|
||||
public override string UserControl
|
||||
{
|
||||
get { return "~/usercontrols/deli/package/steps/files.ascx"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace OurUmbraco.MarketPlace.BusinessLogic.ListingCreator.StepDefinitions
|
||||
{
|
||||
public class Screenshots : ListingCreatorStep
|
||||
{
|
||||
public override string Alias
|
||||
{
|
||||
get { return "screenshots"; }
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Screenshots"; }
|
||||
}
|
||||
|
||||
public override string UserControl
|
||||
{
|
||||
get { return "~/usercontrols/deli/package/steps/screenshots.ascx"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,9 @@
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using OurUmbraco.MarketPlace.NodeListing;
|
||||
using OurUmbraco.MarketPlace.Providers;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web;
|
||||
|
||||
@@ -62,5 +67,61 @@ namespace OurUmbraco.MarketPlace.Extensions
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<IListingItem> ToIListingItemList(this IEnumerable<IPublishedContent> content, bool optimized)
|
||||
{
|
||||
var items = new List<IListingItem>();
|
||||
foreach (var c in content)
|
||||
{
|
||||
yield return c.ToIListingItem(optimized);
|
||||
}
|
||||
}
|
||||
|
||||
public static IListingItem ToIListingItem(this IPublishedContent content, bool optimized)
|
||||
{
|
||||
return new NodeListingProvider().GetListing(content, optimized);
|
||||
}
|
||||
|
||||
public static IEnumerable<ICategory> ToICategoryList(this IEnumerable<IPublishedContent> contents)
|
||||
{
|
||||
List<ICategory> items = new List<ICategory>();
|
||||
foreach (var c in contents)
|
||||
{
|
||||
yield return c.ToICategory();
|
||||
}
|
||||
}
|
||||
|
||||
public static ICategory ToICategory(this IPublishedContent c)
|
||||
{
|
||||
var cat = new Category
|
||||
{
|
||||
Id = c.Id,
|
||||
CategoryGuid = new Guid(c.GetPropertyValue<string>("categoryGuid")),
|
||||
Name = c.Name,
|
||||
Description = c.GetPropertyValue<string>("description"),
|
||||
Image = c.GetPropertyAsMediaItem("icon"),
|
||||
HQOnly = c.GetPropertyValue<string>("hqOnly") == "1",
|
||||
Url = c.Url,
|
||||
ProjectCount = c.Descendants().Count(p => p.GetPropertyValue<int>("projectLive") == 1)
|
||||
};
|
||||
|
||||
return cat;
|
||||
}
|
||||
|
||||
public static string GetPropertyAsMediaItem(this IPublishedContent content, string field)
|
||||
{
|
||||
if (string.IsNullOrEmpty(content.GetPropertyValue<string>(field)) == false)
|
||||
{
|
||||
var mItem = new umbraco.cms.businesslogic.media.Media(int.Parse(content.GetPropertyValue<string>(field)));
|
||||
|
||||
var propertyValue = string.Empty;
|
||||
var property = mItem.getProperty("umbracoFile");
|
||||
if (property != null)
|
||||
propertyValue = property.Value.ToString();
|
||||
|
||||
return propertyValue;
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace OurUmbraco.MarketPlace.Interfaces
|
||||
{
|
||||
public interface IListingCreatorStep
|
||||
{
|
||||
string Alias { get; }
|
||||
bool Completed { get; set; }
|
||||
string Name { get; }
|
||||
string UserControl { get; }
|
||||
bool HideFromNavigation { get; }
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@ namespace OurUmbraco.MarketPlace.Interfaces
|
||||
public interface IMediaProvider
|
||||
{
|
||||
IEnumerable<IMediaFile> GetMediaForProjectByType(int projectId,FileType type);
|
||||
IEnumerable<IMediaFile> GetMediaFilesByProjectId(int projectId);
|
||||
void SaveOrUpdate(IMediaFile file);
|
||||
IMediaFile GetFileById(int fileId);
|
||||
void Remove(IMediaFile file);
|
||||
IMediaFile CreateFile(string fileName, Guid listingVersionGuid, Guid vendorGuid, HttpPostedFile file, FileType fileType, List<UmbracoVersion> versions, string dotNetVersion, bool mediumTrust);
|
||||
List<WikiFile> GetMediaFilesByProjectId(int projectId);
|
||||
void SaveOrUpdate(WikiFile file);
|
||||
WikiFile GetFileById(int fileId);
|
||||
void Remove(WikiFile file);
|
||||
WikiFile CreateFile(string fileName, Guid listingVersionGuid, Guid vendorGuid, HttpPostedFile file, FileType fileType, List<UmbracoVersion> versions, string dotNetVersion, bool mediumTrust);
|
||||
}
|
||||
}
|
||||
|
||||
+122
-37
@@ -1,18 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using OurUmbraco.MarketPlace.Extensions;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using OurUmbraco.MarketPlace.Models;
|
||||
using OurUmbraco.Powers.BusinessLogic;
|
||||
using OurUmbraco.Wiki.BusinessLogic;
|
||||
using OurUmbraco.MarketPlace.Providers;
|
||||
using OurUmbraco.Wiki.Extensions;
|
||||
using umbraco;
|
||||
using umbraco.BusinessLogic;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace OurUmbraco.MarketPlace.NodeLising
|
||||
namespace OurUmbraco.MarketPlace.NodeListing
|
||||
{
|
||||
public class NodeListingProvider
|
||||
{ /// <summary>
|
||||
@@ -33,6 +32,35 @@ namespace OurUmbraco.MarketPlace.NodeLising
|
||||
throw new NullReferenceException("Content is Null cannot find a node with the id:" + id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get project listing based on GUID
|
||||
/// </summary>
|
||||
/// <param name="guid"></param>
|
||||
/// <param name="optimized">if set performs less DB interactions to increase speed.</param>
|
||||
/// <returns></returns>
|
||||
public IListingItem GetListing(Guid guid, bool optimized = false)
|
||||
{
|
||||
var strGuid = guid.ToString().ToUpper();
|
||||
|
||||
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
|
||||
|
||||
// we have to use the translate function to ensure that the casing is the same for comparison as there are GUIDS in the db in both upper and lowercase
|
||||
var contents =
|
||||
umbracoHelper.TypedContentAtXPath(
|
||||
string.Format(
|
||||
"//Project [@isDoc and translate(packageGuid,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = translate('{0}','ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')]",
|
||||
strGuid));
|
||||
|
||||
var content = contents.FirstOrDefault();
|
||||
|
||||
if (content != null)
|
||||
{
|
||||
return content.ToIListingItem(optimized);
|
||||
}
|
||||
|
||||
throw new NullReferenceException("Node is Null cannot find a node with the guid:" + strGuid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get listing
|
||||
/// </summary>
|
||||
@@ -82,7 +110,7 @@ namespace OurUmbraco.MarketPlace.NodeLising
|
||||
listingItem.LicenseKey = content.GetPropertyValue<string>("licenseKey", "");
|
||||
|
||||
//this section was created to speed up loading operations and cut down on the number of database interactions
|
||||
if (!optimized)
|
||||
if (optimized == false)
|
||||
{
|
||||
listingItem.DocumentationFile = GetMediaForProjectByType(content.Id, FileType.docs);
|
||||
listingItem.ScreenShots = GetMediaForProjectByType(content.Id, FileType.screenshot);
|
||||
@@ -125,39 +153,10 @@ namespace OurUmbraco.MarketPlace.NodeLising
|
||||
|
||||
public IEnumerable<IMediaFile> GetMediaForProjectByType(int projectId, FileType type)
|
||||
{
|
||||
var wikiFiles = WikiFile.CurrentFiles(projectId);
|
||||
|
||||
var mediaFiles = new List<MediaFile>();
|
||||
|
||||
foreach (var wikiFile in wikiFiles)
|
||||
{
|
||||
var mediaFile = new MediaFile
|
||||
{
|
||||
Current = wikiFile.Current,
|
||||
Archived = wikiFile.Archived,
|
||||
CreateDate = wikiFile.CreateDate,
|
||||
Name = wikiFile.Name,
|
||||
Id = wikiFile.Id,
|
||||
CreatedBy = wikiFile.CreatedBy,
|
||||
DotNetVersion = wikiFile.DotNetVersion,
|
||||
Downloads = wikiFile.Downloads,
|
||||
FileType = (FileType)Enum.Parse(typeof(FileType), wikiFile.FileType),
|
||||
FileVersion = wikiFile.NodeVersion,
|
||||
Path = wikiFile.Path,
|
||||
RemovedBy = wikiFile.RemovedBy,
|
||||
SupportsMediumTrust = false,
|
||||
UmbVersion = wikiFile.Versions,
|
||||
Verified = wikiFile.Verified
|
||||
};
|
||||
|
||||
if (mediaFiles.Contains(mediaFile) == false)
|
||||
mediaFiles.Add(mediaFile);
|
||||
}
|
||||
|
||||
return mediaFiles;
|
||||
var mediaProvider = new MediaProvider();
|
||||
return mediaProvider.GetMediaForProjectByType(projectId, type);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Persists the listing object to the database
|
||||
/// </summary>
|
||||
@@ -191,7 +190,7 @@ namespace OurUmbraco.MarketPlace.NodeLising
|
||||
content.SetValue("packageGuid", listingItem.ProjectGuid.ToString());
|
||||
content.SetValue("approved", (listingItem.Approved) ? "1" : "0");
|
||||
content.SetValue("termsAgreementDate", listingItem.TermsAgreementDate);
|
||||
content.SetValue("owner", listingItem.Vendor.Member.Id);
|
||||
content.SetValue("owner", listingItem.VendorId);
|
||||
content.SetValue("websiteUrl", listingItem.ProjectUrl);
|
||||
content.SetValue("licenseKey", listingItem.LicenseKey);
|
||||
|
||||
@@ -241,7 +240,93 @@ namespace OurUmbraco.MarketPlace.NodeLising
|
||||
|
||||
listingItem.Id = content.Id;
|
||||
listingItem.NiceUrl = library.NiceUrl(listingItem.Id);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets all listings for a vendor
|
||||
/// </summary>
|
||||
/// <param name="vendorId"></param>
|
||||
/// <param name="optimized">if set performs less DB interactions to increase speed.</param>
|
||||
/// <param name="all">If set returns both live and not live listings</param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<IListingItem> GetListingsByVendor(int vendorId, bool optimized = false, bool all = false)
|
||||
{
|
||||
var contents = GetProjectsFromDeliProjectRoot(all).Where(c => c.GetPropertyValue<int>("owner") == vendorId);
|
||||
|
||||
return contents.ToIListingItemList(optimized);
|
||||
}
|
||||
|
||||
private static IEnumerable<IPublishedContent> GetProjectsFromDeliProjectRoot(bool all)
|
||||
{
|
||||
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
|
||||
var content = umbracoHelper.TypedContent(int.Parse(ConfigurationManager.AppSettings["deliProjectRoot"]));
|
||||
if (content == null)
|
||||
throw new Exception("Could not find the Deli project root.");
|
||||
var contents = content.Descendants().Where(c => c.DocumentTypeAlias == "Project");
|
||||
|
||||
if (all == false)
|
||||
contents = contents.Where(p => p.GetPropertyValue<bool>("projectLive"));
|
||||
|
||||
return contents;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a listing of projects that a specified member contributes to.
|
||||
/// </summary>
|
||||
/// <param name="memberId"></param>
|
||||
/// <param name="optimized">if set performs less DB interactions to increase speed.</param>
|
||||
/// <param name="all">if set returns both live and not live projects.</param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<IListingItem> GetListingsForContributor(int memberId, bool optimized = false, bool all = false)
|
||||
{
|
||||
|
||||
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
|
||||
var contribProjects = new List<IPublishedContent>();
|
||||
const string sql = @"SELECT * FROM projectContributors WHERE memberId=@memberId";
|
||||
var contribPackageIds = UmbracoContext.Current.Application.DatabaseContext.Database.Fetch<int>(sql, new { memberId });
|
||||
|
||||
foreach (var contribPackageId in contribPackageIds)
|
||||
{
|
||||
contribProjects.Add(umbracoHelper.TypedContent(contribPackageId));
|
||||
}
|
||||
|
||||
var listings = new List<IListingItem>();
|
||||
foreach (var contribItem in contribProjects)
|
||||
{
|
||||
listings.Add(GetListing(contribItem.Id, optimized, -1));
|
||||
}
|
||||
|
||||
return listings;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// gets a list of listings
|
||||
/// </summary>
|
||||
/// <param name="optimized">if set performs less DB interactions to increase speed.</param>
|
||||
/// <param name="all">if set returns both live and not live listings</param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<IListingItem> GetAllListings(bool optimized = false, bool all = false)
|
||||
{
|
||||
return GetAllListings(0, 0, optimized, all);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// gets paged list of listings
|
||||
/// </summary>
|
||||
/// <param name="skip"></param>
|
||||
/// <param name="take"></param>
|
||||
/// <param name="optimized">if set performs less DB interactions to increase speed.</param>
|
||||
/// <param name="all">if set returns both live and not live listings</param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<IListingItem> GetAllListings(int skip, int take, bool optimized = false, bool all = false)
|
||||
{
|
||||
var contents = GetProjectsFromDeliProjectRoot(all);
|
||||
|
||||
if (take > 0)
|
||||
contents = contents.Skip(skip).Take(take);
|
||||
|
||||
return contents.ToIListingItemList(optimized);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
|
||||
namespace OurUmbraco.MarketPlace.Providers
|
||||
{
|
||||
public class Category : ICategory
|
||||
{
|
||||
|
||||
protected int _id;
|
||||
protected Guid _categoryGuid;
|
||||
protected string _name;
|
||||
protected string _description;
|
||||
protected string _image;
|
||||
protected string _url;
|
||||
protected int _projectCount;
|
||||
protected bool _HQOnly;
|
||||
|
||||
public int Id
|
||||
{
|
||||
get { return _id; }
|
||||
set { _id = value; }
|
||||
}
|
||||
|
||||
|
||||
public Guid CategoryGuid
|
||||
{
|
||||
get { return _categoryGuid; }
|
||||
set { _categoryGuid = value; }
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
set { _name = value; }
|
||||
}
|
||||
|
||||
public string Description
|
||||
{
|
||||
get { return _description; }
|
||||
set { _description = value; }
|
||||
}
|
||||
|
||||
public string Image
|
||||
{
|
||||
get { return _image; }
|
||||
set { _image = value; }
|
||||
}
|
||||
|
||||
public bool HQOnly
|
||||
{
|
||||
get { return _HQOnly; }
|
||||
set { _HQOnly = value; }
|
||||
}
|
||||
|
||||
public string Url
|
||||
{
|
||||
get { return _url; }
|
||||
set { _url = value; }
|
||||
}
|
||||
public int ProjectCount
|
||||
{
|
||||
get { return _projectCount; }
|
||||
set { _projectCount = value; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using OurUmbraco.MarketPlace.Models;
|
||||
using OurUmbraco.Wiki.BusinessLogic;
|
||||
|
||||
namespace OurUmbraco.MarketPlace.Providers
|
||||
{
|
||||
public class MediaProvider : IMediaProvider
|
||||
{
|
||||
public IEnumerable<IMediaFile> GetMediaForProjectByType(int projectId, FileType type)
|
||||
{
|
||||
var wikiFiles = WikiFile.CurrentFiles(projectId);
|
||||
|
||||
var mediaFiles = new List<MediaFile>();
|
||||
|
||||
foreach (var wikiFile in wikiFiles)
|
||||
{
|
||||
var mediaFile = new MediaFile
|
||||
{
|
||||
Current = wikiFile.Current,
|
||||
Archived = wikiFile.Archived,
|
||||
CreateDate = wikiFile.CreateDate,
|
||||
Name = wikiFile.Name,
|
||||
Id = wikiFile.Id,
|
||||
CreatedBy = wikiFile.CreatedBy,
|
||||
DotNetVersion = wikiFile.DotNetVersion,
|
||||
Downloads = wikiFile.Downloads,
|
||||
FileType = (FileType)Enum.Parse(typeof(FileType), wikiFile.FileType),
|
||||
FileVersion = wikiFile.NodeVersion,
|
||||
Path = wikiFile.Path,
|
||||
RemovedBy = wikiFile.RemovedBy,
|
||||
SupportsMediumTrust = false,
|
||||
UmbVersion = wikiFile.Versions,
|
||||
Verified = wikiFile.Verified
|
||||
};
|
||||
|
||||
if (mediaFiles.Contains(mediaFile) == false)
|
||||
mediaFiles.Add(mediaFile);
|
||||
}
|
||||
|
||||
return mediaFiles;
|
||||
}
|
||||
/// <summary>
|
||||
/// Get all the files that are associated with this project
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public List<WikiFile> GetMediaFilesByProjectId(int projectId)
|
||||
{
|
||||
return WikiFile.CurrentFiles(projectId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get an media file by its Id
|
||||
/// </summary>
|
||||
/// <param name="fileId"></param>
|
||||
/// <returns></returns>
|
||||
public WikiFile GetFileById(int fileId)
|
||||
{
|
||||
return new WikiFile(fileId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save or update a media file back to the database.
|
||||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
public void SaveOrUpdate(WikiFile file)
|
||||
{
|
||||
var wf = file;
|
||||
wf.Save();
|
||||
}
|
||||
|
||||
private static string GetFileTypeAsString(FileType file)
|
||||
{
|
||||
switch (file)
|
||||
{
|
||||
case FileType.screenshot:
|
||||
return "screenshot";
|
||||
break;
|
||||
case FileType.package:
|
||||
return "package";
|
||||
break;
|
||||
case FileType.hotfix:
|
||||
return "hotfix";
|
||||
break;
|
||||
case FileType.docs:
|
||||
return "docs";
|
||||
break;
|
||||
case FileType.source:
|
||||
return "source";
|
||||
break;
|
||||
default:
|
||||
return "package";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove(WikiFile file)
|
||||
{
|
||||
file.Delete();
|
||||
}
|
||||
|
||||
public WikiFile CreateFile(string fileName, Guid listingVersionGuid, Guid vendorGuid, HttpPostedFile file, FileType fileType, List<UmbracoVersion> v, string dotNetVersion, bool mediumTrust)
|
||||
{
|
||||
// we have to convert to the uWiki UmbracoVersion :(
|
||||
|
||||
List<UmbracoVersion> vers = new List<UmbracoVersion>();
|
||||
|
||||
foreach (var ver in v)
|
||||
{
|
||||
vers.Add(UmbracoVersion.AvailableVersions()[ver.Version]);
|
||||
}
|
||||
|
||||
|
||||
//Create the Wiki File
|
||||
var uWikiFile = WikiFile.Create(fileName, listingVersionGuid, vendorGuid, file, GetFileTypeAsString(fileType), vers);
|
||||
//return the IMediaFile
|
||||
|
||||
//Convert to Deli Media file
|
||||
var MediaFile = GetFileById(uWikiFile.Id);
|
||||
MediaFile.DotNetVersion = dotNetVersion;
|
||||
SaveOrUpdate(MediaFile);
|
||||
return MediaFile;
|
||||
}
|
||||
|
||||
public static string ToVersionString(List<UmbracoVersion> Versions)
|
||||
{
|
||||
var stringVers = string.Empty;
|
||||
foreach (var ver in Versions)
|
||||
{
|
||||
stringVers += ver.Version + ",";
|
||||
}
|
||||
|
||||
return stringVers.TrimEnd(',');
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static List<UmbracoVersion> GetVersionsFromString(string p)
|
||||
{
|
||||
var verArray = p.Split(',');
|
||||
var verList = new List<UmbracoVersion>();
|
||||
foreach (var ver in verArray)
|
||||
{
|
||||
if (UmbracoVersion.AvailableVersions().ContainsKey(ver))
|
||||
verList.Add(UmbracoVersion.AvailableVersions()[ver]);
|
||||
}
|
||||
return verList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
|
||||
namespace OurUmbraco.MarketPlace.Providers
|
||||
{
|
||||
class ProjectTag : IProjectTag
|
||||
|
||||
{
|
||||
protected int _id;
|
||||
protected string _text;
|
||||
protected int _count;
|
||||
protected int _liveCount;
|
||||
|
||||
public int Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
set
|
||||
{
|
||||
_id = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return _text;
|
||||
}
|
||||
set
|
||||
{
|
||||
_text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return _count; }
|
||||
set { _count = value; }
|
||||
}
|
||||
|
||||
public int LiveCount
|
||||
{
|
||||
get { return _liveCount; }
|
||||
set { _liveCount = value; }
|
||||
}
|
||||
|
||||
public bool Equals(IProjectTag other)
|
||||
{
|
||||
return this.Id == other.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using OurUmbraco.MarketPlace.Extensions;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace OurUmbraco.MarketPlace.Providers
|
||||
{
|
||||
public class UmbracoCategoryProvider : ICategoryProvider
|
||||
{
|
||||
public IEnumerable<ICategory> GetAllCategories()
|
||||
{
|
||||
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
|
||||
var content = umbracoHelper.TypedContent(int.Parse(ConfigurationManager.AppSettings["deliProjectRoot"]));
|
||||
var contents = content.Descendants().Where(x => x.DocumentTypeAlias == "ProjectGroup");
|
||||
|
||||
return contents.ToICategoryList();
|
||||
}
|
||||
|
||||
public ICategory GetCurrent()
|
||||
{
|
||||
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
|
||||
var content = umbracoHelper.TypedContent(HttpContext.Current.Items["pageID"]);
|
||||
|
||||
if (content.DocumentTypeAlias != "ProjectGroup")
|
||||
{
|
||||
throw new Exception("Content is not of the correct type");
|
||||
}
|
||||
|
||||
return content.ToICategory();
|
||||
}
|
||||
|
||||
public ICategory GetCategory(int id)
|
||||
{
|
||||
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
|
||||
var content = umbracoHelper.TypedContent(id);
|
||||
|
||||
if (content.DocumentTypeAlias != "ProjectGroup")
|
||||
{
|
||||
throw new Exception("Content is not of the correct type");
|
||||
}
|
||||
|
||||
return content.ToICategory();
|
||||
}
|
||||
|
||||
public ICategory GetCategory(Guid id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OurUmbraco.MarketPlace.Interfaces;
|
||||
using OurUmbraco.MarketPlace.NodeListing;
|
||||
using umbraco.cms.businesslogic.Tags;
|
||||
|
||||
namespace OurUmbraco.MarketPlace.Providers
|
||||
{
|
||||
public class UmbracoProjectTagProvider : IProjectTagProvider
|
||||
{
|
||||
public IEnumerable<IProjectTag> GetAllTags(bool liveOnly = false)
|
||||
{
|
||||
if (!liveOnly)
|
||||
{
|
||||
return Tag.GetTags("project").Where(x => x.NodeCount > 2).Select(x => new ProjectTag()
|
||||
{
|
||||
Id = x.Id,
|
||||
Text = x.TagCaption,
|
||||
LiveCount = x.NodeCount
|
||||
});
|
||||
}
|
||||
|
||||
var tagList = new List<IProjectTag>();
|
||||
|
||||
var nodeListingProvider = new NodeListingProvider();
|
||||
|
||||
var projects = nodeListingProvider.GetAllListings(true);
|
||||
|
||||
foreach (var p in projects)
|
||||
{
|
||||
foreach (var t in p.Tags)
|
||||
if (tagList.Contains(t))
|
||||
{
|
||||
tagList.Find(delegate (IProjectTag tag)
|
||||
{
|
||||
return tag.Id == t.Id;
|
||||
}).LiveCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
t.LiveCount++;
|
||||
tagList.Add(t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return tagList;
|
||||
}
|
||||
|
||||
public IEnumerable<IProjectTag> GetTagsByProjectId(int projectId)
|
||||
{
|
||||
return Tag.GetTags(projectId).Select(x => new ProjectTag()
|
||||
{
|
||||
Id = x.Id,
|
||||
Text = x.TagCaption,
|
||||
Count = x.NodeCount
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public IProjectTag GetTagById(int id)
|
||||
{
|
||||
return Tag.GetTags("project").Where(x => x.Id == id).Select(y => new ProjectTag()
|
||||
{
|
||||
Id = y.Id,
|
||||
Text = y.TagCaption,
|
||||
Count = y.NodeCount
|
||||
}).FirstOrDefault();
|
||||
}
|
||||
|
||||
public void SetTags(int projectId, string tags)
|
||||
{
|
||||
Tag.AddTagsToNode(projectId, tags, "project");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,10 +292,17 @@
|
||||
<Compile Include="Forum\Services\ForumService.cs" />
|
||||
<Compile Include="Forum\Services\TopicService.cs" />
|
||||
<Compile Include="Forum\Singleton.cs" />
|
||||
<Compile Include="MarketPlace\BusinessLogic\ListingCreator\ListingCreatorStep.cs" />
|
||||
<Compile Include="MarketPlace\BusinessLogic\ListingCreator\ListingCreatorStepCollection.cs" />
|
||||
<Compile Include="MarketPlace\BusinessLogic\ListingCreator\StepDefinitions\Complete.cs" />
|
||||
<Compile Include="MarketPlace\BusinessLogic\ListingCreator\StepDefinitions\Files.cs" />
|
||||
<Compile Include="MarketPlace\BusinessLogic\ListingCreator\StepDefinitions\Details.cs" />
|
||||
<Compile Include="MarketPlace\BusinessLogic\ListingCreator\StepDefinitions\Screenshots.cs" />
|
||||
<Compile Include="MarketPlace\Extensions\NodeProviderExtensions.cs" />
|
||||
<Compile Include="MarketPlace\Interfaces\FileType.cs" />
|
||||
<Compile Include="MarketPlace\Interfaces\ICategory.cs" />
|
||||
<Compile Include="MarketPlace\Interfaces\ICategoryProvider.cs" />
|
||||
<Compile Include="MarketPlace\Interfaces\IListingCreatorStep.cs" />
|
||||
<Compile Include="MarketPlace\Interfaces\IListingItem.cs" />
|
||||
<Compile Include="MarketPlace\Interfaces\IListingProvider.cs" />
|
||||
<Compile Include="MarketPlace\Interfaces\IMediaFile.cs" />
|
||||
@@ -312,7 +319,12 @@
|
||||
<Compile Include="MarketPlace\ListingItem\ListingItem.cs" />
|
||||
<Compile Include="MarketPlace\Models\MediaFile.cs" />
|
||||
<Compile Include="MarketPlace\Models\UmbracoProject.cs" />
|
||||
<Compile Include="MarketPlace\NodeLising\NodeListingProvider.cs" />
|
||||
<Compile Include="MarketPlace\NodeListing\NodeListingProvider.cs" />
|
||||
<Compile Include="MarketPlace\Providers\Category.cs" />
|
||||
<Compile Include="MarketPlace\Providers\MediaProvider.cs" />
|
||||
<Compile Include="MarketPlace\Providers\ProjectTag.cs" />
|
||||
<Compile Include="MarketPlace\Providers\UmbracoCategoryProvider.cs" />
|
||||
<Compile Include="MarketPlace\Providers\UmbracoProjectTagProvider.cs" />
|
||||
<Compile Include="Powers\Api\PowersController.cs" />
|
||||
<Compile Include="Powers\Buddha\Buddha.cs" />
|
||||
<Compile Include="Powers\BusinessLogic\Action.cs" />
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace OurUmbraco.Wiki.BusinessLogic
|
||||
public bool Archived { get; set; }
|
||||
|
||||
public bool Verified { get; set; }
|
||||
public bool SupportsMediumTrust => true;
|
||||
|
||||
public List<UmbracoVersion> Versions { get; set; }
|
||||
public UmbracoVersion Version { get; set; }
|
||||
@@ -109,7 +110,7 @@ namespace OurUmbraco.Wiki.BusinessLogic
|
||||
return wikiFiles;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private readonly Events _events = new Events();
|
||||
|
||||
private WikiFile() { }
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -80,6 +80,12 @@ namespace our
|
||||
return result ?? 0;
|
||||
}
|
||||
|
||||
public static bool HasMemberDownloadedPackage(int memberId, int projectId)
|
||||
{
|
||||
var result = Umbraco.Core.ApplicationContext.Current.DatabaseContext.Database.ExecuteScalar<int>("select COUNT(*) from projectDownload where projectId = @0 and memberId = @1", projectId, memberId);
|
||||
return result != 0;
|
||||
}
|
||||
|
||||
|
||||
public static int GetReleaseDownloadCount(int projectId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user