Skip to content

Commit 8b8225c

Browse files
Added Section rendering usage.
Add new contact button on the form directly.
1 parent e0981b9 commit 8b8225c

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed
Binary file not shown.

src/Dnn.ContactList.Mvc/Models/Settings.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
using System.ComponentModel;
5-
using System.ComponentModel.DataAnnotations;
6-
using System.Resources;
7-
using System.Security.AccessControl;
8-
using DotNetNuke.Services.Localization;
95
using Newtonsoft.Json;
106

117
namespace Dnn.ContactList.Mvc.Models

src/Dnn.ContactList.Mvc/Views/Contact/Index.cshtml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@using DotNetNuke.Web.Mvc.Helpers
1+
@using DotNetNuke.Collections
2+
@using DotNetNuke.Web.Mvc.Helpers
23
@inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage<DotNetNuke.Collections.IPagedList<Dnn.ContactList.Api.Contact>>
34

45
<div>
@@ -18,4 +19,18 @@
1819
<a href="@Url.Action("Index", "Contact", new {pageIndex = Model.PageIndex + 1})"><i class="fa fa-arrow-right"></i></a>
1920
}
2021
</div>
21-
</div>
22+
@if (@Dnn.ModuleContext.IsEditable && Convert.ToBoolean(Dnn.ModuleContext.Configuration.ModuleSettings.GetValueOrDefault("AllowContactCreation", false)))
23+
{
24+
<div class="buttons">
25+
<a class="dnnPrimaryAction" href="@Url.Action("Edit", new {ctl = "Edit"})">@Dnn.LocalizeString("AddContact")</a>
26+
</div>
27+
}
28+
</div>
29+
@section scripts
30+
{
31+
<script type="text/javascript">
32+
$(document).ready(function() {
33+
console.log('I am called');
34+
});
35+
</script>
36+
}

src/Dnn.ContactList.Mvc/Views/Contact/_ContactPartial.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage<Dnn.ContactList.Api.Contact>
33
<div class="contactCard" style="float: left;">
44
@{
5-
if (Convert.ToBoolean(Dnn.ModuleContext.Configuration.ModuleSettings.GetValueOrDefault("AllowContactCreation", false)))
5+
if (@Dnn.ModuleContext.IsEditable && Convert.ToBoolean(Dnn.ModuleContext.Configuration.ModuleSettings.GetValueOrDefault("AllowContactCreation", false)))
66
{
77
<div class="right">
88
<a href="@Url.Action("Edit", "Contact", new {ctl = "Edit", contactId = Model.ContactId})" title="@Dnn.LocalizeString("Edit")">

src/Dnn.ContactList.Mvc/module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
width: 200px;
2727
margin-top: 20px;
2828
}
29-
30-
.editContact .buttons {
29+
.buttons {
3130
margin-top: 10px;
3231
text-align: center;
3332
padding-top: 20px;
33+
clear: both;
3434
}
3535

3636
/* info and errors */

0 commit comments

Comments
 (0)