summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthewsotoudeh <matthewsot@outlook.com>2015-08-04 11:02:01 -0700
committermatthewsotoudeh <matthewsot@outlook.com>2015-08-04 11:02:01 -0700
commitb184a621d1c145060d1f9c779e2b63bd1d769a4e (patch)
tree5b380b0bcdffbe5134113304f64292f815d171dd
parent0f5e9c2e2fa3af9349df132ea9dc80e0b873e3ed (diff)
2015 updates!
-rw-r--r--.gitignore3
-rw-r--r--Classfinder/Classfinder/Content/Styles/Site/Welcome/signup.less2
-rw-r--r--Classfinder/Classfinder/Controllers/HomeController.cs22
-rw-r--r--Classfinder/Classfinder/Views/Home/Schedule.cshtml114
-rw-r--r--Classfinder/Classfinder/Views/Manage/Schedule.cshtml34
-rw-r--r--Classfinder/Classfinder/Views/Shared/Index.cshtml3
-rw-r--r--Classfinder/Classfinder/Views/Shared/_Layout.cshtml51
-rw-r--r--Classfinder/Classfinder/Views/Shared/_SchedulePicker.cshtml14
-rw-r--r--Classfinder/Classfinder/Views/Welcome/Schedule.cshtml24
-rw-r--r--Classfinder/Classfinder/Views/Welcome/SignUp.cshtml2
10 files changed, 149 insertions, 120 deletions
diff --git a/.gitignore b/.gitignore
index 2f4242c..9781453 100644
--- a/.gitignore
+++ b/.gitignore
@@ -194,4 +194,5 @@ Classfinder/Classfinder/Content/Styles/**/*.css.map
!Classfinder/Classfinder/Content/Styles/bootstrap.min.css
!Classfinder/Classfinder/Content/Styles/Site.css
-!Classfinder/Classfinder/Content/Styles/Site/Default/thankyou.css \ No newline at end of file
+!Classfinder/Classfinder/Content/Styles/Site/Default/thankyou.css
+Classfinder/.vs/config/applicationhost.config \ No newline at end of file
diff --git a/Classfinder/Classfinder/Content/Styles/Site/Welcome/signup.less b/Classfinder/Classfinder/Content/Styles/Site/Welcome/signup.less
index d707482..6e34591 100644
--- a/Classfinder/Classfinder/Content/Styles/Site/Welcome/signup.less
+++ b/Classfinder/Classfinder/Content/Styles/Site/Welcome/signup.less
@@ -1,7 +1,7 @@
@import "shared.less";
#progress {
- width:25%;
+ width:33.33%;
}
#signup-box {
diff --git a/Classfinder/Classfinder/Controllers/HomeController.cs b/Classfinder/Classfinder/Controllers/HomeController.cs
index e041265..ccc2563 100644
--- a/Classfinder/Classfinder/Controllers/HomeController.cs
+++ b/Classfinder/Classfinder/Controllers/HomeController.cs
@@ -70,7 +70,27 @@ namespace Classfinder.Controllers
}
ViewBag.FirstSemester = CheckAndFillWithNoClass(user.FirstSemester, user.School).OrderBy(@class => @class.Period);
- ViewBag.SecondSemester = CheckAndFillWithNoClass(user.SecondSemester, user.School).OrderBy(@class => @class.Period);
+ //ViewBag.SecondSemester = CheckAndFillWithNoClass(user.SecondSemester, user.School).OrderBy(@class => @class.Period);
+
+ ViewBag.Description = "";
+ foreach (var @class in user.FirstSemester)
+ {
+ if (@class.Name == "No Class") continue;
+ var teacher = @class.Name.Contains(",") ? @class.Name.Substring(0, @class.Name.LastIndexOf(',')) : "";
+ if (teacher.Trim().Length > 0)
+ {
+ ViewBag.Description += @class.Period + ": " + @class.Name.Split(',').Last().Trim() + " - " + teacher + ", ";
+ }
+ else
+ {
+ ViewBag.Description += @class.Period + ": " + @class.Name.Split(',').Last().Trim() + ", ";
+ }
+ }
+
+ if (ViewBag.Description.Length > 2)
+ {
+ ViewBag.Description = ViewBag.Description.Substring(0, ViewBag.Description.Length - 2).Trim();
+ }
return View();
}
diff --git a/Classfinder/Classfinder/Views/Home/Schedule.cshtml b/Classfinder/Classfinder/Views/Home/Schedule.cshtml
index 16fe327..43b35b9 100644
--- a/Classfinder/Classfinder/Views/Home/Schedule.cshtml
+++ b/Classfinder/Classfinder/Views/Home/Schedule.cshtml
@@ -2,14 +2,14 @@
@using Microsoft.AspNet.Identity
@{
- ViewBag.Title = ViewBag.RealName + "'s Schedule";
+ ViewBag.Title = ViewBag.RealName + "'s Schedule on Classfinder";
var logoLink = ViewBag.UserName == null ? "/" : "/Schedule/" + ViewBag.UserName;
}
@section head {
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="~/Content/Scripts/suffix.js"></script>
- <meta name="og:description" content="@(ViewBag.RealName)'s schedule is on Classfinder. Click here to check it out & see who'll be in your classes next year." />
+ <meta name="og:description" content="@(ViewBag.Description)" />
@Styles.Render("~/Content/Styles/Site/Home/schedule.css")
}
@@ -61,7 +61,8 @@
<div id="top-left">
<h1 id="period-name"></h1>
<h2 id="student-count"></h2>
- <h2 id="semester-chooser"><a href="#sem1" data-semester="1" class="curr-semester">Semester 1</a> | <a href="#sem2" data-semester="2">Semester 2</a></h2>
+ <div style="position: relative; left: 12px; top: 5px;" class="fb-share-button" data-href="http://classfinder.me/Schedule/@(ViewBag.ViewingUserName)" data-layout="button_count"></div>
+ @*<h2 id="semester-chooser"><a href="#sem1" data-semester="1" class="curr-semester">Semester 1</a> | <a href="#sem2" data-semester="2">Semester 2</a></h2>*@
</div>
<div id="top-right">
<div id="options">
@@ -71,11 +72,16 @@
<a href="/Manage/Schedule">modify schedule</a> @:|
<a href="/Manage/Password">settings</a>
}
+ else
+ {
+ <a href="/">learn more</a> @:|
+ <a href="/Welcome/SignUp">sign up</a> @:|
+ <a href="/#login-now">log in</a>
+}
</div>
<h2 id="viewing-label">Viewing:</h2>
<h1 id="viewing-name">@(ViewBag.RealName)'s Schedule</h1>
- <div class="fb-share-button" data-type="button_count" data-href="http://classfinder.me/Schedule/@(ViewBag.ViewingUserName)"></div>
</div>
<div id="table-container">
@@ -130,56 +136,56 @@
$(".period-box[data-period=" + $(this).attr("data-period") + "]").click();
});
- $("#semester-chooser").children("a").click(function() {
- $(".curr-semester").removeClass("curr-semester");
- $(this).addClass("curr-semester");
-
- semester = parseInt($(this).attr("data-semester"));
-
- $.getJSON("/API/Schedule/" + userId + "/" + semester, function(data) {
- for (var currPeriod = 1; currPeriod <= 7; currPeriod++) {
- var periodDiv = $('.period-box[data-period="' + currPeriod + '"]');
- var mobileDiv = $('.period-box-mobile[data-period="' + currPeriod + '"]');
-
- var returnedClassesWithPeriod = data.filter(function (val) {
- return val.period == currPeriod;
- });
-
- if (returnedClassesWithPeriod.length == 0) {
- periodDiv.text(currPeriod + " | No Class | N/A");
- mobileDiv.text(currPeriod + " | No Class | N/A");
- if (currPeriod == 1 || currPeriod == 7) {
- periodDiv.addClass("hidden-period");
- } else {
- periodDiv.removeClass("hidden-period");
- }
- continue;
- } else {
- var currClass = returnedClassesWithPeriod[0];
- var isHiddenPeriod = (currPeriod == 1 || currPeriod == 7) && currClass.name == "No Class";
- var parts = currClass.name.split(',');
-
- var toText = currPeriod + " | " + parts[parts.length - 1] + " | ";
- if (parts.length == 1) {
- toText += "N/A";
- } else {
- toText += parts[0];
- }
-
- periodDiv.text(toText);
- mobileDiv.text(toText);
-
- if (isHiddenPeriod) {
- periodDiv.addClass("hidden-period");
- } else {
- periodDiv.removeClass("hidden-period");
- }
- }
- }
-
- $(".selected").click();
- });
- });
+ //$("#semester-chooser").children("a").click(function() {
+ // $(".curr-semester").removeClass("curr-semester");
+ // $(this).addClass("curr-semester");
+
+ // semester = parseInt($(this).attr("data-semester"));
+
+ // $.getJSON("/API/Schedule/" + userId + "/" + semester, function(data) {
+ // for (var currPeriod = 1; currPeriod <= 7; currPeriod++) {
+ // var periodDiv = $('.period-box[data-period="' + currPeriod + '"]');
+ // var mobileDiv = $('.period-box-mobile[data-period="' + currPeriod + '"]');
+
+ // var returnedClassesWithPeriod = data.filter(function (val) {
+ // return val.period == currPeriod;
+ // });
+
+ // if (returnedClassesWithPeriod.length == 0) {
+ // periodDiv.text(currPeriod + " | No Class | N/A");
+ // mobileDiv.text(currPeriod + " | No Class | N/A");
+ // if (currPeriod == 1 || currPeriod == 7) {
+ // periodDiv.addClass("hidden-period");
+ // } else {
+ // periodDiv.removeClass("hidden-period");
+ // }
+ // continue;
+ // } else {
+ // var currClass = returnedClassesWithPeriod[0];
+ // var isHiddenPeriod = (currPeriod == 1 || currPeriod == 7) && currClass.name == "No Class";
+ // var parts = currClass.name.split(',');
+
+ // var toText = currPeriod + " | " + parts[parts.length - 1] + " | ";
+ // if (parts.length == 1) {
+ // toText += "N/A";
+ // } else {
+ // toText += parts[0];
+ // }
+
+ // periodDiv.text(toText);
+ // mobileDiv.text(toText);
+
+ // if (isHiddenPeriod) {
+ // periodDiv.addClass("hidden-period");
+ // } else {
+ // periodDiv.removeClass("hidden-period");
+ // }
+ // }
+ // }
+
+ // $(".selected").click();
+ // });
+ //});
$(".period-box:not(.hidden-period)").first().click();
</script> \ No newline at end of file
diff --git a/Classfinder/Classfinder/Views/Manage/Schedule.cshtml b/Classfinder/Classfinder/Views/Manage/Schedule.cshtml
index 59097a8..70c4564 100644
--- a/Classfinder/Classfinder/Views/Manage/Schedule.cshtml
+++ b/Classfinder/Classfinder/Views/Manage/Schedule.cshtml
@@ -18,29 +18,29 @@
var semester = 1;
</script>
-<div id="semester-picker">
+@*<div id="semester-picker">
<span id="semester-one" data-semester="1" class="selected-semester">Semester 1</span> | <span id="semester-two" data-semester="2">Semester 2</span>
<br/>
<a href="#" id="copy-link">copy classes from Semester <span id="semester-num-from">1</span> to Semester <span id="semester-num-to">2</span></a>
-</div>
+</div>*@
@Html.Partial("~/Views/Shared/_SchedulePicker.cshtml")
<script type="text/javascript">
- $("#semester-one, #semester-two").click(function() {
- semester = parseInt($(this).attr("data-semester"));
- $("#semester-picker").children("span").removeClass("selected-semester");
- $(this).addClass("selected-semester");
- $("#period-selector").children().first().click();
- });
+ //$("#semester-one, #semester-two").click(function() {
+ // semester = parseInt($(this).attr("data-semester"));
+ // $("#semester-picker").children("span").removeClass("selected-semester");
+ // $(this).addClass("selected-semester");
+ // $("#period-selector").children().first().click();
+ //});
- $("#copy-link").click(function() {
- $.getJSON("/API/Schedule/CopyFromSemester/" + $("#semester-num-from").text() + "/ToSemester/" + $("#semester-num-to").text(), function (data) {
- if (data.good == true) {
- $("#period-selector").children(".selected").first().click();
- } else {
- alert("Woops, there was an error o.0");
- }
- });
- });
+ //$("#copy-link").click(function() {
+ // $.getJSON("/API/Schedule/CopyFromSemester/" + $("#semester-num-from").text() + "/ToSemester/" + $("#semester-num-to").text(), function (data) {
+ // if (data.good == true) {
+ // $("#period-selector").children(".selected").first().click();
+ // } else {
+ // alert("Woops, there was an error o.0");
+ // }
+ // });
+ //});
</script> \ No newline at end of file
diff --git a/Classfinder/Classfinder/Views/Shared/Index.cshtml b/Classfinder/Classfinder/Views/Shared/Index.cshtml
index 50da7a0..0b2503c 100644
--- a/Classfinder/Classfinder/Views/Shared/Index.cshtml
+++ b/Classfinder/Classfinder/Views/Shared/Index.cshtml
@@ -71,8 +71,9 @@
</div>
</div>
-<div id="login-popup" style="display:none;" class="popup">
+<div id="login-popup" style="display:none;height: 450px;" class="popup">
<h1>log in</h1>
+ <p style="width: 80%; margin: 0 auto; color: rgb(34, 34, 34);">Note: we've removed all accounts from last year, please sign up again if your username/password isn't working!</p>
<!-- TODO: validate over API -->
<span>@(ViewBag.LoginError ?? "")</span>
<form action="/Account/Login?ReturnUrl=@(ViewBag.ReturnUrl ?? "")" method="POST" id="login-form">
diff --git a/Classfinder/Classfinder/Views/Shared/_Layout.cshtml b/Classfinder/Classfinder/Views/Shared/_Layout.cshtml
index 8a7e513..6f00b67 100644
--- a/Classfinder/Classfinder/Views/Shared/_Layout.cshtml
+++ b/Classfinder/Classfinder/Views/Shared/_Layout.cshtml
@@ -1,30 +1,31 @@
<!DOCTYPE html>
<html>
- <head>
- <!-- Stop reading this through view-source... there is a better way! -->
- <!-- We're on Github at https://github.com/matthewsot/classfinder :D -->
- <!-- email matthewsot@outlook.com for more info/help -->
+<head>
+ <!-- Stop reading this through view-source... there is a better way! -->
+ <!-- We're on Github at https://github.com/matthewsot/classfinder :D -->
+ <!-- email matthewsot@outlook.com for more info/help -->
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="The simple who's-in-your-class app for students across all grades. Created by yours truly: Adhiv, Matthew, and Will."><title>@ViewBag.Title</title>
- <script src="~/Content/Scripts/prefix-free.min.js"></script>
- <link href='http://fonts.googleapis.com/css?family=Lato:400,300,700' rel='stylesheet' type='text/css'>
- <link rel="shortcut icon" href="/Content/Images/favicon.ico" />
- @RenderSection("head", false)
- @RenderSection("scripts", false)
- </head>
- <body>
- <noscript style="display:block;position:absolute;top:0;left:0;width:100%;height:100%;z-index:100000;background-color:#000;color:#fff;">
- <h1>Woops, looks like you've disabled Javascript :\</h1>
- <br />
- Classfinder relies on Javascript for pretty much everything - redirection, communicating with our backend, and more.
- <br />
- Please enable Javascript for classfinder.me to use our site effectively.
- <br />
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="The simple who's-in-your-class app for students across all grades. Created by yours truly: Adhiv, Matthew, and Will.">
+ <title>@ViewBag.Title</title>
+ <script src="~/Content/Scripts/prefix-free.min.js"></script>
+ <link href='http://fonts.googleapis.com/css?family=Lato:400,300,700' rel='stylesheet' type='text/css'>
+ <link rel="shortcut icon" href="/Content/Images/favicon.ico" />
+ @RenderSection("head", false)
+ @RenderSection("scripts", false)
+</head>
+<body>
+ <noscript style="display:block;position:absolute;top:0;left:0;width:100%;height:100%;z-index:100000;background-color:#000;color:#fff;">
+ <h1>Woops, looks like you've disabled Javascript :\</h1>
+ <br />
+ Classfinder relies on Javascript for pretty much everything - redirection, communicating with our backend, and more.
+ <br />
+ Please enable Javascript for classfinder.me to use our site effectively.
+ <br />
- <a href="http://www.enable-javascript.com/">Click here</a> to learn how to enable Javascript in your browser.
- </noscript>
- @RenderBody()
- </body>
+ <a href="http://www.enable-javascript.com/">Click here</a> to learn how to enable Javascript in your browser.
+ </noscript>
+ @RenderBody()
+</body>
</html>
diff --git a/Classfinder/Classfinder/Views/Shared/_SchedulePicker.cshtml b/Classfinder/Classfinder/Views/Shared/_SchedulePicker.cshtml
index ce44b8b..2912b53 100644
--- a/Classfinder/Classfinder/Views/Shared/_SchedulePicker.cshtml
+++ b/Classfinder/Classfinder/Views/Shared/_SchedulePicker.cshtml
@@ -22,7 +22,7 @@
$(".period-num").click(function () {
$("#selected-class").text("");
schedPickerPeriod = parseInt($(this).text());
- $("#teacher-input").keyup();
+ $("#subject-input").keyup();
//meh. I shouldn't use such a generic "selected" class for this
//redo this with sched-period-selected or use polymer or something, idk
@@ -30,7 +30,7 @@
$(this).addClass("selected");
$("#period-label").text(suffix(schedPickerPeriod));
- var teacher = $("#teacher-input").val(""); //todo: make sure this works
+ var teacher = ""; //$("#teacher-input").val(""); //todo: make sure this works
var subject = $("#subject-input").val("");
$.getJSON("/API/Schedule/" + userId + "/" + semester + "/" + schedPickerPeriod, function(data) {
@@ -64,13 +64,13 @@
<a href="#no-class" id="no-class-btn" class="transparent default button">No Class</a>
<div id="class-search-box">
- <input id="teacher-input" type="text" placeholder=" Teacher" />
- <input id="subject-input" type="text" placeholder=" Subject" />
+ @*<input id="teacher-input" type="text" placeholder=" Teacher" />*@
+ <input id="subject-input" style="width: 63%; left: 20px;" type="text" placeholder=" Subject" />
<button id="add-class-btn" class="default button">Add Class</button>
<script type="text/javascript">
function getClassName() {
- var teacher = $("#teacher-input").val().trim();
+ var teacher = "";//$("#teacher-input").val().trim();
var subject = $("#subject-input").val().trim();
var className = teacher;
@@ -105,7 +105,7 @@
});
}
- var teacher = $("#teacher-input").val(""); //todo: make sure this works
+ var teacher = "";//$("#teacher-input").val(""); //todo: make sure this works
var subject = $("#subject-input").val("");
}
@@ -163,7 +163,7 @@
addClass($(this).text());
});
- $("#teacher-input").trigger("keyup");
+ $("#subject-input").trigger("keyup");
</script>
</div>
</div>
diff --git a/Classfinder/Classfinder/Views/Welcome/Schedule.cshtml b/Classfinder/Classfinder/Views/Welcome/Schedule.cshtml
index d12333f..633684c 100644
--- a/Classfinder/Classfinder/Views/Welcome/Schedule.cshtml
+++ b/Classfinder/Classfinder/Views/Welcome/Schedule.cshtml
@@ -2,7 +2,7 @@
@{
ViewBag.Title = "Schedule";
Layout = "_Setup.cshtml";
- ViewBag.Semester = ViewBag.StepNum - 1;
+ ViewBag.Semester = 1;
}
@section head {
@@ -11,7 +11,7 @@
@Styles.Render("~/Content/Styles/Site/Welcome/schedule.css")
<style type="text/css">
#progress {
- width: @(ViewBag.StepNum * 25)%;
+ width: @(ViewBag.StepNum * 33)%;
}
</style>
<script type="text/javascript">
@@ -45,17 +45,17 @@ else {
<script type="text/javascript">
$("#next-button").click(function() {
- if (semester == 1) {
- $.getJSON("/API/Schedule/CopyFromSemester/1/ToSemester/2", function (data) {
- if (data.good == true) {
- window.location.href = "/Welcome/Schedule/2";
- } else {
- alert("Woops, there was an error o.0");
- }
- });
- } else {
+ //if (semester == 1) {
+ // $.getJSON("/API/Schedule/CopyFromSemester/1/ToSemester/2", function (data) {
+ // if (data.good == true) {
+ // window.location.href = "/Welcome/Schedule/2";
+ // } else {
+ // alert("Woops, there was an error o.0");
+ // }
+ // });
+ //} else {
window.location.href = "/Welcome/Complete";
- }
+ //}
});
//$("#previous-button").click(function() {
diff --git a/Classfinder/Classfinder/Views/Welcome/SignUp.cshtml b/Classfinder/Classfinder/Views/Welcome/SignUp.cshtml
index 6e67877..1af2652 100644
--- a/Classfinder/Classfinder/Views/Welcome/SignUp.cshtml
+++ b/Classfinder/Classfinder/Views/Welcome/SignUp.cshtml
@@ -44,7 +44,7 @@
<div class="signup-row">
<input type="text" placeholder="Username" id="username" spellcheck="false" class="pretty-input" />
- <input type="email" placeholder="Email (Optional)" id="email" class="pretty-input" />
+ <input type="email" placeholder="Email" id="email" class="pretty-input" />
</div>
<div class="signup-row">
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback