mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-25 16:44:09 +01:00
fix #1350 by removing admin_email from preferences model and add it as a site option in
site.yml.tmpl. This one needs running migrations
This commit is contained in:
parent
a32f928fc8
commit
bd656ee1c7
5 changed files with 17 additions and 7 deletions
|
|
@ -49,7 +49,7 @@ class UsersController < ApplicationController
|
|||
@user = get_new_user
|
||||
else # all other situations (i.e. a non-admin is logged in, or no one is logged in, but we have some users)
|
||||
@page_title = t('users.no_signups_title')
|
||||
@admin_email = User.find_admin.preference.admin_email
|
||||
@admin_email = SITE_CONFIG['admin_email']
|
||||
render :action => "nosignup", :layout => "login"
|
||||
return
|
||||
end
|
||||
|
|
@ -72,7 +72,7 @@ class UsersController < ApplicationController
|
|||
format.html do
|
||||
unless User.no_users_yet? || (@user && @user.is_admin?) || SITE_CONFIG['open_signups']
|
||||
@page_title = t('users.no_signups_title')
|
||||
@admin_email = User.find_admin.preference.admin_email
|
||||
@admin_email = SITE_CONFIG['admin_email']
|
||||
render :action => "nosignup", :layout => "login"
|
||||
return
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ class Preference < ActiveRecord::Base
|
|||
belongs_to :sms_context, :class_name => 'Context'
|
||||
|
||||
attr_accessible :date_format, :week_starts, :show_number_completed, :show_completed_projects_in_sidebar,
|
||||
:show_hidden_contexts_in_sidebar, :staleness_starts, :due_style, :admin_email, :locale,
|
||||
:show_hidden_contexts_in_sidebar, :staleness_starts, :due_style, :locale,
|
||||
:title_date_format, :time_zone, :show_hidden_projects_in_sidebar, :show_project_on_todo_done, :review_period,
|
||||
:refresh, :verbose_action_descriptors, :mobile_todos_per_page, :sms_email, :sms_context_id
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
<%= pref_with_text_field 'user', 'first_name' %>
|
||||
<%= pref_with_text_field 'user', 'last_name' %>
|
||||
<%= pref_with_select_field('prefs', 'locale', I18n.available_locales.map {|l| l.to_s}) %>
|
||||
<% if current_user.is_admin? %>
|
||||
<%= pref_with_text_field('prefs', 'admin_email') %>
|
||||
<% end %>
|
||||
<%= pref_with_select_field('prefs', 'locale', I18n.available_locales.map {|l| l.to_s}) %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue