<div class="jam-game-vote-widget">

	<!--
		If not logged in, ask them to login to vote...
	-->
	<p ng-if="!App.user">
		<a ng-href="{{ ::Environment.authBaseUrl }}/login">Log in to Game Jolt</a>, or <a ng-href="{{ ::Environment.authBaseUrl }}/join">sign up</a>, to vote on games!
	</p>

	<div ng-if="App.user">

		<div ng-if="ctrl.isLoading">
			<gj-loading loading-big="true"></gj-loading>
		</div>

		<div ng-if="!ctrl.isLoading">

			<!--
				Developers can't vote on their own games.
				TODO(collaborators) in the vue branch should do a perm check.
			-->
			<p ng-if="App.user.id == 0 + ctrl.game.developer.id"> <!-- The 0 + is only here to make sure this file will conflict with the vue branch. -->
				Nice try, my friend, but you can't vote on your own game!
			</p>

			<!--
				If restricted to participants and they're not a participant.
			-->
			<p ng-if="ctrl.jam.voting_user_restriction == 'participants' && !ctrl.isParticipant">
				The jam organizers have restricted voting to jam participants.
			</p>

			<!-- TODO(collaborators) in the vue branch should do a perm check. -->
			<div ng-if="App.user.id != 0 + ctrl.game.developer.id && !(ctrl.jam.voting_user_restriction == 'participants' && !ctrl.isParticipant)"> <!-- The 0 + is only here to make sure this file will conflict with the vue branch. -->

				<p ng-if="ctrl.jam.voting_type == 'categories'">Vote for this game by rating it in each of the categories below. If a particular category doesn't apply for this game, please choose <code>n/a</code>. For example, it would be appropriate to choose <code>n/a</code> for a "Graphics" category when rating a text-based game.</p>

				<p class="small"><em>Votes must be entered during the voting period, which will end <strong am-time-ago="ctrl.jam.voting_end_date"></strong>. You can change your vote at any time before then, but after voting has ended, your decision will be finalized. You can vote for as many games as you wish.</em></p>

				<gj-jam-game-vote-widget-form
					gj-jam="ctrl.jam"
					gj-game="ctrl.game"
					gj-jam-voting-categories="ctrl.votingCategories"
					gj-user-ratings="ctrl.userRatings"
					>
				</gj-jam-game-vote-widget-form>
			</div>
		</div>

	</div>
</div>
