Beispiel #1
0
        public static MvcHtmlString TagCloud(this HtmlHelper origin, Developer dev)
        {
            List <string> nuage = new List <string>();
            //je mets tout dans une liste de string
            //je récupère les languages de notre dev
            List <ITLang> langs = ITLang.ChargerToutesLesITLang()
                                  .Where(l => l.Developers.Where(d => d.IdDev
                                                                 == dev.IdDev).Count() > 0).ToList();

            foreach (ITLang item in langs)
            {
                nuage.Add(item.ITLabel);
            }

            //TODO: Add css and struct to create Tag cloud
            TagBuilder ta = new TagBuilder("div");

            ta.AddCssClass("Cloud");
            TagBuilder tul = new TagBuilder("ul");

            tul.AddCssClass("tags");
            pos = new List <int>();
            foreach (string item in nuage)
            {
                TagBuilder tli = new TagBuilder("li");
                tli.AddCssClass("tag" + randomstyle());
                tli.InnerHtml  = item;
                tul.InnerHtml += tli.ToString();
            }
            ta.InnerHtml = tul.ToString();
            return(new MvcHtmlString(ta.ToString()));
        }
Beispiel #2
0
        //
        // GET: /Home/
        public ActionResult Index()
        {
            Session["CurrentController"] = this;
            HomeModel HM = new HomeModel()
            {
                lstCateg = Categories.ChargerToutesLesCategories(),
                lstLangs = ITLang.ChargerToutesLesITLang(),
                lstDev   = Developer.ChargerTousLesDev()
            };

            return(View("Index", HM));
        }
        //
        // GET: /Dev/
        public ActionResult Details(int id)
        {
            Session["CurrentController"] = this;
            DetailsModel Current = new DetailsModel()
            {
                lstCateg   = Categories.ChargerToutesLesCategories(),
                lstLangs   = ITLang.ChargerToutesLesITLang(),
                lstDev     = Developer.ChargerTousLesDev(),
                CurrentDev = Developer.ChargerUnDev(id)
            };

            return(View(Current));
        }