Skip to content

Commit 39ac695

Browse files
committed
commit before work
1 parent 8e32106 commit 39ac695

37 files changed

+2025
-3004
lines changed

.data/app.xml

Lines changed: 0 additions & 2839 deletions
This file was deleted.

GIT

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## Git Repository
2+
## https://github.com/2sic/2sxc-content-bootstrap3

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# 2sxc-content-bootstrap3
2+
The default "Content" types and templates for DNN (DotNetNuke) with bootstrap 3.x. Here some thumbnails:
3+
4+
[<img src="https://github.com/2sic/2sxc-content-bootstrap3/wiki/assets/thumbnails.jpg">](http://2sxc.org/en/blog/post/27-responsive-bootstrap3-structured-content-design-templates-for-dnn-and-2sxc)
5+
6+
## Purpose
7+
Each DNN portal using [2sxc][2sxc] has a section called "Content" which contains the main content-types and main templates.
8+
This could be initialized manually, but in most cases it's more efficient to install a set of best-practice content-types and templates. To ensure this stuff looks good, these content-types and templates should be optimized to the CSS-framework in use.
9+
10+
This package **Content-Bootstrap3** is the default configuration package which 2sxc offers for Bootstrap installations.
11+
12+
## Quick-Start
13+
14+
1. Almost everything you want to know is in the [wiki](https://github.com/2sic/2sxc-content-bootstrap3/wiki)
15+
1. **Installation**: Whenever you install 2sxc on a DNN portal, or when you create a new portal on a [DNN with 2sxc installed](http://2sxc.org/en/Learn/Install-2sxc), 2sxc will automatitcally ask you if you want to install this. If you need to know more, read about [installations in the wiki](https://github.com/2sic/2sxc-content-bootstrap3/wiki/Installation-Instructions).
16+
1. **Skin/Theme Optimizations**: We have some recommendations, if you care about this, read about the [optimizations in the wiki](https://github.com/2sic/2sxc-content-bootstrap3/wiki/Theme-Optimizations)
17+
1. **Customize to your colors and CSS**: check out the [instructions in the wiki](https://github.com/2sic/2sxc-content-bootstrap3/wiki/Customizing%20CSS%20or%20SASS)
18+
19+
## Questions and Support
20+
1. We from 2sxc use [StackOverflow with the tag 2sxc][StackOverflow] for support. Post your questions there.
21+
2. Real issues can be posted in [issues](https://github.com/2sic/2sxc-content-bootstrap3/issues)
22+
23+
24+
25+
[2sxc]:https://2sxc.org
26+
[StackOverflow]:http://stackoverflow.com/questions/tagged/2sxc
27+
[SCSS]:http://sass-lang.com/

_Course-Overview.cshtml

Lines changed: 127 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,145 @@
1-
<div class="ly-maxwrapper ly-maxwrapper-white">
1+
@using Connect.Koi;
2+
3+
<div class="app-events app-event-list ly-maxwrapper ly-maxwrapper-white">
24
<div class="container-fluid ly-content">
3-
<div class="ly-container-inner">
5+
<div class="ly-container-inner app-course">
46
<div class="panel-group co-kurs-wrapper" id="accordion" role="tablist" aria-multiselectable="true">
57
@foreach (var group in AsDynamic(Data["Default"]))
68
{
79
// Here's the short version for the list of course-parents
810
var courses = ((ToSic.Eav.Interfaces.IEntity)AsEntity(group)) // cast to use power-API
911
.Relationships.AllParents // all parents, no matter what type
10-
.Where(c => c.Type.Name == "Course")
12+
.Where(c => c.Type.Name == "Event")
13+
.SelectMany(c => c.Relationships.AllParents.Where(p => p.Type.Name == "EventDate"))
1114
.Select(c => AsDynamic(c)) // now only the courses
12-
.Where(c => c.DateTo >= DateTime.Now.AddDays(-2) || c.individual == true);
15+
.Where(c => c.Start.Date >= DateTime.Now || c.Event[0].individual == true);
1316

1417
<div class="panel panel-default">
15-
<div class="panel-heading sc-element" role="tab" id="heading_@group.EntityId">
16-
17-
<h4 class="panel-title">
18-
<a data-toggle="collapse" data-parent="#accordion" href="#collapse_@group.EntityId" aria-expanded="@((group.InitiallyExpanded == true) ? "true" : "false")" aria-controls="collapse_@group.EntityId" class="@((group.InitiallyExpanded == true) ? "" : "collapsed" )">
19-
<span class="co-panel-icon">
20-
@if(!String.IsNullOrEmpty(Content.Icon)){
21-
<i class="fa @group.Icon co-icon" aria-hidden="true"></i>
22-
}
23-
</span>
24-
@group.Title
25-
</a>
26-
@group.Toolbar
27-
</h4>
28-
</div>
29-
<div id="collapse_@group.EntityId" class="panel-collapse collapse @((group.InitiallyExpanded == true) ? "in" : "")" role="tabpanel" aria-labelledby="heading_@group.EntityId">
30-
@if (!string.IsNullOrEmpty(group.Description))
31-
{
32-
<div class="panel-body">
33-
@Html.Raw(group.Description)
34-
@if (!string.IsNullOrEmpty(group.Download))
35-
{
36-
<a class="btn btn-md btn-default co-kurs-pdf" href="@group.Download" target="_blank"><span class="glyphicon glyphicon-file"></span> @App.Resources.Download</a>
37-
}
38-
</div>
39-
}
40-
@if(Permissions.UserMayEditContent) {
41-
@Edit.Toolbar(toolbar: new { contentType = "Course", action = "new", prefill = new { Topic = @group.EntityGuid.ToString() } } )
42-
<i>Neuen Termin zur Gruppe hinzufügen</i>
43-
}
44-
45-
46-
<ul class="list-group">
47-
@foreach (var course in courses.OrderBy(c => c.Date))
48-
{
49-
var registrations = AsDynamic(App.Data["CourseRegistration"]).Where(c => c.Status == "registered" && c.Course.Count > 0 && c.Course[0].EntityGuid == course.EntityGuid);
50-
var freeSeats = @course.Seats - registrations.Count();
51-
52-
<li class="list-group-item xsc-element">
53-
<div class="row sc-element">
54-
<div class="col-xs-12 col-sm-3 col-md-3">
55-
@Edit.Toolbar(course, actions: "edit", settings: new { hover = "left"} )
56-
<strong>@App.Resources.CourseTitle</strong><br/>@course.Title
57-
58-
@if(!string.IsNullOrEmpty(course.Management)) {
59-
<br/><br />
60-
<strong>@App.Resources.Management</strong><br />@Html.Raw(course.Management)
61-
}
62-
63-
@if(!string.IsNullOrEmpty(course.Fee)) {
64-
<br/><br />
65-
<strong>@App.Resources.Fee</strong><br />@Html.Raw(course.Fee)
66-
}
67-
68-
@if(!string.IsNullOrEmpty(course.ShortDescription)) {
69-
<br><br>
70-
<strong>@App.Resources.LabelShortDescription</strong><br>
71-
<span>@Html.Raw(course.ShortDescription.Replace("\n", "<br/>"))</span>
72-
}
18+
@* Checked divs from here on *@
19+
<div class="panel-heading sc-element" id="heading_@group.EntityId">
20+
<h2 class="panel-title">
21+
@*
22+
<span class="co-panel-icon">
23+
<i class="fa @group.Icon" aria-hidden="true"></i>
24+
</span>
25+
*@
26+
@group.Title
27+
</h2>
28+
</div>
29+
@if (!string.IsNullOrEmpty(group.Description))
30+
{
31+
<div @Koi.Class("all='sc-element' bs3,unk='row' bs4='row'")>
32+
@Edit.Toolbar(group)
33+
<div @Koi.Class("all='co-group-description' bs3,unk='col col-xs-12 col-sm-10' bs4='col-12 col-sm-10'")>
34+
@Html.Raw(group.Description)
35+
</div>
36+
<div @Koi.Class("bs3,unk='col col-xs-12 col-sm-2' bs4='col-12 col-sm-2'")>
37+
@if (!string.IsNullOrEmpty(group.Download))
38+
{
39+
<a class="btn btn-md btn-default co-kurs-pdf" href="@group.Download" target="_blank">
40+
@Html.Raw(App.Resources.Download)
41+
</a>
42+
}
43+
</div>
44+
</div>
45+
}
46+
<a data-toggle="collapse" data-parent="#accordion" href="#collapse_@group.EntityId" aria-expanded="true" aria-controls="collapse_@group.EntityId" class="panel-link-title @((group.InitiallyExpanded == true) ? "" : "collapsed" )">
47+
<span class="co-panel-icon" style="margin-right: 10px;">
48+
<i class="fa fa-calendar" aria-hidden="true"></i>
49+
</span>
50+
@group.Title
51+
<span class="co-panel-icon-r">
52+
53+
</span>
54+
</a>
55+
<div id="collapse_@group.EntityId" class="panel-collapse collapse @((group.InitiallyExpanded == true) ? "show" : "")" role="tabpanel" aria-labelledby="heading_@group.EntityId">
56+
<div class="list-group">
57+
@Edit.Toolbar(actions: "new", contentType: "EventDate", settings: new { hover = "left" })
58+
@foreach (var eventDate in courses.OrderBy(c => c.Date))
59+
{
60+
var course = eventDate.Event[0];
61+
var registrations = AsDynamic(App.Data["CourseRegistration"]).Where(c => c.Status == "registered" && c.EventDateEntity.Count > 0 && c.EventDateEntity[0].EntityGuid == eventDate.EntityGuid);
62+
var freeSeats = @eventDate.Seats - registrations.Count();
7363

74-
@if(!string.IsNullOrEmpty(course.Document)) {
75-
<br><br>
76-
<a class="btn btn-md btn-default co-kurs-pdf" style="position:relative; left:-12px;" href="@course.Document" target="_blank"><span class="glyphicon glyphicon-file"></span> @App.Resources.Download</a>
77-
}
78-
</div>
79-
<div class="col-xs-12 col-sm-2 col-md-2"></div>
80-
<div class="col-xs-12 col-sm-4 col-md-4">
81-
<strong>@Html.Raw(App.Resources.DateTime)</strong>
82-
83-
<br />
84-
@Html.Raw(course.Time.Replace("\n", "<br/>"))
85-
86-
@if(!string.IsNullOrEmpty(course.City)) {
87-
<br /><br />
88-
<strong>@Html.Raw(App.Resources.Location.Replace("\n", "<br/>"))</strong>
89-
<br />
90-
@Html.Raw(course.City.Replace("\n", "<br/>"))
91-
}
92-
93-
<br /><br />
64+
<div @Koi.Class("all='list-group-item app-event-item sc-element' bs3,unk='' bs4=''")>
65+
<div @Koi.Class("all='sc-element' bs3,unk='row' bs4='row'")>
66+
@Edit.Toolbar(eventDate)
67+
<div @Koi.Class("bs3,unk='col-xs-12 col-sm-6 col-md-4' bs4='col-12 col-md-6 col-lg-4'")>
68+
<div class="app-img @((String.IsNullOrEmpty(@course.Image)) ? "app-noimg" : "")">
69+
<img @Koi.Class("bs3='img-responsive' bs4,unk='img-fluid'") src="@((!String.IsNullOrEmpty(@course.Image)) ? @course.Image + "?w=800&h=480&mode=crop&scale=both&quality=80&anchor=" + @course.CropAnchor : @App.Resources.PlaceholderMissingImage + "?max-height=210&mode=max&scale=both&quality=80")"alt="@course.Title" />
70+
</div>
71+
</div>
72+
<div @Koi.Class("bs3,unk='col-xs-12 col-sm-6 col-md-8' bs4='col-12 col-md-6 col-lg-8'")>
73+
@*Edit.Toolbar(course, actions: "edit", settings: new { hover = "right"} )
74+
@Edit.Toolbar(toolbar: new object[] {
75+
new {
76+
showCondition = true,
77+
command = new { action = "contentitems",
78+
contentType= "CourseRegistration",
79+
filters = new {Course = new[] { course.EntityTitle } }
80+
}
81+
}
82+
}, settings: new { hover="right" })*@
83+
<div class="app-text">
84+
<h2>@course.Title @((!String.IsNullOrEmpty(eventDate.TitleAddition)) ? App.Resources.TitleAdditionPrefix + " " + eventDate.TitleAddition + " " + App.Resources.TitleAdditionSuffix : "" )</h2>
85+
<span class="app-date">@eventDate.Start.ToString("dd.MM.yyyy") | </span>
86+
<span class="app-categories">
87+
<span>@course.Topic[0].Title</span>
88+
</span>
89+
@if(!string.IsNullOrEmpty(course.ShortDescription)) {
90+
<p>@Html.Raw(course.ShortDescription.Replace("\n", "<br />"))</p>
91+
}
92+
</div>
9493

95-
@if(course.RegistrationEnabled && course.FullyBooked == false && course.Canceled == false) {
96-
<strong>@Html.Raw(App.Resources.Seats.Replace("\n", "<br/>"))</strong><br />@freeSeats<br />
97-
}
98-
</div>
99-
<div class="col-xs-12 col-sm-3 col-md-3">
100-
@if (course.Canceled == true) {
101-
<div class="alert alert-warning pull-right" role="alert">
102-
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
103-
@App.Resources.StatusCanceled
104-
</div>
105-
}
106-
else if(course.RegistrationEnabled) {
107-
if(freeSeats <= 0 || course.FullyBooked) {
108-
<div class="alert alert-warning pull-right" role="alert">
109-
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
110-
@App.Resources.StatusFullyBooked
94+
@if(course.DetailsOpensLink == true) {
95+
if(!string.IsNullOrEmpty(course.Document)) {
96+
<a class="btn btn-md btn-default co-kurs-pdf" href="@course.Document" target="_blank">@Html.Raw(App.Resources.LabelReadMore)</a>
97+
}
98+
}
99+
else {
100+
<a @Koi.Class("all='co-btn-opendetails' bs3,unk='app-readmore' bs4='app-readmore'") href="@Link.To(parameters: "details=" + @eventDate.EntityId)">@Html.Raw(App.Resources.LabelReadMore)</a>
101+
}
102+
@if (course.Canceled == true) {
103+
<div class="alert alert-warning" style="margin-top:15px;" role="alert">
104+
@App.Resources.StatusCanceled
111105
</div>
112-
}
113-
else {
114-
<a class="btn btn-md btn-primary pull-right" href="@Link.To(parameters: "mid=" + Dnn.Module.ModuleID + "&cid=" + @course.EntityId)"><span class="glyphicon glyphicon-log-in"></span> @App.Resources.Register</a>
115-
}
116-
}
117-
@* toolbar to edit registrations of this course - opens the items and filters by this course-name *@
118-
@Edit.Toolbar(toolbar: new object[] {
119-
new {
120-
showCondition = true,
121-
command = new { action = "contentitems",
122-
contentType= "CourseRegistration",
123-
filters = new {Course = new[] { course.EntityTitle } }
124-
}
125-
}
126-
}, settings: new { hover="none", show = "always" })
127-
</div>
128-
</div>
129-
</li>
130-
}
131-
132-
@* if no courses exist, show this *@
133-
@if(courses.Count() == 0) {
134-
<li class="list-group-item xsc-element">
135-
<div class="row">
136-
<div class="col-xs-12">
137-
@Html.Raw(App.Resources.NoCoursesFound)
138-
</div>
139-
</div>
140-
</li>
141-
}
142-
</ul>
143-
</div>
106+
}
107+
else if(App.Settings.RegistrationEnabled && eventDate.RegistrationEnabled) {
108+
if(freeSeats <= 0 || eventDate.IsFullyBooked) {
109+
<div class="alert alert-warning" style="margin-top:15px;" role="alert">
110+
@App.Resources.StatusFullyBooked
111+
</div>
112+
}
113+
else {
114+
<br />
115+
<a @Koi.Class("all='co-btn-openregister' bs3,unk='app-readmore' bs4='app-readmore'") href="@Link.To(parameters: "mid=" + Dnn.Module.ModuleID + "&cid=" + @course.EntityId)">@Html.Raw(App.Resources.Register) ›</a>
116+
}
117+
}
118+
</div>
119+
</div>
120+
</div>
121+
}
122+
123+
@* if no courses exist, show this *@
124+
@if(courses.Count() == 0) {
125+
<div class="list-group-item xsc-element">
126+
<div class="row">
127+
<div class="col-xs-12 sc-element">
128+
@Edit.Toolbar(actions: "new", contentType: "EventDate" )
129+
@Html.Raw(App.Resources.NoCoursesFound)
130+
</div>
131+
</div>
132+
</div>
133+
}
134+
</div>
135+
</div>
144136
</div>
145137
}
146138
</div>
147139
</div>
148140
</div>
149-
</div>
141+
</div>
142+
143+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
144+
<link rel="stylesheet" href="@App.Path/dist/liststyles.css" />
145+
<script src="@App.Path/dist/script.js" ></script>

0 commit comments

Comments
 (0)