Skip to content

Commit 3b92b78

Browse files
authored
Handle long location names in home page (#2719)
1 parent dbb1b47 commit 3b92b78

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

app/templates/gentelella/index.html

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
cursor: pointer;
88

99
}
10+
1011
.event-holder:hover > .thumbnail > .caption {
1112
background-color: #f7f7f7;
1213
}
@@ -36,12 +37,9 @@
3637
}
3738

3839
.event-holder .location_name {
39-
white-space: nowrap;
40-
max-widows:;: 12em;
41-
overflow: hidden;
42-
text-overflow: ellipsis;
4340
position: relative;
4441
display: inline-block;
42+
height: 20px;
4543
}
4644

4745
.event-holder .tags {
@@ -91,6 +89,11 @@
9189
font-weight: 300;
9290
text-transform: uppercase;
9391
}
92+
93+
div.tooltip-inner {
94+
text-align: left;
95+
max-width: 350px;
96+
}
9497
</style>
9598
{% endblock %}
9699
{% block title %}
@@ -145,7 +148,10 @@
145148
<div class="caption">
146149
<small class="time">{{ event.start_time.strftime('%a, %B %d %I:%M %p') }}</small>
147150
<h4 class="name">{{ event.name }}</h4>
148-
<div class="location_name" title="{{ event.location_name }}" data-toggle="tooltip" data-placement="right">{{ event.location_name.split(",")[0] }}</div>
151+
<div class="location_name" title="{{ event.location_name }}" data-toggle="tooltip"
152+
data-placement="right" data-original-text="{{ event.location_name.split(",")[0] }}">
153+
<span class="text"></span>
154+
</div>
149155
<hr>
150156
<p class="tags">
151157
{% if event.type %}
@@ -185,10 +191,12 @@ <h1>{{ _("The simplest way to create events.") }}</h1>
185191
<div class="col-md-10 col-md-push-1">
186192
<form class="form-inline row home-search" method="get" action="/browse">
187193
<div class="form-group col-sm-4 col-xs-10">
188-
<input type="text" name="query" class="form-control input-lg" style="width: 100%;" placeholder="Search for events">
194+
<input type="text" name="query" class="form-control input-lg" style="width: 100%;"
195+
placeholder="Search for events">
189196
</div>
190197
<div class="form-group col-sm-3 hidden-xs">
191-
<input type="text" name="location" id="location" class="form-control input-lg" style="width: 100%;" placeholder="Location">
198+
<input type="text" name="location" id="location" class="form-control input-lg" style="width: 100%;"
199+
placeholder="Location">
192200
</div>
193201
<div class="form-group col-sm-3 hidden-xs">
194202
<select class="form-control input-lg" name="period" style="width: 100%;" title="Period">
@@ -244,7 +252,8 @@ <h4>{{ _("Share this event") }}</h4>
244252
</div>
245253
<div class="modal-body" style="text-align: center;">
246254
{% include 'gentelella/components/social_buttons.html' %}
247-
<input id="share-url-box" type="text" class="form-control" onClick="this.select();" value="{{ request.url }}" title="Share URL">
255+
<input id="share-url-box" type="text" class="form-control" onClick="this.select();"
256+
value="{{ request.url }}" title="Share URL">
248257
</div>
249258
</div>
250259
</div>
@@ -254,7 +263,7 @@ <h4>{{ _("Share this event") }}</h4>
254263

255264
{% block tail_js %}
256265
{{ super() }}
257-
266+
<script src="{{ url_for('static', filename='js/jquery/jquery.ellipsis.js') }}"></script>
258267
<script type="text/javascript" src="{{ url_for('static', filename='js/jquery/jquery.codezero.js') }}"></script>
259268
<script type="text/javascript">
260269
var pathArray = location.href.split('/');
@@ -280,5 +289,7 @@ <h4>{{ _("Share this event") }}</h4>
280289
location.href = "{{ url_for("admin.browse_view") }}?" + name + "=" + encodeURI(value);
281290
});
282291

292+
$(".location_name").ellipsis();
293+
283294
</script>
284295
{% endblock %}

0 commit comments

Comments
 (0)