Commit 9c32c3ec6311c96aeee2ed22ab3e87fe20ed4764
1 parent
fb30df4d
Exists in
master
and in
4 other branches
Add link to proposals at result table
Showing
4 changed files
with
19 additions
and
5 deletions
Show diff stats
index.html
@@ -376,7 +376,7 @@ | @@ -376,7 +376,7 @@ | ||
376 | {{#each proposals}} | 376 | {{#each proposals}} |
377 | <tr> | 377 | <tr> |
378 | <td class="">{{calcPosition @index ../pagination.per_page ../pagination.page}}°</td> | 378 | <td class="">{{calcPosition @index ../pagination.per_page ../pagination.page}}°</td> |
379 | - <td class="abstract-text"><div class="truncate"><p class="truncated">{{stripTags abstract}}</p></div></td> | 379 | + <td class="abstract-text"><div class="truncate"><p class="truncated"><a href="#/programas/{{../topic_id}}/propostas/{{id}}">{{stripTags abstract}}</a></p></div></td> |
380 | <td class="views value">{{hits}}</td> | 380 | <td class="views value">{{hits}}</td> |
381 | <td class="votes-for value">{{votes_for}}</td> | 381 | <td class="votes-for value">{{votes_for}}</td> |
382 | <td class="votes-against value">{{votes_against}}</td> | 382 | <td class="votes-against value">{{votes_against}}</td> |
js/footable.js
@@ -426,7 +426,8 @@ | @@ -426,7 +426,8 @@ | ||
426 | if (!ft.hasAnyBreakpointColumn()) return; | 426 | if (!ft.hasAnyBreakpointColumn()) return; |
427 | 427 | ||
428 | $table.find(opt.toggleSelector).unbind(trg.toggleRow).bind(trg.toggleRow, function (e) { | 428 | $table.find(opt.toggleSelector).unbind(trg.toggleRow).bind(trg.toggleRow, function (e) { |
429 | - var $row = $(this).is('tr') ? $(this) : $(this).parents('tr:first'); | 429 | + var $this = $(this); |
430 | + var $row = $this.is('tr') ? $this : $this.parents('tr:first'); | ||
430 | ft.toggleDetail($row); | 431 | ft.toggleDetail($row); |
431 | }); | 432 | }); |
432 | 433 |
js/main.js
@@ -260,16 +260,17 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -260,16 +260,17 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
260 | page: page, | 260 | page: page, |
261 | }; | 261 | }; |
262 | 262 | ||
263 | - // hack: add title to result table | 263 | + // hack: add more info to result table |
264 | data.title = $resultsContainer.closest('.categories').find('.proposal-header .title').text(); | 264 | data.title = $resultsContainer.closest('.categories').find('.proposal-header .title').text(); |
265 | + data.topic_id = topic_id; | ||
265 | 266 | ||
266 | $resultsContainer.html(resultsTemplate(data)); | 267 | $resultsContainer.html(resultsTemplate(data)); |
267 | $resultsContainer.find('.loading').hide(); | 268 | $resultsContainer.find('.loading').hide(); |
268 | $resultsContainer.find('.results-content').show(); | 269 | $resultsContainer.find('.results-content').show(); |
269 | - $('.timeago').timeago(); | 270 | + $resultsContainer.find('.timeago').timeago(); |
270 | $resultsContainer.show(); | 271 | $resultsContainer.show(); |
272 | + $resultsContainer.find('.footable').footable(); // must be called on visible elements. | ||
271 | 273 | ||
272 | - $('.footable').footable(); | ||
273 | 274 | ||
274 | if(data.pagination.total > data.pagination.per_page) { | 275 | if(data.pagination.total > data.pagination.per_page) { |
275 | $resultsContainer.find('.paging').pagination({ | 276 | $resultsContainer.find('.paging').pagination({ |
sass/style.sass
@@ -940,6 +940,7 @@ td | @@ -940,6 +940,7 @@ td | ||
940 | text-align: center | 940 | text-align: center |
941 | width: 10% | 941 | width: 10% |
942 | .truncate | 942 | .truncate |
943 | + position: relative | ||
943 | display: table | 944 | display: table |
944 | table-layout: fixed | 945 | table-layout: fixed |
945 | width: 100% | 946 | width: 100% |
@@ -949,6 +950,17 @@ td | @@ -949,6 +950,17 @@ td | ||
949 | overflow-x: hidden | 950 | overflow-x: hidden |
950 | text-overflow: ellipsis | 951 | text-overflow: ellipsis |
951 | white-space: nowrap | 952 | white-space: nowrap |
953 | + &:after | ||
954 | + display: block | ||
955 | + content: "[...]" | ||
956 | + // content: "\e000" | ||
957 | + position: absolute | ||
958 | + top: 0 | ||
959 | + right: 2px | ||
960 | + padding: 1px 3px | ||
961 | + color: #888 | ||
962 | + background-color: #e0e0e0 | ||
963 | + | ||
952 | &.phone | 964 | &.phone |
953 | .footable-toggle | 965 | .footable-toggle |
954 | float: right | 966 | float: right |