Skip to content

Commit

Permalink
Merge pull request #24 from nugged/favorites_they_are_everywhere
Browse files Browse the repository at this point in the history
Favorites! Favorites evrywhere!
  • Loading branch information
JJ committed Jul 23, 2015
2 parents 28aac71 + 4205a56 commit e349340
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 21 deletions.
3 changes: 3 additions & 0 deletions actdocs/templates/core/talk/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<thead>
<tr>
<th>{{Speaker}}</th>
<th>&nbsp;</th>
<th>{{Talk title}}</th>
[% IF global.config.talks_languages %]<th>{{Language}}</th>[% END %]
<th>{{Duration}}</th>
Expand All @@ -30,6 +31,8 @@
[% user_info(t.user) %]
</td>

<td width="30">[% PROCESS talk/fav_ajax onetalk = t %]</td>

<td>
[% IF t.type == 'Act::Event' %]
[% event_link(t) %]
Expand Down
20 changes: 20 additions & 0 deletions actdocs/templates/talk/fav_ajax
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[% IF global.request.user.has_registered %]
<a href="/ye2015/talk/[% onetalk.talk_id %]"
[%# For best toggling state, reversed test and tald_id stored in tag data- items: %]
[% IF global.request.user.is_my_talk(onetalk.talk_id) %]
title="{{remove from personal schedule}}"
data-toggle="tooltip" data-placement="top"
class="talk-checkbox"
data-talkfav="1" data-talkid="[% onetalk.talk_id %]"
data-titlerev="{{add to personal schedule}}">
<img src="/ye2015/img/fav-3.png" width="20px">
[% ELSE %]
title="{{add to personal schedule}}"
data-toggle="tooltip" data-placement="top"
class="talk-checkbox"
data-talkfav="0" data-talkid="[% onetalk.talk_id %]"
data-titlerev="{{remove from personal schedule}}">
<img src="/ye2015/img/no-fav-3.png" width="20px">
[% END %]
</a>
[% END %]
2 changes: 1 addition & 1 deletion actdocs/templates/talk/list
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[%
IF tag;
IF tag;
title = loc("List of talks tagged <tag>", tag);
ELSE;
title = loc("List of talks");
Expand Down
21 changes: 1 addition & 20 deletions actdocs/templates/talk/talk_list
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,7 @@
@date 14-Jun-2015
@desc Trying to make a star appearing close to the user's favorite talks. The star will also be a link to modify the choice
-->
[% IF global.request.user.has_registered %]
<a href="/ye2015/talk/[% t.talk_id %]"
[%# For best toggling state, reversed test and tald_id stored in tag data- items: %]
[% IF global.request.user.is_my_talk(t.talk_id) %]
title="{{remove from personal schedule}}"
data-toggle="tooltip" data-placement="top"
class="talk-checkbox"
data-talkfav="1" data-talkid="[% t.talk_id %]"
data-titlerev="{{add to personal schedule}}">
<img src="/ye2015/img/fav-3.png" width="20px">
[% ELSE %]
title="{{add to personal schedule}}"
data-toggle="tooltip" data-placement="top"
class="talk-checkbox"
data-talkfav="0" data-talkid="[% t.talk_id %]"
data-titlerev="{{remove from personal schedule}}">
<img src="/ye2015/img/no-fav-3.png" width="20px">
[% END %]
</a>
[% END %]
[% PROCESS talk/fav_ajax onetalk = t %]
</td>
<td>
[% talk_link(t) %]
Expand Down
6 changes: 6 additions & 0 deletions actdocs/templates/user/show
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@
<span class="label label-warning">{{Pending}}</span>
[% END %]
</td>
[% IF t.confirmed %]
<td width="30">
[% PROCESS talk/fav_ajax onetalk = t %]
</td>
[% END %]
<td>
[% talk_link(t) %]
</td>
Expand Down Expand Up @@ -206,6 +211,7 @@
<table class="table">
[% FOREACH t = mytalks %]
<tr>
<td width="30">[% PROCESS talk/fav_ajax onetalk = t %]</td>
<td>[% talk_link(t) %]</td>
</tr>
[% END %]
Expand Down

0 comments on commit e349340

Please sign in to comment.