From cba4c47e7cca06434742fc5fd282c40973c546d1 Mon Sep 17 00:00:00 2001 From: tkimia Date: Wed, 23 Apr 2014 20:26:37 -0400 Subject: started with advanced search --- app/views/common/_show_user.html.erb | 4 ++-- app/views/search/go.html.erb | 16 ++++++++++++++-- app/views/tournaments/new.html.erb | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) (limited to 'app/views') diff --git a/app/views/common/_show_user.html.erb b/app/views/common/_show_user.html.erb index 70f1ca4..dd136a0 100644 --- a/app/views/common/_show_user.html.erb +++ b/app/views/common/_show_user.html.erb @@ -1,8 +1,8 @@
-
<%= image_tag ('http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(target.email) + '?s=100&d=mm') %>
+
<%= image_tag ('http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(target.email) + '?s=100&d=mm') %>
-
+
<%# "header" %> <%= link_to(target) do %>

<%= target.user_name %>

<% end %> diff --git a/app/views/search/go.html.erb b/app/views/search/go.html.erb index d2bf8f3..ea2dabf 100644 --- a/app/views/search/go.html.erb +++ b/app/views/search/go.html.erb @@ -4,12 +4,24 @@
Advanced Search [hide]
-

This is where the advancedsearch will go.

+ <%= form_tag("/search", method: "get") do %> +
+ <%= label_tag :query, 'Find:' %> + <%= text_field_tag(:query, params[:query]) %> +
+
+ <%= label_tag :game_type, 'Game Type:' %> + <%= select_tag(:game_type, options_from_collection_for_select(@games, 'id', 'name'), :prompt => 'All Games') %> +
+
+ <%= submit_tag("Search", :name=>nil) %> +
+ <% end %>
<%# Show search results if a query was not nill %> -<% if !@query.empty? %> +<% if !@query.nil? and !@query.empty? %> <% if @tournaments.empty? and @players.empty? %>

No results found for "<%= @query %>"

diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb index 8c74068..c2b9904 100644 --- a/app/views/tournaments/new.html.erb +++ b/app/views/tournaments/new.html.erb @@ -4,7 +4,7 @@ <%= select_tag('game', options_from_collection_for_select(@games, 'id', 'name', @tournament.game.nil? || @tournament.game.id), :prompt => "Select a Game Type") %> - <%= submit_tag("Select", :class => "btn btn-success btn-xs") %> + <%= submit_tag("Select", :class => "btn") %> <% end %>
-- cgit v1.2.3-54-g00ecf From a729106e956e051818bb2d37f1581f3bf3abcefd Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Wed, 23 Apr 2014 20:32:58 -0400 Subject: Fixed several user controller errors --- app/controllers/users_controller.rb | 2 +- app/views/users/show.html.erb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 68c0743..cfa5d67 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -39,7 +39,7 @@ class UsersController < ApplicationController respond_to do |format| if @user.save sign_in @user - if @user.id == daft punk1 + if @user.id == 1 # This is the first user, so give them all the power @user.permissions = 0xFFFFFFFF @user.save diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index b85cbda..81eee6f 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -20,6 +20,14 @@ too single

+

+ <%= label :username %>
+ <%= text_field %> + +

+ +

+

Recent Tournaments Played

-- cgit v1.2.3-54-g00ecf From 190bfeb784f9760326c54069d2dbf875a820c6ec Mon Sep 17 00:00:00 2001 From: tkimia Date: Wed, 23 Apr 2014 20:38:16 -0400 Subject: tournaments now have their game type when displayed. Not sure why I hadn't thought of that earlier --- app/assets/stylesheets/tournaments.css.scss | 10 ++++++++++ app/views/common/_show_tournament.html.erb | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/assets/stylesheets/tournaments.css.scss b/app/assets/stylesheets/tournaments.css.scss index 41d6023..cc55253 100644 --- a/app/assets/stylesheets/tournaments.css.scss +++ b/app/assets/stylesheets/tournaments.css.scss @@ -75,6 +75,16 @@ div.tournament-listing { padding: 5px 0 0 0; } } + + .t-game{ + font-weight: bold; + text-align: center; + } + + .t-image{ + display: block; + margin:auto; + } } div.leave-buttons { diff --git a/app/views/common/_show_tournament.html.erb b/app/views/common/_show_tournament.html.erb index 89d8f53..0f60fad 100644 --- a/app/views/common/_show_tournament.html.erb +++ b/app/views/common/_show_tournament.html.erb @@ -1,5 +1,7 @@
-
<%= image_tag ('http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(target.hosts.first.email) + '?s=100&d=mm') %>
+
<%= image_tag('http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(target.hosts.first.email) + '?s=100&d=mm', class: "t-image") %> +

<%= Game.find(target.game_id).name %>

+
<%# "header" %> <%= link_to(target) do %>

<%= target.name %>

<% end %> -- cgit v1.2.3-54-g00ecf From 422a7b39a06e2fe54415f2be08548021a981e8a8 Mon Sep 17 00:00:00 2001 From: nfoy Date: Wed, 23 Apr 2014 20:40:56 -0400 Subject: Beginnings of actual messageboxer api --- app/assets/stylesheets/pms.css.scss | 8 ++++++ app/controllers/pms_controller.rb | 6 +++-- app/views/pms/index.html.erb | 51 ++++++++++++++++++++++++++++++++++--- 3 files changed, 59 insertions(+), 6 deletions(-) (limited to 'app/views') diff --git a/app/assets/stylesheets/pms.css.scss b/app/assets/stylesheets/pms.css.scss index 5106093..a14299e 100644 --- a/app/assets/stylesheets/pms.css.scss +++ b/app/assets/stylesheets/pms.css.scss @@ -1,3 +1,11 @@ // Place all the styles related to the pms controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ + +p, li { + color: #DD9125; +} +td, th { + padding: 0px; + color: #DD9125; +} \ No newline at end of file diff --git a/app/controllers/pms_controller.rb b/app/controllers/pms_controller.rb index 1279fdf..2cb55f8 100644 --- a/app/controllers/pms_controller.rb +++ b/app/controllers/pms_controller.rb @@ -24,10 +24,12 @@ class PmsController < ApplicationController def create @pm = Pm.new(pm_params) @pm.author = current_user - require 'pp' - pp pm_params['recipient_id'] + #require 'pp' + #pp pm_params['recipient_id'] @pm.recipient = User.find_by_user_name(pm_params['recipient_id']) + @pm.author.send_message(@pm.recipient, @pm.message, 'Default') + respond_to do |format| if @pm.save format.html { redirect_to @pm, notice: 'Pm was successfully created.' } diff --git a/app/views/pms/index.html.erb b/app/views/pms/index.html.erb index ceb1a40..73c7a87 100644 --- a/app/views/pms/index.html.erb +++ b/app/views/pms/index.html.erb @@ -25,8 +25,8 @@ <%= pm.recipient.user_name %> <%= pm.message %> <%= link_to 'Show', pm %> - <%= link_to 'Edit', edit_pm_path(pm) %> - <%= link_to 'Destroy', pm, method: :delete, data: { confirm: 'Are you sure?' } %> + <%# link_to 'Edit', edit_pm_path(pm) %> + <%= link_to 'Delete', pm, method: :delete, data: { confirm: 'Are you sure (also deletes the author\'s copy)?' } %> <% end %> <% else %> @@ -44,13 +44,56 @@ <%= pm.recipient.user_name %> <%= pm.message %> <%= link_to 'Show', pm %> - <%= link_to 'Edit', edit_pm_path(pm) %> - <%= link_to 'Destroy', pm, method: :delete, data: { confirm: 'Are you sure?' } %> + <%# link_to 'Edit', edit_pm_path(pm) %> + <%= link_to 'Delete', pm, method: :delete, data: { confirm: 'Are you sure (also deletes the recipient\'s copy)?'} %> <% end %> <% else %>

No New Messages

<% end %> + + +

Conversations

+ + +

Inbox

+ + + <% conversation1 = current_user.mailbox.inbox.first %> + <% if !conversation1.nil? %> + <% receipts1 = conversation1.receipts_for current_user %> + <% receipts1.each do |receipt1| %> + <% message1 = receipt1.message %> + <%= message1.subject %> + <%= message1.body %> + <% end %> + <% else %> +

No Messages

+ <% end %> + + + +

Outbox

+ + + <% conversation1 = current_user.mailbox.sentbox.first %> + <% if !conversation1.nil? %> + + From + Subject + Body + + <% receipts1 = conversation1.receipts_for current_user %> + <% receipts1.each do |receipt1| %> + <% message1 = receipt1.message %> + <%= message1.subject %> + <%= message1.body %> + <% end %> + <% else %> +

No Messages

+ <% end %> + + -- cgit v1.2.3-54-g00ecf