private GroupHeaderViewModel GetGroupsLandingHeader(string currentTab) { var model = new GroupHeaderViewModel { HeaderTabs = new TabViewModel() { Tabs = new List <Tab> { new Tab { Name = "My groups", Order = 1, Url = Url.Action("Index", "Home", new { tab = Constants.MyGroupsTab }), Active = currentTab.Equals(Constants.MyGroupsTab), }, new Tab { Name = "Discover new groups", Order = 2, Url = Url.Action("Index", "Home", new { tab = Constants.DiscoverGroupsTab }), Active = currentTab.Equals(Constants.DiscoverGroupsTab), } } }, Name = currentTab.Equals(Constants.MyGroupsTab) ? _localizationService.GetResourceString("Group.MyGroups.Title") : _localizationService.GetResourceString("Group.DiscoverGroups.Title"), Description = currentTab.Equals(Constants.MyGroupsTab) ? _localizationService.GetResourceString("Group.MyGroups.HeaderIntro") : _localizationService.GetResourceString("Group.DiscoverGroups.HeaderIntro") }; return(model); }
/// <summary> /// Initializes a new instance of the <see cref="GroupHeaderElement"/> class. /// </summary> public GroupHeaderElement() { InitializeComponent(); Model = new GroupHeaderViewModel(this); //isnotification.ItemsSource = "NOTIFICATION"; //istask.ItemsSource = "TASKS"; //ispolicy.ItemsSource = "POLICIES"; }
public PartialViewResult GroupHeader(string slug, string tab = null) { var group = _groupService.GetBySlugWithSubGroups(slug, LoggedOnReadOnlyUser?.Id); var viewModel = new GroupHeaderViewModel() { Name = group.Group.Name, Description = group.Group.Description, Colour = group.Group.Colour, HeaderTabs = GetGroupTabsModel(slug, tab), Image = group.Group.Image, Id = group.Group.Id, ActionMenu = GetGroupActionMenu(group.Group) }; return(PartialView("_GroupHeader", viewModel)); }