Form to delete your own account

This commit is contained in:
Brenda Wallace
2017-05-21 21:51:44 +12:00
parent aee90268a5
commit b538330785
7 changed files with 16 additions and 19 deletions

View File

@@ -55,6 +55,7 @@ module ApplicationHelper
# Falls back to Gravatar
#
def avatar_uri(member, size = 150)
return unless member
if member.preferred_avatar_uri.present?
# Some avatars support different sizes
# http://graph.facebook.com/12345678/picture?width=150&height=150

View File

@@ -6,7 +6,10 @@
.col-md-11
.comment-meta
Posted by
= link_to comment.author.login_name, member_path(comment.author)
- if comment.author
= link_to comment.author.login_name, member_path(comment.author)
- else
Deleted
on
= comment.created_at
- if comment.updated_at > comment.created_at

View File

@@ -5,7 +5,7 @@
.form-group
= f.label :current_password, "Password required to delete", class: 'control-label col-md-2'
.col-md-4
= f.password_field :current_password, :class => 'form-control', id: 'current_pw_for_delete'
= f.password_field :current_password, class: 'form-control', id: 'current_pw_for_delete'
.form-group
.form-actions.col-md-offset-2.col-md-8

View File

@@ -1,4 +1,5 @@
= link_to image_tag(avatar_uri(member, 150),
alt: '',
class: 'img img-responsive avatar'),
member_path(member)
- if member
= link_to image_tag(avatar_uri(member, 150),
alt: '',
class: 'img img-responsive avatar'),
member_path(member)

View File

@@ -10,7 +10,10 @@
.post-meta
%p
Posted by
= link_to post.author.login_name, member_path(post.author)
- if post.author
= link_to post.author.login_name, member_path(post.author)
- else
Deleted
- if post.forum
in
= link_to post.forum, post.forum

View File

@@ -7,7 +7,7 @@
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
- unless current_member
- if @post.author && !current_member
.alert.alert-info
= link_to @post.author.login_name, member_path(@post.author)
is using

View File

@@ -239,8 +239,6 @@ ActiveRecord::Schema.define(version: 20170520060252) do
t.float "longitude"
t.decimal "area"
t.string "area_unit"
t.integer "width"
t.integer "length"
end
add_index "gardens", ["owner_id"], name: "index_gardens_on_owner_id", using: :btree
@@ -490,14 +488,5 @@ ActiveRecord::Schema.define(version: 20170520060252) do
add_index "seeds", ["slug"], name: "index_seeds_on_slug", unique: true, using: :btree
create_table "squares", force: :cascade do |t|
t.integer "garden_id"
t.integer "x"
t.integer "y"
t.integer "planting_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_foreign_key "harvests", "plantings"
end