Reactivate accessibility css

- Added setting to turn accessibility mode on/off for not logged in
  users
pull/801/head
Christian Ratz 11 years ago
parent 8aaf998621
commit f8426244d7
  1. 2
      app/models/user.rb
  2. 4
      app/views/layouts/base.html.erb
  3. 2
      app/views/settings/_display.html.erb
  4. 1
      config/locales/de.yml
  5. 1
      config/locales/en.yml
  6. 2
      config/settings.yml
  7. 1
      doc/CHANGELOG.md
  8. 3
      features/projects/visibility.feature
  9. 2
      features/step_definitions/error_steps.rb
  10. 33
      spec/models/user_spec.rb

@ -413,7 +413,7 @@ class User < Principal
end
def impaired
anonymous? || !!self.pref.impaired
(anonymous? && Setting.accessibility_mode_for_anonymous?) || !!self.pref.impaired
end
def impaired?

@ -38,6 +38,10 @@ See doc/COPYRIGHT.rdoc for more details.
<%= csrf_meta_tags %>
<%= favicon_link_tag 'favicon.ico' %>
<%= stylesheet_link_tag current_theme.stylesheet_manifest, :media => "all" %>
<% if User.current.impaired? && accessibility_css_enabled? %>
<%= stylesheet_link_tag 'accessibility' %>
<% end %>
<%= javascript_include_tag 'application' %>
<!-- user specific tags -->
<%= user_specific_javascript_includes %>

@ -33,6 +33,8 @@ See doc/COPYRIGHT.rdoc for more details.
<p><%= setting_select :ui_theme, OpenProject::Themes.collect { |theme| [theme.name, theme.identifier] }, :label => :label_theme %></p>
<p><%= setting_check_box :user_may_override_theme %></p>
<p><%= setting_check_box :accessibility_mode_for_anonymous %></p>
<p id="setting_available_languages"><%= setting_multiselect :available_languages, all_lang_options_for_select(false) %></p>
<p id="setting_default_language"><%= setting_select :default_language, all_lang_options_for_select(false) %></p>

@ -1254,6 +1254,7 @@ de:
setting_time_format: "Zeitformat"
setting_ui_theme: "Stil"
setting_user_may_override_theme: "Benutzer dürfen einen eigenen Stil wählen"
setting_accessibility_mode_for_anonymous: "Für barrierefreie Nutzung optimierte Oberfläche für nicht angemeldete Nutzer."
setting_user_format: "Benutzer-Anzeigeformat"
setting_users_deletable_by_admins: "Admins können Nutzeraccounts löschen"
setting_users_deletable_by_self: "Nutzer können ihren Account löschen"

@ -1240,6 +1240,7 @@ en:
setting_time_format: "Time format"
setting_ui_theme: "Theme"
setting_user_may_override_theme: "Users may choose their own themes"
setting_accessibility_mode_for_anonymous: "Enable accessibility mode for anonymous users"
setting_user_format: "Users display format"
setting_users_deletable_by_admins: "User accounts deletable by admins"
setting_users_deletable_by_self: "Users allowed to delete their accounts"

@ -225,6 +225,8 @@ ui_theme:
default: 'default'
user_may_override_theme:
default: 1
accessibility_mode_for_anonymous:
default: 0
emails_footer:
serialized: true
default:

@ -29,6 +29,7 @@ See doc/COPYRIGHT.rdoc for more details.
# Changelog
* [Accessibility] Reactivate accessibility css; Setting for Accessibility mode for anonymous users
* `#1951` Layout for ## and ### textile link help is broken
* `#2147` [Accessibility] Link form elements to their label - new timeline
* `#2151` [Accessibility] Link form elements to their label - new wiki page

@ -38,7 +38,8 @@ Background:
@javascript
Scenario: A Project is visible on the landing page if it is set to public
Given I am on the login page
And I follow "Projects" within "#top-menu-items"
Then I should see "Projects" within "#top-menu-items"
When I go to the overall Projects page
Then I should see "Bob's Accounting" within "#content"
@javascript

@ -49,7 +49,7 @@ Then /^there should( not)? be a flash (error|notice) message$/ do |no_message, k
end
Then /^the flash message should contain "([^"]*)"$/ do |message|
page.find(:css, '.flash > a').text.should include(message)
page.find(:css, '.flash').text.should include(message)
end
Then /^I should( not)? see (\d+) error message(?:s)?$/ do |negative, count|

@ -330,4 +330,37 @@ describe User do
it { User.find_by_rss_key(@rss_key).should == nil }
end
end
describe '#impaired?' do
let(:anonymous) { FactoryGirl.create(:anonymous)}
let(:user) { FactoryGirl.create(:user)}
context 'anonymous user with accessibility mode disabled for anonymous users' do
before do
Setting.stub(:accessibility_mode_for_anonymous?).and_return(false)
end
it { anonymous.impaired?.should be_false }
end
context 'anonymous user with accessibility mode enabled for anonymous users' do
before do
Setting.stub(:accessibility_mode_for_anonymous?).and_return(true)
end
it { anonymous.impaired?.should be_true }
end
context 'not impaired user' do
it { user.impaired?.should be_false }
end
context 'impaired user' do
before do
user.pref[:impaired] = true
end
it { user.impaired?.should be_true }
end
end
end

Loading…
Cancel
Save