diff --git a/app/models/issue.rb b/app/models/issue.rb
index f0ad319..b1e8549 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -53,7 +53,8 @@ class Issue < ActiveRecord::Base
before_validation :init_variables, :if => Proc.new{|issue| issue.new_record?}
before_save :parse_text
- after_save :remove_readings
+ # FIXME
+ # after_save :remove_readings
acts_as_readable
diff --git a/app/models/user.rb b/app/models/user.rb
index 4277f51..c04157f 100755
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -355,6 +355,9 @@ class User < ActiveRecord::Base
end
def self.params(params, cuser)
- params.require(:user).permit(:raw_password, :firstname, :lastname, :email, :steamid, :country, :birthdate, :timezone, :public_email, :filter, :team_id)
+ profile_attrs = cuser.profile.attributes.keys - ["id", "created_at", "updated_at"]
+ allowed = [:raw_password, :firstname, :lastname, :email, :steamid, :country, :birthdate, :timezone, :public_email, :filter, :time_zone, :team_id, profile_attributes: [profile_attrs]]
+ allowed << :username if cuser.admin?
+ params.require(:user).permit(*allowed)
end
end
diff --git a/app/views/gathers/edit.html.erb b/app/views/gathers/edit.html.erb
index b396d7f..c9d4f27 100644
--- a/app/views/gathers/edit.html.erb
+++ b/app/views/gathers/edit.html.erb
@@ -1,73 +1,73 @@
Gather Admin: #<%= @gather.id %>
-
Restart Gather
+
Restart Gather
- <%= form_for(@gather, html: { class: 'square' }) do |f| %>
+ <%= form_for(@gather, html: { class: 'square' }) do |f| %>
<%= render 'shared/errors', messages: @gather.errors.full_messages %>
-
+
<%= f.hidden_field :admin %>
- <%= f.label :captain1 %>
- <%= f.select :captain1_id, @gather.gatherers.collect{|c| [c, c.id]} %>
+ <%= f.label :captain1 %>
+ <%= f.select :captain1_id, @gather.gatherers.collect{|c| [c, c.id]} %>
- <%= f.label :captain2 %>
- <%= f.select :captain2_id, @gather.gatherers.collect{|c| [c, c.id]} %>
+ <%= f.label :captain2 %>
+ <%= f.select :captain2_id, @gather.gatherers.collect{|c| [c, c.id]} %>
- <%= f.submit 'Restart Gather' %>
+ <%= f.submit 'Restart Gather' %>
- <% end %>
+ <% end %>
-
Change Turns
+
Change Turns
- <%= form_for(@gather, html: { class: 'square' }) do |f| %>
+ <%= form_for(@gather, html: { class: 'square' }) do |f| %>
<%= render 'shared/errors', messages: @gather.errors.full_messages %>
- <%= f.label :turn %>
- <%= f.select :turn, ['Team 1', 'Team 2'] %>
+ <%= f.label :turn %>
+ <%= f.select :turn, ['Team 1', 'Team 2'] %>
- <%= f.submit 'Change Turn' %>
+ <%= f.submit 'Change Turn' %>
- <% end %>
+ <% end %>
-
Replace Players
+
Replace Players
- <% if @gather.gatherers.first %>
+ <% if @gather.gatherers.first %>
<%= form_for(@gather.gatherers.first, html: { class: 'square' }) do |f| %>
-
+
<%= f.label :id, "Select Player" %>
<%= f.select :id, @gather.gatherers.collect{|g| [g.user, g.id]} %>
-
-
+
+
<%= f.label :username, "Replace with:" %>
<%= f.text_field :username %>
-
-
+
+
<%= f.submit 'Replace Player' %>
-
+
+ <% end %>
<% end %>
- <% end %>
-
Start New
- <%= form_for Gather.new do |f| %>
+
Start New
+ <%= form_for Gather.new do |f| %>
<% f.object.category = @gather.category %>
<%= f.hidden_field :category_id %>
- <%= f.submit "Start New Gather (#{f.object.category})" %>
+ <%= f.submit "Start New Gather (#{f.object.category})" %>
- <% end %>
-
+ <% end %>
+
\ No newline at end of file