Skip to content

Commit

Permalink
More Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephMDavis committed Oct 12, 2018
1 parent f87ea4f commit 70db25e
Show file tree
Hide file tree
Showing 16 changed files with 622 additions and 202 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<featureDefinitions>
<featureDefinition
featureGuid="0cefbf18-56de-11dc-8f36-bac755d89593"
supportedDatabases="MSSQL,MySQL"
resourceFile="WebStoreResources"
featureNameReasourceKey="WebStoreName"
controlSource="WebStore/WebStoreModule.ascx"
sortOrder="800"
isCacheable="false"
defaultCacheTime="0"
excludeFromFeatureList="false"
icon="blank.gif"
isSearchable="true"
searchListNameResourceKey="WebStoreSearchName"
deleteProvider="WebStoreContentDeleteHandler"
supportsPageReuse="false"
>
featureGuid="0cefbf18-56de-11dc-8f36-bac755d89593"
supportedDatabases="MSSQL,MySQL"
resourceFile="WebStoreResources"
featureNameReasourceKey="WebStoreName"
controlSource="WebStore/WebStoreModule.ascx"
sortOrder="800"
isCacheable="false"
defaultCacheTime="0"
excludeFromFeatureList="false"
icon="blank.gif"
isSearchable="true"
searchListNameResourceKey="WebStoreSearchName"
deleteProvider="WebStoreContentDeleteHandler"
supportsPageReuse="false"
>
<featureSetting
resourceFile="WebStoreResources"
resourceKey="EnableContentRatingInProductListSetting"
Expand Down Expand Up @@ -69,14 +69,64 @@

<featureSetting
resourceFile="WebStoreResources"
grouNameKey=""
resourceKey="CartPageFooter"
defaultValue=""
controlType="ISettingControl"
controlSrc="~/Controls/HtmlSetting.ascx"
helpKey="webstore-CartPageFooter-help"
sortOrder="500"
regexValidationExpression=""
/>

<!--<featureSetting
resourceFile="WebStoreResources"
resourceKey="HomeView"
groupNameKey="ViewSettings"
controlSrc="~/Controls/ViewSelector.ascx"
controlType="ICustomField"
defaultValue="_Home"
regexValidationExpression=""
sortOrder="600"
/>
<featureSetting
resourceFile="WebStoreResources"
resourceKey="ProductListView"
groupNameKey="ViewSettings"
controlSrc="~/Controls/ViewSelector.ascx"
controlType="ICustomField"
defaultValue="_ProductList"
regexValidationExpression=""
sortOrder="610"
/>
<featureSetting
resourceFile="WebStoreResources"
resourceKey="OfferListView"
groupNameKey="ViewSettings"
controlSrc="~/Controls/ViewSelector.ascx"
controlType="ICustomField"
defaultValue="_OfferList"
regexValidationExpression=""
sortOrder="620"
/>
<featureSetting
resourceFile="WebStoreResources"
resourceKey="CartView"
groupNameKey="ViewSettings"
controlSrc="~/Controls/ViewSelector.ascx"
controlType="ICustomField"
defaultValue="_Cart"
regexValidationExpression=""
sortOrder="630"
/>
<featureSetting
resourceFile="WebStoreResources"
resourceKey="CheckoutView"
groupNameKey="ViewSettings"
controlSrc="~/Controls/ViewSelector.ascx"
controlType="ICustomField"
defaultValue="_Checkout"
regexValidationExpression=""
sortOrder="640"
/>-->
</featureDefinition>
</featureDefinitions>
29 changes: 6 additions & 23 deletions WebStore.UI/WebStore/AdminProductEdit.aspx.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Author:
/// Created: 2007-02-24
/// Last Modified: 2015-04-13 (Joe Davis)
/// Last Modified: 20181012 (Joe Davis)
///
/// The use and distribution terms for this software are covered by the
/// Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
Expand Down Expand Up @@ -325,13 +325,9 @@ private void Save()

if ((product.Url.Length == 0) && (txtName.Text.Length > 0))
{
product.Url = "/"
+ SiteUtils.SuggestFriendlyUrl(
txtName.Text + WebStoreResources.ProductUrlSuffix,
siteSettings);
product.Url = "/" + SiteUtils.SuggestFriendlyUrl(txtName.Text + WebStoreResources.ProductUrlSuffix,siteSettings, "");

needToCreateFriendlyUrl = true;

}
else
{
Expand All @@ -352,10 +348,7 @@ private void Save()
newUrl.SiteGuid = siteSettings.SiteGuid;
newUrl.PageGuid = product.Guid;
newUrl.Url = product.Url.Replace("/", string.Empty);
newUrl.RealUrl = "~/WebStore/ProductDetail.aspx?pageid="
+ pageId.ToInvariantString()
+ "&mid=" + moduleId.ToInvariantString()
+ "&product=" + product.Guid.ToString();
newUrl.RealUrl = $"~/WebStore/ProductDetail.aspx?pageid={pageId.ToInvariantString()}&mid={moduleId.ToInvariantString()}&product={product.Guid.ToString()}";

newUrl.Save();

Expand Down Expand Up @@ -384,8 +377,7 @@ private void btnDelete_Click(object sender, EventArgs e)

if (WebConfigSettings.LogIpAddressForContentDeletions)
{
log.Info("user deleted product " + p.Name + " from ip address " + SiteUtils.GetIP4Address());

log.Info($"user deleted product {p.Name} from ip address {SiteUtils.GetIP4Address()}");
}

FriendlyUrl.DeleteByPageGuid(p.Guid);
Expand Down Expand Up @@ -1014,21 +1006,12 @@ private void PopulateLabels()

protected string GetRefreshUrl()
{

string result = SiteRoot + "/WebStore/AdminProductEdit.aspx?pageid="
+ pageId.ToInvariantString()
+ "&mid=" + moduleId.ToInvariantString()
+ "&prod=" + productGuid.ToString();

return result;

return $"{SiteRoot}/WebStore/AdminProductEdit.aspx?pageid={pageId.ToInvariantString()}&mid={moduleId.ToInvariantString()}&prod={productGuid.ToString()}";
}

private string GetReturnUrl()
{
return SiteRoot + "/WebStore/AdminProduct.aspx?pageid="
+ pageId.ToInvariantString()
+ "&mid=" + moduleId.ToInvariantString();
return $"{SiteRoot}/WebStore/AdminProduct.aspx?pageid={pageId.ToInvariantString()}&mid={moduleId.ToInvariantString()}";
}

private void LoadSettings()
Expand Down
15 changes: 9 additions & 6 deletions WebStore.UI/WebStore/Cart.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,32 @@
<asp:Literal ID="litShippingTotal" runat="server" />
<asp:Literal ID="litDiscount" runat="server" />
<asp:Literal ID="litTotal" runat="server" />

<portal:FormGroupPanel ID="pnlDiscountCode" runat="server">
<portal:FormGroupPanel ID="pnlCheckoutActions" runat="server">

<portal:FormGroupPanel ID="pnlDiscountCode" runat="server" SkinID="CartCheckoutDiscountPanel">
<mp:SiteLabel ID="SiteLabel4" runat="server" CssClass="storelabel" ConfigKey="CartDiscountCodeLabel" ResourceFile="WebStoreResources" />
<asp:TextBox ID="txtDiscountCode" runat="server" CssClass="discountcode" />
<portal:mojoButton ID="btnApplyDiscount" runat="server" />
<portal:mojoLabel ID="lblDiscountError" runat="server" CssClass="txterror warning alert alert-warning" />
</portal:FormGroupPanel>

<portal:FormGroupPanel id="pnlCheckoutLinks" runat="server">
<portal:FormGroupPanel id="pnlCheckoutLinks" runat="server" SkinID="CartCheckoutLinksPanel">
<asp:Literal ID="litConfirmOrder" runat="server" EnableViewState="false" />
<asp:Literal ID="litKeepShopping" runat="server" EnableViewState="false" />
<portal:LoginLink id="lnkLogin" runat="server" />
</portal:FormGroupPanel>

<portal:FormGroupPanel ID="pnlPayPal" runat="server" Visible="false">
<portal:FormGroupPanel ID="pnlPayPal" runat="server" Visible="false" SkinID="CartCheckoutPayPalPanel">
<asp:ImageButton ID="btnPayPal" runat="server" ImageUrl="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif"
AlternateText="Checkout with PayPal" />
<br />
<portal:mojoLabel ID="lblMessage" runat="server" CssClass="txterror info alert alert-info"></portal:mojoLabel>
<asp:Literal ID="litPayPalFormVariables" runat="server" />
</portal:FormGroupPanel>
<portal:CommerceTestModeWarning ID="commerceWarning" runat="server" />
<div class="clearpanel"></div>
</portal:FormGroupPanel>

<portal:CommerceTestModeWarning ID="commerceWarning" runat="server" />
<div class="clearpanel clearfix"></div>
<asp:Literal ID="litCartFooter" runat="server" EnableViewState="false" />
</portal:InnerBodyPanel>
</portal:OuterBodyPanel>
Expand Down
41 changes: 25 additions & 16 deletions WebStore.UI/WebStore/Cart.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ private void ShowCart()
pnlDiscountCode.Visible = false;
litEmptyCart.Text = String.Format(displaySettings.EmptyCartFormat, WebStoreResources.EmptyCartMessage, SiteUtils.GetCurrentPageUrl(), WebStoreResources.EmptyCartGoShopping);
litKeepShopping.Text = String.Format(displaySettings.StartShoppingLinkFormat, SiteUtils.GetCurrentPageUrl(), WebStoreResources.StartShopping);
pnlCheckoutActions.OutsideTopMarkup = displaySettings.CartCheckoutActionsEmptyCartOutsideTopMarkup;
pnlCheckoutActions.OutsideBottomMarkup = displaySettings.CartCheckoutActionsEmptyCartOutsideBottomMarkup;
}
}

Expand Down Expand Up @@ -282,44 +284,51 @@ private void DoPayPalStandardCheckout()

}

private void PopulateLabels()
{
Control c = Master.FindControl("Breadcrumbs");
if (c != null)
{
BreadcrumbsControl crumbs = (BreadcrumbsControl)c;
crumbs.ForceShowBreadcrumbs = true;

}
Title = SiteUtils.FormatPageTitle(siteSettings, CurrentPage.PageName + " - " + WebStoreResources.CartHeader);
heading.Text = WebStoreResources.CartHeader;
private void PopulateLabels()
{
Control c = Master.FindControl("Breadcrumbs");
if (c != null)
{
BreadcrumbsControl crumbs = (BreadcrumbsControl)c;
crumbs.ForceShowBreadcrumbs = true;

string confirmOrderUrl = SiteRoot +
"/WebStore/ConfirmOrder.aspx?pageid=" + pageId.ToInvariantString()
+ "&mid=" + moduleId.ToInvariantString();
}
Title = SiteUtils.FormatPageTitle(siteSettings, CurrentPage.PageName + " - " + WebStoreResources.CartHeader);
heading.Text = WebStoreResources.CartHeader;

string confirmOrderUrl = $"{SiteRoot}/WebStore/ConfirmOrder.aspx?pageid={pageId.ToInvariantString()}&mid={moduleId.ToInvariantString()}";

litConfirmOrder.Text = String.Format(displaySettings.ConfirmOrderLinkFormat, confirmOrderUrl, WebStoreResources.ProceedToCheckout);

litKeepShopping.Text = String.Format(displaySettings.ContinueShoppingLinkFormat, SiteUtils.GetCurrentPageUrl(), WebStoreResources.CartKeepShoppingLink);

pnlDiscountCode.CssClass = "settingrow discountcode";
pnlDiscountCode.CssClass = displaySettings.CartCheckoutDiscountDivCssClass;


btnApplyDiscount.Text = WebStoreResources.ApplyDiscountButton;

lblDiscountError.Text = string.Empty;
lblDiscountError.Text = string.Empty;

lnkLogin.OverrideText = WebStoreResources.LoginToCheckout;
lnkLogin.CssClass = displaySettings.LoginToCheckoutCssClass;

pnlCheckoutActions.CssClass = displaySettings.CartCheckoutActionsDivClass;


pnlCheckoutLinks.CssClass = displaySettings.CartCheckoutLinksDivCssClass;
pnlCheckoutLinks.OutsideTopMarkup = displaySettings.CartCheckoutLinksDivOutsideTopMarkup;
pnlCheckoutLinks.OutsideBottomMarkup = displaySettings.CartCheckoutLinksDivOutsideBottomMarkup;

if (!Request.IsAuthenticated && !canCheckoutWithoutAuthentication)
{
pnlCheckoutLinks.CssClass += $" {displaySettings.CartCheckoutLinksDivAnonymousExtraCssClass}";
pnlCheckoutLinks.OutsideTopMarkup = displaySettings.CartCheckoutLinksDivAnonymousOutsideTopMarkup;
pnlCheckoutLinks.OutsideBottomMarkup = displaySettings.CartCheckoutLinksDivAnonymousOutsideBottomMarkup;
}

pnlPayPal.CssClass = displaySettings.CartPayPalDivCssClass;
pnlPayPal.OutsideTopMarkup = displaySettings.CartPayPalDivOutsideTopMarkup;
pnlPayPal.OutsideBottomMarkup = displaySettings.CartPayPalDivOutsideBottomMarkup;
}

private void LoadParams()
Expand Down
9 changes: 9 additions & 0 deletions WebStore.UI/WebStore/Cart.aspx.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 70db25e

Please sign in to comment.