Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
918 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
@{ | ||
ViewBag.Title = "Index"; | ||
ViewBag.Title = "TapMap"; | ||
} | ||
|
||
<h2>Taps</h2> | ||
<h2>Welcome to TapMap</h2> | ||
|
||
<div style="padding:10px;" id="taps"> | ||
<script language="javascript"> | ||
window.setInterval(function () { | ||
$.get('@Url.Content("~/Tap/List")', function (data) { | ||
$("#taps").empty(); | ||
$.each(data, function (i, v) { | ||
$("#taps").append( | ||
"<div>" + v.user + " tapped " + v.beer + " at " + v.place + "</div>" + | ||
"<div style='margin-bottom:10px;border-bottom:1px solid #c0c0c0;'><em>" | ||
+ v.comment + " at " + v.time + | ||
"</em></div>" | ||
); | ||
}); | ||
<div id="taps" class="well" style="margin-top:20px;"> | ||
|
||
</div> | ||
|
||
<script language="javascript"> | ||
window.setInterval(function () { | ||
$.get('@Url.Content("~/Tap/List")', function (data) { | ||
$("#taps").empty(); | ||
$.each(data, function (i, v) { | ||
var date = v.time.replace("/Date(", "").replace(")/", ""); | ||
$("#taps").append( | ||
"<div>" + v.user + " tapped " + v.beer + " at " + v.place + "</div>" + | ||
"<div style='margin-bottom:10px;border-bottom:1px solid #c0c0c0;'><em>" | ||
+ v.comment + " at " + new Date(parseInt(date)) + | ||
"</em></div>" | ||
); | ||
}); | ||
}, 10000); | ||
</script> | ||
</div> | ||
}); | ||
}, 1000); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@{ Func<bool> isLoggedIn = () => SessionUser.Current.IsInRole(TapMapWeb.Constants.RoleConstants.ACTIVE_USERS); } | ||
@if (isLoggedIn()) | ||
{ | ||
<div> | ||
@Html.Label("Place") | ||
@Html.TextBox("Place") | ||
@Html.Hidden("PlaceId") | ||
@Html.Label("Beer") | ||
@Html.TextBox("Beer") | ||
@Html.Hidden("BeerId") | ||
@Html.Label("Comment") | ||
@Html.TextArea("Comment") | ||
<input type="Button" value="Tap" id="Tap" class="btn-primary" /> | ||
</div> | ||
} | ||
<script language="javascript"> | ||
$().ready(function (a) { | ||
$("#Place").autocomplete({ | ||
source: '@Url.Content("~/AutoComplete/Places")', | ||
minLength: 2, | ||
select: function (e, u) { $("#PlaceId").val(u.item.id); } | ||
}); | ||
$("#Beer").autocomplete({ | ||
source: '@Url.Content("~/AutoComplete/Beers")', | ||
minLength: 2, | ||
select: function (e, u) { $("#BeerId").val(u.item.id); } | ||
}); | ||
$("#Tap").bind("click", function (e) { | ||
$.post('@Url.Content("~/Tap/Create")', | ||
{ | ||
"placeId": $("#PlaceId").val(), | ||
"beerId": $("#BeerId").val(), | ||
"Comment": $("#Comment").val() | ||
}, | ||
function (data) { | ||
$("#Place").val(""); | ||
$("#Beer").val(""); | ||
$("#Comment").val(""); | ||
}); | ||
}); | ||
}); | ||
</script> |
Oops, something went wrong.