Exemple #1
0
        public static HtmlBuilder HeaderLogo(
            this HtmlBuilder hb,
            Context context,
            SiteSettings ss)
        {
            var existsImage = BinaryUtilities.ExistsTenantImage(
                context: context,
                ss: ss,
                referenceId: context.TenantId,
                sizeType: Images.ImageData.SizeTypes.Logo);
            var title = Title(context: context);

            return(hb.H(number: 2, id: "Logo", action: () => hb
                        .A(
                            attributes: new HtmlAttributes().Href(context.Publish
                        ? ss.ReferenceType == "Wikis"
                            ? Locations.ItemEdit(
                                                                      context: context,
                                                                      id: context.Id)
                            : Locations.ItemIndex(
                                                                      context: context,
                                                                      id: context.SiteId)
                        : Locations.Top(context: context)),
                            action: () => hb
                            .LogoImage(
                                context: context,
                                showTitle: !title.IsNullOrEmpty(),
                                existsTenantImage: existsImage)
                            .Span(id: "ProductLogo", action: () => hb
                                  .Text(text: title)))));
        }