Skip to content

Commit

Permalink
Add date line in the flash chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Godzil committed Jan 11, 2019
1 parent b8e9247 commit fd6d25e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/resource/language/en/base.xml
Expand Up @@ -13,5 +13,6 @@
<string key="submit.send">Send</string>
<string key="type.datetime.relative">{case:{lag:86400,{time}},0,Today,1,Yesterday,On the {date:{time},Y-m-d}} at {date:{time},h:ia}</string>
<string key="type.time.absolute">{date:{time},h:i:sa}</string>
<string key="type.date.relative">{case:{lag:86400,{time}},0,Today,1,Yesterday,{date:{time},d-m}}</string>
</section>
</locale>
1 change: 1 addition & 0 deletions src/resource/language/fr/base.xml
Expand Up @@ -13,5 +13,6 @@
<string key="submit.send">Envoyer</string>
<string key="type.datetime.relative">{case:{lag:86400,{time}},0,Aujourd'hui,1,Hier,Le {date:{time},d/m/Y}} à {date:{time},H:i}</string>
<string key="type.time.absolute">{date:{time},H:i:s}</string>
<string key="type.date.relative">{case:{lag:86400,{time}},0,Aujourd'hui,1,Hier,{date:{time},d/m}}</string>
</section>
</locale>
35 changes: 19 additions & 16 deletions src/resource/template/html/yn-home.deval
Expand Up @@ -78,23 +78,26 @@
<div class="panel-header">{{ $ tra ("yn.home.chat") }}</div>
<div class="panel-body">
<ul>
{{ for shout in shouts }}
<li>
{{ if user.is_admin }}
<a href="{{ $ url ("chat.shout.delete", ["shout": shout.id]) }}">
{{ end }}
<em class="time">{{ $ tra ("yn.home.chat.time", ["time": shout.time]) }}</em>
{{ if user.is_admin }}
</a>
{{ end }}
{{ $ " " }}
<strong class="author {{ $ shout.is_guest && "guest" || "user" }}">{{ $ shout.nick }}</strong>
<span class="text">
{{ unwrap }}
{{ $ shout.render_text ("html", router, logger) }}
{{ for day, shoutsofday in group(shouts, (s) => tra("base.type.date.relative", ["time": s.time]), (s) => [s], (a, b) => cat(a, b)) }}
{{ for shout in shoutsofday }}
<li>
{{ if user.is_admin }}
<a href="{{ $ url ("chat.shout.delete", ["shout": shout.id]) }}">
{{ end }}
<em class="time">{{ $ tra ("yn.home.chat.time", ["time": shout.time]) }}</em>
{{ if user.is_admin }}
</a>
{{ end }}
</span>
</li>
{{ $ " " }}
<strong class="author {{ $ shout.is_guest && "guest" || "user" }}">{{ $ shout.nick }}</strong>
<span class="text">
{{ unwrap }}
{{ $ shout.render_text ("html", router, logger) }}
{{ end }}
</span>
</li>
{{ end }}
<li> <span class="shout-day">{{ $ day }}</span> </li>
{{ end }}
</ul>
<form class="form-cascade form-thick" action="{{ $ url ("chat.shout.new") }}" method="POST">
Expand Down
17 changes: 17 additions & 0 deletions src/static/layout/html/yn-home.inc.less
Expand Up @@ -60,6 +60,23 @@
}
}
}
.shout-day {
text-align: center;
display: block;
overflow: hidden;
color: @guest-text;
}
.shout-day:before, .shout-day:after {
content: "";
display: inline-block;
width: 50%;
margin: 0 .5em 0 -55%;
vertical-align: middle;
border-bottom: 1px solid @guest-text;
}
.shout-day:after {
margin: 0 -55% 0 .5em;
}
}

.index {
Expand Down

0 comments on commit fd6d25e

Please sign in to comment.