mirror of
https://github.com/projekteuler/projekteuler.git
synced 2025-12-10 08:46:41 +01:00
commit
ddb1cfac33
3
.gitignore
vendored
3
.gitignore
vendored
@ -19,3 +19,6 @@
|
|||||||
/coverage
|
/coverage
|
||||||
# Ignore encrypted secrets key file.
|
# Ignore encrypted secrets key file.
|
||||||
config/secrets.yml.key
|
config/secrets.yml.key
|
||||||
|
|
||||||
|
# Ignore master key for decrypting credentials and more.
|
||||||
|
/config/master.key
|
||||||
|
|||||||
2
Gemfile
2
Gemfile
@ -48,6 +48,8 @@ gem 'will_paginate-bootstrap', '~> 1.0.1'
|
|||||||
|
|
||||||
gem 'devise', '~> 4.5.0'
|
gem 'devise', '~> 4.5.0'
|
||||||
gem 'devise-bootstrap-views', '~> 0.0.11'
|
gem 'devise-bootstrap-views', '~> 0.0.11'
|
||||||
|
gem 'omniauth'
|
||||||
|
gem 'omniauth-github'
|
||||||
|
|
||||||
gem 'codemirror-rails', '~> 5.16.0'
|
gem 'codemirror-rails', '~> 5.16.0'
|
||||||
# Use ActiveModel has_secure_password
|
# Use ActiveModel has_secure_password
|
||||||
|
|||||||
23
Gemfile.lock
23
Gemfile.lock
@ -85,11 +85,14 @@ GEM
|
|||||||
docile (1.3.1)
|
docile (1.3.1)
|
||||||
erubi (1.8.0)
|
erubi (1.8.0)
|
||||||
execjs (2.7.0)
|
execjs (2.7.0)
|
||||||
|
faraday (0.15.4)
|
||||||
|
multipart-post (>= 1.2, < 3)
|
||||||
ffi (1.9.25)
|
ffi (1.9.25)
|
||||||
ffi (1.9.25-x64-mingw32)
|
ffi (1.9.25-x64-mingw32)
|
||||||
ffi (1.9.25-x86-mingw32)
|
ffi (1.9.25-x86-mingw32)
|
||||||
globalid (0.4.2)
|
globalid (0.4.2)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
|
hashie (3.6.0)
|
||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
jbuilder (2.8.0)
|
jbuilder (2.8.0)
|
||||||
@ -100,6 +103,7 @@ GEM
|
|||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (1.8.6)
|
json (1.8.6)
|
||||||
|
jwt (2.1.0)
|
||||||
loofah (2.2.3)
|
loofah (2.2.3)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
@ -116,6 +120,8 @@ GEM
|
|||||||
msgpack (1.2.6-x64-mingw32)
|
msgpack (1.2.6-x64-mingw32)
|
||||||
msgpack (1.2.6-x86-mingw32)
|
msgpack (1.2.6-x86-mingw32)
|
||||||
multi_json (1.13.1)
|
multi_json (1.13.1)
|
||||||
|
multi_xml (0.6.0)
|
||||||
|
multipart-post (2.0.0)
|
||||||
mysql2 (0.5.2)
|
mysql2 (0.5.2)
|
||||||
mysql2 (0.5.2-x64-mingw32)
|
mysql2 (0.5.2-x64-mingw32)
|
||||||
mysql2 (0.5.2-x86-mingw32)
|
mysql2 (0.5.2-x86-mingw32)
|
||||||
@ -126,6 +132,21 @@ GEM
|
|||||||
mini_portile2 (~> 2.4.0)
|
mini_portile2 (~> 2.4.0)
|
||||||
nokogiri (1.10.1-x86-mingw32)
|
nokogiri (1.10.1-x86-mingw32)
|
||||||
mini_portile2 (~> 2.4.0)
|
mini_portile2 (~> 2.4.0)
|
||||||
|
oauth2 (1.4.1)
|
||||||
|
faraday (>= 0.8, < 0.16.0)
|
||||||
|
jwt (>= 1.0, < 3.0)
|
||||||
|
multi_json (~> 1.3)
|
||||||
|
multi_xml (~> 0.5)
|
||||||
|
rack (>= 1.2, < 3)
|
||||||
|
omniauth (1.9.0)
|
||||||
|
hashie (>= 3.4.6, < 3.7.0)
|
||||||
|
rack (>= 1.6.2, < 3)
|
||||||
|
omniauth-github (1.3.0)
|
||||||
|
omniauth (~> 1.5)
|
||||||
|
omniauth-oauth2 (>= 1.4.0, < 2.0)
|
||||||
|
omniauth-oauth2 (1.6.0)
|
||||||
|
oauth2 (~> 1.1)
|
||||||
|
omniauth (~> 1.9)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
rack (2.0.6)
|
rack (2.0.6)
|
||||||
rack-test (1.1.0)
|
rack-test (1.1.0)
|
||||||
@ -240,6 +261,8 @@ DEPENDENCIES
|
|||||||
jbuilder (~> 2.8.0)
|
jbuilder (~> 2.8.0)
|
||||||
jquery-rails (~> 4.3.3)
|
jquery-rails (~> 4.3.3)
|
||||||
mysql2 (~> 0.5.2)
|
mysql2 (~> 0.5.2)
|
||||||
|
omniauth
|
||||||
|
omniauth-github
|
||||||
rails (= 5.2.2)
|
rails (= 5.2.2)
|
||||||
rails-controller-testing
|
rails-controller-testing
|
||||||
rails-i18n (~> 5.1.3)
|
rails-i18n (~> 5.1.3)
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
class AdminController < ApplicationController
|
class AdminController < ApplicationController
|
||||||
before_action :authenticate_admin!
|
before_action :authenticate!
|
||||||
|
|
||||||
|
def authenticate!
|
||||||
|
authenticate_user!
|
||||||
|
throw(:warden) unless current_user.admin?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
18
app/controllers/users/omniauth_callbacks_controller.rb
Normal file
18
app/controllers/users/omniauth_callbacks_controller.rb
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||||
|
skip_before_action :verify_authenticity_token
|
||||||
|
|
||||||
|
def sign_in_with(provider_name)
|
||||||
|
@user = User.from_omniauth(request.env["omniauth.auth"])
|
||||||
|
@user.remember_me!
|
||||||
|
sign_in_and_redirect @user, event: :authentication
|
||||||
|
set_flash_message(:notice, :success, kind: provider_name) if is_navigational_format?
|
||||||
|
end
|
||||||
|
|
||||||
|
def developer
|
||||||
|
sign_in_with "Developer"
|
||||||
|
end
|
||||||
|
|
||||||
|
def github
|
||||||
|
sign_in_with "GitHub"
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,6 +0,0 @@
|
|||||||
class Admin < ApplicationRecord
|
|
||||||
# Include default devise modules. Others available are:
|
|
||||||
# :confirmable, :lockable, :timeoutable and :omniauthable
|
|
||||||
devise :database_authenticatable,
|
|
||||||
:recoverable, :rememberable, :trackable, :validatable
|
|
||||||
end
|
|
||||||
11
app/models/user.rb
Normal file
11
app/models/user.rb
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
class User < ApplicationRecord
|
||||||
|
devise :omniauthable, :rememberable
|
||||||
|
|
||||||
|
enum role: [:user, :admin]
|
||||||
|
|
||||||
|
def self.from_omniauth(auth)
|
||||||
|
where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
|
||||||
|
user.name = auth.info.name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,18 +0,0 @@
|
|||||||
<%= bootstrap_devise_error_messages! %>
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<h4><%= t('.resend_confirmation_instructions', :default => 'Resend confirmation instructions') %></h4>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post, role: "form" }) do |f| %>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :email %>
|
|
||||||
<%= f.email_field :email, autofocus: true, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= f.submit t('.resend_confirmation_instructions', :default => 'Resend confirmation instructions'), class: "btn btn-primary" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= render "devise/shared/links" %>
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
<p><%= t('.greeting', :recipient => @resource.email, :default => "Welcome #{@resource.email}!") %></p>
|
|
||||||
|
|
||||||
<p><%= t('.instruction', :default => "You can confirm your account email through the link below:") %></p>
|
|
||||||
|
|
||||||
<p><%= link_to t('.action', :default => "Confirm my account"),
|
|
||||||
confirmation_url(@resource, :confirmation_token => @token, locale: I18n.locale) %></p>
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
<p><%= t('.greeting', :recipient => @resource.email, :default => "Hello #{@resource.email}!") %></p>
|
|
||||||
|
|
||||||
<p><%= t('.instruction', :default => "Someone has requested a link to change your password, and you can do this through the link below.") %></p>
|
|
||||||
|
|
||||||
<p><%= link_to t('.action', :default => "Change my password"), edit_password_url(@resource, :reset_password_token => @token, locale: I18n.locale) %></p>
|
|
||||||
|
|
||||||
<p><%= t('.instruction_2', :default => "If you didn't request this, please ignore this email.") %></p>
|
|
||||||
<p><%= t('.instruction_3', :default => "Your password won't change until you access the link above and create a new one.") %></p>
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
<p><%= t('.greeting', :recipient => @resource.email, :default => "Hello #{@resource.email}!") %></p>
|
|
||||||
|
|
||||||
<p><%= t('.message', :default => "Your account has been locked due to an excessive amount of unsuccessful sign in attempts.") %></p>
|
|
||||||
|
|
||||||
<p><%= t('.instruction', :default => "Click the link below to unlock your account:") %></p>
|
|
||||||
|
|
||||||
<p><%= link_to t('.action', :default => "Unlock my account"), unlock_url(@resource, :unlock_token => @resource.unlock_token, locale: I18n.locale) %></p>
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<%= bootstrap_devise_error_messages! %>
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<h4><%= t('.change_your_password', :default => 'Change your password') %></h4>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, role: "form" }) do |f| %>
|
|
||||||
<%= f.hidden_field :reset_password_token %>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :password, t('.new_password', :default => 'New password') %>
|
|
||||||
<%= f.password_field :password, autofocus: true, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :password_confirmation, t('.confirm_new_password', :default => 'Confirm new password') %>
|
|
||||||
<%= f.password_field :password_confirmation, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= f.submit t('.change_my_password', :default => 'Change my password'), class: "btn btn-primary" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<%= render "devise/shared/links" %>
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<%= bootstrap_devise_error_messages! %>
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<h4><%= t('.forgot_your_password', :default => 'Forgot your password?') %></h4>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, role: "form" }) do |f| %>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :email %>
|
|
||||||
<%= f.email_field :email, autofocus: true, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= f.submit t('.send_me_reset_password_instructions', :default => "Send me reset password instructions"), class: "btn btn-primary" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<%= render "devise/shared/links" %>
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
<%= bootstrap_devise_error_messages! %>
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<h4><%= t('.title', :resource => resource_class.model_name.human , :default => 'Edit #{resource_name.to_s.humanize}') %></h4>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :email %>
|
|
||||||
<%= f.email_field :email, autofocus: true, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :password %> <i>(<%= t('.leave_blank_if_you_don_t_want_to_change_it', :default => "leave blank if you don't want to change it") %>)</i><br />
|
|
||||||
<%= f.password_field :password, :autocomplete => "off", class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :password_confirmation %><br />
|
|
||||||
<%= f.password_field :password_confirmation, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :current_password %> <i>(<%= t('.we_need_your_current_password_to_confirm_your_changes', :default => 'we need your current password to confirm your changes') %>)</i>
|
|
||||||
<%= f.password_field :current_password, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
<%= f.submit t('.update', :default => "Update"), class: "btn btn-primary" %></div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p><%= t('.unhappy', :default => 'Unhappy') %>? <%= link_to t('.cancel_my_account', :default => "Cancel my account"), registration_path(resource_name), :data => { :confirm => t('.are_you_sure', :default => "Are you sure?") }, :method => :delete %>.</p>
|
|
||||||
|
|
||||||
<%= link_to "Back", :back %>
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<%= bootstrap_devise_error_messages! %>
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<h4><%= t('.sign_up', :default => "Sign up") %></h4>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: { role: "form" }) do |f| %>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :email %>
|
|
||||||
<%= f.email_field :email, autofocus: true, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :password %><br />
|
|
||||||
<%= f.password_field :password, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :password_confirmation %>
|
|
||||||
<%= f.password_field :password_confirmation, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
<%= f.submit t('.sign_up', :default => "Sign up"), class: "btn btn-primary" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<%= render "devise/shared/links" %>
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
<% provide(:title, t('.sign_in')) %>
|
|
||||||
|
|
||||||
<%= alert_box t('.no_sign_in_required_for_translating'), context: :warning %>
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<h4><%= t('.sign_in', :default => "Sign in") %></h4>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { role: "form" }) do |f| %>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :email %>
|
|
||||||
<%= f.email_field :email, autofocus: true, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :password %>
|
|
||||||
<%= f.password_field :password, autocomplete: "off", class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
<% if devise_mapping.rememberable? %>
|
|
||||||
<div class="checkbox">
|
|
||||||
<label>
|
|
||||||
<%= f.check_box :remember_me %> <%= t '.remember_me' %>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<%= f.submit t('.sign_in', :default => "Sign in"), class: "btn btn-primary" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<%= render "devise/shared/links" %>
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
<%- if controller_name != 'sessions' %>
|
|
||||||
<%= link_to t(".sign_in", :default => "Sign in"), new_session_path(resource_name) %><br />
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
|
||||||
<%= link_to t(".sign_up", :default => "Sign up"), new_registration_path(resource_name) %><br />
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
|
|
||||||
<%= link_to t(".forgot_your_password", :default => "Forgot your password?"), new_password_path(resource_name) %><br />
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
|
||||||
<%= link_to t('.didn_t_receive_confirmation_instructions', :default => "Didn't receive confirmation instructions?"), new_confirmation_path(resource_name) %><br />
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
|
||||||
<%= link_to t('.didn_t_receive_unlock_instructions', :default => "Didn't receive unlock instructions?"), new_unlock_path(resource_name) %><br />
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<%- if devise_mapping.omniauthable? %>
|
|
||||||
<%- resource_class.omniauth_providers.each do |provider| %>
|
|
||||||
<%= link_to t('.sign_in_with_provider', :provider => provider.to_s.titleize, :default => "Sign in with #{provider.to_s.titleize}"), omniauth_authorize_path(resource_name, provider) %><br />
|
|
||||||
<% end -%>
|
|
||||||
<% end -%>
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
<%= bootstrap_devise_error_messages! %>
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<h4><%= t('.resend_unlock_instructions', :default => "Resend unlock instructions") %></h4>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post, html: { role: "form" } }) do |f| %>
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :email %>
|
|
||||||
<%= f.email_field :email, autofocus: true, class: "form-control" %>
|
|
||||||
</div>
|
|
||||||
<%= f.submit t('.resend_unlock_instructions', :default => "Resend unlock instructions"), class: "btn btn-primary"%>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<%= render "devise/shared/links" %>
|
|
||||||
@ -6,16 +6,26 @@
|
|||||||
<%= nav class: 'navbar-left' do %>
|
<%= nav class: 'navbar-left' do %>
|
||||||
<%= link_to t('application.info'), about_info_path %>
|
<%= link_to t('application.info'), about_info_path %>
|
||||||
<%= link_to Problem.model_name.human(count: 2), problems_path %>
|
<%= link_to Problem.model_name.human(count: 2), problems_path %>
|
||||||
<% if admin_signed_in? %>
|
<% if user_signed_in? and current_user.admin? %>
|
||||||
<%= link_to t('admin.dashboard.index.administration'), admin_dashboard_index_path %>
|
<%= link_to t('admin.dashboard.index.administration'), admin_dashboard_index_path %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= nav class: 'navbar-right' do %>
|
<%= nav class: 'navbar-right' do %>
|
||||||
<%= link_to t('application.legal'), about_legal_path %>
|
<%= link_to t('application.legal'), about_legal_path %>
|
||||||
<% if admin_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<%= link_to(t('application.sign_out'), destroy_admin_session_path, method: :delete) %>
|
<span class="navbar-text">Eingeloggt als <b>
|
||||||
|
<%= current_user.name %>
|
||||||
|
<% if current_user.admin? %>
|
||||||
|
<%= icon :star %>
|
||||||
|
<% end %>
|
||||||
|
</b></span>
|
||||||
|
<%= link_to(t('application.sign_out'), destroy_user_session_path, method: :delete) %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to(t('application.sign_in'), new_admin_session_path) %>
|
<% if Rails.env.development? %>
|
||||||
|
<%= link_to(t('application.sign_in'), user_developer_omniauth_authorize_path) %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to(t('application.sign_in'), user_github_omniauth_authorize_path) %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
1
config/credentials.yml.enc
Normal file
1
config/credentials.yml.enc
Normal file
@ -0,0 +1 @@
|
|||||||
|
fmujPxH4j3Pge1kfEi/+pTVW7yA6/X3pBWwuLTIRhchpJokcEie/lbUNlpGOhzGUeOaNZpdEWbB+DVh7r8VUf9FaTMZwyA8u7ipB6Kt7FxrmyqGF4Sb3N54JdREq5KetMCR209VR5URghVnTv6fWMNY/CnfmoAhIi6z40ARP//wSgSQIYlTSsIF/LWdaI9Zn6v3eJ4KSs53EeHyIUal5E67QnvPESwWLvZ6BrKh6GO67xfjAKnoWU4YK+bkFeffubRSKqbb9fAHZLiEVD0glOAeibuJzLAZZa5worvQQgJLZnS1syWCDIz4U6PN4/ZBfrxq8Y+TpBXCEu/5JWrr6ARqbQy8Qnte+IL5EYY65Z70vyI9fcpVYiyKtvUQOsOypf/UxMjahg0MSddZlAiY3+ufyA1Sw9s7BCClaaNtOCtRM/thwNRdn3kNh2S/9YuodVSu5PV/V6DDX9BSo/FZeTbntBSsFnIe5NWwyEaC7jn1zp0FXeAT1N7beUpYcIwWXl7roGATq5J+eSycSAydj5TSPpy6pe0JV--zgHjFhqIX9PMSptP--a4kSt219OHlMrnkVTQFQVA==
|
||||||
@ -233,7 +233,15 @@ Devise.setup do |config|
|
|||||||
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
||||||
# up on your models and hooks.
|
# up on your models and hooks.
|
||||||
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
||||||
|
if Rails.env.development?
|
||||||
|
config.omniauth :developer, fields: [:name], uid_field: :name
|
||||||
|
end
|
||||||
|
if Rails.env.production?
|
||||||
|
config.omniauth :github, Rails.application.credentials.github[:client_id], Rails.application.credentials.github[:client_secret], scope: ''
|
||||||
|
end
|
||||||
|
if Rails.env.test?
|
||||||
|
config.omniauth :github, '', '', scope: ''
|
||||||
|
end
|
||||||
# ==> Warden configuration
|
# ==> Warden configuration
|
||||||
# If you want to use other strategies, that are not supported by Devise, or
|
# If you want to use other strategies, that are not supported by Devise, or
|
||||||
# change the failure app, you can configure them inside the config.warden block.
|
# change the failure app, you can configure them inside the config.warden block.
|
||||||
|
|||||||
@ -1,60 +1,143 @@
|
|||||||
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
|
||||||
|
|
||||||
de:
|
de:
|
||||||
|
activerecord:
|
||||||
|
attributes:
|
||||||
|
user:
|
||||||
|
confirmation_sent_at: Bestätigung gesendet am
|
||||||
|
confirmation_token: Bestätigungs-Token
|
||||||
|
confirmed_at: Bestätigt am
|
||||||
|
created_at: Erstellt am
|
||||||
|
current_password: Bisheriges Passwort
|
||||||
|
current_sign_in_at: Aktuelle Anmeldung vom
|
||||||
|
current_sign_in_ip: IP der aktuellen Anmeldung
|
||||||
|
email: E-Mail
|
||||||
|
encrypted_password: Verschlüsseltes Passwort
|
||||||
|
failed_attempts: Fehlversuche
|
||||||
|
last_sign_in_at: Letzte Anmeldung am
|
||||||
|
last_sign_in_ip: IP der letzten Anmeldung
|
||||||
|
locked_at: Gesperrt am
|
||||||
|
password: Passwort
|
||||||
|
password_confirmation: Passwortbestätigung
|
||||||
|
remember_created_at: Angemeldet bleiben vom
|
||||||
|
remember_me: Angemeldet bleiben
|
||||||
|
reset_password_sent_at: Passwort-Zurücksetzen-E-Mail gesendet am
|
||||||
|
reset_password_token: Passwort-Zurücksetzen-Token
|
||||||
|
sign_in_count: Anzahl Anmeldungen
|
||||||
|
unconfirmed_email: Unbestätigte E-Mail-Adresse
|
||||||
|
unlock_token: Entsperrungs-Token
|
||||||
|
updated_at: Aktualisiert am
|
||||||
|
models:
|
||||||
|
user: Benutzer
|
||||||
devise:
|
devise:
|
||||||
confirmations:
|
confirmations:
|
||||||
confirmed: "Vielen Dank für Ihre Registrierung. Bitte melden Sie sich jetzt an."
|
confirmed: Ihre E-Mail-Adresse wurde erfolgreich bestätigt.
|
||||||
confirmed_and_signed_in: "Vielen Dank für Ihre Registrierung. Sie sind jetzt angemeldet."
|
new:
|
||||||
send_instructions: "Sie erhalten in wenigen Minuten eine E-Mail, mit der Sie Ihre Registrierung bestätigen können."
|
resend_confirmation_instructions: Anleitung zur Bestätigung noch mal schicken
|
||||||
send_paranoid_instructions: "Falls Ihre E-Mail-Adresse in unserer Datenbank existiert erhalten Sie in wenigen Minuten eine E-Mail mit der Sie Ihre Registrierung bestätigen können."
|
send_instructions: Sie erhalten in wenigen Minuten eine E-Mail, mit der Sie Ihre Registrierung bestätigen können.
|
||||||
|
send_paranoid_instructions: Falls Ihre E-Mail-Adresse in unserer Datenbank existiert, erhalten Sie in wenigen Minuten eine E-Mail, mit der Sie Ihre Registrierung bestätigen können.
|
||||||
failure:
|
failure:
|
||||||
already_authenticated: "Sie sind bereits angemeldet."
|
already_authenticated: Sie sind bereits angemeldet.
|
||||||
inactive: "Ihr Account ist nicht aktiv."
|
inactive: Ihr Konto ist nicht aktiv.
|
||||||
invalid: "Ungültige Anmeldedaten."
|
invalid: "%{authentication_keys} oder Passwort ungültig."
|
||||||
invalid_token: "Der Anmelde-Token ist ungültig."
|
last_attempt: Sie haben noch einen Versuch, bis Ihr Konto gesperrt wird.
|
||||||
locked: "Ihr Account ist gesperrt."
|
locked: Ihr Konto ist gesperrt.
|
||||||
not_found_in_database: "E-Mail-Adresse oder Passwort ungültig."
|
not_found_in_database: "%{authentication_keys} oder Passwort ungültig."
|
||||||
timeout: "Ihre Sitzung ist abgelaufen, bitte melden Sie sich erneut an."
|
timeout: Ihre Sitzung ist abgelaufen, bitte melden Sie sich erneut an.
|
||||||
unauthenticated: "Sie müssen sich anmelden oder registrieren, bevor Sie fortfahren können."
|
unauthenticated: Sie müssen sich anmelden oder registrieren, bevor Sie fortfahren können.
|
||||||
unconfirmed: "Sie müssen Ihren Account bestätigen, bevor Sie fortfahren können."
|
unconfirmed: Sie müssen Ihr Konto bestätigen, bevor Sie fortfahren können.
|
||||||
mailer:
|
mailer:
|
||||||
confirmation_instructions:
|
confirmation_instructions:
|
||||||
subject: "Anleitung zur Bestätigung Ihres Accounts"
|
action: Mein Konto bestätigen
|
||||||
|
greeting: Willkommen %{recipient}!
|
||||||
|
instruction: 'Folgen Sie dem untenstehenden Link, um Ihr Konto zu bestätigen:'
|
||||||
|
subject: Anleitung zur Bestätigung Ihres Kontos
|
||||||
|
email_changed:
|
||||||
|
greeting: Hallo %{recipient}!
|
||||||
|
message: Wir schreiben Ihnen, um Sie darüber zu informieren, dass Ihre E-Mail-Adresse zu %{email} geändert wurde.
|
||||||
|
subject: E-Mail-Adresse geändert
|
||||||
|
password_change:
|
||||||
|
greeting: Hallo %{recipient}!
|
||||||
|
message: Wir schreiben Ihnen, um Sie darüber zu informieren, dass Ihr Passwort geändert wurde.
|
||||||
|
subject: Passwort geändert
|
||||||
reset_password_instructions:
|
reset_password_instructions:
|
||||||
subject: "Anleitung um Ihr Passwort zurückzusetzen"
|
action: Passwort ändern
|
||||||
|
greeting: Hallo %{recipient}!
|
||||||
|
instruction: Jemand hat einen Link angefordert, um Ihr Passwort zu ändern. Klicken Sie auf den unten aufgeführten Link um das Passwort zu ändern.
|
||||||
|
instruction_2: Bitte ignorieren Sie diese E-Mail, wenn Sie kein neues Passwort angefordert haben.
|
||||||
|
instruction_3: Das Passwort wird nicht geändert bis Sie den obenstehenden Link abrufen und ein neues Passwort bestimmen.
|
||||||
|
subject: Anleitung für das Zurücksetzen Ihres Passworts
|
||||||
unlock_instructions:
|
unlock_instructions:
|
||||||
subject: "Anleitung um Ihren Account freizuschalten"
|
action: Mein Konto entsperren
|
||||||
|
greeting: Hallo %{recipient}!
|
||||||
|
instruction: 'Folgen Sie dem untenstehenden Link, um Ihr Konto zu entsperren:'
|
||||||
|
message: Ihr Konto wurde aufgrund einer großen Anzahl von fehlgeschlagenen Anmeldeversuchen gesperrt.
|
||||||
|
subject: Anleitung für die Konto-Freischaltung
|
||||||
omniauth_callbacks:
|
omniauth_callbacks:
|
||||||
failure: "Sie konnten nicht mit Ihrem %{kind}-Account angemeldet werden, weil '%{reason}'."
|
failure: Sie konnten nicht mit Ihrem %{kind}-Konto angemeldet werden, weil "%{reason}".
|
||||||
success: "Sie haben sich erfolgreich mit Ihrem %{kind}-Account angemeldet."
|
success: Sie haben sich erfolgreich mit Ihrem %{kind}-Konto angemeldet.
|
||||||
passwords:
|
passwords:
|
||||||
no_token: "Sie können diese Seite nur von dem Link aus einer E-Mail zum Passwort-Zurücksetzen aufrufen. Wenn Sie einen solchen Link aufgerufen haben, stellen Sie bitte sicher, dass Sie die vollständige Adresse aufrufen."
|
edit:
|
||||||
send_instructions: "Sie erhalten in wenigen Minuten eine E-Mail mit der Anleitung, wie Sie Ihr Passwort zurücksetzen können."
|
change_my_password: Ändere mein Passwort
|
||||||
send_paranoid_instructions: "Falls Ihre E-Mail-Adresse in unserer Datenbank existiert erhalten Sie in wenigen Minuten eine E-Mail mit der Anleitung, wie Sie Ihr Passwort zurücksetzen können."
|
change_your_password: Passwort ändern
|
||||||
updated: "Ihr Passwort wurde geändert. Sie sind jetzt angemeldet."
|
confirm_new_password: Neues Passwort bestätigen
|
||||||
updated_not_active: "Ihr Passwort wurde geändert."
|
new_password: Neues Passwort
|
||||||
|
new:
|
||||||
|
forgot_your_password: Haben Sie Ihr Passwort vergessen?
|
||||||
|
send_me_reset_password_instructions: Schicken Sie mir die Anleitung, mein Passwort zurückzusetzen
|
||||||
|
no_token: Sie können sich nicht auf dieser Seite anmelden, wenn Sie nicht von einer Passwort-Zurücksetzen-E-Mail kommen. Wenn Sie von solch einer E-Mail kommen, überprüfen Sie bitte, ob Sie die gesamte URL verwendet haben.
|
||||||
|
send_instructions: Sie erhalten in wenigen Minuten eine E-Mail mit der Anleitung, wie Sie Ihr Passwort zurücksetzen können.
|
||||||
|
send_paranoid_instructions: Falls Ihre E-Mail-Adresse in unserer Datenbank existiert, erhalten Sie in wenigen Minuten eine E-Mail, mit der Anleitung, wie Sie Ihr Passwort zurücksetzen können.
|
||||||
|
updated: Ihr Passwort wurde geändert. Sie sind jetzt angemeldet.
|
||||||
|
updated_not_active: Ihr Passwort wurde geändert.
|
||||||
registrations:
|
registrations:
|
||||||
destroyed: "Ihr Account wurde gelöscht."
|
destroyed: Ihr Konto wurde gelöscht.
|
||||||
signed_up: "Sie haben sich erfolgreich registriert."
|
edit:
|
||||||
signed_up_but_inactive: "Sie haben sich erfolgreich registriert. Wir konnten Sie noch nicht anmelden, da Ihr Account inaktiv ist."
|
are_you_sure: Sind Sie sicher?
|
||||||
signed_up_but_locked: "Sie haben sich erfolgreich registriert. Wir konnten Sie noch nicht anmelden, da Ihr Account gesperrt ist."
|
cancel_my_account: Konto löschen
|
||||||
signed_up_but_unconfirmed: "Sie haben sich erfolgreich registriert. Wir konnten Sie noch nicht anmelden, da Ihr Account noch nicht bestätigt ist. Sie erhalten in Kürze eine E-Mail mit der Anleitung, wie Sie Ihren Account freischalten können."
|
currently_waiting_confirmation_for_email: Warte auf Bestätigung von %{email}.
|
||||||
update_needs_confirmation: "Ihre Daten wurden aktualisiert, aber Sie müssen Ihre neue E-Mail-Adresse bestätigen. Sie erhalten in wenigen Minuten eine E-Mail, mit der Sie die Änderung Ihrer E-Mail-Adresse abschliessen können."
|
leave_blank_if_you_don_t_want_to_change_it: freilassen, wenn Sie das nicht ändern wollen
|
||||||
updated: "Ihre Daten wurden aktualisiert."
|
title: "%{resource} bearbeiten"
|
||||||
|
unhappy: Unzufrieden?
|
||||||
|
update: Aktualisieren
|
||||||
|
we_need_your_current_password_to_confirm_your_changes: wir benötigen Ihr aktuelles Passwort, um die Änderung zu bestätigen
|
||||||
|
new:
|
||||||
|
sign_up: Registrieren
|
||||||
|
signed_up: Sie haben sich erfolgreich registriert.
|
||||||
|
signed_up_but_inactive: Sie haben sich erfolgreich registriert. Wir konnten Sie jedoch nicht anmelden, weil Ihr Konto noch nicht aktiviert ist.
|
||||||
|
signed_up_but_locked: Sie haben sich erfolgreich registriert. Wir konnten Sie jedoch nicht anmelden, weil Ihr Konto gesperrt ist.
|
||||||
|
signed_up_but_unconfirmed: Sie erhalten in wenigen Minuten eine E-Mail mit einem Link für die Bestätigung der Registrierung. Klicken Sie auf den Link um Ihr Konto zu aktivieren.
|
||||||
|
update_needs_confirmation: Ihre Daten wurden aktualisiert, aber Sie müssen Ihre neue E-Mail-Adresse bestätigen. Sie erhalten in wenigen Minuten eine E-Mail, mit der Sie die Änderung Ihrer E-Mail-Adresse abschließen können.
|
||||||
|
updated: Ihre Daten wurden aktualisiert.
|
||||||
sessions:
|
sessions:
|
||||||
signed_in: "Erfolgreich angemeldet."
|
already_signed_out: Erfolgreich abgemeldet.
|
||||||
signed_out: "Erfolgreich abgemeldet."
|
new:
|
||||||
|
sign_in: Anmelden
|
||||||
|
signed_in: Erfolgreich angemeldet.
|
||||||
|
signed_out: Erfolgreich abgemeldet.
|
||||||
|
shared:
|
||||||
|
links:
|
||||||
|
back: Zurück
|
||||||
|
didn_t_receive_confirmation_instructions: Keine Anleitung zur Bestätigung erhalten?
|
||||||
|
didn_t_receive_unlock_instructions: Keine Anleitung zum Entsperren erhalten?
|
||||||
|
forgot_your_password: Passwort vergessen?
|
||||||
|
sign_in: Anmelden
|
||||||
|
sign_in_with_provider: Mit %{provider} anmelden
|
||||||
|
sign_up: Registrieren
|
||||||
|
minimum_password_length:
|
||||||
|
one: "(mindestens %{count} Zeichen)"
|
||||||
|
other: "(mindestens %{count} Zeichen)"
|
||||||
unlocks:
|
unlocks:
|
||||||
send_instructions: "Sie erhalten in wenigen Minuten eine E-Mail mit der Anleitung, wie Sie Ihren Account entsperren können."
|
new:
|
||||||
send_paranoid_instructions: "Falls Ihre E-Mail-Adresse in unserer Datenbank existiert erhalten Sie in wenigen Minuten eine E-Mail mit der Anleitung, wie Sie Ihren Account entsperren können."
|
resend_unlock_instructions: Anleitung zum Entsperren noch mal schicken
|
||||||
unlocked: "Ihr Account wurde entsperrt. Sie sind jetzt angemeldet."
|
send_instructions: Sie erhalten in wenigen Minuten eine E-Mail mit der Anleitung, wie Sie Ihr Konto entsperren können.
|
||||||
|
send_paranoid_instructions: Falls Ihre E-Mail-Adresse in unserer Datenbank existiert, erhalten Sie in wenigen Minuten eine E-Mail, mit der Anleitung, wie Sie Ihr Konto entsperren können.
|
||||||
|
unlocked: Ihr Konto wurde entsperrt. Bitte melden Sie sich an, um fortzufahren.
|
||||||
errors:
|
errors:
|
||||||
messages:
|
messages:
|
||||||
already_confirmed: "wurde bereits bestätigt"
|
already_confirmed: wurde bereits bestätigt, bitte versuchen Sie, sich anzumelden
|
||||||
confirmation_period_expired: "muss innerhalb %{period} bestätigt werden, bitte fordern Sie einen neuen Link an"
|
confirmation_period_expired: musste innerhalb von %{period} bestätigt werden, bitte neu anfordern.
|
||||||
expired: "ist abgelaufen, bitte neu anfordern"
|
expired: ist abgelaufen, bitte neu anfordern
|
||||||
not_found: "nicht gefunden"
|
not_found: nicht gefunden
|
||||||
not_locked: "ist nicht gesperrt"
|
not_locked: ist nicht gesperrt
|
||||||
not_saved:
|
not_saved:
|
||||||
one: "Konnte %{resource} nicht speichern: ein Fehler."
|
one: "%{resource} konnte aufgrund eines Fehlers nicht gespeichert werden:"
|
||||||
other: "Konnte %{resource} nicht speichern: %{count} Fehler."
|
other: "%{count} Fehler verhinderten das Speichern von %{resource}:"
|
||||||
|
|||||||
@ -1,112 +0,0 @@
|
|||||||
de:
|
|
||||||
devise:
|
|
||||||
confirmations:
|
|
||||||
new:
|
|
||||||
resend_confirmation_instructions: Anleitung zur Bestätigung noch mal schicken
|
|
||||||
confirmed: Ihre Konto wurde erfolgreich bestätigt.
|
|
||||||
send_instructions: Sie erhalten ein wenigen Minuten eine E-Mail mit Anweisungen, wie Sie Ihr Konto bestätigen.
|
|
||||||
send_paranoid_instructions: Falls Ihre E-Mail-Adresse in unserer Datenbank existiert, werden Sie in wenigen Minuten eine E-Mail mit Anweisungen erhalten, wie Sie Ihr Konto bestätigen.
|
|
||||||
failure:
|
|
||||||
already_authenticated: "Sie sind schon angemeldet."
|
|
||||||
inactive: "Ihr Konto ist noch nicht aktiviert."
|
|
||||||
invalid: "Ungültige E-Mail-Adresse oder Passwort."
|
|
||||||
invalid_token: "Ungültiger Authentifikations-Schlüssel."
|
|
||||||
locked: "Ihr Konto ist gesperrt."
|
|
||||||
not_found_in_database: "Ungültige E-Mail-Adresse oder Passwort."
|
|
||||||
timeout: "Ihre Sitzung ist abgelaufen. Bitte melden sich erneut an, um fortzufahren."
|
|
||||||
unauthenticated: "Sie müssen sich anmelden oder registrieren, um fortfahren zu können."
|
|
||||||
unconfirmed: "Sie müssen Ihr Konto bestätigen, um fortfahren zu können."
|
|
||||||
mailer:
|
|
||||||
confirmation_instructions:
|
|
||||||
action: Mein Konto bestätigen
|
|
||||||
greeting: Willkommen %{recipient}!
|
|
||||||
instruction: ! 'Folgen Sie dem untenstehenden Link, um Ihr Konto zu bestätigen:'
|
|
||||||
subject: Anleitung zur Bestätigung Ihres Accounts
|
|
||||||
reset_password_instructions:
|
|
||||||
action: Passwort ändern
|
|
||||||
greeting: Hallo %{recipient}!
|
|
||||||
instruction: Jemand hat einen Link angefordert, um Ihr Passwort zu ändern, und Sie können das durch den unten aufgeführten Link tun.
|
|
||||||
instruction_2: Wenn Sie das nicht angefordert haben, bitte ignorieren Sie diese E-Mail.
|
|
||||||
instruction_3: Das Passwort wird nicht geändert bis Sie den obenstehenden Link abrufen, und ein neues Passwort bestimmen.
|
|
||||||
subject: Anleitung um das Passwort zurückzusetzten
|
|
||||||
unlock_instructions:
|
|
||||||
action: Mein Konto entsperren
|
|
||||||
greeting: Hallo %{recipient}!
|
|
||||||
instruction: ! 'Folgen Sie dem untenstehenden Link, um Ihr Konto zu entsperren:'
|
|
||||||
message: Ihr Konto wurde aufgrund einer großen Anzahl von fehlgeschlagenen Anmeldeversuchen gesperrt.
|
|
||||||
subject: Anleitung um Ihr Konto zu entsperren
|
|
||||||
omniauth_callbacks:
|
|
||||||
failure: "Sie konnten nicht über %{kind} authentifiziert werden, da \"%{reason}\"."
|
|
||||||
success: "Erfolgreich über %{kind} authentifiziert."
|
|
||||||
passwords:
|
|
||||||
new:
|
|
||||||
forgot_your_password: Haben Sie Ihr Passwort vergessen?
|
|
||||||
send_me_reset_password_instructions: Schicken Sie mir die Anleitung, mein Passwort zurückzusetzen
|
|
||||||
edit:
|
|
||||||
change_your_password: Passwort ändern
|
|
||||||
new_password: Neues Passwort
|
|
||||||
confirm_new_password: Neues Passwort bestätigen
|
|
||||||
change_my_password: Ändere mein Passwort
|
|
||||||
no_token: "Sie können diese Seite nicht ohne Link zum Zurücksetzen Ihres Passworts aufrufen. Wenn Sie Ihr Passwort zurücksetzen wollen, gehen Sie sicher, dass Sie die vollständige Adresse benutzt haben, die Sie mit der E-Mail erhalten haben."
|
|
||||||
send_instructions: "Sie werden eine E-Mail mit der Anleitung, wie Sie Ihr Passwort zurücksetzen können, in wenigen Minuten erhalten."
|
|
||||||
send_paranoid_instructions: "Falls Ihre E-Mail-Adresse in unserer Datenbank existiert, werden Sie in wenigen Minuten eine E-Mail mit einem Link zum Zurücksetzen Ihres Passworts erhalten."
|
|
||||||
updated: Ihr Passwort wurde erfolgreich geändert. Sie sind nun angemeldet.
|
|
||||||
updated_not_active: "Ihr Passwort wurde erfolgreich geändert."
|
|
||||||
registrations:
|
|
||||||
edit:
|
|
||||||
are_you_sure: Sind Sie sicher?
|
|
||||||
cancel_my_account: Konto löschen
|
|
||||||
leave_blank_if_you_don_t_want_to_change_it: freilassen, wenn Sie das nicht ändern wollen
|
|
||||||
title: ! '%{resource} bearbeiten'
|
|
||||||
we_need_your_current_password_to_confirm_your_changes: wir benötigen Ihr aktuelles Passwort, um die Änderung zu bestätigen
|
|
||||||
update: "Aktualisieren"
|
|
||||||
unhappy: "Unglücklich"
|
|
||||||
new:
|
|
||||||
sign_up: Registrieren
|
|
||||||
destroyed: "Auf Wiedersehen! Ihr Konto wurde erfolreich gekündigt. Wir hoffen Sie bald wiederzusehen."
|
|
||||||
signed_up: "Willkommen! Sie haben sich erfolgreich registriert."
|
|
||||||
signed_up_but_inactive: "Sie haben sich erfolgreich registriert. Aber wir konnten Sie nicht anmelden, da Ihr Konto noch nicht aktiviert ist."
|
|
||||||
signed_up_but_locked: "Sie haben sich erfolgreich registriert. Aber wir konnten Sie nicht anmelden, da Ihr Konto gesperrt ist."
|
|
||||||
signed_up_but_unconfirmed: "Eine Nachricht mit einem Aktivierungs-Link wurde an Ihre E-Mail-Adresse geschickt. Bitte öffnen Sie diesen Link, um Ihr Konto zu aktivieren."
|
|
||||||
update_needs_confirmation: "Ihr Konto wurde erfolgreich aktualisiert, aber wir müssen Ihre E-Mail-Adresse verifizieren. Bitte überprüfen Sie Ihre E-Mails und klicken auf den Bestätigungs-Link, um Ihre E-Mail-Adresse abschliessend zu bestätigen."
|
|
||||||
updated: "Ihr Konto wurde erfolgreich aktualisiert."
|
|
||||||
sessions:
|
|
||||||
signed_in: "Erfolgreich angemeldet."
|
|
||||||
signed_out: "Erfolgreich abgemeldet."
|
|
||||||
new:
|
|
||||||
sign_in: Anmelden
|
|
||||||
remember_me: Angemeldet bleiben
|
|
||||||
no_sign_in_required_for_translating: "Für das Vorschlagen von Übersetzungen ist keine Anmeldung notwendig. Die Anmeldung dient lediglich der Verwaltung durch Admins."
|
|
||||||
shared:
|
|
||||||
links:
|
|
||||||
didn_t_receive_confirmation_instructions: Keine Anleitung zur Bestätigung erhalten?
|
|
||||||
didn_t_receive_unlock_instructions: Keine Anleitung zum Entsperren erhalten?
|
|
||||||
forgot_your_password: Passwort vergessen?
|
|
||||||
sign_in: Anmelden
|
|
||||||
sign_in_with_provider: Mit %{provider} anmelden
|
|
||||||
sign_up: Registrieren
|
|
||||||
unlocks:
|
|
||||||
new:
|
|
||||||
resend_unlock_instructions: Anleitung zum Entsperren noch mal schicken
|
|
||||||
send_instructions: "Sie werden eine E-Mail mit der Anleitung, wie Sie Ihr Konto entsperren können, in wenigen Minuten erhalten."
|
|
||||||
send_paranoid_instructions: "Falls Ihr Konto existiert, werden Sie eine E-Mail mit der Anleitung, wie Sie Ihr Konto entsperren können, in wenigen Minuten erhalten."
|
|
||||||
unlocked: "Ihr Konto wurde erfolreich entsperrt. Bitte melden Sie sich an, um fortfahren zu können."
|
|
||||||
errors:
|
|
||||||
messages:
|
|
||||||
already_confirmed: "wurde schon bestätigt - bitte versuchen Sie sich anzumelden"
|
|
||||||
confirmation_period_expired: "muss innerhalb %{period} bestätigt werden - bitte fordern Sie den Link erneut an"
|
|
||||||
expired: "ist ausgelaufen - bitte fordern Sie den Link erneut an"
|
|
||||||
not_found: "nicht gefunden"
|
|
||||||
not_locked: "war nicht gesperrt"
|
|
||||||
not_saved:
|
|
||||||
one: "1 Fehler verhinderte, dass %{resource} gespeichert werden konnte:"
|
|
||||||
other: "%{count} Fehler verhinderten, dass %{resource} gespeichert werden konnte:"
|
|
||||||
activerecord:
|
|
||||||
models:
|
|
||||||
admin: "Admin"
|
|
||||||
attributes:
|
|
||||||
admin:
|
|
||||||
current_sign_in_at: "Angemeldet am"
|
|
||||||
email: "E-Mail"
|
|
||||||
password: "Passwort"
|
|
||||||
last_sign_in_at: "Zuletzt angemeldet am"
|
|
||||||
@ -22,7 +22,13 @@ Rails.application.routes.draw do
|
|||||||
resources :translations, only: [:new, :create]
|
resources :translations, only: [:new, :create]
|
||||||
end
|
end
|
||||||
|
|
||||||
devise_for :admins, skip: :registrations
|
devise_for :users, :controllers => {
|
||||||
|
:omniauth_callbacks => "users/omniauth_callbacks"
|
||||||
|
}
|
||||||
|
devise_scope :user do
|
||||||
|
delete 'sign_out', :to => 'devise/sessions#destroy', :as => :destroy_user_session
|
||||||
|
end
|
||||||
|
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
get '', to: 'dashboard#index', as: 'dashboard_index'
|
get '', to: 'dashboard#index', as: 'dashboard_index'
|
||||||
post '/update_problem_count', to: 'dashboard#update_problem_count', as: 'dashboard_update_problem_count'
|
post '/update_problem_count', to: 'dashboard#update_problem_count', as: 'dashboard_update_problem_count'
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
aXUUhT76Uhw5fnfkwOwNP1EWppHhl8QB/N0VNzb0BNcZ+S2xsq9biPVY9OakzXj24If4KV9hYw5LJkN1xmQcwxQMJ2lqdow6fkdwFuHnjPMNZyzr7G3aaLylpamkBUaY7paUfRVjJAWJge0l2cv/fZcKuRS2B2CmjqjdTfcvxHb9R/UXM1Vv10Cp88dPKlQ11SYd3g0m6W87TZL+Hut6hweKuvA6DJlnGpNH/B+yaVYPzVfkpCN7mtNv7HEtkfATMzeoPmeW10EgwfljntfPZ33l5+eOJvOidrme1vDzVKO7Ag==--7sKcvkcMXbiQWQdA--aIz51lRbRz/t/xnkvY8WTQ==
|
|
||||||
53
db/migrate/20190203145552_devise_create_users.rb
Normal file
53
db/migrate/20190203145552_devise_create_users.rb
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class DeviseCreateUsers < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
create_table :users do |t|
|
||||||
|
## OmniAuth-able
|
||||||
|
t.string :provider, null: false
|
||||||
|
t.string :uid, null: false
|
||||||
|
|
||||||
|
## User role
|
||||||
|
t.integer :role, default: 0
|
||||||
|
|
||||||
|
## Rememberable
|
||||||
|
t.datetime :remember_created_at
|
||||||
|
|
||||||
|
|
||||||
|
## Database authenticatable
|
||||||
|
# t.string :email, null: false, default: ""
|
||||||
|
# t.string :encrypted_password, null: false, default: ""
|
||||||
|
|
||||||
|
## Recoverable
|
||||||
|
# t.string :reset_password_token
|
||||||
|
# t.datetime :reset_password_sent_at
|
||||||
|
|
||||||
|
|
||||||
|
## Trackable
|
||||||
|
# t.integer :sign_in_count, default: 0, null: false
|
||||||
|
# t.datetime :current_sign_in_at
|
||||||
|
# t.datetime :last_sign_in_at
|
||||||
|
# t.string :current_sign_in_ip
|
||||||
|
# t.string :last_sign_in_ip
|
||||||
|
|
||||||
|
## Confirmable
|
||||||
|
# t.string :confirmation_token
|
||||||
|
# t.datetime :confirmed_at
|
||||||
|
# t.datetime :confirmation_sent_at
|
||||||
|
# t.string :unconfirmed_email # Only if using reconfirmable
|
||||||
|
|
||||||
|
## Lockable
|
||||||
|
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
||||||
|
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||||
|
# t.datetime :locked_at
|
||||||
|
|
||||||
|
|
||||||
|
t.timestamps null: false
|
||||||
|
end
|
||||||
|
|
||||||
|
# add_index :users, :email, unique: true
|
||||||
|
# add_index :users, :reset_password_token, unique: true
|
||||||
|
# add_index :users, :confirmation_token, unique: true
|
||||||
|
# add_index :users, :unlock_token, unique: true
|
||||||
|
end
|
||||||
|
end
|
||||||
5
db/migrate/20190203150923_add_name_to_users.rb
Normal file
5
db/migrate/20190203150923_add_name_to_users.rb
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class AddNameToUsers < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
add_column :users, :name, :string
|
||||||
|
end
|
||||||
|
end
|
||||||
8
db/migrate/20190203164629_drop_admins.rb
Normal file
8
db/migrate/20190203164629_drop_admins.rb
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
class DropAdmins < ActiveRecord::Migration[5.2]
|
||||||
|
def up
|
||||||
|
drop_table :admins
|
||||||
|
end
|
||||||
|
def down
|
||||||
|
fail ActiveRecord::IrreversibleMigration
|
||||||
|
end
|
||||||
|
end
|
||||||
29
db/schema.rb
29
db/schema.rb
@ -10,24 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2019_02_02_113250) do
|
ActiveRecord::Schema.define(version: 2019_02_03_164629) do
|
||||||
|
|
||||||
create_table "admins", force: :cascade do |t|
|
|
||||||
t.string "email", default: "", null: false
|
|
||||||
t.string "encrypted_password", default: "", null: false
|
|
||||||
t.string "reset_password_token"
|
|
||||||
t.datetime "reset_password_sent_at"
|
|
||||||
t.datetime "remember_created_at"
|
|
||||||
t.integer "sign_in_count", default: 0, null: false
|
|
||||||
t.datetime "current_sign_in_at"
|
|
||||||
t.datetime "last_sign_in_at"
|
|
||||||
t.string "current_sign_in_ip"
|
|
||||||
t.string "last_sign_in_ip"
|
|
||||||
t.datetime "created_at"
|
|
||||||
t.datetime "updated_at"
|
|
||||||
t.index ["email"], name: "index_admins_on_email", unique: true
|
|
||||||
t.index ["reset_password_token"], name: "index_admins_on_reset_password_token", unique: true
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "problems", force: :cascade do |t|
|
create_table "problems", force: :cascade do |t|
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
@ -46,4 +29,14 @@ ActiveRecord::Schema.define(version: 2019_02_02_113250) do
|
|||||||
t.index ["problem_id"], name: "index_translations_on_problem_id"
|
t.index ["problem_id"], name: "index_translations_on_problem_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "users", force: :cascade do |t|
|
||||||
|
t.string "provider", null: false
|
||||||
|
t.string "uid", null: false
|
||||||
|
t.integer "role", default: 0
|
||||||
|
t.datetime "remember_created_at"
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
t.string "name"
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
33
db/seeds.rb
33
db/seeds.rb
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
Translation.delete_all
|
Translation.delete_all
|
||||||
Problem.delete_all
|
Problem.delete_all
|
||||||
Admin.delete_all
|
User.delete_all
|
||||||
|
|
||||||
|
|
||||||
for i in 1..20 do
|
for i in 1..20 do
|
||||||
@ -17,27 +17,32 @@ end
|
|||||||
|
|
||||||
for i in 1..10 do
|
for i in 1..10 do
|
||||||
translation = Translation.create!(
|
translation = Translation.create!(
|
||||||
problem: Problem.find(i),
|
problem: Problem.find(i),
|
||||||
title: "Problem Nummer #{i}",
|
title: "Problem Nummer #{i}",
|
||||||
content: %Q(<p>Das hier ist der Inhalt von <b>Problem #{i}</b>.
|
content: %Q(<p>Das hier ist der Inhalt von <b>Problem #{i}</b>.
|
||||||
<br />Hier ist die zweite Zeile.</p>
|
<br />Hier ist die zweite Zeile.</p>
|
||||||
<p>Es können auch Formeln im Text (z.B. $1+2=3$) oder als eigene Zeile genutzt werden.</p>
|
<p>Es können auch Formeln im Text (z.B. $1+2=3$) oder als eigene Zeile genutzt werden.</p>
|
||||||
\\[ a^2 + b^2 = c^2 \\]
|
\\[ a^2 + b^2 = c^2 \\])
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
problem = Problem.find(i)
|
problem = Problem.find(i)
|
||||||
problem.set_translation(translation)
|
problem.set_translation(translation)
|
||||||
problem.save!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
Admin.create!(
|
User.create!(
|
||||||
email: 'admin@example.com',
|
provider: :developer,
|
||||||
password: 'password',
|
uid: "admin",
|
||||||
password_confirmation: 'password'
|
name: "admin",
|
||||||
|
role: 1
|
||||||
|
)
|
||||||
|
|
||||||
|
User.create!(
|
||||||
|
provider: :developer,
|
||||||
|
uid: "translator",
|
||||||
|
name: "translator"
|
||||||
)
|
)
|
||||||
|
|
||||||
p "Created #{Problem.count} problems"
|
p "Created #{Problem.count} problems"
|
||||||
p "Created #{Translation.count} translations"
|
p "Created #{Translation.count} translations"
|
||||||
p "Created #{Admin.count} admins"
|
p "Created #{User.count} users"
|
||||||
|
|||||||
@ -4,21 +4,29 @@ class Admin::DashboardControllerTest < ActionDispatch::IntegrationTest
|
|||||||
include Devise::Test::IntegrationHelpers
|
include Devise::Test::IntegrationHelpers
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
login
|
end
|
||||||
|
|
||||||
|
test "should not get index if not admin" do
|
||||||
|
login_translator
|
||||||
|
get admin_dashboard_index_url
|
||||||
|
assert_redirected_to root_url
|
||||||
end
|
end
|
||||||
|
|
||||||
test "should get index" do
|
test "should get index" do
|
||||||
|
login_admin
|
||||||
get admin_dashboard_index_url
|
get admin_dashboard_index_url
|
||||||
assert_response :success
|
assert_response :success
|
||||||
end
|
end
|
||||||
|
|
||||||
test "should post new problem count" do
|
test "should post new problem count" do
|
||||||
|
login_admin
|
||||||
post admin_dashboard_update_problem_count_url(problem_count: 15)
|
post admin_dashboard_update_problem_count_url(problem_count: 15)
|
||||||
assert_redirected_to admin_dashboard_index_url
|
assert_redirected_to admin_dashboard_index_url
|
||||||
assert_equal 15, Problem.count
|
assert_equal 15, Problem.count
|
||||||
end
|
end
|
||||||
|
|
||||||
test "should fail incorrect problem count" do
|
test "should fail incorrect problem count" do
|
||||||
|
login_admin
|
||||||
post admin_dashboard_update_problem_count_url(problem_count: 2)
|
post admin_dashboard_update_problem_count_url(problem_count: 2)
|
||||||
assert_redirected_to admin_dashboard_index_url
|
assert_redirected_to admin_dashboard_index_url
|
||||||
assert_equal 3, Problem.count
|
assert_equal 3, Problem.count
|
||||||
|
|||||||
@ -4,7 +4,7 @@ class Admin::TranslationsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
include Devise::Test::IntegrationHelpers
|
include Devise::Test::IntegrationHelpers
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
login
|
login_admin
|
||||||
@translation = translations(:translation_one)
|
@translation = translations(:translation_one)
|
||||||
@translation_alternative = translations(:translation_two_alternative)
|
@translation_alternative = translations(:translation_two_alternative)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,10 +1,17 @@
|
|||||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
# This model initially had no columns defined. If you add columns to the
|
# This model initially had no columns defined. If you add columns to the
|
||||||
# model remove the '{}' from the fixture names and add the columns immediately
|
# model remove the '{}' from the fixture names and add the columns immediately
|
||||||
# below each fixture, per the syntax in the comments below
|
# below each fixture, per the syntax in the comments below
|
||||||
#
|
#
|
||||||
|
|
||||||
admin:
|
admin:
|
||||||
email: admin@example.com
|
provider: github
|
||||||
encrypted_password: <%= Devise::Encryptor.digest(Admin, 'password') %>
|
uid: admin
|
||||||
|
name: admin
|
||||||
|
role: 1
|
||||||
|
|
||||||
|
translator:
|
||||||
|
provider: github
|
||||||
|
uid: translator
|
||||||
|
name: translator
|
||||||
|
role: 0
|
||||||
19
test/integration/translator_flow_test.rb
Normal file
19
test/integration/translator_flow_test.rb
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class TranslatorFlowTest < ActionDispatch::IntegrationTest
|
||||||
|
test "can view a problem" do
|
||||||
|
get '/problems/1'
|
||||||
|
assert_response :success
|
||||||
|
assert_select "h1", "First title Problem 1"
|
||||||
|
end
|
||||||
|
|
||||||
|
test "can login via github" do
|
||||||
|
get '/users/auth/github'
|
||||||
|
assert_response :redirect
|
||||||
|
follow_redirect!
|
||||||
|
follow_redirect!
|
||||||
|
assert_response :success
|
||||||
|
assert controller.user_signed_in?
|
||||||
|
assert_equal "translator", controller.current_user.name
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,6 +1,6 @@
|
|||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class AdminTest < ActiveSupport::TestCase
|
class UserTest < ActiveSupport::TestCase
|
||||||
# test "the truth" do
|
# test "the truth" do
|
||||||
# assert true
|
# assert true
|
||||||
# end
|
# end
|
||||||
@ -10,8 +10,23 @@ class ActiveSupport::TestCase
|
|||||||
fixtures :all
|
fixtures :all
|
||||||
|
|
||||||
# Add more helper methods to be used by all tests here...
|
# Add more helper methods to be used by all tests here...
|
||||||
def login
|
def login_admin
|
||||||
admin = admins(:admin)
|
admin = users(:admin)
|
||||||
sign_in admin
|
sign_in admin
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def login_translator
|
||||||
|
translator = users(:translator)
|
||||||
|
sign_in translator
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
class ActionDispatch::IntegrationTest
|
||||||
|
OmniAuth.config.test_mode = true
|
||||||
|
OmniAuth.config.mock_auth[:github] = OmniAuth::AuthHash.new({
|
||||||
|
provider: :github,
|
||||||
|
uid: 'translator',
|
||||||
|
name: 'translator'
|
||||||
|
})
|
||||||
end
|
end
|
||||||
Loading…
Reference in New Issue
Block a user