Skip to content

Commit

Permalink
Major Gravatar render cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Janssen committed May 27, 2017
1 parent aa1806d commit 3e224be
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ run-be.sh
/conf/dump.rdb
/conf/application.conf.local
/run-local.sh
/redis-devoxxlocal.conf
app-2.10/
conf/redis-devoxxlocal.conf
6 changes: 3 additions & 3 deletions app/views/ApproveOrRefuse/allApprovedByTalkType.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ <h3>@allProposals.size proposals approved</h3>
</td>
<td>@proposal.id</td>
<td>
@tags.renderGravatar(proposal.mainSpeaker,showName = true, showPhoto = false)
@tags.renderGravatar(proposal.mainSpeaker, showName = Some(true))
@proposal.secondarySpeaker.map { sp =>
@tags.renderGravatar(sp,showName = true, showPhoto = false)
@tags.renderGravatar(sp, showName = Some(true))
}
@proposal.otherSpeakers.map{ sp2=>
@tags.renderGravatar(sp2,showName = true, showPhoto = false)
@tags.renderGravatar(sp2, showName = Some(true))
}
</td>
<td>
Expand Down
6 changes: 3 additions & 3 deletions app/views/ApproveOrRefuse/allRefusedByTalkType.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ <h3>@defining(allProposals.size){refusedSize=>
</td>
<td>@proposal.id</td>
<td>
@tags.renderGravatar(proposal.mainSpeaker,showName = true, showPhoto = false)
@tags.renderGravatar(proposal.mainSpeaker, showName = Some(true))
@proposal.secondarySpeaker.map { sp =>
@tags.renderGravatar(sp,showName = true, showPhoto = false)
@tags.renderGravatar(sp, showName = Some(true))
}
@proposal.otherSpeakers.map{ sp2=>
@tags.renderGravatar(sp2,showName = true, showPhoto = false)
@tags.renderGravatar(sp2, showName = Some(true))
}
</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion app/views/Backoffice/allProposals.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h3>All Proposals</h3>
<small>@proposal.title</small>
</td>
<td>
@tags.renderGravatar(proposal.mainSpeaker, showPhoto = false)
@tags.renderGravatar(proposal.mainSpeaker)
</td>
<td>
<span class="label [email protected]">@proposal.state.code</span>
Expand Down
2 changes: 1 addition & 1 deletion app/views/Backoffice/showAllDeclined.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h3>All Declined Proposals</h3>
<small>@proposal.title</small>
</td>
<td>
@tags.renderGravatar(proposal.mainSpeaker, showPhoto = false)
@tags.renderGravatar(proposal.mainSpeaker)
</td>
<td>
<span class="label [email protected]">@proposal.state.code</span>
Expand Down
10 changes: 9 additions & 1 deletion app/views/CFPAdmin/allMyVotes.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ <h5>@Messages("gt.myvotes", Messages(talkType)) for which you voted</h5>
<small>@Html(Messages(proposal.track.label))</small>
</td>
<td>
<small>@proposal.allSpeakers.map(_.cleanName).mkString(", ")</small>
@tags.renderGravatar(proposal.mainSpeaker)

@proposal.secondarySpeaker.map { sc =>
@tags.renderGravatar(sc)
}

@proposal.otherSpeakers.map { s =>
@tags.renderGravatar(s)
}
</td>
}
}
Expand Down
5 changes: 2 additions & 3 deletions app/views/CFPAdmin/allProposalsByTrack.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h1 class="panel-title"><i class="icon-bar-chart"></i> All submitted proposals f
</td>
<td>@proposal.id</td>
<td>
@tags.renderGravatar(proposal.mainSpeaker,showName = true, showPhoto = false)
@tags.renderGravatar(proposal.mainSpeaker, showName = Some(true))
</td>
<td>
@Messages(proposal.talkType.id)
Expand All @@ -68,7 +68,7 @@ <h1 class="panel-title"><i class="icon-bar-chart"></i> All submitted proposals f
</div>
</div>
</div>

</div>
<script type="text/javascript">
$(document).ready(function() {

Expand All @@ -86,5 +86,4 @@ <h1 class="panel-title"><i class="icon-bar-chart"></i> All submitted proposals f
});
} );
</script>

}
4 changes: 2 additions & 2 deletions app/views/CFPAdmin/allProposalsByType.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h1 class="panel-title"><i class="icon-bar-chart"></i> All submitted proposals f
</td>
<td>@proposal.id</td>
<td>
@tags.renderGravatar(proposal.mainSpeaker,showName = true, showPhoto = false)
@tags.renderGravatar(proposal.mainSpeaker,showName = Some(true))
</td>
<td>
@Messages(proposal.track.id)
Expand All @@ -67,7 +67,7 @@ <h1 class="panel-title"><i class="icon-bar-chart"></i> All submitted proposals f
</div>
</div>
</div>

</div>
<script type="text/javascript">
$(document).ready(function() {

Expand Down
2 changes: 1 addition & 1 deletion app/views/CFPAdmin/allSpeakers.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h4></h4>
@speakers.map{ speaker: Speaker =>
<tr>
<td>
@tags.renderGravatar(speaker.uuid, showName=true, showPhoto=false)
@tags.renderGravatar(speaker.uuid, showName = Some(true))
</td>
<td>
@speaker.cleanLang
Expand Down
2 changes: 1 addition & 1 deletion app/views/CFPAdmin/allWebusers.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h3>All speakers</h3>
@speakers.sortBy(w=>Webuser.hasAccessToCFP(w.uuid)).reverse.map{ webuser: Webuser =>
<tr>
<td>
@tags.renderGravatar(webuser.uuid, showName=true, showPhoto=false)
@tags.renderGravatar(webuser.uuid, showPhoto = false)
</td>
<td>
<small>@webuser.email</small>
Expand Down
2 changes: 2 additions & 0 deletions app/views/CFPAdmin/cfpAdminIndex.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ <h3><i class="icon-ok-circle"></i> @Messages("admin.proposals.todolist.title")</
</td>
<td>
@tags.renderGravatar(proposal.mainSpeaker)

@proposal.secondarySpeaker.map { sc =>
@tags.renderGravatar(sc)
}

@proposal.otherSpeakers.map { s =>
@tags.renderGravatar(s)
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/CFPAdmin/duplicateSpeakers.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h4></h4>
@speakers.map{ speaker: Speaker =>
<tr>
<td>
@tags.renderGravatar(speaker.uuid, showName=true, showPhoto=false)
@tags.renderGravatar(speaker.uuid, showName = Some(true))
</td>
<td>
@speaker.cleanLang
Expand Down
4 changes: 2 additions & 2 deletions app/views/CFPAdmin/leaderBoard.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ <h3>Approved by Track (total @params.allApprovedByTrack.size)</h3>
<div class="col-md-6">
<h3>Approved by Type</h3>

@params.allApprovedByTalkType.map { case (propType, total) =>
@params.allApprovedByTalkType.foreach { case (propType, total) =>
@Messages(propType) : <span class="label label-warning">@total</span>
approved submissions for <span class="label label-success">@params.totalSlotsToAllocate.get(propType + ".label")</span> slots<br>
}
Expand Down Expand Up @@ -286,7 +286,7 @@ <h3>Accepted by Track</h3>
<div class="col-md-6">
<h3>Accepted by Type</h3>
<p>Talk accepted by a speaker</p>
@params.totalAcceptedByType.map { case (propType, total) =>
@params.totalAcceptedByType.foreach { case (propType, total) =>
@Messages(propType) : <span class="label label-warning">@total</span>
accepted submissions for <span class="label label-success">@params.totalSlotsToAllocate.get(propType+".label")</span> slots<br>
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/CFPAdmin/showVotesForProposal.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h3>@Messages("svp.allVotes")</h3>
<div class="media">
@allVotes.sortBy(_._2).map { case (author, vote) =>
<div class="media-body">
<span class="pull-left">@tags.renderGravatar(author, showName = false)</span> &nbsp; <h5 class="media-heading">@Messages("svp.voted") @tags.renderVote(vote.toInt) </h5>
<span class="pull-left">@tags.renderGravatar(author)</span> &nbsp; <h5 class="media-heading">@Messages("svp.voted") @tags.renderVote(vote.toInt) </h5>
</div>
}
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/views/CallForPaper/homeForSpeaker.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ <h3><i class="icon-tasks"></i> @Messages("your.submission")</h3>
</td>
<td>
<div style="max-width: 114px">
@tags.renderGravatar(prop.mainSpeaker, showName = false)
@tags.renderGravatar(prop.mainSpeaker)
@prop.secondarySpeaker.map { secondarySpeakerUUID =>
@tags.renderGravatar(secondarySpeakerUUID, showName = false)
@tags.renderGravatar(secondarySpeakerUUID)
}
@prop.otherSpeakers.map { listOfUUID =>
@listOfUUID.split(",").map { suid =>
@tags.renderGravatar(suid, showName = false)
@tags.renderGravatar(suid)
}
}
</div>
Expand Down
6 changes: 4 additions & 2 deletions app/views/tags/renderGravatar.scala.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
@(uuid: String, showName:Boolean = true, showPhoto:Boolean = Some(true))
@(uuid: String,
showName: Boolean = true,
showPhoto: Boolean = true)

@models.Speaker.findByUUID(uuid).map { speaker =>
@models.Webuser.findByUUID(uuid).map { webuser =>
@if(speaker.avatarUrl.isEmpty) {
@if(speaker.avatarUrl.isEmpty) {
<div class="media">
<a class="cfp-gravatars pull-left" href="@ConferenceDescriptor.current()[email protected](uuid)">
@if(showPhoto) {
Expand Down
4 changes: 2 additions & 2 deletions app/views/tags/renderGravatarByProposal.scala.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@(proposalId: String,
showName:Boolean = true,
showPhoto:Boolean = Some(true))
showName:Option[Boolean] = Some(true),
showPhoto:Option[Boolean] = Some(true))

@models.Proposal.findById(proposalId).map { proposal =>
@models.Webuser.findByUUID(proposal.mainSpeaker).map { webuser =>
Expand Down

0 comments on commit 3e224be

Please sign in to comment.