From 919ba959bbc782315b0a8b171aa96e2118a43067 Mon Sep 17 00:00:00 2001 From: tkimia Date: Mon, 28 Apr 2014 00:00:47 -0400 Subject: fixed the db seeds. They can now be started --- app/models/match.rb | 1 + app/views/common/_show_tournament.html.erb | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/models/match.rb b/app/models/match.rb index d4c0ce5..ff81d68 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -12,6 +12,7 @@ class Match < ActiveRecord::Base ok = true tournament_stage.scoring_method.stats_needed.each do |stat| ok &= statistics.where(match: self, name: stat).nil? + end ok end diff --git a/app/views/common/_show_tournament.html.erb b/app/views/common/_show_tournament.html.erb index 151e5d2..12a7fea 100644 --- a/app/views/common/_show_tournament.html.erb +++ b/app/views/common/_show_tournament.html.erb @@ -33,8 +33,10 @@ <% else %>

You've signed up for this tournament!

<% end %> - <%= form_tag(tournament_brackets_path(target), method: "post") do %> - <%= submit_tag("Make Bracket") %> + <% if target.status == 1 %> + <%= form_tag(tournament_brackets_path(target), method: "post") do %> + <%= submit_tag("Make Bracket") %> + <% end %> <% end %> <% end %> -- cgit v1.2.3 From 33fcf6de9feaaa6f90dfe5082e08d280c930dae1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 28 Apr 2014 00:04:30 -0400 Subject: Re-jigger the sampling interface --- app/models/match.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app') diff --git a/app/models/match.rb b/app/models/match.rb index c2df6e0..1edac8f 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -9,6 +9,16 @@ class Match < ActiveRecord::Base winner.players.include? player end + def users + ret = [] + self.teams.each{|t| ret.concat(t.users)} + return ret + end + + def stats_from(sampling_class) + # TODO + end + def handle_sampling(params) # TODO end -- cgit v1.2.3 From 952387be24043e76dfd9b7a461ee31d1246fa58e Mon Sep 17 00:00:00 2001 From: nfoy Date: Mon, 28 Apr 2014 00:07:57 -0400 Subject: Messages and alerts play together more nicely now. --- app/views/pms/index.html.erb | 69 +++++++++++++++++++++++++++++++++++++------- app/views/pms/show.html.erb | 1 + 2 files changed, 60 insertions(+), 10 deletions(-) (limited to 'app') diff --git a/app/views/pms/index.html.erb b/app/views/pms/index.html.erb index 056b371..fec6db2 100644 --- a/app/views/pms/index.html.erb +++ b/app/views/pms/index.html.erb @@ -23,6 +23,9 @@ <% if conversation.is_unread?(current_user) && receipts.last.message.sender != current_user %> <% message = receipts.last.message %> + <% if conversation.subject == "Pay Attention!" %> + <% conversation.mark_as_read(current_user) %> + <% end %> <% people = conversation.participants %> <% people.each do |person| %> @@ -65,17 +68,63 @@ <% if conversation.is_read?(current_user) || receipts.last.message.sender == current_user %> <% message = receipts.last.message %> - - <% people = conversation.participants %> - <% people.each do |person| %> - <% unless person == current_user %> - <%= truncate(person.user_name, length: 20) %> + <% if conversation.subject != "Pay Attention!" %> + + <% people = conversation.participants %> + <% people.each do |person| %> + <% unless person == current_user %> + <%= truncate(person.user_name, length: 20) %> + <% end %> <% end %> - <% end %> - - <%= truncate(conversation.subject, length: 30) %> - <%= truncate(message.body, length: 42) %> - <%= link_to 'View', @pms.find_by(conversation: conversation) %> + + <%= truncate(conversation.subject, length: 30) %> + <%= truncate(message.body, length: 42) %> + <%= link_to 'View', @pms.find_by(conversation: conversation) %> + <% end %> + + <% end %> + <% end %> + + <% #else %> + + <% #end %> + + + +
+

Alerts

+<% conversations = current_user.mailbox.conversations %> + + + + + + + <%# if conversations.reject { |c| c.is_read?(current_user) || (c.receipts_for current_user).last.message.sender == current_user }.empty? %> + + + + + + + <% conversations.each do |conversation| %> + <% receipts = conversation.receipts_for current_user %> + <% if conversation.is_read?(current_user) || receipts.last.message.sender == current_user %> + <% message = receipts.last.message %> + + <% if conversation.subject == "Pay Attention!" %> + + + + + <% end %> <% end %> <% end %> diff --git a/app/views/pms/show.html.erb b/app/views/pms/show.html.erb index ca8d9bf..2c93102 100644 --- a/app/views/pms/show.html.erb +++ b/app/views/pms/show.html.erb @@ -31,6 +31,7 @@

________________________________________________

+ <% @pm.message = "" %> <%= form_for(@pm) do |f| %>

<%= f.text_area :message %> -- cgit v1.2.3
WithSubjectBody
+ <% people = conversation.participants %> + <% people.each do |person| %> + <% unless person == current_user %> + <%= truncate(person.user_name, length: 20) %> + <% end %> + <% end %> + <%= truncate(conversation.subject, length: 30) %><%= truncate(message.body, length: 42) %><%= link_to 'View', @pms.find_by(conversation: conversation) %>