Example #1
0
 public void SetPageMetaData(AreaTag area, bool forIndoor)
 {
     ViewData["PageTitle"]       = PageMetaInfoGenerator.GetTitle(area, forIndoor);
     ViewData["PageDescription"] = PageMetaInfoGenerator.GetMetaDescription(area, forIndoor);
     ViewData["PageKeywords"]    = PageMetaInfoGenerator.GetMetaKeywords(area, forIndoor);
     ViewData["PageRobots"]      = GetRobotsDefinition(PageRobots.IndexFollow);
 }
Example #2
0
        private void bindClimbingPlaces()
        {
            int areaID;

            if (int.TryParse(AreaID.Text, out areaID))
            {
                //-- Used to preselect places
                placesUserClimbsIDs = cfController.GetPlacesUserClimbs(UserID).Select(c => c.ID).ToList();

                List <IClimbingPlace> areasPlaces = getPlacesForArea(areaID);

                PlacesLV.DataSource = areasPlaces;
                PlacesLV.DataBind();
                AddPlaceDIV.Visible = true;

                NoResultsP.Visible = areasPlaces.Count == 0;
                if (areasPlaces.Count == 0)
                {
                    AreaTag selectedArea    = (from c in CFDataCache.AllAreaTags where c.ID == int.Parse(AreaID.Text) select c).SingleOrDefault();
                    string  placeTypeString = "indoor";
                    if (OutdoorRB.Checked)
                    {
                        placeTypeString = "outdoor";
                    }
                    NoResultsLtr.Text = string.Format("No results for {0} places in {1}", placeTypeString, selectedArea.Name);
                }
            }
            else
            {
                NoResultsP.Visible = true;
                NoResultsLtr.Text  = "Please select a valid city / state / country from the text box above";
            }
        }
Example #3
0
        protected string GetAreaPage(AreaTag areaTag)
        {
            //-- TODO: make title better
            string title = string.Format("Indoor climbing {0}, outdoor rock climbing {0} & climbing clubs around {0}", areaTag.ParagraphName);

            return(string.Format("<a href='{0}' title='{1}'>{2}</a> ({3}/{4})", areaTag.ClimbfindUrl,
                                 title, areaTag.ParagraphName, IndoorAreasAndPlaceCount[areaTag], OutdoorAreasAndPlaceCount[areaTag]));
        }
Example #4
0
        public static string OtherAreasInCountryCloud(ViewPage page, Nation nation)
        {
            AreaTag        currentViewedArea  = (from c in CFDataCache.AllAreaTags where c.CountryID == (short)nation && c.IsCountry select c).SingleOrDefault();
            List <AreaTag> areasInSameCountry = new CFController().GetAllAreaTagsInCountry(nation);

            return(page.Html.RenderUserControl("~/Views/Places/OtherAreasInCountryCloud.ascx",
                                               areasInSameCountry, new { CurrentViewedArea = currentViewedArea }));
        }
Example #5
0
 protected void ContinueToMap_Click(Object o, EventArgs e)
 {
     if (PeterBlum.VAM.Globals.Page.IsValid)
     {
         AreaTag tag = cfController.GetAreaTagForCountry(NationalityDDLUC.SelectedNation);
         MapCoordinatePickerUC.SetMapStartPosition(tag.Latitude, tag.Longitude, tag.DefaultVirtualEarthZoom);
         AddPlaceMV.SetActiveView(VIEWPlotOnMap);
     }
 }
Example #6
0
 /// <summary>
 ///
 /// </summary>
 public static string GetMetaDescription(AreaTag area, bool forIndoor)
 {
     if (forIndoor)
     {
         return(string.Format("Indoor rock climbing gyms in {0}, {0} mountaineering clubs, climbing clubs {0}", area.ParagraphName));
     }
     else
     {
         return(string.Format("Outdoor rock climbing  locations in {0}", area.ParagraphName));
     }
 }
Example #7
0
 /// <summary>
 ///
 /// </summary>
 public static string GetTitle(AreaTag area, bool forIndoor)
 {
     if (forIndoor)
     {
         return(string.Format("Indoor rock climbing in {0} - Climbfind.com", area.ParagraphName));
     }
     else
     {
         return(string.Format("Outdoor rock climbing around {0} - Climbfind.com", area.ParagraphName));
     }
 }
Example #8
0
 /// <summary>
 ///
 /// </summary>
 public static string GetMetaKeywords(AreaTag area, bool forIndoor)
 {
     if (forIndoor)
     {
         return(string.Format("Indoor rock climbing, climbing gym {0}, find rock climbing partners {0}", area.ParagraphName));
     }
     else
     {
         return(string.Format("Outdoor rock climbing, climbing locations in {0}, find outdoor climbing partners {0}", area.ParagraphName));
     }
 }
Example #9
0
        public AreaTag UpdateAreaTag(AreaTag tag)
        {
            //-- Send app notification email
            CFLogger.RecordModerateEditAreaTag(CurrentClimber.ID, tag.Name, tag.CountryID);

            AreaTag newTag = new AreaTagDA().Update(tag);

            CFDataCache.CacheAllAreaTags();

            return(newTag);
        }
 /// <summary>
 /// 
 /// </summary>
 public static string GetMetaKeywords(AreaTag area, bool forIndoor)
 {
     if (forIndoor)
     {
         return string.Format("Indoor rock climbing, climbing gym {0}, find rock climbing partners {0}", area.ParagraphName);
     }
     else
     {
         return string.Format("Outdoor rock climbing, climbing locations in {0}, find outdoor climbing partners {0}", area.ParagraphName);
     }
 }
 /// <summary>
 /// 
 /// </summary>
 public static string GetMetaDescription(AreaTag area, bool forIndoor)
 {
     if (forIndoor)
     {
         return string.Format("Indoor rock climbing gyms in {0}, {0} mountaineering clubs, climbing clubs {0}", area.ParagraphName);
     }
     else
     {
         return string.Format("Outdoor rock climbing  locations in {0}", area.ParagraphName);
     }
 }
Example #12
0
        private ActionResult RenderAreaPage(AreaTag area)
        {
            if (area == default(AreaTag))
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                string title       = string.Format("Rock climbing around {0}, climbing gyms in {0}, {0} outdoor climbing & climbing clubs around {0}", area.ParagraphName);
                string description = string.Format("Information about indoor climbing in {0}, find places to climb outdoors in {0} and mountaineering clubs around", area.ParagraphName);
                string keywords    = string.Format("{0} indoor climbing walls, climb outdoors {0}, {0} climbing partners, Bouldering {0}, {0} Climbing Information, Map of {0} climbs, {0} climbing clubs", area.Name);

                SetPageMetaData(title, description, keywords, PageRobots.IndexFollow);
                return(View("AreaPage", area));
            }
        }
Example #13
0
        protected void CreatePlace_Click(Object sender, EventArgs e)
        {
            if (PeterBlum.VAM.Globals.Page.IsValid)
            {
                string friendlyUrlName     = NameTxB.Text.Trim().Replace(" ", "-").ToLower();
                string friendlyUrlLocation = NationalityDDLUC.SelectedNation.GetCountryFriendlyUrl();

                Place existingPlace = cfController.GetPlace(friendlyUrlLocation, friendlyUrlName);

                if (existingPlace != null)
                {
                    //-- Incase user clicks button twice this is to stop an exception
                    RedirectTo <ModerateController>(c => c.EditIndoorPlace(existingPlace.ID));
                }
                else
                {
                    string address = AddressTxB.Text.Replace("'", ""); // Stop virtual earth javascript from crashing

                    Place place = cfController.AddIndoorPlace(new Place
                    {
                        CreatedByUserID     = UserID,
                        CountryID           = (short)NationalityDDLUC.SelectedNation,
                        Description         = "",
                        FriendlyUrlLocation = friendlyUrlLocation,
                        IsIndoor            = true,
                        Latitude            = MapCoordinatePickerUC.Latitude,
                        Longitude           = MapCoordinatePickerUC.Longitude,
                        Name      = NameTxB.Text.Trim(),
                        ShortName = ShortNameTxB.Text.Trim(),
                    }, address, "", WebsiteTxB.Text, BoulderCB.Checked, LeadClimbCB.Checked,
                                                              TopRopeCB.Checked);

                    PlaceIDHD.Value = place.ID.ToString();

                    if (IsRegularRB.Checked)
                    {
                        cfController.SavePlaceUserClimbsAt(UserID, NewPlaceID);
                    }

                    //-- Continue to map
                    AreaTag tag = cfController.GetAreaTagForCountry(NationalityDDLUC.SelectedNation);
                    MapCoordinatePickerUC.SetMapStartPosition(tag.Latitude, tag.Longitude, tag.DefaultVirtualEarthZoom);
                    AddPlaceMV.SetActiveView(VIEWPlotOnMap);
                }
            }
        }
Example #14
0
        protected string GetCountriesSetOfAreaPages(Nation nation)
        {
            List <AreaTag> subAreaTags     = (from c in IndoorAreasAndPlaceCount.Keys where c.CountryID == (short)nation && !c.IsCountry select c).ToList();
            AreaTag        countryAreaTags = (from c in IndoorAreasAndPlaceCount.Keys where c.CountryID == (short)nation && c.IsCountry select c).SingleOrDefault();

            StringBuilder sb = new StringBuilder("<div>");

            sb.AppendFormat("<img src=\"/images/UI/flags/{0}\" alt=\"Rock climbing gyms in {1}, {1} indoor climbing walls and outdoor climbing around {1}\" /><b> ", FlagList.GetFlag(nation), FlagList.GetCountryName(nation));
            sb.AppendFormat(GetAreaPage(countryAreaTags));
            sb.Append("</b></div>");
            sb.Append("<div style=\"font-size:10px;padding:2px 0px 8px 10px\">");
            foreach (AreaTag tag in subAreaTags)
            {
                sb.AppendFormat(GetAreaPage(tag));
                sb.Append("<br />");
            }

            sb.Append("</div>");

            return(sb.ToString());
        }
        protected void CreateAreaTag_Click(Object sender, EventArgs e)
        {
            if (PeterBlum.VAM.Globals.Page.IsValid)
            {
                //-- Validate country is not unknown or UK

                string friendlyUrlName = NameTxB.Text.Replace(" ", "-").ToLower();

                AreaTag tag = new AreaTag
                {
                    DefaultVirtualEarthZoom = 8,
                    FriendlyUrlName         = friendlyUrlName,
                    Latitude      = 0,
                    Longitude     = 0,
                    Name          = NameTxB.Text,
                    ParagraphName = ParagraphNameTxB.Text,
                    CountryID     = (short)NationalityDDLUC.SelectedNation
                };

                AreaTag newTag = cfController.AddAreaTag(tag);
                RedirectTo <ModerateController>(c => c.EditAreaTag(newTag.ID));
            }
        }
 public void SetPageMetaData(AreaTag area, bool forIndoor)
 {
     ViewData["PageTitle"] = PageMetaInfoGenerator.GetTitle(area, forIndoor);
     ViewData["PageDescription"] = PageMetaInfoGenerator.GetMetaDescription(area, forIndoor);
     ViewData["PageKeywords"] = PageMetaInfoGenerator.GetMetaKeywords(area, forIndoor);
     ViewData["PageRobots"] = GetRobotsDefinition(PageRobots.IndexFollow);
 }
 public void SetArea(AreaTag area)
 {
     ResultsHD.Value = area.ID.ToString();
     TxB.Text        = area.Name;
 }
Example #18
0
 public static string OtherPlaceRegularsCloud(ViewPage page, AreaTag currentViewedArea, bool isForIndoor)
 {
     return(page.Html.RenderUserControl("~/Views/Places/OtherPlaceRegularsCloud.ascx"));
 }
Example #19
0
        private void Stream( ArrayList data, AreaTag areaTag )
        {
            data.Add( new Snoop.Data.ClassSeparator( typeof( AreaTag ) ) );

              data.Add( new Snoop.Data.Object( "Area", areaTag.Area ) );
              data.Add( new Snoop.Data.Object( "Area tag type", areaTag.AreaTagType ) );
              data.Add( new Snoop.Data.Bool( "Leader", areaTag.HasLeader ) );
              data.Add( new Snoop.Data.Object( "View", areaTag.View ) );
        }
 /// <summary>
 /// 
 /// </summary>
 public static string GetTitle(AreaTag area, bool forIndoor)
 {
     if (forIndoor) { return string.Format("Indoor rock climbing in {0} - Climbfind.com", area.ParagraphName); }
     else { return string.Format("Outdoor rock climbing around {0} - Climbfind.com", area.ParagraphName); }
 }