OpenAuth.Net/OpenAuth.Mvc/Controllers/HomeController.cs
yubaolee c617a3ecdb ru
2017-10-12 16:38:46 +08:00

51 lines
1.3 KiB
C#

using System.Text;
using System.Web.Mvc;
namespace OpenAuth.Mvc.Controllers
{
public class HomeController : BaseController
{
public ActionResult Index()
{
return View();
}
public ActionResult Main()
{
return View();
}
public ActionResult Git()
{
return View();
}
/// <summary>
/// 所有页面按钮控制分部视图
/// </summary>
/// <returns>ActionResult.</returns>
[ChildActionOnly]
public ActionResult MenuHeader()
{
var sb = new StringBuilder();
foreach (var element in CurrentModule.Elements)
{
sb.Append("<button "
+ " data-type='" + element.DomId + "' "
+ " class='layui-btn " + element.Class + "' "
+ element.Attr
+ ">");
if (!string.IsNullOrEmpty(element.Icon))
{
sb.Append("<i class='layui-icon'>" + element.Icon + "</i>");
}
sb.Append(element.Name + "</button>");
}
ViewBag.Buttons = sb.ToString();
return View();
}
}
}