OpenAuth.Net/OpenAuth.Mvc/Controllers/HomeController.cs

51 lines
1.4 KiB
C#
Raw Normal View History

2017-08-30 18:16:06 +08:00
using System.Text;
2016-10-14 11:22:16 +08:00
using System.Web.Mvc;
2015-09-22 23:10:00 +08:00
namespace OpenAuth.Mvc.Controllers
{
public class HomeController : BaseController
{
2015-11-22 21:32:38 +08:00
2015-09-22 23:10:00 +08:00
public ActionResult Index()
2016-10-14 11:22:16 +08:00
{
return View();
}
2017-08-30 17:15:05 +08:00
public ActionResult Main()
{
return View();
}
2017-08-30 18:16:06 +08:00
2017-08-31 19:23:29 +08:00
2015-12-01 22:46:29 +08:00
public ActionResult Git()
{
return View();
}
/// <summary>
/// 所有页面按钮控制分部视图
/// </summary>
/// <returns>ActionResult.</returns>
[ChildActionOnly]
public ActionResult MenuHeader()
{
2016-10-14 11:22:16 +08:00
var sb = new StringBuilder();
foreach (var element in CurrentModule.Elements)
{
sb.Append("<button "
2017-02-08 09:15:49 +08:00
+ " id='" + element.DomId + "' "
+ " class='btn btn-sm " + element.Class + "' "
+ " onclick='" + element.Script + "' " + element.Attr
+ ">");
if (!string.IsNullOrEmpty(element.Icon))
{
sb.Append("<i class='ace-icon fa fa-" + element.Icon + "'></i>");
}
sb.Append(element.Name + "</button>");
2016-10-14 11:22:16 +08:00
}
ViewBag.Buttons = sb.ToString();
return View();
}
2015-09-22 23:10:00 +08:00
}
}