diff --git a/Gemfile.lock b/Gemfile.lock
index 50639ac..dd28958 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -191,7 +191,7 @@ GEM
mime-types (2.6.2)
mimemagic (0.3.0)
mini_portile (0.6.2)
- minitest (5.8.1)
+ minitest (5.8.2)
mocha (1.1.0)
metaclass (~> 0.0.1)
multi_json (1.11.2)
@@ -451,6 +451,3 @@ DEPENDENCIES
webmock
whenever
will_paginate
-
-BUNDLED WITH
- 1.10.6
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index b5c5e95..9c25afc 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -262,6 +262,17 @@ class UsersController < ApplicationController
:email,
:password,
:password_confirmation,
+ :avatar,
+ :delete_avatar,
+ :sex,
+ :yearofbirth,
+ :description,
+ :homepages_attributes,
+ :message_on_newsletter,
+ :message_on_message,
+ :message_on_new_phenotype,
+ :message_on_phenotype_comment_reply,
+ :message_on_snp_comment_reply,
)
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 85e45bb..2919cb6 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -2,14 +2,14 @@ class User < ActiveRecord::Base
include PgSearchCommon
has_attached_file :avatar,
- styles: { medium: "300x300>", thumb: "100x100>#", head: "32x32#" },
+ styles: { medium: "300x300>", thumb: "100x100>", head: "32x32#" },
default_url: 'standard_:style.png'
before_validation :clear_avatar
validates_attachment_size :avatar, less_than: 1.megabyte
validates_attachment_content_type :avatar,
- content_type: ['image/jpeg', 'image/png', 'image/gif']
+ content_type: /\Aimage\/.*\Z/
# call on authlogic
acts_as_authentic do |c|
# replace SHA512 by bcrypt
diff --git a/app/views/users/_edit.html.erb b/app/views/users/_edit.html.erb
index b94bc73..ab7fb53 100644
--- a/app/views/users/_edit.html.erb
+++ b/app/views/users/_edit.html.erb
@@ -1,6 +1,6 @@
-<% # helper thing so we don't have to put up fields into every page %>
-<%= nested_form_for(@user, :remote => true, :url => user_path, :html => { :class => "form-stacked",:multipart => true } ) do |f| %>
-<%= render 'shared/error_messages', :target => @user %>
+<%= nested_form_for(@user, url: user_path, html: { multipart: true, class: "horizontal" }) do |f| %>
+
+<%= render 'shared/error_messages', target: @user %>
@@ -14,37 +14,34 @@
General Information
- <%= image_tag @user.avatar.url(:thumb) %>
- <%if @user.avatar_file_name != nil%>
- <%= f.label(:delete_avatar, 'Delete current avatar') %><%= f.check_box(:delete_avatar) %>
- <%end%>
-
- <%= f.label :avatar, "Upload new avatar"%>
- <%=f.file_field :avatar%>
-
-
-
- <%= f.label :name %>
+ <%= f.label :name, "Your username" %>
<%= f.text_field :name %>
-
+
+ <%= f.label :avatar, "Your current avatar" %>
+ <%= image_tag @user.avatar.url(:thumb) %>
+ <% if @user.avatar_file_name != nil %>
+
+ <%= f.check_box(:delete_avatar) %> Delete current avatar?
+
+ <% end %>
+
+ <%= f.label :avatar, "Upload new avatar"%>
+ <%= f.file_field :avatar %>
+
-
<%=link_to "Change eMail/Password",{ :controller => "users", :action => "changepassword",:id => @user.id }%>
+
<%= link_to "Change eMail/Password", {controller: "users", action: "changepassword", id: @user.id} %>
- <% if current_user.genotypes.length >= 1%><%= link_to "Add another genotyping!", :controller => "genotypes", :action => "new"%><% end %>
+ <% if current_user.genotypes.length >= 1%><%= link_to "Add another genotyping!", controller: "genotypes", action: "new"%><% end %>
Your Phenotypes
-
<%= f.label :sex, "Chromosomal Sex"%>
- <%= f.select :sex, options_for_select(["XX", "XY", "other", "rather not say"], :selected => @user.sex) %>
-
-
+ <%= f.select :sex, options_for_select(["XX", "XY", "other", "rather not say"], selected: @user.sex) %>
<%= f.label :yearofbirth, "Year of Birth"%>
- <%= f.select :yearofbirth, options_for_select(((1900..2011).to_a << "rather not say").reverse, :selected => @user.yearofbirth) %>
-
+ <%= f.select :yearofbirth, options_for_select(((1900..2015).to_a << "rather not say").reverse, selected: @user.yearofbirth) %>
Additional phenotypes
<%= f.fields_for :user_phenotypes do |p| %>
<% @phenotype = Phenotype.find_by_id(p.object.phenotype_id) %>
@@ -62,22 +59,18 @@
<%end %>
- <%= link_to "Add a new phenotype", :controller => "phenotypes", :action => "new" %>
+ <%= link_to "Add a new phenotype", controller: "phenotypes", action: "new" %>
Details
-
-
Add or edit a description of yourself:
<%= f.text_area :description, :size => "1x10" %>
-
+
Add or edit a description of yourself:
<%= f.text_area :description, size: "1x10" %>
Please provide at least one homepage (or Twitter, Blog etc.)
<%= f.fields_for :homepages do |h| %>
-
Description <%= h.text_field :description %>
URL <%= h.url_field :url %><%= h.link_to_remove "Remove"%>
-
<% end %>
<%= f.link_to_add "Add a page", :homepages %>
@@ -121,6 +114,6 @@
- <%= f.submit "Update Information", :class => "btn btn-primary", :id => "update_user" %>
+ <%= f.submit "Update Information", class: "btn btn-primary", id: "update_user" %>
<% end %>
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb
index 4f41905..81be280 100644
--- a/app/views/users/edit.html.erb
+++ b/app/views/users/edit.html.erb
@@ -1,4 +1,3 @@
<%= render 'edit' %>
-
diff --git a/lib/tasks/clean_snpedia.rake b/lib/tasks/clean_snpedia.rake
deleted file mode 100644
index e87a326..0000000
--- a/lib/tasks/clean_snpedia.rake
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace :snpedia do
- desc "kick out those nasty extra-crap things"
- task :clean => :environment do
- SnpediaPaper.all.each do |paper|
- if paper.summary.index("}}") != nil
- puts "OLD"
- puts paper.summary
- paper.update_attributes(:summary => paper.summary[0...paper.summary.index("}}")-1])
- puts "NEW"
- puts paper.summary
- end
- end
- end
-end
diff --git a/lib/tasks/delete_brokensnps.rake b/lib/tasks/delete_brokensnps.rake
deleted file mode 100644
index 4f944cf..0000000
--- a/lib/tasks/delete_brokensnps.rake
+++ /dev/null
@@ -1,15 +0,0 @@
-# delete broken snps of user
-
-namespace :snps do
- desc "delete broken snps"
- task :delete => :environment do
- Snp.where("id >= 1941594 and id <= 1956090").find_each do |s|
- s.user_snps.each do |us|
- puts "delete user-snp: " + us.snp_name
- UserSnp.delete(us)
- end
- puts "delete snp: " + s.name
- Snp.delete(s)
- end
- end
-end
diff --git a/turnoffserver b/turnoffserver
index f00fa34..3801d1f 100644
--- a/turnoffserver
+++ b/turnoffserver
@@ -1,5 +1,4 @@
#/bin/bash
screen -X -S Server quit
-screen -X -S Solr quit
killall -9 redis-server
screen -X -S Sidekiq quit