Maxlength and truncation

This commit is contained in:
Eliot Berriot 2018-02-22 23:36:53 +01:00
parent 6e4fb2e5d5
commit 2fb533c5f5
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
1 changed files with 7 additions and 5 deletions

View File

@ -4,16 +4,16 @@
<p>Something's missing in the library? Let us know what you would like to listen!</p> <p>Something's missing in the library? Let us know what you would like to listen!</p>
<div class="required field"> <div class="required field">
<label>Artist name</label> <label>Artist name</label>
<input v-model="currentArtistName" placeholder="The Beatles, Mickael Jackson…" required> <input v-model="currentArtistName" placeholder="The Beatles, Mickael Jackson…" required maxlength="200">
</div> </div>
<div class="field"> <div class="field">
<label>Albums</label> <label>Albums</label>
<p>Leave this field empty if you're requesting the whole discography.</p> <p>Leave this field empty if you're requesting the whole discography.</p>
<input v-model="currentAlbums" placeholder="The White Album, Thriller…"> <input v-model="currentAlbums" placeholder="The White Album, Thriller…" maxlength="2000">
</div> </div>
<div class="field"> <div class="field">
<label>Comment</label> <label>Comment</label>
<textarea v-model="currentComment" rows="3" placeholder="Use this comment box to add details to your request if needed"></textarea> <textarea v-model="currentComment" rows="3" placeholder="Use this comment box to add details to your request if needed" maxlength="2000"></textarea>
</div> </div>
<button class="ui submit button" type="submit">Submit</button> <button class="ui submit button" type="submit">Submit</button>
</form> </form>
@ -29,8 +29,10 @@
<div v-for="request in requests" class="item"> <div v-for="request in requests" class="item">
<div class="content"> <div class="content">
<div class="header">{{ request.artist_name }}</div> <div class="header">{{ request.artist_name }}</div>
<div v-if="request.albums" class="description">{{ truncate(request.albums, 50) }}</div> <div v-if="request.albums" class="description">
<div v-if="request.comment" class="description">{{ truncate(request.comment, 50) }}</div> {{ request.albums|truncate }}</div>
<div v-if="request.comment" class="description">
{{ request.comment|truncate }}</div>
</div> </div>
</div> </div>
</div> </div>