From 6bd7af6ee47b423950be2e31b6a57ffda20af05a Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 16:57:17 -0500 Subject: [PATCH 01/75] Redoing Docket Info Generation --- app/controllers/docket_controller.rb | 52 +++++++++++++++---- app/views/docket/index.html.erb | 77 +++++++++++++++++++--------- 2 files changed, 94 insertions(+), 35 deletions(-) diff --git a/app/controllers/docket_controller.rb b/app/controllers/docket_controller.rb index 0dd75b7..2225d73 100644 --- a/app/controllers/docket_controller.rb +++ b/app/controllers/docket_controller.rb @@ -2,35 +2,67 @@ class DocketController < ApplicationController def index redirect_to log_in_path, notice: "Please log in to use Docket." unless current_user + @current_day = Date.today + + @days_of_today_and_tomorrow = [] + + (0..2).each do |wnum| + @days_of_today_and_tomorrow << @current_day + wnum.days + end + + @days_of_this_week = [] + + difference_between_today_and_start_of_week = @current_day.wday + + start_of_week = @current_day - difference_between_today_and_start_of_week.days + + (0..6).each do |wnum| + @days_of_this_week << start_of_week + wnum.days + end + + start_of_other_range = @days_of_this_week.last + @today_and_tomorrow_exams = [] + @this_week_exams = [] @other_exams = [] + current_user.exams.each do |e| - case - when ((e.date == Date.today) or (e.date == Date.today + 1.day)) - @today_and_tomorrow_exams << e - when e.date > Date.today + 1.day + case + when (@days_of_this_week.include? e.date) + @this_week_exams << e + when (@days_of_today_and_tomorrow.include? e.date) + @today_and_tomorrow_exams << e + when (e.date > start_of_other_range) @other_exams << e end end @today_and_tomorrow_assignments = [] + @this_week_assignments = [] @other_assignments = [] + current_user.assignments.each do |e| - case - when ((e.due_date == Date.today) or (e.due_date == Date.today + 1.day)) + case + when (@days_of_this_week.include? e.due_date) + @this_week_assignments << e + when (@days_of_today_and_tomorrow.include? e.due_date) @today_and_tomorrow_assignments << e - when e.due_date > Date.today + 1.day + when (e.due_date > start_of_other_range) @other_assignments << e end end @today_and_tomorrow_events = [] + @this_week_events = [] @other_events = [] + current_user.events.each do |e| - case - when ((e.date == Date.today) or (e.date == Date.today + 1.day)) + case + when (@days_of_this_week.include? e.date) + @this_week_events << e + when (@days_of_today_and_tomorrow.include? e.date) @today_and_tomorrow_events << e - when e.date > Date.today + 1.day + when (e.date > start_of_other_range) @other_events << e end end diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 8b6cc52..e47c52f 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -2,9 +2,10 @@

My Docket

-

Exams for today and tomorrow

-<% if @today_and_tomorrow_exams.empty? %> - No exams today or tomorrow. +

This week:

+

Assignments

+<% if @this_week_assignments.empty? %> + No assignments for this week. <% else %> @@ -16,7 +17,32 @@ - <% @today_and_tomorrow_exams.sort_by(&:date).each do |exam| %> + <% @this_week_assignments.sort_by(&:due_date).each do |assignment| %> + + + + + + <% end %> + +
<%= link_to assignment.name, assignment %><%= link_to assignment.classroom.name, assignment.classroom %><%= assignment.due_date %>
+<% end %> + +

Exams

+<% if @this_week_exams.empty? %> + No exams for this week. +<% else %> + + + + + + + + + + + <% @this_week_exams.sort_by(&:date).each do |exam| %> @@ -27,35 +53,35 @@
NameClassDate
<%= link_to exam.name, exam %> <%= link_to exam.classroom.name, exam.classroom %>
<% end %> -

Assignments for today and tomorrow

-<% if @today_and_tomorrow_assignments.empty? %> - No assignments due today or tomorrow. +

Events

+<% if @this_week_events.empty? %> + No events for this week. <% else %> - + - <% @today_and_tomorrow_assignments.sort_by(&:due_date).each do |assignment| %> + <% @this_week_events.sort_by(&:date).each do |event| %> - - - + + + <% end %>
Name ClassDue DateDate
<%= link_to assignment.name, assignment %><%= link_to assignment.classroom.name, assignment.classroom %><%= assignment.due_date %><%= link_to event.name, event %><%= link_to event.classroom.name, event.classroom %><%= event.date %>
<% end %> - + From ce838f1361c44d325c04055bbba7881500f30218 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 17:00:11 -0500 Subject: [PATCH 02/75] Ehh, we'll get rid of this whole thing and start over with the table. --- app/views/docket/index.html.erb | 37 ++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index e47c52f..a7c61b1 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -2,11 +2,11 @@

My Docket

-

This week:

+ + + Events. + + + +<% end %> + Events. From 2c87b101937a14030cfbb40041eed246748e794b Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 18:04:51 -0500 Subject: [PATCH 07/75] Implement events display. --- app/views/docket/index.html.erb | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index ce375aa..42c070c 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -38,8 +38,25 @@
- - Events. + <% day_events = current_user.day_events(day) %> + <% if day_events.count == 0 %> + No events. + <% else %> + + + + + + + + <% day_events.each do |event| %> + + + + <% end %> + +
Name
<%= event.name %>
+ <% end %>
From 70fe0f91629ef8378204140e3b049582fe3a160d Mon Sep 17 00:00:00 2001 From: Sammidysam Date: Sun, 29 Dec 2013 18:10:10 -0500 Subject: [PATCH 08/75] Remove excess blank lines --- app/controllers/users_controller.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2203802..779369f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -85,8 +85,6 @@ def index_activities @activities = PublicActivity::Activity.order("created_at desc") end - - private # Use callbacks to share common setup or constraints between actions. def set_user From 1e444fcb02924a43a2e3ff040b7d5d4649ca49ff Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 18:10:49 -0500 Subject: [PATCH 09/75] Bye-bye, Old (commented) Stuff! See you never! :P --- app/views/docket/index.html.erb | 113 -------------------------------- 1 file changed, 113 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index e94741e..1ca413b 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -61,116 +61,3 @@ <% end %> - - - - From a86e6b7a458df0f0ecdff348d4df3ced622aa2f2 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 18:17:59 -0500 Subject: [PATCH 10/75] Remove date column from "assignments/exams" table. This will prevent redundancy, something which we like to avoid. Since the date is in the title of each panel, the user should hopefully know that these assignments/exams are taking place on that date. --- app/views/docket/index.html.erb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 1ca413b..717cad3 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -20,7 +20,6 @@ Type Name Class - Date @@ -29,7 +28,6 @@ <%= thing.class == Assignment ? "Assignment Due" : thing.class == Exam ? "Exam to Take" : "Something" %> <%= thing.name %> <%= thing.classroom.name %> - <%= thing.class == Assignment ? thing.due_date : thing.date %> <% end %> From f9e33dc8139b76662740e5f6550f2b144ea99118 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 18:24:17 -0500 Subject: [PATCH 11/75] Starting to make a/e table slightly more sane --- app/views/docket/index.html.erb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 717cad3..6d3349e 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -15,22 +15,20 @@ No assignments or exams. <% else %> - - - - - - - - - <% day_assignments_and_exams.each do |thing| %> + + + + + + + <% day_assignments_and_exams.each do |thing| %> + - <% end %> - + <% end %>
TypeNameClass
<%= thing.class == Assignment ? "Assignment Due" : thing.class == Exam ? "Exam to Take" : "Something" %> <%= thing.name %> <%= thing.classroom.name %>
<% end %> From 989fa0e5eb5d893ee654c490877f9c7cc78b6cd5 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 18:45:37 -0500 Subject: [PATCH 12/75] classroom: Add day_{assignments,exams} function. This allows us to get the assignments or exams for the classroom on a given day. --- app/models/classroom.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/models/classroom.rb b/app/models/classroom.rb index 4b362a8..c0d317f 100644 --- a/app/models/classroom.rb +++ b/app/models/classroom.rb @@ -28,6 +28,14 @@ def teacher_name=(name) self.teacher = Teacher.find_or_create_by_name(name) unless name.blank? end + def day_assignments(day) + self.assignments.select {|assignment| assignment.due_date == day} + end + + def day_exams(day) + self.exams.select {|exam| exam.date == day} + end + belongs_to :teacher belongs_to :course has_many :assignments From 7ff452c379eee6b6e1adb5e585eaa14de2b240d2 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 18:46:37 -0500 Subject: [PATCH 13/75] user: Add "classes" function This will give the classrooms that the user belongs to. --- app/models/user.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index c8e6c98..da01639 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -39,6 +39,10 @@ def day_events(day) self.events.select {|event| event.date == day} end + def classes + self.classrooms + end + has_many :memberships has_many :classrooms, :through => :memberships has_many :attendances From 0892964d9d27b9ce60a0dcbe47a941eb6fc329aa Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 18:47:43 -0500 Subject: [PATCH 14/75] Heavy work on docket assignment/exam display. While it's not perfect nor perfectly optimized, it works beautifully for what it is as of right now. --- app/views/docket/index.html.erb | 38 ++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 6d3349e..0f84829 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -14,22 +14,30 @@ <% if day_assignments_and_exams.count == 0 %> No assignments or exams. <% else %> - - - - - - - - <% day_assignments_and_exams.each do |thing| %> - - - - - +
+ <% current_user.classes.sort! {|first, last| first.period <=> last.period }.each do |classroom| %> +
+ <%= classroom.course_name %> +
+
+
+ <% day_things = classroom.day_assignments(day) + classroom.day_exams(day) %> + <% if day_things.count == 0 %> + Nothing to do today. + <% else %> + <% day_things.each do |day_thing| %> + <% if day_thing.class == Assignment %> + Assignment "<%= day_thing.name %>" is due today. + <% elsif day_thing.class == Exam %> + Exam "<%= day_thing.name %>" is today. + <% else %> + Something bad happened. + <% end %> + <% end %> + <% end %> +
<% end %> -
<%= thing.class == Assignment ? "Assignment Due" : thing.class == Exam ? "Exam to Take" : "Something" %> - <%= thing.name %><%= thing.classroom.name %>
+ <% end %> From bedd9cb3c58d209c64e7e0806cbb00aa51916cfe Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 18:54:11 -0500 Subject: [PATCH 15/75] Adding day_activities function to classrooms. This returns all of the activities that will happen in the class on a given day. --- app/models/classroom.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/classroom.rb b/app/models/classroom.rb index c0d317f..e9dc15d 100644 --- a/app/models/classroom.rb +++ b/app/models/classroom.rb @@ -36,6 +36,10 @@ def day_exams(day) self.exams.select {|exam| exam.date == day} end + def day_activities(day) + self.day_assignments(day) + self.day_exams(day) + end + belongs_to :teacher belongs_to :course has_many :assignments From b1cb2a0894f123b55d6999a5d9258c93ed2d1644 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 18:55:01 -0500 Subject: [PATCH 16/75] Add classes_with_assignments_on function to user This will return all of the user's classes which have activities on a given day. I realized that I should rename it to classes_with_activities_on, considering that that is what it selects based on. I'll do that right now. --- app/models/user.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index da01639..fccea14 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -43,6 +43,10 @@ def classes self.classrooms end + def classes_with_assignments_on(day) + self.classrooms.select {|classroom| classroom.day_activities(day).count > 0} + end + has_many :memberships has_many :classrooms, :through => :memberships has_many :attendances From f4efe866dcdaae289d3b5d9d93dfb09056c7fc08 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 18:56:33 -0500 Subject: [PATCH 17/75] classes_with_{assignments -> activities}_on in user (Renaming the function classes_with_assignments_on to classes_with_activities_on to better reflect the behavior of the function) --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index fccea14..e64e627 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -43,7 +43,7 @@ def classes self.classrooms end - def classes_with_assignments_on(day) + def classes_with_activities_on(day) self.classrooms.select {|classroom| classroom.day_activities(day).count > 0} end From f0c1863b7cd8b00b0e0d52b170952f83c55b5daf Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 18:57:42 -0500 Subject: [PATCH 18/75] Some changes to how docket is generated. Each assignment or exam is linked to within the document, and only classes with things on a given day will be displayed. --- app/views/docket/index.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 0f84829..636643d 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -15,7 +15,7 @@ No assignments or exams. <% else %>
- <% current_user.classes.sort! {|first, last| first.period <=> last.period }.each do |classroom| %> + <% current_user.classes_with_activities_on(day).sort! {|first, last| first.period <=> last.period }.each do |classroom| %>
<%= classroom.course_name %>
@@ -27,9 +27,9 @@ <% else %> <% day_things.each do |day_thing| %> <% if day_thing.class == Assignment %> - Assignment "<%= day_thing.name %>" is due today. + <%= link_to day_thing.name, day_thing %> is due today. <% elsif day_thing.class == Exam %> - Exam "<%= day_thing.name %>" is today. + Exam <%= link_to day_thing.name, day_thing %> is today. <% else %> Something bad happened. <% end %> From eb8676c49e209e8544b083f95926f3b6da3eb403 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 19:14:49 -0500 Subject: [PATCH 19/75] user: Fixes to day_events algorithm Now collects all events which happen during the given day (used to only give the ones that would happen at midnight on that day) and also sorts them by date. --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index e64e627..e3ddc47 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -36,7 +36,7 @@ def day_exams(day) end def day_events(day) - self.events.select {|event| event.date == day} + self.events.select {|event| event.date > day.beginning_of_day && event.date < day.end_of_day}.sort! {|first,last| first.date <=> last.date} end def classes From 98c33bbfe4dd210537a2ee05060007500e9b79de Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 19:15:56 -0500 Subject: [PATCH 20/75] docket: Display events better. No more table, and now it spits them out in a prettier format. --- app/views/docket/index.html.erb | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 636643d..2f4c46e 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -46,20 +46,13 @@ <% if day_events.count == 0 %> No events. <% else %> - - - - - - - - <% day_events.each do |event| %> - - - - <% end %> - -
Name
<%= event.name %>
+
+ <% day_events.each do |event| %> +
+ <%= event.name %> @ <%= event.date.strftime("%H:%M") %> +
+ <% end %> +
<% end %>
From af6e83096322b1e8be5e303a5624dafaf2aa7d5c Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 19:27:16 -0500 Subject: [PATCH 21/75] Optimizations and features added to docket. Features: Adds badges at the top of every day's panel, displaying assignment, exam, and event counts. Links in event display. Optimizations: Everything (day_{assignments,exams,assignments_and_exams,events,items}) is defined ahead of time and is all just one value that gets used instead of querying the database over and over again. --- app/views/docket/index.html.erb | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 2f4c46e..16bb885 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -5,12 +5,32 @@ <% @days_of_this_week.each do |day| %>
- <%= Date::DAYNAMES[day.wday] %>, the <%= day.mday.ordinalize %> of <%= Date::MONTHNAMES[day.month] %> +
+
+ <%= Date::DAYNAMES[day.wday] %>, the <%= day.mday.ordinalize %> of <%= Date::MONTHNAMES[day.month] %> +
+ + <% day_assignments = current_user.day_assignments(day) %> + <% day_exams = current_user.day_exams(day) %> + <% day_assignments_and_exams = day_assignments + day_exams %> + <% day_events = current_user.day_events(day) %> + + <% day_items = day_assignments + day_exams + day_events %> + +
+ <%= day_assignments.count %> + <%= day_exams.count %> + <%= day_events.count %> + + ~ + + <%= day_items.count %> +
+
- <% day_assignments_and_exams = current_user.day_assignments(day) + current_user.day_exams(day) %> <% if day_assignments_and_exams.count == 0 %> No assignments or exams. <% else %> @@ -42,14 +62,13 @@
- <% day_events = current_user.day_events(day) %> <% if day_events.count == 0 %> No events. <% else %>
<% day_events.each do |event| %>
- <%= event.name %> @ <%= event.date.strftime("%H:%M") %> + <%= link_to event.name, event %> @ <%= event.date.strftime("%H:%M") %>
<% end %>
From b3b866346686ce5defc72eee8165574eac40d061 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 29 Dec 2013 20:23:11 -0500 Subject: [PATCH 22/75] scss/application: We don't need this padding anymore. --- app/assets/stylesheets/application.css.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index ad14dad..16fe900 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -15,7 +15,6 @@ body { padding: 40px; - padding-top: 70px; } .twitter-typeahead .tt-query, From bb86f4b06db05182183d6c98d352e1e05df749d5 Mon Sep 17 00:00:00 2001 From: Sammidysam Date: Sun, 29 Dec 2013 22:32:57 -0500 Subject: [PATCH 23/75] Link to class --- app/views/docket/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 16bb885..bba73f9 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -37,7 +37,7 @@
<% current_user.classes_with_activities_on(day).sort! {|first, last| first.period <=> last.period }.each do |classroom| %>
- <%= classroom.course_name %> + <%= link_to classroom.course_name, classroom_path(classroom) %>
From 25b18f33e1f7c744f2cb371170872e4e8ec6ee60 Mon Sep 17 00:00:00 2001 From: Sammidysam Date: Sun, 29 Dec 2013 22:37:49 -0500 Subject: [PATCH 24/75] Better variable name --- app/views/docket/index.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index bba73f9..ad6ddee 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -41,15 +41,15 @@
- <% day_things = classroom.day_assignments(day) + classroom.day_exams(day) %> - <% if day_things.count == 0 %> + <% day_activities = classroom.day_assignments(day) + classroom.day_exams(day) %> + <% if day_activities.count == 0 %> Nothing to do today. <% else %> - <% day_things.each do |day_thing| %> - <% if day_thing.class == Assignment %> - <%= link_to day_thing.name, day_thing %> is due today. - <% elsif day_thing.class == Exam %> - Exam <%= link_to day_thing.name, day_thing %> is today. + <% day_activities.each do |day_activity| %> + <% if day_activity.class == Assignment %> + <%= link_to day_activity.name, day_activity %> is due today. + <% elsif day_activity.class == Exam %> + Exam <%= link_to day_activity.name, day_activity %> is today. <% else %> Something bad happened. <% end %> From 6264795b39776f1618ea9c574621156d288bcdbf Mon Sep 17 00:00:00 2001 From: Sammidysam Date: Sun, 29 Dec 2013 23:06:42 -0500 Subject: [PATCH 25/75] Separate exams and assignments --- app/helpers/users_helper.rb | 3 + app/models/user.rb | 16 +++- app/views/docket/index.html.erb | 137 +++++++++++++++++++------------- 3 files changed, 98 insertions(+), 58 deletions(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 2310a24..1609d38 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -1,2 +1,5 @@ module UsersHelper + def sort_by_period(list) + list.sort! { |first, last| first.period <=> last.period } + end end diff --git a/app/models/user.rb b/app/models/user.rb index e3ddc47..5099068 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -28,15 +28,15 @@ def exams end def day_assignments(day) - self.assignments.select {|assignment| assignment.due_date == day} + self.assignments.select { |assignment| assignment.due_date == day } end def day_exams(day) - self.exams.select {|exam| exam.date == day} + self.exams.select { |exam| exam.date == day } end def day_events(day) - self.events.select {|event| event.date > day.beginning_of_day && event.date < day.end_of_day}.sort! {|first,last| first.date <=> last.date} + self.events.select { |event| event.date > day.beginning_of_day && event.date < day.end_of_day}.sort! {|first,last| first.date <=> last.date } end def classes @@ -44,7 +44,15 @@ def classes end def classes_with_activities_on(day) - self.classrooms.select {|classroom| classroom.day_activities(day).count > 0} + self.classrooms.select { |classroom| classroom.day_activities(day).count > 0 } + end + + def classes_with_assignments_on(day) + self.classrooms.select { |classroom| classroom.day_assignments(day).count > 0 } + end + + def classes_with_exams_on(day) + self.classrooms.select { |classroom| classroom.day_exams(day).count > 0 } end has_many :memberships diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index ad6ddee..99d8652 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -3,77 +3,106 @@
<% @days_of_this_week.each do |day| %> -
-
-
-
- <%= Date::DAYNAMES[day.wday] %>, the <%= day.mday.ordinalize %> of <%= Date::MONTHNAMES[day.month] %> -
+
+
+
+
+ <%= Date::DAYNAMES[day.wday] %>, the <%= day.mday.ordinalize %> of <%= Date::MONTHNAMES[day.month] %> +
- <% day_assignments = current_user.day_assignments(day) %> - <% day_exams = current_user.day_exams(day) %> - <% day_assignments_and_exams = day_assignments + day_exams %> - <% day_events = current_user.day_events(day) %> + <% day_assignments = current_user.day_assignments(day) %> + <% day_exams = current_user.day_exams(day) %> + <% day_assignments_and_exams = day_assignments + day_exams %> + <% day_events = current_user.day_events(day) %> - <% day_items = day_assignments + day_exams + day_events %> + <% day_items = day_assignments + day_exams + day_events %> -
- <%= day_assignments.count %> - <%= day_exams.count %> - <%= day_events.count %> +
+ <%= day_assignments.count %> + <%= day_exams.count %> + <%= day_events.count %> - ~ + ~ - <%= day_items.count %> + <%= day_items.count %> +
-
-
-
- <% if day_assignments_and_exams.count == 0 %> - No assignments or exams. - <% else %> -
- <% current_user.classes_with_activities_on(day).sort! {|first, last| first.period <=> last.period }.each do |classroom| %> -
- <%= link_to classroom.course_name, classroom_path(classroom) %> +
+
+ <% if day_assignments_and_exams.count == 0 %> + No assignments or exams today! + <% else %> + <% if day_exams.count == 0 %> + No exams today! + <% else %> +
+
+ Exams +
+ +
+ +
+ <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> + <% if classroom.day_exams(day).count == 1 %> + <%= link_to classroom.course_name, classroom_path(classroom) %> + + - + + <%= link_to classroom.day_exams(day).first.name, exam_path(classroom.day_exams(day).first) %> + <% else %> + + <% end %> + <% end %> +
-
-
- <% day_activities = classroom.day_assignments(day) + classroom.day_exams(day) %> - <% if day_activities.count == 0 %> - Nothing to do today. - <% else %> - <% day_activities.each do |day_activity| %> - <% if day_activity.class == Assignment %> - <%= link_to day_activity.name, day_activity %> is due today. - <% elsif day_activity.class == Exam %> - Exam <%= link_to day_activity.name, day_activity %> is today. + <% end %> + + <% if day_assignments.count == 0 %> + No assignments today! + <% else %> +
+
+ Assignments +
+ +
+ +
+ <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> + <% class_assignments = classroom.day_assignments(day) %> + <% if class_assignments.count == 1 %> + <% class_assignment = class_assignments.first %> + <%= link_to classroom.course_name, classroom_path(classroom) %> + + - + + <%= link_to class_assignment.name, assignment_path(class_assignment) %> <% else %> - Something bad happened. + <% end %> <% end %> - <% end %> +
<% end %> -
- <% end %> -
+ <% end %> +
-
- <% if day_events.count == 0 %> - No events. - <% else %> -
- <% day_events.each do |event| %> -
- <%= link_to event.name, event %> @ <%= event.date.strftime("%H:%M") %> +
+ <% if day_events.count == 0 %> + No events. + <% else %> +
+ <% day_events.each do |event| %> +
+ <%= link_to event.name, event %> @ <%= event.date.strftime("%H:%M") %> +
+ <% end %>
<% end %> -
- <% end %> +
-
<% end %> From ff4e7550e6c93ebeb5c23153afdbb1b0d6019609 Mon Sep 17 00:00:00 2001 From: Sammidysam Date: Sun, 29 Dec 2013 23:17:15 -0500 Subject: [PATCH 26/75] Finish redesign --- app/views/docket/index.html.erb | 68 ++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 99d8652..baa8788 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -41,22 +41,38 @@
Exams
+ + <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> + <% class_exams = classroom.day_exams(day) %> + + <% if class_exams.count == 1 %> +
-
+ <% class_exam = class_exams.first %> -
- <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> - <% if classroom.day_exams(day).count == 1 %> +
<%= link_to classroom.course_name, classroom_path(classroom) %> - - <%= link_to classroom.day_exams(day).first.name, exam_path(classroom.day_exams(day).first) %> - <% else %> - + <%= link_to class_exam.name, exam_path(class_exam) %> +
+ <% elsif class_exams.count > 0 %> +
+ +
+ <%= link_to classroom.course_name, classroom_path(classroom) %> +
+ + <% class_exams.each do |exam| %> +
+ +
+ <%= link_to exam.name, exam_path(exam) %> +
<% end %> <% end %> -
+ <% end %>
<% end %> @@ -67,24 +83,38 @@
Assignments
- -
- -
- <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> - <% class_assignments = classroom.day_assignments(day) %> - <% if class_assignments.count == 1 %> - <% class_assignment = class_assignments.first %> + + <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> + <% class_assignments = classroom.day_assignments(day) %> + + <% if class_assignments.count == 1 %> +
+ + <% class_assignment = class_assignments.first %> + +
<%= link_to classroom.course_name, classroom_path(classroom) %> - <%= link_to class_assignment.name, assignment_path(class_assignment) %> - <% else %> - +
+ <% elsif class_assignments.count > 0 %> +
+ +
+ <%= link_to classroom.course_name, classroom_path(classroom) %> +
+ + <% class_assignments.each do |assignment| %> +
+ +
+ <%= link_to assignment.name, exam_path(assignment) %> +
<% end %> <% end %> -
+ <% end %>
<% end %> <% end %> From 7c4082d2caa471986a338d66de9ce65e74760ea5 Mon Sep 17 00:00:00 2001 From: Sammidysam Date: Sun, 29 Dec 2013 23:29:12 -0500 Subject: [PATCH 27/75] Make event display emulate physical docket Sorry @four04, but I think until we add user display configuration we need to use the time system that the majority of people use (AM/PM). --- app/views/docket/index.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index baa8788..b286029 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -127,7 +127,9 @@
<% day_events.each do |event| %>
- <%= link_to event.name, event %> @ <%= event.date.strftime("%H:%M") %> + <%= event.date.strftime("%l:%M %p") %> + - + <%= link_to event.name, event %>
<% end %>
From 8d91be4c922b9e09ccd41ea1c8214dfef8367ec7 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 30 Dec 2013 10:35:04 -0500 Subject: [PATCH 28/75] Revert "Make event display emulate physical docket" This reverts commit 7c4082d2caa471986a338d66de9ce65e74760ea5. --- app/views/docket/index.html.erb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index b286029..baa8788 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -127,9 +127,7 @@
<% day_events.each do |event| %>
- <%= event.date.strftime("%l:%M %p") %> - - - <%= link_to event.name, event %> + <%= link_to event.name, event %> @ <%= event.date.strftime("%H:%M") %>
<% end %>
From 64655997a65866d74812b395866b0ffdbf59df8a Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 30 Dec 2013 10:35:32 -0500 Subject: [PATCH 29/75] Revert "Finish redesign" This reverts commit ff4e7550e6c93ebeb5c23153afdbb1b0d6019609. --- app/views/docket/index.html.erb | 68 +++++++++------------------------ 1 file changed, 19 insertions(+), 49 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index baa8788..99d8652 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -41,38 +41,22 @@
Exams
- - <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> - <% class_exams = classroom.day_exams(day) %> - - <% if class_exams.count == 1 %> -
- <% class_exam = class_exams.first %> +
-
+
+ <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> + <% if classroom.day_exams(day).count == 1 %> <%= link_to classroom.course_name, classroom_path(classroom) %> - - <%= link_to class_exam.name, exam_path(class_exam) %> -
- <% elsif class_exams.count > 0 %> -
- -
- <%= link_to classroom.course_name, classroom_path(classroom) %> -
- - <% class_exams.each do |exam| %> -
- -
- <%= link_to exam.name, exam_path(exam) %> -
+ <%= link_to classroom.day_exams(day).first.name, exam_path(classroom.day_exams(day).first) %> + <% else %> + <% end %> <% end %> - <% end %> +
<% end %> @@ -83,38 +67,24 @@
Assignments
- - <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> - <% class_assignments = classroom.day_assignments(day) %> - - <% if class_assignments.count == 1 %> -
- - <% class_assignment = class_assignments.first %> - -
+ +
+ +
+ <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> + <% class_assignments = classroom.day_assignments(day) %> + <% if class_assignments.count == 1 %> + <% class_assignment = class_assignments.first %> <%= link_to classroom.course_name, classroom_path(classroom) %> - <%= link_to class_assignment.name, assignment_path(class_assignment) %> -
- <% elsif class_assignments.count > 0 %> -
- -
- <%= link_to classroom.course_name, classroom_path(classroom) %> -
- - <% class_assignments.each do |assignment| %> -
- -
- <%= link_to assignment.name, exam_path(assignment) %> -
+ <% else %> + <% end %> <% end %> - <% end %> +
<% end %> <% end %> From 79d893da4ae5010569e982ac21f3970610d96a3e Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 30 Dec 2013 10:35:46 -0500 Subject: [PATCH 30/75] Revert "Separate exams and assignments" This reverts commit 6264795b39776f1618ea9c574621156d288bcdbf. --- app/helpers/users_helper.rb | 3 - app/models/user.rb | 16 +--- app/views/docket/index.html.erb | 137 +++++++++++++------------------- 3 files changed, 58 insertions(+), 98 deletions(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 1609d38..2310a24 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -1,5 +1,2 @@ module UsersHelper - def sort_by_period(list) - list.sort! { |first, last| first.period <=> last.period } - end end diff --git a/app/models/user.rb b/app/models/user.rb index 5099068..e3ddc47 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -28,15 +28,15 @@ def exams end def day_assignments(day) - self.assignments.select { |assignment| assignment.due_date == day } + self.assignments.select {|assignment| assignment.due_date == day} end def day_exams(day) - self.exams.select { |exam| exam.date == day } + self.exams.select {|exam| exam.date == day} end def day_events(day) - self.events.select { |event| event.date > day.beginning_of_day && event.date < day.end_of_day}.sort! {|first,last| first.date <=> last.date } + self.events.select {|event| event.date > day.beginning_of_day && event.date < day.end_of_day}.sort! {|first,last| first.date <=> last.date} end def classes @@ -44,15 +44,7 @@ def classes end def classes_with_activities_on(day) - self.classrooms.select { |classroom| classroom.day_activities(day).count > 0 } - end - - def classes_with_assignments_on(day) - self.classrooms.select { |classroom| classroom.day_assignments(day).count > 0 } - end - - def classes_with_exams_on(day) - self.classrooms.select { |classroom| classroom.day_exams(day).count > 0 } + self.classrooms.select {|classroom| classroom.day_activities(day).count > 0} end has_many :memberships diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 99d8652..ad6ddee 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -3,106 +3,77 @@
<% @days_of_this_week.each do |day| %> -
-
-
-
- <%= Date::DAYNAMES[day.wday] %>, the <%= day.mday.ordinalize %> of <%= Date::MONTHNAMES[day.month] %> -
+
+
+
+
+ <%= Date::DAYNAMES[day.wday] %>, the <%= day.mday.ordinalize %> of <%= Date::MONTHNAMES[day.month] %> +
- <% day_assignments = current_user.day_assignments(day) %> - <% day_exams = current_user.day_exams(day) %> - <% day_assignments_and_exams = day_assignments + day_exams %> - <% day_events = current_user.day_events(day) %> + <% day_assignments = current_user.day_assignments(day) %> + <% day_exams = current_user.day_exams(day) %> + <% day_assignments_and_exams = day_assignments + day_exams %> + <% day_events = current_user.day_events(day) %> - <% day_items = day_assignments + day_exams + day_events %> + <% day_items = day_assignments + day_exams + day_events %> -
- <%= day_assignments.count %> - <%= day_exams.count %> - <%= day_events.count %> +
+ <%= day_assignments.count %> + <%= day_exams.count %> + <%= day_events.count %> - ~ + ~ - <%= day_items.count %> -
+ <%= day_items.count %>
+
-
-
- <% if day_assignments_and_exams.count == 0 %> - No assignments or exams today! - <% else %> - <% if day_exams.count == 0 %> - No exams today! - <% else %> -
-
- Exams -
- -
- -
- <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> - <% if classroom.day_exams(day).count == 1 %> - <%= link_to classroom.course_name, classroom_path(classroom) %> - - - - - <%= link_to classroom.day_exams(day).first.name, exam_path(classroom.day_exams(day).first) %> - <% else %> - - <% end %> - <% end %> -
+
+
+ <% if day_assignments_and_exams.count == 0 %> + No assignments or exams. + <% else %> +
+ <% current_user.classes_with_activities_on(day).sort! {|first, last| first.period <=> last.period }.each do |classroom| %> +
+ <%= link_to classroom.course_name, classroom_path(classroom) %>
- <% end %> - - <% if day_assignments.count == 0 %> - No assignments today! - <% else %> -
-
- Assignments -
- -
- -
- <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> - <% class_assignments = classroom.day_assignments(day) %> - <% if class_assignments.count == 1 %> - <% class_assignment = class_assignments.first %> - <%= link_to classroom.course_name, classroom_path(classroom) %> - - - - - <%= link_to class_assignment.name, assignment_path(class_assignment) %> +
+
+ <% day_activities = classroom.day_assignments(day) + classroom.day_exams(day) %> + <% if day_activities.count == 0 %> + Nothing to do today. + <% else %> + <% day_activities.each do |day_activity| %> + <% if day_activity.class == Assignment %> + <%= link_to day_activity.name, day_activity %> is due today. + <% elsif day_activity.class == Exam %> + Exam <%= link_to day_activity.name, day_activity %> is today. <% else %> - + Something bad happened. <% end %> <% end %> -
+ <% end %>
<% end %> - <% end %> -
+
+ <% end %> +
-
- <% if day_events.count == 0 %> - No events. - <% else %> -
- <% day_events.each do |event| %> -
- <%= link_to event.name, event %> @ <%= event.date.strftime("%H:%M") %> -
- <% end %> +
+ <% if day_events.count == 0 %> + No events. + <% else %> +
+ <% day_events.each do |event| %> +
+ <%= link_to event.name, event %> @ <%= event.date.strftime("%H:%M") %>
<% end %> -
+
+ <% end %>
+
<% end %> From 7baf2ff55d12193a29c0b38ceb45abef7e7572f8 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 30 Dec 2013 10:35:54 -0500 Subject: [PATCH 31/75] Revert "Better variable name" This reverts commit 25b18f33e1f7c744f2cb371170872e4e8ec6ee60. --- app/views/docket/index.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index ad6ddee..bba73f9 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -41,15 +41,15 @@
- <% day_activities = classroom.day_assignments(day) + classroom.day_exams(day) %> - <% if day_activities.count == 0 %> + <% day_things = classroom.day_assignments(day) + classroom.day_exams(day) %> + <% if day_things.count == 0 %> Nothing to do today. <% else %> - <% day_activities.each do |day_activity| %> - <% if day_activity.class == Assignment %> - <%= link_to day_activity.name, day_activity %> is due today. - <% elsif day_activity.class == Exam %> - Exam <%= link_to day_activity.name, day_activity %> is today. + <% day_things.each do |day_thing| %> + <% if day_thing.class == Assignment %> + <%= link_to day_thing.name, day_thing %> is due today. + <% elsif day_thing.class == Exam %> + Exam <%= link_to day_thing.name, day_thing %> is today. <% else %> Something bad happened. <% end %> From 33ca74ebb49a17d0e611062a993728aeaffb511e Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 30 Dec 2013 10:36:05 -0500 Subject: [PATCH 32/75] Revert "Link to class" This reverts commit bb86f4b06db05182183d6c98d352e1e05df749d5. --- app/views/docket/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index bba73f9..16bb885 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -37,7 +37,7 @@
<% current_user.classes_with_activities_on(day).sort! {|first, last| first.period <=> last.period }.each do |classroom| %>
- <%= link_to classroom.course_name, classroom_path(classroom) %> + <%= classroom.course_name %>
From 2e9f7f37c5f1432ce613a26e9326867210a0bdf9 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 30 Dec 2013 10:40:26 -0500 Subject: [PATCH 33/75] Add some spaces in the braces for better spacing This follows what @Sammidysam did in part in 6264795. --- app/models/user.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index e3ddc47..9f8029f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -28,15 +28,15 @@ def exams end def day_assignments(day) - self.assignments.select {|assignment| assignment.due_date == day} + self.assignments.select { |assignment| assignment.due_date == day } end def day_exams(day) - self.exams.select {|exam| exam.date == day} + self.exams.select { |exam| exam.date == day } end def day_events(day) - self.events.select {|event| event.date > day.beginning_of_day && event.date < day.end_of_day}.sort! {|first,last| first.date <=> last.date} + self.events.select { |event| event.date > day.beginning_of_day && event.date < day.end_of_day }.sort! { |first,last| first.date <=> last.date } end def classes @@ -44,7 +44,7 @@ def classes end def classes_with_activities_on(day) - self.classrooms.select {|classroom| classroom.day_activities(day).count > 0} + self.classrooms.select { |classroom| classroom.day_activities(day).count > 0 } end has_many :memberships From 5c5881575e93f2da805910d5e4b41a81491fe591 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 30 Dec 2013 10:43:53 -0500 Subject: [PATCH 34/75] Add classes_with_{assignments,exams}_on to user This will help with changing the interface. --- app/models/user.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index 9f8029f..1253f71 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -47,6 +47,14 @@ def classes_with_activities_on(day) self.classrooms.select { |classroom| classroom.day_activities(day).count > 0 } end + def classes_with_assignments_on(day) + self.classrooms.select { |classroom| classroom.day_assignments(day).count > 0 } + end + + def classes_with_exams_on(day) + self.classrooms.select { |classroom| classroom.day_exams(day).count > 0 } + end + has_many :memberships has_many :classrooms, :through => :memberships has_many :attendances From 8ceeb7c7442e7ca3e8490556cccb4e1c4f3fab6f Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 30 Dec 2013 10:47:10 -0500 Subject: [PATCH 35/75] Add link-no-underline class to and link classes This will make it easier to navigate, without displaying the underlines under the links (which is annoying IMHO) --- app/views/docket/index.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 16bb885..88ec3dc 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -37,7 +37,7 @@
<% current_user.classes_with_activities_on(day).sort! {|first, last| first.period <=> last.period }.each do |classroom| %>
- <%= classroom.course_name %> + <%= link_to classroom.course_name, classroom, class: "link-no-underline" %>
@@ -47,9 +47,9 @@ <% else %> <% day_things.each do |day_thing| %> <% if day_thing.class == Assignment %> - <%= link_to day_thing.name, day_thing %> is due today. + <%= link_to day_thing.name, day_thing, class: "link-no-underline" %> is due today. <% elsif day_thing.class == Exam %> - Exam <%= link_to day_thing.name, day_thing %> is today. + Exam <%= link_to day_thing.name, day_thing, class: "link-no-underline" %> is today. <% else %> Something bad happened. <% end %> @@ -68,7 +68,7 @@
<% day_events.each do |event| %>
- <%= link_to event.name, event %> @ <%= event.date.strftime("%H:%M") %> + <%= link_to event.name, event, class: "link-no-underline" %> @ <%= event.date.strftime("%H:%M") %>
<% end %>
From 53d2cf159761535f1e6ac577319aed607f75dc1d Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 30 Dec 2013 10:49:51 -0500 Subject: [PATCH 36/75] Add comment to docket#index in spacing cell This is to avoid confusion --- app/views/docket/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 88ec3dc..cdb06f6 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -39,7 +39,7 @@
<%= link_to classroom.course_name, classroom, class: "link-no-underline" %>
-
+
<% day_things = classroom.day_assignments(day) + classroom.day_exams(day) %> <% if day_things.count == 0 %> From 35548ed5a4f174ebd29c87376f77fe6962ddfc94 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 30 Dec 2013 11:11:20 -0500 Subject: [PATCH 37/75] Improvements to docket rendering. Exams are separated from assignments. I'll continue improving this further, including making everything much more compact. --- app/assets/stylesheets/application.css.scss | 5 ++ app/views/docket/index.html.erb | 71 +++++++++++++-------- 2 files changed, 48 insertions(+), 28 deletions(-) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 16fe900..b09812e 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -109,3 +109,8 @@ body { .link-no-underline:hover { text-decoration: none; } + +.hr-less-padding { + margin-top: 8px; + margin-bottom: 8px; +} diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index cdb06f6..06111d5 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -30,44 +30,59 @@
-
- <% if day_assignments_and_exams.count == 0 %> - No assignments or exams. - <% else %> -
- <% current_user.classes_with_activities_on(day).sort! {|first, last| first.period <=> last.period }.each do |classroom| %> -
- <%= link_to classroom.course_name, classroom, class: "link-no-underline" %> +
+
+ <% if day_exams.count == 0 %> +
No exams.
+ <% else %> +
Exams:
+ <% current_user.classes_with_exams_on(day).sort! { |first, last| first.period <=> last.period }.each do |classroom| %> +
+
+ <%= link_to classroom.course_name, classroom, class: "link-no-underline" %>:
-
-
- <% day_things = classroom.day_assignments(day) + classroom.day_exams(day) %> - <% if day_things.count == 0 %> - Nothing to do today. - <% else %> - <% day_things.each do |day_thing| %> - <% if day_thing.class == Assignment %> - <%= link_to day_thing.name, day_thing, class: "link-no-underline" %> is due today. - <% elsif day_thing.class == Exam %> - Exam <%= link_to day_thing.name, day_thing, class: "link-no-underline" %> is today. - <% else %> - Something bad happened. - <% end %> - <% end %> - <% end %> + <% classroom_day_exams = classroom.day_exams(day) %> + <% classroom_day_exams.each do |exam| %> +
+
+ <%= link_to exam.name, exam, class: "link-no-underline" %> +
+ <% end %> + <% end %> + <% end %> +
+ +
+ +
+ <% if day_assignments.count == 0 %> +
No assignments.
+ <% else %> +
Assignments:
+ <% current_user.classes_with_assignments_on(day).sort! { |first, last| first.period <=> last.period }.each do |classroom| %> +
+
+ <%= link_to classroom.course_name, classroom, class: "link-no-underline" %>
+ <% classroom_day_assignments = classroom.day_assignments(day) %> + <% classroom_day_assignments.each do |assignment| %> +
+
+ <%= link_to assignment.name, assignment, class: "link-no-underline" %> is due today. +
+ <% end %> <% end %> -
- <% end %> + <% end %> +
-
+
<% if day_events.count == 0 %> No events. <% else %>
<% day_events.each do |event| %> -
+
<%= link_to event.name, event, class: "link-no-underline" %> @ <%= event.date.strftime("%H:%M") %>
<% end %> From b167901327c158383ec91477c981fad64e72ef87 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 30 Dec 2013 11:18:32 -0500 Subject: [PATCH 38/75] classrooms: add sort_by_period for sorting an array by period. This helps with various tasks that other things must do. --- app/helpers/classrooms_helper.rb | 3 +++ app/views/docket/index.html.erb | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/helpers/classrooms_helper.rb b/app/helpers/classrooms_helper.rb index 6830ed3..5b48e38 100644 --- a/app/helpers/classrooms_helper.rb +++ b/app/helpers/classrooms_helper.rb @@ -1,2 +1,5 @@ module ClassroomsHelper + def sort_by_period(classrooms) + return classrooms.sort! { |first, last| first.period <=> last.period } + end end diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 06111d5..6a716d5 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -36,7 +36,7 @@
No exams.
<% else %>
Exams:
- <% current_user.classes_with_exams_on(day).sort! { |first, last| first.period <=> last.period }.each do |classroom| %> + <% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %>
<%= link_to classroom.course_name, classroom, class: "link-no-underline" %>: @@ -59,10 +59,10 @@
No assignments.
<% else %>
Assignments:
- <% current_user.classes_with_assignments_on(day).sort! { |first, last| first.period <=> last.period }.each do |classroom| %> + <% sort_by_period(current_user.classes_with_assignments_on(day)).each do |classroom| %>
- <%= link_to classroom.course_name, classroom, class: "link-no-underline" %> + <%= link_to classroom.course_name, classroom, class: "link-no-underline" %>:
<% classroom_day_assignments = classroom.day_assignments(day) %> <% classroom_day_assignments.each do |assignment| %> From 4baa7feff067505ba6ada6acdc2e09a8a51454a2 Mon Sep 17 00:00:00 2001 From: Sammidysam Date: Mon, 30 Dec 2013 16:34:30 -0500 Subject: [PATCH 39/75] Adjust spacing I like indenting each class. It seems to make things more clear to me. If somebody disagrees, all the more reason to program docket view configuration. --- app/views/docket/index.html.erb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 6a716d5..f71fe32 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -37,14 +37,14 @@ <% else %>
Exams:
<% sort_by_period(current_user.classes_with_exams_on(day)).each do |classroom| %> -
-
+
+
<%= link_to classroom.course_name, classroom, class: "link-no-underline" %>:
<% classroom_day_exams = classroom.day_exams(day) %> <% classroom_day_exams.each do |exam| %> -
-
+
+
<%= link_to exam.name, exam, class: "link-no-underline" %>
<% end %> @@ -60,14 +60,14 @@ <% else %>
Assignments:
<% sort_by_period(current_user.classes_with_assignments_on(day)).each do |classroom| %> -
-
+
+
<%= link_to classroom.course_name, classroom, class: "link-no-underline" %>:
<% classroom_day_assignments = classroom.day_assignments(day) %> <% classroom_day_assignments.each do |assignment| %> -
-
+
+
<%= link_to assignment.name, assignment, class: "link-no-underline" %> is due today.
<% end %> From 6d781a57409123826573dcf7c09046845909723a Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 31 Dec 2013 16:12:03 -0500 Subject: [PATCH 40/75] Make the list of users in a classroom be prettier This adds .badge and .link-no-underline to the members, making them more separated. --- app/views/classrooms/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/classrooms/show.html.erb b/app/views/classrooms/show.html.erb index ed6e322..35baa3d 100644 --- a/app/views/classrooms/show.html.erb +++ b/app/views/classrooms/show.html.erb @@ -11,7 +11,7 @@

Members: <% @classroom.users.each do |student| %> - <%= link_to student.name, student %> + <%= link_to student.name, student, class: "link-no-underline badge" %> <% end %>

From 229bbff3f46840393778b32805373e443115bc1b Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Wed, 1 Jan 2014 12:57:58 -0500 Subject: [PATCH 41/75] Fixing sidebar and body stuff. This works for v0.2.0, is this okay @cg505/@Sammidysam? --- app/assets/stylesheets/application.css.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index b09812e..19a4ec7 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -15,6 +15,11 @@ body { padding: 40px; + padding-top: 70px; +} + +.page-header { + margin-top: 0px; } .twitter-typeahead .tt-query, From 1b22309b89c397cb294fc86a2da686236709580b Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 6 Jan 2014 10:08:41 -0500 Subject: [PATCH 42/75] Adding empty configuration system. I mostly followed @cg505's comment in #23. --- .../javascripts/configuration.js.coffee | 3 +++ app/assets/stylesheets/configuration.css.scss | 3 +++ app/controllers/configuration_controller.rb | 10 +++++++ app/helpers/configuration_helper.rb | 2 ++ app/models/configuration.rb | 2 ++ app/views/configuration/edit.html.erb | 2 ++ app/views/configuration/show.html.erb | 2 ++ app/views/configuration/update.html.erb | 2 ++ config/routes.rb | 3 +++ .../20140106150804_create_configurations.rb | 9 +++++++ .../configuration_controller_spec.rb | 26 +++++++++++++++++++ spec/helpers/configuration_helper_spec.rb | 15 +++++++++++ spec/models/configuration_spec.rb | 5 ++++ .../views/configuration/edit.html.erb_spec.rb | 5 ++++ .../views/configuration/show.html.erb_spec.rb | 5 ++++ .../configuration/update.html.erb_spec.rb | 5 ++++ 16 files changed, 99 insertions(+) create mode 100644 app/assets/javascripts/configuration.js.coffee create mode 100644 app/assets/stylesheets/configuration.css.scss create mode 100644 app/controllers/configuration_controller.rb create mode 100644 app/helpers/configuration_helper.rb create mode 100644 app/models/configuration.rb create mode 100644 app/views/configuration/edit.html.erb create mode 100644 app/views/configuration/show.html.erb create mode 100644 app/views/configuration/update.html.erb create mode 100644 db/migrate/20140106150804_create_configurations.rb create mode 100644 spec/controllers/configuration_controller_spec.rb create mode 100644 spec/helpers/configuration_helper_spec.rb create mode 100644 spec/models/configuration_spec.rb create mode 100644 spec/views/configuration/edit.html.erb_spec.rb create mode 100644 spec/views/configuration/show.html.erb_spec.rb create mode 100644 spec/views/configuration/update.html.erb_spec.rb diff --git a/app/assets/javascripts/configuration.js.coffee b/app/assets/javascripts/configuration.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/configuration.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/configuration.css.scss b/app/assets/stylesheets/configuration.css.scss new file mode 100644 index 0000000..ccac3c2 --- /dev/null +++ b/app/assets/stylesheets/configuration.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the configuration controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/configuration_controller.rb b/app/controllers/configuration_controller.rb new file mode 100644 index 0000000..164f35d --- /dev/null +++ b/app/controllers/configuration_controller.rb @@ -0,0 +1,10 @@ +class ConfigurationController < ApplicationController + def show + end + + def edit + end + + def update + end +end diff --git a/app/helpers/configuration_helper.rb b/app/helpers/configuration_helper.rb new file mode 100644 index 0000000..583e43a --- /dev/null +++ b/app/helpers/configuration_helper.rb @@ -0,0 +1,2 @@ +module ConfigurationHelper +end diff --git a/app/models/configuration.rb b/app/models/configuration.rb new file mode 100644 index 0000000..fc4e609 --- /dev/null +++ b/app/models/configuration.rb @@ -0,0 +1,2 @@ +class Configuration < ActiveRecord::Base +end diff --git a/app/views/configuration/edit.html.erb b/app/views/configuration/edit.html.erb new file mode 100644 index 0000000..11e1093 --- /dev/null +++ b/app/views/configuration/edit.html.erb @@ -0,0 +1,2 @@ +

Configuration#edit

+

Find me in app/views/configuration/edit.html.erb

diff --git a/app/views/configuration/show.html.erb b/app/views/configuration/show.html.erb new file mode 100644 index 0000000..cc1f8c6 --- /dev/null +++ b/app/views/configuration/show.html.erb @@ -0,0 +1,2 @@ +

Configuration#show

+

Find me in app/views/configuration/show.html.erb

diff --git a/app/views/configuration/update.html.erb b/app/views/configuration/update.html.erb new file mode 100644 index 0000000..8345363 --- /dev/null +++ b/app/views/configuration/update.html.erb @@ -0,0 +1,2 @@ +

Configuration#update

+

Find me in app/views/configuration/update.html.erb

diff --git a/config/routes.rb b/config/routes.rb index 09b87cb..f733744 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,7 @@ Docket::Application.routes.draw do + get "configuration/show" + get "configuration/edit" + get "configuration/update" get "docket" => "docket#index" resources :memberships diff --git a/db/migrate/20140106150804_create_configurations.rb b/db/migrate/20140106150804_create_configurations.rb new file mode 100644 index 0000000..b2cdc67 --- /dev/null +++ b/db/migrate/20140106150804_create_configurations.rb @@ -0,0 +1,9 @@ +class CreateConfigurations < ActiveRecord::Migration + def change + create_table :configurations do |t| + t.integer :user_id + + t.timestamps + end + end +end diff --git a/spec/controllers/configuration_controller_spec.rb b/spec/controllers/configuration_controller_spec.rb new file mode 100644 index 0000000..2c00040 --- /dev/null +++ b/spec/controllers/configuration_controller_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe ConfigurationController do + + describe "GET 'show'" do + it "returns http success" do + get 'show' + response.should be_success + end + end + + describe "GET 'edit'" do + it "returns http success" do + get 'edit' + response.should be_success + end + end + + describe "GET 'update'" do + it "returns http success" do + get 'update' + response.should be_success + end + end + +end diff --git a/spec/helpers/configuration_helper_spec.rb b/spec/helpers/configuration_helper_spec.rb new file mode 100644 index 0000000..b9dc0fb --- /dev/null +++ b/spec/helpers/configuration_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the ConfigurationHelper. For example: +# +# describe ConfigurationHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +describe ConfigurationHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/configuration_spec.rb b/spec/models/configuration_spec.rb new file mode 100644 index 0000000..d6ed3f7 --- /dev/null +++ b/spec/models/configuration_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe Configuration do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/views/configuration/edit.html.erb_spec.rb b/spec/views/configuration/edit.html.erb_spec.rb new file mode 100644 index 0000000..d3ba1e7 --- /dev/null +++ b/spec/views/configuration/edit.html.erb_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe "configuration/edit.html.erb" do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/views/configuration/show.html.erb_spec.rb b/spec/views/configuration/show.html.erb_spec.rb new file mode 100644 index 0000000..da27a20 --- /dev/null +++ b/spec/views/configuration/show.html.erb_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe "configuration/show.html.erb" do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/views/configuration/update.html.erb_spec.rb b/spec/views/configuration/update.html.erb_spec.rb new file mode 100644 index 0000000..ea14c5b --- /dev/null +++ b/spec/views/configuration/update.html.erb_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe "configuration/update.html.erb" do + pending "add some examples to (or delete) #{__FILE__}" +end From 2c8c21dbc205986a5e175c288e1f058074d7e067 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 6 Jan 2014 10:11:16 -0500 Subject: [PATCH 43/75] Update db schema to match new configuration migration Forgot to migrate, now I did. --- db/schema.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index b706d7e..3338474 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20131226143724) do +ActiveRecord::Schema.define(version: 20140106150804) do create_table "activities", force: true do |t| t.integer "trackable_id" @@ -55,6 +55,12 @@ t.datetime "updated_at" end + create_table "configurations", force: true do |t| + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + end + create_table "courses", force: true do |t| t.string "name" t.text "description" From 73470d4fa891bd660c924c68cd1ae382ea743832 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 6 Jan 2014 10:13:01 -0500 Subject: [PATCH 44/75] Add model relationships between configuration and user Since it's just one-to-one (right?), it should be pretty simple. --- app/models/configuration.rb | 1 + app/models/user.rb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/models/configuration.rb b/app/models/configuration.rb index fc4e609..28dccc5 100644 --- a/app/models/configuration.rb +++ b/app/models/configuration.rb @@ -1,2 +1,3 @@ class Configuration < ActiveRecord::Base + has_one :user end diff --git a/app/models/user.rb b/app/models/user.rb index 1253f71..d57369f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -59,4 +59,6 @@ def classes_with_exams_on(day) has_many :classrooms, :through => :memberships has_many :attendances has_many :events, :through => :attendances + + has_one :configuration end From 2f2c9027679cdee7a8c8df0bcd0dd66f02dc3942 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 6 Jan 2014 10:21:37 -0500 Subject: [PATCH 45/75] Adding "My Account" link to navbar This will make it easier for the user to get to their configuration in the future (we'd just change it to user_edit_path or whatever works). --- app/views/layouts/application.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 000f783..835ee33 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -19,6 +19,9 @@ <%= navbar :brand => "My Docket", :brand_link => root_url, :fixed => :top do %> <%= navbar_group :class => "foo", :id => "menu" do %> + <% if current_user %> + <%= navbar_item "My Account", user_path(current_user) %> + <% end %> <%= navbar_item "Events", events_path %> <%= navbar_item "Teachers", teachers_path %> <%= navbar_item "Courses", courses_path %> From 104200ad2d07b58a5d97b3b3074065f5b81bb9e9 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 6 Jan 2014 10:27:20 -0500 Subject: [PATCH 46/75] Change "My Account" link to redirect to user#edit instead of #show This makes it easier to get to user configuration? Not sure. --- app/views/layouts/application.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 835ee33..acde79d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -20,7 +20,7 @@ <%= navbar :brand => "My Docket", :brand_link => root_url, :fixed => :top do %> <%= navbar_group :class => "foo", :id => "menu" do %> <% if current_user %> - <%= navbar_item "My Account", user_path(current_user) %> + <%= navbar_item "My Account", edit_polymorphic_path(current_user) %> <% end %> <%= navbar_item "Events", events_path %> <%= navbar_item "Teachers", teachers_path %> From 95279222b716bed6e09040be512b2891590448b8 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 6 Jan 2014 11:09:47 -0500 Subject: [PATCH 47/75] Add navbar-inverse class to navbar This is untested, but it seems like it should work. --- app/views/layouts/application.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index acde79d..c0a62c1 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -17,7 +17,7 @@ - <%= navbar :brand => "My Docket", :brand_link => root_url, :fixed => :top do %> + <%= navbar :brand => "My Docket", :brand_link => root_url, :fixed => :top, class: "navbar-inverse" do %> <%= navbar_group :class => "foo", :id => "menu" do %> <% if current_user %> <%= navbar_item "My Account", edit_polymorphic_path(current_user) %> From a82324454806c5c18666508da1db39b26ddddcad Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 6 Jan 2014 11:15:50 -0500 Subject: [PATCH 48/75] Oops, I can't read documentation Slash I just guess incorrectly. --- app/views/layouts/application.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index e35ccab..1435f2d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -17,7 +17,7 @@ - <%= navbar :brand => "My Docket", :brand_link => root_url, :fixed => :top, class: "navbar-inverse" do %> + <%= navbar :brand => "My Docket", :brand_link => root_url, :fixed => :top, :inverse => true do %> <%= navbar_group :class => "foo", :id => "menu" do %> <% if current_user %> <%= navbar_item "My Account", edit_polymorphic_path(current_user) %> @@ -62,7 +62,7 @@
Schedule
- +
<% if !current_user || current_user.classrooms.empty? %>
No classes
From aef2b844e9d523125d5267d9228eb60f0703c7f4 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 6 Jan 2014 11:23:11 -0500 Subject: [PATCH 49/75] Some SCSS tweaks It doesn't need to be *that* dark, just *somewhat* dark. --- app/assets/stylesheets/application.css.scss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index d748437..5ae59fd 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -125,3 +125,12 @@ body { margin-top: 8px; margin-bottom: 8px; } + +.navbar-inverse { + background-color: #303030; + border-color: #101010; + + a, p, li { + color: #a0a0a0 !important; + } +} From c21a120a4bf0ee5767774ffff820db712bc1bfa5 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 6 Jan 2014 11:27:11 -0500 Subject: [PATCH 50/75] Remove !importants and make a:hover look better. --- app/assets/stylesheets/application.css.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 5ae59fd..1b0fbad 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -131,6 +131,10 @@ body { border-color: #101010; a, p, li { - color: #a0a0a0 !important; + color: #a0a0a0; + } + + a :hover { + color: #f0f0f0; } } From c2e40ae1a0eacba5b014719ffb2485a72caef745 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Mon, 6 Jan 2014 11:53:26 -0500 Subject: [PATCH 51/75] Use newer hash syntax for navbar generator (Due to point made in comments on a82324454806c5c18666508da1db39b26ddddcad) --- app/views/layouts/application.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1435f2d..f031632 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -17,7 +17,7 @@ - <%= navbar :brand => "My Docket", :brand_link => root_url, :fixed => :top, :inverse => true do %> + <%= navbar brand: "My Docket", brand_link: root_url, fixed: :top, inverse: true do %> <%= navbar_group :class => "foo", :id => "menu" do %> <% if current_user %> <%= navbar_item "My Account", edit_polymorphic_path(current_user) %> From a6a7192e6ed3ef1d49b482b23c445d86a4fe933c Mon Sep 17 00:00:00 2001 From: Sammidysam Date: Mon, 6 Jan 2014 11:57:08 -0500 Subject: [PATCH 52/75] Finish c2e40ae1a0eacba5b014719ffb2485a72caef745 --- app/views/layouts/application.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f031632..0c2a109 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -18,7 +18,7 @@ <%= navbar brand: "My Docket", brand_link: root_url, fixed: :top, inverse: true do %> - <%= navbar_group :class => "foo", :id => "menu" do %> + <%= navbar_group class: "foo", id: "menu" do %> <% if current_user %> <%= navbar_item "My Account", edit_polymorphic_path(current_user) %> <% end %> @@ -27,7 +27,7 @@ <%= navbar_item "Courses", courses_path %> <%= navbar_item "Classes", classrooms_path %> <% end %> - <%= navbar_group :align => "right" do %> + <%= navbar_group align: "right" do %> <%= navbar_text current_user ? "Logged in as " + current_user.name : "Not logged in" %> <% if current_user %> <%= navbar_item "Log Out", log_out_path %> From 6a848403c2bbbb79adb85be9034914735a4cc612 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 11:21:45 -0500 Subject: [PATCH 53/75] Adding docket-toggle.js file (for Javascript backend) --- app/assets/javascripts/application.js | 3 ++- app/assets/javascripts/docket-toggle.js | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/docket-toggle.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 9acecc0..66cd7fc 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,6 +14,7 @@ //= require jquery_ujs //= require jquery.turbolinks //= require bootstrap +//= require docket-toggle //= require typeahead var ready; @@ -38,7 +39,7 @@ $(document).ready(ready); $(document).ready(function () { /* -* Clamped-width. +* Clamped-width. * Usage: *
This long content will force clamped width
* diff --git a/app/assets/javascripts/docket-toggle.js b/app/assets/javascripts/docket-toggle.js new file mode 100644 index 0000000..c5669a4 --- /dev/null +++ b/app/assets/javascripts/docket-toggle.js @@ -0,0 +1,20 @@ +function docket_collapse_toggle(day_tag) +{ + var panel = document.getElementById("docket-collapsing-day-panel-" + day_tag); + var icon = panel.getElementsByClassName("docket-collapsing-indicator-image")[0]; + var body = panel.getElementsByClassName("docket-collapsing-div-data")[0]; + + var collapsed = panel.getAttribute("docket-is-collapsed") == "true" ? true : false; + + if(collapsed) { + panel.setAttribute("docket-is-collapsed", "false"); + + icon.className = "docket-collapsing-indicator-image glyphicon glyphicon-chevron-up"; + body.style.display = "inherit"; + } else { + panel.setAttribute("docket-is-collapsed", "true"); + + icon.className = "docket-collapsing-indicator-image glyphicon glyphicon-chevron-down"; + body.style.display = "none"; + } +} From 3a522d7f95c11ce7b8a39c7163b94f420d75bbff Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 11:22:22 -0500 Subject: [PATCH 54/75] Adding a glyphicon generator function Primitive, yes, and somewhat useless, but still helpful (especially for an upcoming commit) --- app/helpers/application_helper.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index acae411..343cf24 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -28,4 +28,9 @@ def current_user nil end end + + def generate_glyphicon(spclass = "", glyphicon_name) + content_tag(:span, :class => "#{spclass} glyphicon glyphicon-#{glyphicon_name}") do + end + end end From 39b137666b3190d93f8b0dfbcc137e42054b7a4f Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 11:23:15 -0500 Subject: [PATCH 55/75] Adding day_is_collapsed boolean for iteration This can be changed, and the generator should then handle all necessary modifications. --- app/views/docket/index.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index f71fe32..62c75f9 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -4,6 +4,7 @@ <% @days_of_this_week.each do |day| %>
+<% day_is_collapsed = false %>
From 3beb2f05bb105bdb141de2d7f813cd81f6aaa2f0 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 11:24:27 -0500 Subject: [PATCH 56/75] Adding some HTML attributes and classes for the javascript This allows the panel to be detected. --- app/views/docket/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 62c75f9..a909d99 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -3,8 +3,8 @@
<% @days_of_this_week.each do |day| %> -
<% day_is_collapsed = false %> +
>
From a8a8a288f334154858aff75557c6fe58afe06d82 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 11:25:23 -0500 Subject: [PATCH 57/75] Adding the other components of the system I'll change the chevron to be grey instead of blue. --- app/views/docket/index.html.erb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index a909d99..638aa72 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -7,6 +7,13 @@
>
+ +
<%= Date::DAYNAMES[day.wday] %>, the <%= day.mday.ordinalize %> of <%= Date::MONTHNAMES[day.month] %>
@@ -18,7 +25,7 @@ <% day_items = day_assignments + day_exams + day_events %> -
+
<%= day_assignments.count %> <%= day_exams.count %> <%= day_events.count %> @@ -30,7 +37,7 @@
-
+
<% if day_exams.count == 0 %> From 8732d1fb857077a1accf6a324a3abcf0f700df0a Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 11:27:35 -0500 Subject: [PATCH 58/75] Move the collapsation control to the right. This seems to make everything more fluid. --- app/views/docket/index.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 638aa72..22f8075 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -7,13 +7,6 @@
>
From 8bdd471218b8ce847c703bf47dc7e6f41d72848f Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 11:32:58 -0500 Subject: [PATCH 59/75] Some updates to the docket-toggle system In this case, everything is more dynamic and there are no longer a group of nested tags. --- app/assets/javascripts/docket-toggle.js | 4 ++-- app/views/docket/index.html.erb | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/docket-toggle.js b/app/assets/javascripts/docket-toggle.js index c5669a4..9bef5ee 100644 --- a/app/assets/javascripts/docket-toggle.js +++ b/app/assets/javascripts/docket-toggle.js @@ -9,12 +9,12 @@ function docket_collapse_toggle(day_tag) if(collapsed) { panel.setAttribute("docket-is-collapsed", "false"); - icon.className = "docket-collapsing-indicator-image glyphicon glyphicon-chevron-up"; + icon.className = "docket-collapsing-indicator-image glyphicon pull-right glyphicon-chevron-up"; body.style.display = "inherit"; } else { panel.setAttribute("docket-is-collapsed", "true"); - icon.className = "docket-collapsing-indicator-image glyphicon glyphicon-chevron-down"; + icon.className = "docket-collapsing-indicator-image glyphicon pull-right glyphicon-chevron-down"; body.style.display = "none"; } } diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 22f8075..1e44eec 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -29,10 +29,7 @@
From 7138965f08852d8dd6cfbaebbc9e3c3be715f7bd Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 11:37:10 -0500 Subject: [PATCH 60/75] Moar dynamicness! Woo, dynamicness \\o/! --- app/assets/javascripts/docket-toggle.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/docket-toggle.js b/app/assets/javascripts/docket-toggle.js index 9bef5ee..986b99c 100644 --- a/app/assets/javascripts/docket-toggle.js +++ b/app/assets/javascripts/docket-toggle.js @@ -2,6 +2,10 @@ function docket_collapse_toggle(day_tag) { var panel = document.getElementById("docket-collapsing-day-panel-" + day_tag); var icon = panel.getElementsByClassName("docket-collapsing-indicator-image")[0]; + + var icon_class_string = icon.className; + var new_icon_class_string = ""; + var body = panel.getElementsByClassName("docket-collapsing-div-data")[0]; var collapsed = panel.getAttribute("docket-is-collapsed") == "true" ? true : false; @@ -9,12 +13,16 @@ function docket_collapse_toggle(day_tag) if(collapsed) { panel.setAttribute("docket-is-collapsed", "false"); - icon.className = "docket-collapsing-indicator-image glyphicon pull-right glyphicon-chevron-up"; + new_icon_class_string = icon_class_string.replace("glyphicon-chevron-down", "glyphicon-chevron-up"); + + icon.className = new_icon_class_string; body.style.display = "inherit"; } else { panel.setAttribute("docket-is-collapsed", "true"); - icon.className = "docket-collapsing-indicator-image glyphicon pull-right glyphicon-chevron-down"; + new_icon_class_string = icon_class_string.replace("glyphicon-chevron-up", "glyphicon-chevron-down"); + + icon.className = new_icon_class_string; body.style.display = "none"; } } From 94085ef61c3d57abb92750ec6175f7fa51a0d83a Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 12:06:10 -0500 Subject: [PATCH 61/75] Moar+ Dynamicness! Arrays! Magic! --- app/assets/javascripts/docket-toggle.js | 39 +++++++++++++++++-------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/docket-toggle.js b/app/assets/javascripts/docket-toggle.js index 986b99c..733a4a8 100644 --- a/app/assets/javascripts/docket-toggle.js +++ b/app/assets/javascripts/docket-toggle.js @@ -2,27 +2,42 @@ function docket_collapse_toggle(day_tag) { var panel = document.getElementById("docket-collapsing-day-panel-" + day_tag); var icon = panel.getElementsByClassName("docket-collapsing-indicator-image")[0]; - - var icon_class_string = icon.className; - var new_icon_class_string = ""; - var body = panel.getElementsByClassName("docket-collapsing-div-data")[0]; var collapsed = panel.getAttribute("docket-is-collapsed") == "true" ? true : false; + var icon_future_class_name = collapsed ? "glyphicon-chevron-up" : "glyphicon-chevron-down"; - if(collapsed) { - panel.setAttribute("docket-is-collapsed", "false"); + var icon_classes = icon.className.split(" "); + + console.log(icon_classes); + + var new_icon_classes = []; + + icon_classes.map(function(cls) + { + var match = cls.match(/glyphicon-chevron-(up|down)/g); + + /* Stop errors */ + if(match == null || match == undefined) { + new_icon_classes.push(cls); - new_icon_class_string = icon_class_string.replace("glyphicon-chevron-down", "glyphicon-chevron-up"); + return; + } - icon.className = new_icon_class_string; + if(match.length > 0) { + new_icon_classes.push(icon_future_class_name); + + return; + } + }); + + icon.className = new_icon_classes.join(" "); + + if(collapsed) { + panel.setAttribute("docket-is-collapsed", "false"); body.style.display = "inherit"; } else { panel.setAttribute("docket-is-collapsed", "true"); - - new_icon_class_string = icon_class_string.replace("glyphicon-chevron-up", "glyphicon-chevron-down"); - - icon.className = new_icon_class_string; body.style.display = "none"; } } From 577d3462cf1c24e883cb05898d73b769c2d5aa9a Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 12:09:09 -0500 Subject: [PATCH 62/75] Removing some unnecessary classes and output. --- app/assets/javascripts/docket-toggle.js | 3 --- app/views/docket/index.html.erb | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/assets/javascripts/docket-toggle.js b/app/assets/javascripts/docket-toggle.js index 733a4a8..c8b4681 100644 --- a/app/assets/javascripts/docket-toggle.js +++ b/app/assets/javascripts/docket-toggle.js @@ -8,9 +8,6 @@ function docket_collapse_toggle(day_tag) var icon_future_class_name = collapsed ? "glyphicon-chevron-up" : "glyphicon-chevron-down"; var icon_classes = icon.className.split(" "); - - console.log(icon_classes); - var new_icon_classes = []; icon_classes.map(function(cls) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 1e44eec..3df29b8 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -4,7 +4,7 @@ <% @days_of_this_week.each do |day| %> <% day_is_collapsed = false %> -
> +
>
From 814929f39332ddd4260c4c1532137e237504a637 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 13:02:18 -0500 Subject: [PATCH 63/75] Adding buttons to surround the indicator glyphicon This looks prettier to me. --- app/views/docket/index.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 3df29b8..676ff24 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -29,7 +29,9 @@
- " onclick="docket_collapse_toggle(<%= "\"#{day.iso8601}\"" %>)"> + )"> + "> +
From 4ed7c95e98e9571f16d3bf55f1a1f12a05442ad1 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Tue, 7 Jan 2014 13:12:08 -0500 Subject: [PATCH 64/75] Some changes to rendering of day panel --- app/views/docket/index.html.erb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/views/docket/index.html.erb b/app/views/docket/index.html.erb index 676ff24..06701b8 100644 --- a/app/views/docket/index.html.erb +++ b/app/views/docket/index.html.erb @@ -7,7 +7,7 @@
>
-
+
<%= Date::DAYNAMES[day.wday] %>, the <%= day.mday.ordinalize %> of <%= Date::MONTHNAMES[day.month] %>
@@ -18,14 +18,10 @@ <% day_items = day_assignments + day_exams + day_events %> -
- <%= day_assignments.count %> - <%= day_exams.count %> - <%= day_events.count %> - - ~ - - <%= day_items.count %> +
+ Assignments: <%= day_assignments.count %> + Exams: <%= day_exams.count %> + Events: <%= day_events.count %>
From 34634857c871ed463b60dfb3d8f20cc750211453 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sat, 18 Jan 2014 06:21:49 -0500 Subject: [PATCH 65/75] Change the version for the new release (whenever it comes out) --- config/initializers/docket.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/docket.rb b/config/initializers/docket.rb index 68004d8..92d738c 100644 --- a/config/initializers/docket.rb +++ b/config/initializers/docket.rb @@ -1,4 +1,4 @@ module Docket - VERSION = "0.1.3" + VERSION = "0.2.0" GITHUB_URL = "https://github.com/kotct/docket" end From 235e89ffbb52cc840e297a737ac546e09faabebe Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sat, 18 Jan 2014 06:28:35 -0500 Subject: [PATCH 66/75] Re-indent Docket Routes Two-space is annoying --- config/routes.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index f733744..f6aa211 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,7 @@ Docket::Application.routes.draw do - get "configuration/show" - get "configuration/edit" - get "configuration/update" + get "configuration/show" + get "configuration/edit" + get "configuration/update" get "docket" => "docket#index" resources :memberships From d854b70b024dfb61f159fe5dfca074e3c7ffea1b Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sat, 18 Jan 2014 06:29:32 -0500 Subject: [PATCH 67/75] Change "'" => "\"" in routes Single quotes is badness. --- config/routes.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index f6aa211..e158629 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,8 +9,8 @@ resources :assignments resources :classrooms do member do - get 'join' - get 'leave' + get "join" + get "leave" end end resources :courses @@ -18,16 +18,16 @@ resources :sessions resources :users do member do - get 'activity' + get "activity" end collection do - get 'activity' => 'users#index_activities' + get "activity" => "users#index_activities" end end resources :events do member do - get 'join' - get 'leave' + get "join" + get "leave" end end @@ -39,13 +39,13 @@ # See how all your routes lay out with "rake routes". # You can have the root of your site routed with "root" - root 'docket#index' + root "docket#index" # Example of regular route: - # get 'products/:id' => 'catalog#view' + # get "products/:id" => "catalog#view" # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + # get "products/:id/purchase" => "catalog#purchase", as: :purchase # Example resource route (maps HTTP verbs to controller actions automatically): # resources :products @@ -53,12 +53,12 @@ # Example resource route with options: # resources :products dob # member do - # get 'short' - # post 'toggle' + # get "short" + # post "toggle" # end # # collection do - # get 'sold' + # get "sold" # end # end @@ -72,13 +72,13 @@ # resources :products do # resources :comments # resources :sales do - # get 'recent', on: :collection + # get "recent", on: :collection # end # end # Example resource route with concerns: # concern :toggleable do - # post 'toggle' + # post "toggle" # end # resources :posts, concerns: :toggleable # resources :photos, concerns: :toggleable From 6eb4b5530e0ca5fead07c63852eadc7c998a9b2d Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sat, 18 Jan 2014 06:30:10 -0500 Subject: [PATCH 68/75] We don't need these comments anymore, either. --- config/routes.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index e158629..b551882 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -35,10 +35,6 @@ get "log_in" => "sessions#new", :as => "log_in" get "log_out" => "sessions#destroy", :as => "log_out" - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" root "docket#index" # Example of regular route: From a4a6353e212b6dd5e3cfdf30219bb66cf52f45e5 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sat, 18 Jan 2014 09:05:58 -0500 Subject: [PATCH 69/75] Adding #wrap to page-content container This may help with making the footer sticky. --- app/views/layouts/application.html.erb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 0b95f58..e714be4 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -36,9 +36,9 @@ <% end %> <% end %> <% end %> - -
- <% if flash[:notice] %> +
+
+ <% if flash[:notice] %>
<%= flash[:notice] %> @@ -82,8 +82,9 @@
<% end %> -
- + +
+