Xwitter 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.babelrc +26 -0
- data/.gitignore +19 -0
- data/.postcssrc.yml +3 -0
- data/.ruby-version +1 -0
- data/Gemfile +44 -0
- data/Gemfile.lock +247 -0
- data/LICENSE.txt +21 -0
- data/README.md +35 -0
- data/Rakefile +7 -0
- data/Schemafile +40 -0
- data/Xwitter.gemspec +28 -0
- data/app/assets/config/manifest.js +3 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/javascripts/application.js +16 -0
- data/app/assets/javascripts/cable.js +13 -0
- data/app/assets/javascripts/channels/.keep +0 -0
- data/app/assets/javascripts/messages.coffee +3 -0
- data/app/assets/javascripts/users.coffee +3 -0
- data/app/assets/stylesheets/application.css +15 -0
- data/app/assets/stylesheets/messages.scss +3 -0
- data/app/assets/stylesheets/scaffolds.scss +84 -0
- data/app/assets/stylesheets/users.scss +3 -0
- data/app/channels/application_cable/channel.rb +4 -0
- data/app/channels/application_cable/connection.rb +4 -0
- data/app/controllers/application_controller.rb +2 -0
- data/app/controllers/concerns/.keep +0 -0
- data/app/controllers/messages_controller.rb +79 -0
- data/app/controllers/profiles_controller.rb +48 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/messages_helper.rb +2 -0
- data/app/helpers/users_helper.rb +2 -0
- data/app/javascript/components/.gitkeep +0 -0
- data/app/javascript/packs/application.js +14 -0
- data/app/javascript/packs/application.scss +1 -0
- data/app/javascript/packs/hello_react.jsx +26 -0
- data/app/javascript/packs/hello_typescript.ts +4 -0
- data/app/javascript/packs/server_rendering.js +5 -0
- data/app/jobs/application_job.rb +2 -0
- data/app/mailers/application_mailer.rb +4 -0
- data/app/models/application_record.rb +3 -0
- data/app/models/concerns/.keep +0 -0
- data/app/models/message.rb +4 -0
- data/app/models/user.rb +6 -0
- data/app/views/layouts/application.html.slim +16 -0
- data/app/views/layouts/mailer.html.erb +13 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/messages/_form.html.slim +12 -0
- data/app/views/messages/_index.html.slim +12 -0
- data/app/views/messages/_message.json.jbuilder +2 -0
- data/app/views/messages/_show.html.slim +11 -0
- data/app/views/messages/edit.html.slim +8 -0
- data/app/views/messages/index.html.slim +20 -0
- data/app/views/messages/index.json.jbuilder +1 -0
- data/app/views/messages/new.html.slim +5 -0
- data/app/views/messages/show.html.slim +9 -0
- data/app/views/messages/show.json.jbuilder +1 -0
- data/app/views/profiles/_form.html.slim +15 -0
- data/app/views/profiles/_user.json.jbuilder +2 -0
- data/app/views/profiles/edit.html.slim +5 -0
- data/app/views/profiles/show.html.slim +8 -0
- data/app/views/profiles/show.json.jbuilder +1 -0
- data/app/views/users/confirmations/new.html.erb +16 -0
- data/app/views/users/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/users/mailer/email_changed.html.erb +7 -0
- data/app/views/users/mailer/password_change.html.erb +3 -0
- data/app/views/users/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/users/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/users/passwords/edit.html.erb +25 -0
- data/app/views/users/passwords/new.html.erb +16 -0
- data/app/views/users/registrations/edit.html.erb +43 -0
- data/app/views/users/registrations/new.html.erb +29 -0
- data/app/views/users/sessions/new.html.slim +16 -0
- data/app/views/users/shared/_links.html.slim +21 -0
- data/app/views/users/unlocks/new.html.erb +16 -0
- data/bin/bundle +3 -0
- data/bin/console +14 -0
- data/bin/rails +9 -0
- data/bin/rake +9 -0
- data/bin/setup +8 -0
- data/bin/spring +17 -0
- data/bin/update +31 -0
- data/bin/webpack +15 -0
- data/bin/webpack-dev-server +15 -0
- data/bin/yarn +11 -0
- data/config/application.rb +19 -0
- data/config/boot.rb +4 -0
- data/config/cable.yml +10 -0
- data/config/credentials.yml.enc +1 -0
- data/config/database.yml +26 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +63 -0
- data/config/environments/production.rb +96 -0
- data/config/environments/test.rb +46 -0
- data/config/initializers/application_controller_renderer.rb +8 -0
- data/config/initializers/assets.rb +14 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/content_security_policy.rb +25 -0
- data/config/initializers/cookies_serializer.rb +5 -0
- data/config/initializers/devise.rb +290 -0
- data/config/initializers/filter_parameter_logging.rb +4 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/mime_types.rb +4 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/devise.en.yml +64 -0
- data/config/locales/en.yml +33 -0
- data/config/puma.rb +34 -0
- data/config/routes.rb +7 -0
- data/config/spring.rb +6 -0
- data/config/storage.yml +34 -0
- data/config/webpack/development.js +5 -0
- data/config/webpack/environment.js +5 -0
- data/config/webpack/loaders/typescript.js +6 -0
- data/config/webpack/production.js +5 -0
- data/config/webpack/test.js +5 -0
- data/config/webpacker.yml +71 -0
- data/config.ru +5 -0
- data/db/seeds.rb +7 -0
- data/lib/Xwitter/version.rb +3 -0
- data/lib/Xwitter.rb +6 -0
- data/lib/assets/.keep +0 -0
- data/lib/tasks/.keep +0 -0
- data/log/.keep +0 -0
- data/package.json +20 -0
- data/public/404.html +67 -0
- data/public/422.html +67 -0
- data/public/500.html +66 -0
- data/public/apple-touch-icon-precomposed.png +0 -0
- data/public/apple-touch-icon.png +0 -0
- data/public/favicon.ico +0 -0
- data/public/robots.txt +1 -0
- data/storage/.keep +0 -0
- data/tsconfig.json +20 -0
- data/vendor/.keep +0 -0
- data/yarn.lock +6051 -0
- metadata +206 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
class MessagesController < ApplicationController
|
|
2
|
+
before_action :set_message, only: [:show, :edit, :update, :destroy]
|
|
3
|
+
|
|
4
|
+
# GET /messages
|
|
5
|
+
# GET /messages.json
|
|
6
|
+
def index
|
|
7
|
+
if user_signed_in? && current_user.name.blank?
|
|
8
|
+
redirect_to edit_profile_url
|
|
9
|
+
return
|
|
10
|
+
end
|
|
11
|
+
@messages = Message.all
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# GET /messages/1
|
|
15
|
+
# GET /messages/1.json
|
|
16
|
+
def show
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# GET /messages/new
|
|
20
|
+
def new
|
|
21
|
+
@message = Message.new
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# GET /messages/1/edit
|
|
25
|
+
def edit
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# POST /messages
|
|
29
|
+
# POST /messages.json
|
|
30
|
+
def create
|
|
31
|
+
@message = Message.new(message_params)
|
|
32
|
+
@message.user = current_user
|
|
33
|
+
|
|
34
|
+
respond_to do |format|
|
|
35
|
+
if @message.save
|
|
36
|
+
format.html { redirect_to @message, notice: 'Message was successfully created.' }
|
|
37
|
+
format.json { render :show, status: :created, location: @message }
|
|
38
|
+
else
|
|
39
|
+
format.html { render :new }
|
|
40
|
+
format.json { render json: @message.errors, status: :unprocessable_entity }
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# PATCH/PUT /messages/1
|
|
46
|
+
# PATCH/PUT /messages/1.json
|
|
47
|
+
def update
|
|
48
|
+
respond_to do |format|
|
|
49
|
+
if @message.update(message_params)
|
|
50
|
+
format.html { redirect_to @message, notice: 'Message was successfully updated.' }
|
|
51
|
+
format.json { render :show, status: :ok, location: @message }
|
|
52
|
+
else
|
|
53
|
+
format.html { render :edit }
|
|
54
|
+
format.json { render json: @message.errors, status: :unprocessable_entity }
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# DELETE /messages/1
|
|
60
|
+
# DELETE /messages/1.json
|
|
61
|
+
def destroy
|
|
62
|
+
@message.destroy
|
|
63
|
+
respond_to do |format|
|
|
64
|
+
format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }
|
|
65
|
+
format.json { head :no_content }
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
private
|
|
70
|
+
# Use callbacks to share common setup or constraints between actions.
|
|
71
|
+
def set_message
|
|
72
|
+
@message = Message.find(params[:id])
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
|
76
|
+
def message_params
|
|
77
|
+
params.require(:message).permit(:text)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
class ProfilesController < ApplicationController
|
|
2
|
+
before_action :set_user, only: [:show, :edit, :update, :destroy]
|
|
3
|
+
|
|
4
|
+
# GET /users/1
|
|
5
|
+
# GET /users/1.json
|
|
6
|
+
def show
|
|
7
|
+
@user = User.find_by(name: params[:username])
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# GET /users/1/edit
|
|
11
|
+
def edit
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# PATCH/PUT /users/1
|
|
15
|
+
# PATCH/PUT /users/1.json
|
|
16
|
+
def update
|
|
17
|
+
respond_to do |format|
|
|
18
|
+
if @user.update(user_params)
|
|
19
|
+
format.html { redirect_to root_url, notice: 'User was successfully updated.' }
|
|
20
|
+
format.json { render :show, status: :ok, location: @user }
|
|
21
|
+
else
|
|
22
|
+
format.html { render :edit }
|
|
23
|
+
format.json { render json: @user.errors, status: :unprocessable_entity }
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# DELETE /users/1
|
|
29
|
+
# DELETE /users/1.json
|
|
30
|
+
def destroy
|
|
31
|
+
@user.destroy
|
|
32
|
+
respond_to do |format|
|
|
33
|
+
format.html { redirect_to root_url, notice: 'User was successfully destroyed.' }
|
|
34
|
+
format.json { head :no_content }
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
private
|
|
39
|
+
# Use callbacks to share common setup or constraints between actions.
|
|
40
|
+
def set_user
|
|
41
|
+
@user = current_user
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
|
45
|
+
def user_params
|
|
46
|
+
params.require(:user).permit(:name, :screen_name)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint no-console:0 */
|
|
2
|
+
// This file is automatically compiled by Webpack, along with any other files
|
|
3
|
+
// present in this directory. You're encouraged to place your actual application logic in
|
|
4
|
+
// a relevant structure within app/javascript and only use these pack files to reference
|
|
5
|
+
// that code so it'll be compiled.
|
|
6
|
+
//
|
|
7
|
+
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
|
|
8
|
+
// layout file, like app/views/layouts/application.html.erb
|
|
9
|
+
|
|
10
|
+
console.log('Hello World from Webpacker')
|
|
11
|
+
// Support component names relative to this directory:
|
|
12
|
+
var componentRequireContext = require.context("components", true)
|
|
13
|
+
var ReactRailsUJS = require("react_ujs")
|
|
14
|
+
ReactRailsUJS.useContext(componentRequireContext)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '~bootstrap/dist/css/bootstrap'
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Run this example by adding <%= javascript_pack_tag 'hello_react' %> to the head of your layout file,
|
|
2
|
+
// like app/views/layouts/application.html.erb. All it does is render <div>Hello React</div> at the bottom
|
|
3
|
+
// of the page.
|
|
4
|
+
|
|
5
|
+
import React from 'react'
|
|
6
|
+
import ReactDOM from 'react-dom'
|
|
7
|
+
import PropTypes from 'prop-types'
|
|
8
|
+
|
|
9
|
+
const Hello = props => (
|
|
10
|
+
<div>Hello {props.name}!</div>
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
Hello.defaultProps = {
|
|
14
|
+
name: 'David'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
Hello.propTypes = {
|
|
18
|
+
name: PropTypes.string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
22
|
+
ReactDOM.render(
|
|
23
|
+
<Hello name="React" />,
|
|
24
|
+
document.body.appendChild(document.createElement('div')),
|
|
25
|
+
)
|
|
26
|
+
})
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// By default, this pack is loaded for server-side rendering.
|
|
2
|
+
// It must expose react_ujs as `ReactRailsUJS` and prepare a require context.
|
|
3
|
+
var componentRequireContext = require.context("components", true)
|
|
4
|
+
var ReactRailsUJS = require("react_ujs")
|
|
5
|
+
ReactRailsUJS.useContext(componentRequireContext)
|
|
File without changes
|
data/app/models/user.rb
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
doctype html
|
|
2
|
+
html
|
|
3
|
+
head
|
|
4
|
+
title Xwitter
|
|
5
|
+
= csrf_meta_tags
|
|
6
|
+
= csp_meta_tag
|
|
7
|
+
= javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
|
|
8
|
+
= javascript_pack_tag 'application'
|
|
9
|
+
= stylesheet_pack_tag 'application'
|
|
10
|
+
= stylesheet_link_tag 'https://cdnjs.cloudflare.com/ajax/libs/open-iconic/1.1.1/font/css/open-iconic-bootstrap.min.css'
|
|
11
|
+
body
|
|
12
|
+
.navbar
|
|
13
|
+
= link_to '/', root_path
|
|
14
|
+
|
|
15
|
+
.container
|
|
16
|
+
= yield
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= yield %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
= form_for @message do |f|
|
|
2
|
+
- if @message.errors.any?
|
|
3
|
+
#error_explanation
|
|
4
|
+
h2 = "#{pluralize(@message.errors.count, "error")} prohibited this message from being saved:"
|
|
5
|
+
ul
|
|
6
|
+
- @message.errors.full_messages.each do |message|
|
|
7
|
+
li = message
|
|
8
|
+
|
|
9
|
+
.field
|
|
10
|
+
= f.label :text
|
|
11
|
+
= f.text_area :text
|
|
12
|
+
.actions = f.submit
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
- messages.each do |message|
|
|
2
|
+
div
|
|
3
|
+
p
|
|
4
|
+
= message.user.screen_name
|
|
5
|
+
|
|
|
6
|
+
= link_to '@' + message.user.name, '/' + message.user.name
|
|
7
|
+
|
|
8
|
+
p= message.text
|
|
9
|
+
p= l message.created_at
|
|
10
|
+
- if user_signed_in? && message.user == current_user
|
|
11
|
+
.oi.oi-trash
|
|
12
|
+
= link_to 'Destroy', message, data: { confirm: 'Are you sure?' }, method: :delete
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
div
|
|
2
|
+
p
|
|
3
|
+
= message.user.screen_name
|
|
4
|
+
|
|
|
5
|
+
= link_to '@' + message.user.name, '/' + message.user.name
|
|
6
|
+
|
|
7
|
+
p= message.text
|
|
8
|
+
p= l message.created_at
|
|
9
|
+
- if user_signed_in? && message.user == current_user
|
|
10
|
+
.oi.oi-trash
|
|
11
|
+
= link_to 'Destroy', message, data: { confirm: 'Are you sure?' }, method: :delete
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
h1
|
|
2
|
+
| Xwitter
|
|
3
|
+
- if user_signed_in?
|
|
4
|
+
= link_to 'New Message', new_message_path, class: 'btn btn-primary'
|
|
5
|
+
- else
|
|
6
|
+
= link_to 'Sign in', new_user_session_path, class: 'btn btn-primary'
|
|
7
|
+
= link_to 'Sign up', new_user_registration_path, class: 'btn btn-default'
|
|
8
|
+
|
|
9
|
+
- @messages.each do |message|
|
|
10
|
+
div
|
|
11
|
+
p
|
|
12
|
+
= message.user.screen_name
|
|
13
|
+
|
|
|
14
|
+
= link_to '@' + message.user.name, '/' + message.user.name
|
|
15
|
+
|
|
16
|
+
p= message.text
|
|
17
|
+
p= l message.created_at
|
|
18
|
+
- if user_signed_in? && message.user == current_user
|
|
19
|
+
.oi.oi-trash
|
|
20
|
+
= link_to 'Destroy', message, data: { confirm: 'Are you sure?' }, method: :delete
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
json.array! @messages, partial: 'messages/message', as: :message
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
json.partial! "messages/message", message: @message
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
= form_for @user, url: profile_path do |f|
|
|
2
|
+
- if @user.errors.any?
|
|
3
|
+
#error_explanation
|
|
4
|
+
h2 = "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
|
|
5
|
+
ul
|
|
6
|
+
- @user.errors.full_messages.each do |message|
|
|
7
|
+
li = message
|
|
8
|
+
|
|
9
|
+
.field
|
|
10
|
+
= f.label :name
|
|
11
|
+
= f.text_field :name
|
|
12
|
+
.field
|
|
13
|
+
= f.label :screen_name
|
|
14
|
+
= f.text_field :screen_name
|
|
15
|
+
.actions = f.submit
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
json.partial! "users/user", user: @user
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<h2>Resend confirmation instructions</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
|
4
|
+
<%= devise_error_messages! %>
|
|
5
|
+
|
|
6
|
+
<div class="field">
|
|
7
|
+
<%= f.label :email %><br />
|
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="actions">
|
|
12
|
+
<%= f.submit "Resend confirmation instructions" %>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<%= render "users/shared/links" %>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<p>Hello <%= @email %>!</p>
|
|
2
|
+
|
|
3
|
+
<% if @resource.try(:unconfirmed_email?) %>
|
|
4
|
+
<p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
|
|
5
|
+
<% else %>
|
|
6
|
+
<p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
|
|
7
|
+
<% end %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
|
2
|
+
|
|
3
|
+
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
|
|
4
|
+
|
|
5
|
+
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
|
|
6
|
+
|
|
7
|
+
<p>If you didn't request this, please ignore this email.</p>
|
|
8
|
+
<p>Your password won't change until you access the link above and create a new one.</p>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
|
2
|
+
|
|
3
|
+
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
|
|
4
|
+
|
|
5
|
+
<p>Click the link below to unlock your account:</p>
|
|
6
|
+
|
|
7
|
+
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<h2>Change your password</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
|
4
|
+
<%= devise_error_messages! %>
|
|
5
|
+
<%= f.hidden_field :reset_password_token %>
|
|
6
|
+
|
|
7
|
+
<div class="field">
|
|
8
|
+
<%= f.label :password, "New password" %><br />
|
|
9
|
+
<% if @minimum_password_length %>
|
|
10
|
+
<em>(<%= @minimum_password_length %> characters minimum)</em><br />
|
|
11
|
+
<% end %>
|
|
12
|
+
<%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="field">
|
|
16
|
+
<%= f.label :password_confirmation, "Confirm new password" %><br />
|
|
17
|
+
<%= f.password_field :password_confirmation, autocomplete: "off" %>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="actions">
|
|
21
|
+
<%= f.submit "Change my password" %>
|
|
22
|
+
</div>
|
|
23
|
+
<% end %>
|
|
24
|
+
|
|
25
|
+
<%= render "users/shared/links" %>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<h2>Forgot your password?</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
|
4
|
+
<%= devise_error_messages! %>
|
|
5
|
+
|
|
6
|
+
<div class="field">
|
|
7
|
+
<%= f.label :email %><br />
|
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="actions">
|
|
12
|
+
<%= f.submit "Send me reset password instructions" %>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<%= render "users/shared/links" %>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
|
4
|
+
<%= devise_error_messages! %>
|
|
5
|
+
|
|
6
|
+
<div class="field">
|
|
7
|
+
<%= f.label :email %><br />
|
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
|
12
|
+
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
|
|
13
|
+
<% end %>
|
|
14
|
+
|
|
15
|
+
<div class="field">
|
|
16
|
+
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
|
|
17
|
+
<%= f.password_field :password, autocomplete: "new-password" %>
|
|
18
|
+
<% if @minimum_password_length %>
|
|
19
|
+
<br />
|
|
20
|
+
<em><%= @minimum_password_length %> characters minimum</em>
|
|
21
|
+
<% end %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="field">
|
|
25
|
+
<%= f.label :password_confirmation %><br />
|
|
26
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="field">
|
|
30
|
+
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
|
|
31
|
+
<%= f.password_field :current_password, autocomplete: "current-password" %>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="actions">
|
|
35
|
+
<%= f.submit "Update" %>
|
|
36
|
+
</div>
|
|
37
|
+
<% end %>
|
|
38
|
+
|
|
39
|
+
<h3>Cancel my account</h3>
|
|
40
|
+
|
|
41
|
+
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
|
|
42
|
+
|
|
43
|
+
<%= link_to "Back", :back %>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<h2>Sign up</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
|
4
|
+
<%= devise_error_messages! %>
|
|
5
|
+
|
|
6
|
+
<div class="field">
|
|
7
|
+
<%= f.label :email %><br />
|
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="field">
|
|
12
|
+
<%= f.label :password %>
|
|
13
|
+
<% if @minimum_password_length %>
|
|
14
|
+
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
|
15
|
+
<% end %><br />
|
|
16
|
+
<%= f.password_field :password, autocomplete: "new-password" %>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="field">
|
|
20
|
+
<%= f.label :password_confirmation %><br />
|
|
21
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="actions">
|
|
25
|
+
<%= f.submit "Sign up" %>
|
|
26
|
+
</div>
|
|
27
|
+
<% end %>
|
|
28
|
+
|
|
29
|
+
<%= render "users/shared/links" %>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
h2 Log in
|
|
2
|
+
|
|
3
|
+
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
|
4
|
+
.field
|
|
5
|
+
= f.label :email
|
|
6
|
+
= f.email_field :email, autofocus: true, autocomplete: "email"
|
|
7
|
+
.field
|
|
8
|
+
= f.label :password
|
|
9
|
+
= f.password_field :password, autocomplete: "current-password"
|
|
10
|
+
.field
|
|
11
|
+
= f.check_box :remember_me
|
|
12
|
+
= f.label :remember_me
|
|
13
|
+
.actions
|
|
14
|
+
= f.submit "Log in"
|
|
15
|
+
|
|
16
|
+
= render "users/shared/links"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
- if controller_name != 'sessions'
|
|
2
|
+
= link_to "Log in", new_session_path(resource_name)
|
|
3
|
+
br
|
|
4
|
+
- if devise_mapping.registerable? && controller_name != 'registrations'
|
|
5
|
+
= link_to "Sign up", new_registration_path(resource_name)
|
|
6
|
+
br
|
|
7
|
+
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
|
|
8
|
+
= link_to "Forgot your password?", new_password_path(resource_name)
|
|
9
|
+
br
|
|
10
|
+
- if devise_mapping.confirmable? && controller_name != 'confirmations'
|
|
11
|
+
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
|
|
12
|
+
br
|
|
13
|
+
- if devise_mapping.lockable? && \
|
|
14
|
+
resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
|
|
15
|
+
= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
|
|
16
|
+
br
|
|
17
|
+
- if devise_mapping.omniauthable?
|
|
18
|
+
- resource_class.omniauth_providers.each do |provider|
|
|
19
|
+
= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}",
|
|
20
|
+
omniauth_authorize_path(resource_name, provider)
|
|
21
|
+
br
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<h2>Resend unlock instructions</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
|
4
|
+
<%= devise_error_messages! %>
|
|
5
|
+
|
|
6
|
+
<div class="field">
|
|
7
|
+
<%= f.label :email %><br />
|
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="actions">
|
|
12
|
+
<%= f.submit "Resend unlock instructions" %>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<%= render "users/shared/links" %>
|
data/bin/bundle
ADDED