Created
August 13, 2012 11:16
-
-
Save falafelsoftware/3339673 to your computer and use it in GitHub Desktop.
Falafel Dashboard HelloWorld Widget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Web.Mvc; | |
using FalafelDashboard.Common; | |
using FalafelDashboard.Configuration; | |
using SitefinityWebApp.Mvc.Areas.HelloWorld.Models; | |
using Telerik.Sitefinity; | |
using Telerik.Sitefinity.Configuration; | |
using Telerik.Sitefinity.Modules.Pages; | |
using Telerik.Sitefinity.Pages.Model; | |
namespace SitefinityWebApp.Mvc.Areas.HelloWorld.Controllers | |
{ | |
/// <summary> | |
/// Controller that provides functionality | |
/// </summary> | |
public class HelloWorldController : Controller | |
{ | |
#region Constants and Fields | |
#endregion | |
#region Properties | |
/// <summary> | |
/// The message to display in the hello world view | |
/// </summary> | |
public string Message { get; set; } | |
#endregion | |
#region Methods | |
public ActionResult Index() | |
{ | |
try | |
{ | |
if (Utils.IsWidgetAllowed("HelloWorld")) | |
{ | |
//INITIALIZE VIEW MODEL | |
var model = new HelloWorldViewModel { Message = "Hello world dashboard widget"}; | |
//TODO: POPULATE VIEW MODEL WITH DATA | |
//RETURN AREA VIEW WITH VIEW MODEL | |
return View("../../Areas/HelloWorld/Views/HelloWorld/Index", model); | |
} | |
return View("../../Areas/HelloWorld/Views/HelloWorld/Unauthorized"); | |
} | |
catch (Exception ex) | |
{ | |
return View("../../Areas/HelloWorld/Views/HelloWorld/Error", ex); | |
} | |
} | |
#endregion | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SitefinityWebApp.Mvc.Areas.HelloWorld.Models | |
{ | |
public class HelloWorldViewModel | |
{ | |
public string Message { get; set; } | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model SitefinityWebApp.Mvc.Areas.HelloWorld.Models.HelloWorldViewModel | |
<div class="dashboard_right_now"> | |
<strong>@Model.Message</strong> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment