Improved groups

This commit is contained in:
Eduard Urbach 2017-10-18 21:18:10 +02:00
parent 6a92dc23bb
commit 3f27562581
3 changed files with 48 additions and 5 deletions

View File

@ -2,12 +2,28 @@ component Group(group *arn.Group)
GroupTabs(group)
if group.Name != ""
h1= group.Name
h1.mountable= group.Name
else
h1 untitled
h1.mountable untitled
p= len(group.Members)
p= group.CreatedBy
.group-view
.group-sidebar.mountable
.group-sidebar-section
h3 Description
.group-description!= markdown.Render(group.Description)
.group-sidebar-section
h3 Rules
.group-rules!= markdown.Render(group.Rules)
.group-sidebar-section
h3 Members
.user-avatars.group-members
each member in group.Members
Avatar(member.User())
.group-feed.mountable
p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin fermentum tellus congue, placerat augue vel, porta tortor. Nunc in elementum enim. Vestibulum ut arcu sed diam dapibus feugiat. Nam posuere, lectus et pellentesque interdum, mi orci aliquet lacus, a posuere lacus mi ac urna. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec suscipit enim nec dui consectetur, vitae pulvinar urna commodo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
component GroupTabs(group *arn.Group)
.tabs

23
pages/group/group.scarlet Normal file
View File

@ -0,0 +1,23 @@
.group-view
horizontal-wrap
width 100%
< 1100px
.group-view
vertical
.group-feed
flex 0.75
padding 1rem
.group-sidebar
flex 0.25
.group-sidebar-section
ui-element
padding 0.5rem 1rem
margin-bottom content-padding
.group-members
margin-bottom 0.5rem
justify-content flex-start

View File

@ -66,7 +66,11 @@ func RenderField(b *bytes.Buffer, v *reflect.Value, field reflect.StructField, i
switch field.Type.String() {
case "string":
b.WriteString(components.InputText(idPrefix+field.Name, fieldValue.String(), field.Name, ""))
if field.Tag.Get("type") == "textarea" {
b.WriteString(components.InputTextArea(idPrefix+field.Name, fieldValue.String(), field.Name, ""))
} else {
b.WriteString(components.InputText(idPrefix+field.Name, fieldValue.String(), field.Name, ""))
}
case "[]string":
b.WriteString(components.InputTags(idPrefix+field.Name, fieldValue.Interface().([]string), field.Name, field.Tag.Get("tooltip")))
case "bool":