savage-beast 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.
- data/.gitignore +2 -0
- data/README.rdoc +42 -0
- data/Rakefile +25 -0
- data/VERSION +1 -0
- data/app/controllers/application.rb +6 -0
- data/app/controllers/beast_application_controller.rb +3 -0
- data/app/controllers/forums_controller.rb +64 -0
- data/app/controllers/moderators_controller.rb +10 -0
- data/app/controllers/monitorships_controller.rb +22 -0
- data/app/controllers/posts_controller.rb +134 -0
- data/app/controllers/topics_controller.rb +110 -0
- data/app/helpers/count_helper.rb +13 -0
- data/app/helpers/forums_helper.rb +15 -0
- data/app/helpers/moderators_helper.rb +2 -0
- data/app/helpers/monitorships_helper.rb +2 -0
- data/app/helpers/posts_helper.rb +3 -0
- data/app/helpers/topics_helper.rb +3 -0
- data/app/models/forum.rb +26 -0
- data/app/models/moderatorship.rb +6 -0
- data/app/models/monitorship.rb +5 -0
- data/app/models/monitorships_sweeper.rb +9 -0
- data/app/models/post.rb +33 -0
- data/app/models/posts_sweeper.rb +12 -0
- data/app/models/topic.rb +94 -0
- data/app/views/forums/_form.html.erb +21 -0
- data/app/views/forums/edit.html.erb +12 -0
- data/app/views/forums/index.html.erb +77 -0
- data/app/views/forums/new.html.erb +10 -0
- data/app/views/forums/show.html.erb +94 -0
- data/app/views/layouts/_head.html.erb +34 -0
- data/app/views/layouts/_post.rss.builder +9 -0
- data/app/views/layouts/application.html.erb +29 -0
- data/app/views/layouts/beast.html.erb +29 -0
- data/app/views/monitorships/create.js.rjs +4 -0
- data/app/views/monitorships/destroy.js.rjs +4 -0
- data/app/views/posts/_edit.html.erb +38 -0
- data/app/views/posts/edit.html.erb +14 -0
- data/app/views/posts/edit.js.rjs +6 -0
- data/app/views/posts/index.html.erb +53 -0
- data/app/views/posts/index.rss.builder +20 -0
- data/app/views/posts/monitored.html.erb +55 -0
- data/app/views/posts/monitored.rss.builder +15 -0
- data/app/views/posts/update.js.rjs +3 -0
- data/app/views/topics/_form.html.erb +28 -0
- data/app/views/topics/edit.html.erb +10 -0
- data/app/views/topics/index.html.erb +2 -0
- data/app/views/topics/new.html.erb +18 -0
- data/app/views/topics/show.html.erb +183 -0
- data/app/views/topics/show.rss.builder +16 -0
- data/config/routes.rb +18 -0
- data/generators/beast/beast_generator.rb +88 -0
- data/generators/beast/templates/migrations/create_savage_tables.rb +73 -0
- data/generators/beast/templates/public/images/clearbits/_readme.txt +12 -0
- data/generators/beast/templates/public/images/clearbits/add.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/addressbook.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/alert.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/apple.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_e.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_n.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_ne.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_nw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_s.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_se.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_sw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_w.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_e.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_n.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_ne.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_nw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_s.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_se.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_sw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_w.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_e.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_n.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_ne.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_nw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_s.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_se.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_sw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_w.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/ascii.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/back.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_blank.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_circle.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_rounded.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_rounded_ne.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_rounded_nw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_rounded_se.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_rounded_sw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bigsmile.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/binary.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/blah.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bstop.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/buy.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/calday.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/calendar.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/camera.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/cart.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/cd.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/cellphone.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/chat.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/check.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/close.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/comment.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/cube.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/day.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/denied.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/document.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/download.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/edit.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/eject.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/equalizer.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/first.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/flag.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/flash.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/folder.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/forward.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/frown.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/ftp.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/graph.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/heart.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/home.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/html.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/ipod.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/last.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/lock.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/loop.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/mail.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/man.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/manman.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/music.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/mute.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/mute_centered.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/newwindow.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/next.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/night.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/open.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/pause.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/phone.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/play.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/previous.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/quicktime.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/redo.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/reload.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/sad.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/save.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/scream.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/search.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/seconds.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/smile.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/smirk.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/star.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/stop.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/subtract.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/switch.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/target.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/tcp.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/time.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/toggle.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/tongue.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/tools.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/trackback.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/trash.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/tv.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/type.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/undo.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/unlock.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/upload.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/user.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/video.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/volume_high.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/volume_low.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/wifi.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/window.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/woman.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/womanman.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/work.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/zoomin.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/zoomout.gif +0 -0
- data/generators/beast/templates/public/images/feed-icon.png +0 -0
- data/generators/beast/templates/public/images/rails.png +0 -0
- data/generators/beast/templates/public/images/reply_background.png +0 -0
- data/generators/beast/templates/public/images/small_circle.gif +0 -0
- data/generators/beast/templates/public/images/spinner.gif +0 -0
- data/generators/beast/templates/public/images/spinner_black.gif +0 -0
- data/generators/beast/templates/public/images/spinner_bounce.gif +0 -0
- data/generators/beast/templates/public/javascripts/beast.js +80 -0
- data/generators/beast/templates/public/stylesheets/display.css +941 -0
- data/lang/en.yml +206 -0
- data/lib/beast.rb +79 -0
- data/lib/savage_beast/application_helper.rb +91 -0
- data/lib/savage_beast/authentication_system.rb +47 -0
- data/lib/savage_beast/user_init.rb +79 -0
- data/lib/tasks/capistrano.rake +90 -0
- data/lib/tasks/deploy_edge.rake +44 -0
- data/lib/tasks/savage_beast.rake +133 -0
- data/po/beast.pot +712 -0
- data/po/nl/beast.po +700 -0
- data/tested_plugins/acts_as_list/README +23 -0
- data/tested_plugins/acts_as_list/init.rb +3 -0
- data/tested_plugins/acts_as_list/lib/active_record/acts/list.rb +256 -0
- data/tested_plugins/acts_as_list/test/list_test.rb +332 -0
- data/tested_plugins/gibberish/LICENSE +18 -0
- data/tested_plugins/gibberish/README +118 -0
- data/tested_plugins/gibberish/Rakefile +14 -0
- data/tested_plugins/gibberish/init.rb +3 -0
- data/tested_plugins/gibberish/lang/es.yml +3 -0
- data/tested_plugins/gibberish/lang/fr.yml +3 -0
- data/tested_plugins/gibberish/lib/gibberish.rb +8 -0
- data/tested_plugins/gibberish/lib/gibberish/localize.rb +88 -0
- data/tested_plugins/gibberish/lib/gibberish/string_ext.rb +17 -0
- data/tested_plugins/gibberish/test/gibberish_test.rb +203 -0
- data/tested_plugins/gibberish/test/lang/es.yml +1 -0
- data/tested_plugins/gibberish/test/lang/fr.yml +1 -0
- data/tested_plugins/mislav-will_paginate/CHANGELOG.rdoc +110 -0
- data/tested_plugins/mislav-will_paginate/LICENSE +18 -0
- data/tested_plugins/mislav-will_paginate/README.rdoc +107 -0
- data/tested_plugins/mislav-will_paginate/Rakefile +53 -0
- data/tested_plugins/mislav-will_paginate/examples/apple-circle.gif +0 -0
- data/tested_plugins/mislav-will_paginate/examples/index.haml +69 -0
- data/tested_plugins/mislav-will_paginate/examples/index.html +92 -0
- data/tested_plugins/mislav-will_paginate/examples/pagination.css +90 -0
- data/tested_plugins/mislav-will_paginate/examples/pagination.sass +91 -0
- data/tested_plugins/mislav-will_paginate/init.rb +1 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate.rb +78 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/array.rb +16 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/collection.rb +146 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/core_ext.rb +32 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/finder.rb +264 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/named_scope.rb +170 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/named_scope_patch.rb +37 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/version.rb +9 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/view_helpers.rb +402 -0
- data/tested_plugins/mislav-will_paginate/test/boot.rb +21 -0
- data/tested_plugins/mislav-will_paginate/test/collection_test.rb +143 -0
- data/tested_plugins/mislav-will_paginate/test/console +8 -0
- data/tested_plugins/mislav-will_paginate/test/database.yml +22 -0
- data/tested_plugins/mislav-will_paginate/test/finder_test.rb +476 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/admin.rb +3 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/developer.rb +14 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/developers_projects.yml +13 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/project.rb +15 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/projects.yml +6 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/replies.yml +29 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/reply.rb +7 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/schema.rb +38 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/topic.rb +10 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/topics.yml +30 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/user.rb +2 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/users.yml +35 -0
- data/tested_plugins/mislav-will_paginate/test/helper.rb +40 -0
- data/tested_plugins/mislav-will_paginate/test/lib/activerecord_test_case.rb +43 -0
- data/tested_plugins/mislav-will_paginate/test/lib/activerecord_test_connector.rb +75 -0
- data/tested_plugins/mislav-will_paginate/test/lib/load_fixtures.rb +11 -0
- data/tested_plugins/mislav-will_paginate/test/lib/view_test_process.rb +178 -0
- data/tested_plugins/mislav-will_paginate/test/tasks.rake +59 -0
- data/tested_plugins/mislav-will_paginate/test/view_test.rb +365 -0
- data/tested_plugins/white_list/README +29 -0
- data/tested_plugins/white_list/Rakefile +22 -0
- data/tested_plugins/white_list/init.rb +2 -0
- data/tested_plugins/white_list/lib/white_list_helper.rb +97 -0
- data/tested_plugins/white_list/test/white_list_test.rb +132 -0
- data/tested_plugins/white_list_formatted_content/init.rb +27 -0
- metadata +322 -0
data/lang/en.yml
ADDED
@@ -0,0 +1,206 @@
|
|
1
|
+
en:
|
2
|
+
beast_title: "Beast"
|
3
|
+
beast_sidebar_title: "What is Beast?"
|
4
|
+
beast_sidebar_body: A small, light-weight forum in Rails with a scary name and a goal of around 500 lines of code when we're done.
|
5
|
+
beast_welcome: Welcome to Beast
|
6
|
+
|
7
|
+
forum_title: Forum
|
8
|
+
forums_title: Forums
|
9
|
+
new_forum: New forum
|
10
|
+
edit_forum: Edit forum
|
11
|
+
save_forum: Save forum
|
12
|
+
create_new_forum: Create new forum
|
13
|
+
|
14
|
+
forum_is_unmoderated: This forum is currently unmoderated.
|
15
|
+
please_be_courteous: Please always be courteous.
|
16
|
+
|
17
|
+
topic_title: Topic
|
18
|
+
Topics_title: Topics
|
19
|
+
edit_topic: Edit topic
|
20
|
+
new_topic: New topic
|
21
|
+
topic_posted_by: "{{title}} posted by {{user}} @ {{date}}"
|
22
|
+
topic_replied_by: "{{title}} replied by {{user}} @ {{date}}"
|
23
|
+
locked_topic: This topic is locked
|
24
|
+
monitoring_topic: Monitoring topic
|
25
|
+
monitor_topic: Monitor topic
|
26
|
+
post_topic: Post topic
|
27
|
+
reply_to_topic: Reply to topic
|
28
|
+
save_reply: Save Reply
|
29
|
+
|
30
|
+
post_title: Post
|
31
|
+
posts_title: Posts
|
32
|
+
edit_post: Edit post
|
33
|
+
delete_post: Delete post
|
34
|
+
last_post: Last Post
|
35
|
+
recent_posts: Recent Posts
|
36
|
+
|
37
|
+
voices_title: Voices
|
38
|
+
monitor_title: Monitor
|
39
|
+
users_title: Users
|
40
|
+
recent_activity: Recent Activity
|
41
|
+
no_recent_activity: No recent activity
|
42
|
+
users_online: Users Online
|
43
|
+
change_login: Please change your login
|
44
|
+
gravatar_notice: To have your very own avatar displayed on this forum visit {{gravatar}} and sign up for a free gravatar.
|
45
|
+
change_email_or_password: Change e-mail or password
|
46
|
+
name_or_login: Name / Login
|
47
|
+
reset_password: Reset Password
|
48
|
+
user_profile: User Profile
|
49
|
+
update_profile: Update Profile
|
50
|
+
find_a_user: Find a User
|
51
|
+
display_name_or_login: Display name or login
|
52
|
+
users: users
|
53
|
+
active: active
|
54
|
+
lurking: lurking
|
55
|
+
add_as_moderator: Add as moderator
|
56
|
+
user_is_an_administrator: User is an administrator
|
57
|
+
monitored: monitored
|
58
|
+
user_since: User since
|
59
|
+
|
60
|
+
pages_title: Pages
|
61
|
+
next_page: Next Page
|
62
|
+
next: "Next »"
|
63
|
+
previous: "« Previous"
|
64
|
+
topics_count:
|
65
|
+
one: "{{count}} topic"
|
66
|
+
other: "{{count}} topics"
|
67
|
+
posts_count:
|
68
|
+
one: "{{count}} post"
|
69
|
+
other: "{{count}} posts"
|
70
|
+
voices_count:
|
71
|
+
one: "{{count}} voice"
|
72
|
+
other: "{{count}} voices"
|
73
|
+
posts_count_found:
|
74
|
+
one: "{{count}} post found"
|
75
|
+
other: "{{count}} posts found"
|
76
|
+
cancel: cancel
|
77
|
+
page: "page {{page}}"
|
78
|
+
|
79
|
+
# field titles
|
80
|
+
admin_title: Admin
|
81
|
+
title_title: Title
|
82
|
+
position_title: Position
|
83
|
+
description_title: Description
|
84
|
+
edit_title: Edit
|
85
|
+
moderators_title: Moderators
|
86
|
+
views_title: Views
|
87
|
+
settings_title: Settings
|
88
|
+
logout_title: Logout
|
89
|
+
signup_title: Signup
|
90
|
+
login_title: Login
|
91
|
+
save_title: Save
|
92
|
+
password_title: Password
|
93
|
+
sticky_title: Sticky
|
94
|
+
locked_title: Locked
|
95
|
+
body_title: Body
|
96
|
+
display_name_title: Display Name
|
97
|
+
identity_url_title: Identity Url
|
98
|
+
website_title: Website
|
99
|
+
bio_title: Bio
|
100
|
+
email_title: Email
|
101
|
+
basics_title: Basics
|
102
|
+
avatars_title: Avatars
|
103
|
+
search_title: Search
|
104
|
+
|
105
|
+
by: by
|
106
|
+
save_changes: Save Changes
|
107
|
+
remember_me: Remember me on this computer
|
108
|
+
delete_conf: "Delete this {thing} forever?"
|
109
|
+
email_directions: Enter your email, and a brand new login key will be sent to you. Click the link in the email to log in, and then change your password.
|
110
|
+
email_submit: E-mail me the link
|
111
|
+
powered_by: Powered by
|
112
|
+
and: and
|
113
|
+
users_monitored_topics: "{{name}}'s Monitored Topics"
|
114
|
+
delete: delete
|
115
|
+
activation: Please visit the link below to activate your account.
|
116
|
+
without_http: without http://
|
117
|
+
admin_in_parens: '(admin)'
|
118
|
+
admin_and_moderation: Admin & Moderation
|
119
|
+
remove_moderated_forum: This user can moderate the following forums. Click one to remove.
|
120
|
+
remove_user_as_moderator: Remove user as moderator for
|
121
|
+
searching_for: Searching for
|
122
|
+
locked: locked
|
123
|
+
edit: edit
|
124
|
+
delete: delete
|
125
|
+
login: login
|
126
|
+
once: once
|
127
|
+
and_again: and again
|
128
|
+
|
129
|
+
open_id_field: Enter your OpenID Identity Url if you know it
|
130
|
+
open_id_field_extended: Enter your OpenID Identity Url if you know it. If your Identity Url supports the {sreg} extension, you can {login_link} and create your account automatically
|
131
|
+
login_field: Logins should start with least 2 characters and may consist of letters, numbers, or the underscore.
|
132
|
+
password_field: Enter your desired password twice. It must be at least 5 characters.
|
133
|
+
|
134
|
+
formatting_help: Formatting Help
|
135
|
+
formatting_bold: "*bold*"
|
136
|
+
formatting_italics: "_italics_"
|
137
|
+
formatting_blockquote: "bq. <span>(quotes)</span>"
|
138
|
+
formatting_list: "* or # <span>(lists)</span>"
|
139
|
+
|
140
|
+
# additions by Raimonds Simanovskis on 2007-05-11
|
141
|
+
or: or
|
142
|
+
by_user: by {{user}}
|
143
|
+
in_forum: in {{forum}}
|
144
|
+
a_few_seconds_ago: "a few seconds ago"
|
145
|
+
1_minute_ago: "1 minute ago"
|
146
|
+
minutes_ago: "{{minutes}} minutes ago"
|
147
|
+
1_hour_ago: "1 hour ago"
|
148
|
+
hours_ago: "{{hours}} hours ago"
|
149
|
+
1_day_ago: "1 day ago"
|
150
|
+
days_ago: "{{days}} days ago"
|
151
|
+
|
152
|
+
topics: topics
|
153
|
+
posts: posts
|
154
|
+
|
155
|
+
comma_locked_topic: ", this topic is locked."
|
156
|
+
|
157
|
+
view: view
|
158
|
+
last: last
|
159
|
+
|
160
|
+
administrator_title: Administrator
|
161
|
+
moderator_title: Moderator
|
162
|
+
|
163
|
+
topic_locked_title: Topic locked
|
164
|
+
|
165
|
+
recent_posts_in_topic: "Recent Posts in '{{topic}}' | Beast"
|
166
|
+
|
167
|
+
delete_post_conf: "Delete this post? Are you sure?"
|
168
|
+
delete_topic_conf: "Delete this topic? Are you sure?"
|
169
|
+
|
170
|
+
date_format: "%b %e, %Y"
|
171
|
+
datetime_format: "%b %e, %Y %l:%M%p"
|
172
|
+
|
173
|
+
posts_feed_title: "{{search_posts_title}} | Beast"
|
174
|
+
|
175
|
+
feed_language: en-us
|
176
|
+
posts_user_is_monitoring: "Posts that {{user}} is monitoring"
|
177
|
+
|
178
|
+
view_all: all
|
179
|
+
|
180
|
+
for_user: for {{user}}
|
181
|
+
|
182
|
+
signup: Signup
|
183
|
+
signup_action: Signup
|
184
|
+
login_action: Login
|
185
|
+
|
186
|
+
check_email_message: "Please check the e-mail address"
|
187
|
+
post_something_message: "Please post something at least..."
|
188
|
+
error_occured_message: "An error occurred"
|
189
|
+
post_deleted_message: "Post of '{title}' was deleted."
|
190
|
+
logged_out_message: "You have been logged out."
|
191
|
+
openid_not_found_message: "Sorry, the OpenID server couldn't be found"
|
192
|
+
openid_canceled_message: "OpenID verification was canceled"
|
193
|
+
openid_failed_message: "Sorry, the OpenID verification failed"
|
194
|
+
openid_saving_error_message: "Error saving the fields from your OpenID profile at {{identity_url}}: {{errors}}"
|
195
|
+
openid_no_user_message: "Sorry, no user by the identity URL {{identity_url}} exists"
|
196
|
+
invalid_login_message: "Invalid login or password, try again please."
|
197
|
+
topic_deleted_message: "Topic '{{title}}' was deleted."
|
198
|
+
could_not_find_account_message: "I could not find an account with the email address '{{email}}'. Did you type it correctly?"
|
199
|
+
signup_permanent_error_message: "A permanent error occured while sending the signup message to '{{email}}'. Please check the e-mail address."
|
200
|
+
signup_cannot_sent_message: "The signup message cannot be sent to '{{email}}' at this moment. Please, try again later."
|
201
|
+
temporary_login_message: "A temporary login email has been sent to '{{email}}'."
|
202
|
+
account_activation_message: "An account activation email has been sent to '{{email}}'."
|
203
|
+
signup_complete_message: "Signup complete!"
|
204
|
+
settings_saved_message: "Your settings have been saved."
|
205
|
+
|
206
|
+
footer_message: "Two's company. Three's a forum. More's a Beast."
|
data/lib/beast.rb
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
ActionView::Base.send :include, SavageBeast::AuthenticationSystem
|
2
|
+
ActionController::Base.send :include, SavageBeast::AuthenticationSystem
|
3
|
+
# You need to include SavageBeast::ApplicationHelper. Doing it this way
|
4
|
+
# makes it be unincluded after the second request when working in development environment.
|
5
|
+
#ApplicationHelper.send :include, SavageBeast::ApplicationHelper
|
6
|
+
|
7
|
+
# Include your application configuration below
|
8
|
+
# @WBH@ would be nice for this to not be necessary somehow...
|
9
|
+
# PASSWORD_SALT = '48e45be7d489cbb0ab582d26e2168621' unless Object.const_defined?(:PASSWORD_SALT)
|
10
|
+
Module.class_eval do
|
11
|
+
def expiring_attr_reader(method_name, value)
|
12
|
+
class_eval(<<-EOS, __FILE__, __LINE__)
|
13
|
+
def #{method_name}
|
14
|
+
class << self;
|
15
|
+
attr_reader :#{method_name};
|
16
|
+
end
|
17
|
+
@#{method_name} = eval(%(#{value}))
|
18
|
+
end
|
19
|
+
EOS
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# All this is given in engines plugin
|
25
|
+
# Define the means by which to add our own routing to Rails' routing
|
26
|
+
class ActionController::Routing::RouteSet::Mapper
|
27
|
+
def from_plugin(name)
|
28
|
+
eval File.read(File.join(RAILS_ROOT, "vendor/plugins/#{name}/routes.rb"))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
#--------------------------------------------------------------------------------
|
33
|
+
# Uncommenting this section of code allows the plugin to work without the engines plugin
|
34
|
+
# installed. Just need to copy the helpers into the lib directory.
|
35
|
+
# So why use Engines?
|
36
|
+
# It allows controller methods to be overridden
|
37
|
+
# It gives an easy way to access images
|
38
|
+
# It allows controller views to be overridden
|
39
|
+
#--------------------------------------------------------------------------------
|
40
|
+
# Add our models and controllers to the application
|
41
|
+
# Stolen from http://weblog.techno-weenie.net/2007/1/24/understanding-the-rails-initialization-process
|
42
|
+
# You can't use config.load_paths because #set_autoload_paths has already been called in the Rails Initialization process
|
43
|
+
#models_path = File.join(directory, 'app', 'models')
|
44
|
+
#$LOAD_PATH << models_path
|
45
|
+
#Dependencies.load_paths << models_path
|
46
|
+
|
47
|
+
#controller_path = File.join(directory, 'app', 'controllers')
|
48
|
+
#$LOAD_PATH << controller_path
|
49
|
+
#Dependencies.load_paths << controller_path
|
50
|
+
#config.controller_paths << controller_path
|
51
|
+
|
52
|
+
#view_path = File.join(directory, 'app', 'views')
|
53
|
+
#if File.exist?(view_path)
|
54
|
+
# ActionController::Base.view_paths.insert(1, view_path) # push it just underneath the app
|
55
|
+
#end
|
56
|
+
|
57
|
+
# Include helpers
|
58
|
+
#ActionView::Base.send :include, ForumsHelper
|
59
|
+
#ActionView::Base.send :include, ApplicationHelper
|
60
|
+
#ActionView::Base.send :include, ModeratorsHelper
|
61
|
+
#ActionView::Base.send :include, PostsHelper
|
62
|
+
#ActionView::Base.send :include, TopicsHelper
|
63
|
+
#--------------------------------------------------------------------------------
|
64
|
+
|
65
|
+
I18n.load_path << Dir[File.join(File.dirname(__FILE__), '..', 'lang', '*.{rb,yml}')]
|
66
|
+
|
67
|
+
begin
|
68
|
+
require 'gettext/rails'
|
69
|
+
GetText.locale = "nl" # Change this to your preference language
|
70
|
+
#puts "GetText found!"
|
71
|
+
rescue MissingSourceFile, LoadError
|
72
|
+
#puts "GetText not found. Using English."
|
73
|
+
class ActionView::Base
|
74
|
+
def _(s)
|
75
|
+
s
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
@@ -0,0 +1,91 @@
|
|
1
|
+
require 'md5'
|
2
|
+
|
3
|
+
module SavageBeast
|
4
|
+
module ApplicationHelper
|
5
|
+
# convenient plugin point
|
6
|
+
def head_extras
|
7
|
+
end
|
8
|
+
|
9
|
+
=begin
|
10
|
+
def submit_tag(value = "Save Changes"[], options={} )
|
11
|
+
or_option = options.delete(:or)
|
12
|
+
return super + "<span class='button_or'>"+"or"[]+" " + or_option + "</span>" if or_option
|
13
|
+
super
|
14
|
+
end
|
15
|
+
=end
|
16
|
+
|
17
|
+
def ajax_spinner_for(id, spinner="spinner.gif")
|
18
|
+
"<img src='/plugin_assets/savage_beast/images/#{spinner}' style='display:none; vertical-align:middle;' id='#{id.to_s}_spinner'> "
|
19
|
+
end
|
20
|
+
|
21
|
+
def avatar_for(user, size=32)
|
22
|
+
begin
|
23
|
+
image_tag "http://www.gravatar.com/avatar.php?gravatar_id=#{MD5.md5(user.email)}&rating=PG&size=#{size}", :size => "#{size}x#{size}", :class => 'photo'
|
24
|
+
rescue
|
25
|
+
image_tag "http://www.gravatar.com/avatar.php?rating=PG&size=#{size}", :size => "#{size}x#{size}", :class => 'photo'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def beast_user_name
|
30
|
+
(current_user ? current_user.display_name : "Guest" )
|
31
|
+
end
|
32
|
+
|
33
|
+
def beast_user_link
|
34
|
+
user_link = (current_user ? user_path(current_user) : "#")
|
35
|
+
link_to beast_user_name, user_link
|
36
|
+
end
|
37
|
+
|
38
|
+
def feed_icon_tag(title, url)
|
39
|
+
(@feed_icons ||= []) << { :url => url, :title => title }
|
40
|
+
link_to image_tag('savage_beast/feed-icon.png', :size => '14x14', :style => 'margin-right:5px', :alt => "Subscribe to #{title}"), url
|
41
|
+
end
|
42
|
+
|
43
|
+
def search_posts_title
|
44
|
+
returning(params[:q].blank? ? t(:recent_posts) : t(:searching_for) + " '#{h params[:q]}'") do |title|
|
45
|
+
title << " "+t(:by_user, :user => h(User.find(params[:user_id]).display_name)) if params[:user_id]
|
46
|
+
title << " "+t(:in_forum, :forum => h(Forum.find(params[:forum_id]).name)) if params[:forum_id]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def topic_title_link(topic, options)
|
51
|
+
if topic.title =~ /^\[([^\]]{1,15})\]((\s+)\w+.*)/
|
52
|
+
"<span class='flag'>#{$1}</span>" +
|
53
|
+
link_to(h($2.strip), forum_topic_path(@forum, topic), options)
|
54
|
+
else
|
55
|
+
link_to(h(topic.title), forum_topic_path(@forum, topic), options)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def search_posts_path(rss = false)
|
60
|
+
options = params[:q].blank? ? {} : {:q => params[:q]}
|
61
|
+
options[:format] = 'rss' if rss
|
62
|
+
[[:user, :user_id], [:forum, :forum_id]].each do |(route_key, param_key)|
|
63
|
+
return send("#{route_key}_posts_path", options.update(param_key => params[param_key])) if params[param_key]
|
64
|
+
end
|
65
|
+
options[:q] ? search_all_posts_path(options) : send("all_posts_path", options)
|
66
|
+
end
|
67
|
+
|
68
|
+
=begin
|
69
|
+
# on windows and this isn't working like you expect?
|
70
|
+
# check: http://beast.caboo.se/forums/1/topics/657
|
71
|
+
# strftime on windows doesn't seem to support %e and you'll need to
|
72
|
+
# use the less cool %d in the strftime line below
|
73
|
+
def distance_of_time_in_words(from_time, to_time = 0, include_seconds = false)
|
74
|
+
from_time = from_time.to_time if from_time.respond_to?(:to_time)
|
75
|
+
to_time = to_time.to_time if to_time.respond_to?(:to_time)
|
76
|
+
distance_in_minutes = (((to_time - from_time).abs)/60).round
|
77
|
+
|
78
|
+
case distance_in_minutes
|
79
|
+
when 0..1 then (distance_in_minutes==0) ? 'a few seconds ago'[] : '1 minute ago'[]
|
80
|
+
when 2..59 then "{minutes} minutes ago"[:minutes_ago, distance_in_minutes]
|
81
|
+
when 60..90 then "1 hour ago"[]
|
82
|
+
when 90..1440 then "{hours} hours ago"[:hours_ago, (distance_in_minutes.to_f / 60.0).round]
|
83
|
+
when 1440..2160 then '1 day ago'[] # 1 day to 1.5 days
|
84
|
+
when 2160..2880 then "{days} days ago"[:days_ago, (distance_in_minutes.to_f / 1440.0).round] # 1.5 days to 2 days
|
85
|
+
else from_time.strftime("%b %e, %Y %l:%M%p"[:datetime_format]).gsub(/([AP]M)/) { |x| x.downcase }
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
=end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module SavageBeast::AuthenticationSystem
|
2
|
+
#this is a shell that Savage Beast uses to query the current user - overide in your app controller
|
3
|
+
|
4
|
+
protected
|
5
|
+
# this is used to keep track of the last time a user has been seen (reading a topic)
|
6
|
+
# it is used to know when topics are new or old and which should have the green
|
7
|
+
# activity light next to them
|
8
|
+
#
|
9
|
+
# we cheat by not calling it all the time, but rather only when a user views a topic
|
10
|
+
# which means it isn't truly "last seen at" but it does serve it's intended purpose
|
11
|
+
#
|
12
|
+
# this could be a filter for the entire app and keep with it's true meaning, but that
|
13
|
+
# would just slow things down without any forseeable benefit since we already know
|
14
|
+
# who is online from the user/session connection
|
15
|
+
#
|
16
|
+
# This is now also used to show which users are online... not at accurate as the
|
17
|
+
# session based approach, but less code and less overhead.
|
18
|
+
def update_last_seen_at
|
19
|
+
#return unless logged_in?
|
20
|
+
#User.update_all ['last_seen_at = ?', Time.now.utc], ['id = ?', current_user.id]
|
21
|
+
#current_user.last_seen_at = Time.now.utc
|
22
|
+
end
|
23
|
+
|
24
|
+
def login_required
|
25
|
+
if !current_user
|
26
|
+
# redirect to login page
|
27
|
+
return false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def authorized?()
|
32
|
+
true
|
33
|
+
# in your code, redirect to an appropriate page if not an admin
|
34
|
+
end
|
35
|
+
|
36
|
+
def current_user
|
37
|
+
#@current_user ||= ((session[:user_id] && User.find_by_id(session[:user_id])) || 0)
|
38
|
+
end
|
39
|
+
|
40
|
+
def logged_in?
|
41
|
+
current_user ? true : false #current_user != 0
|
42
|
+
end
|
43
|
+
|
44
|
+
def admin?
|
45
|
+
#logged_in? && current_user.admin?
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
|
2
|
+
module SavageBeast
|
3
|
+
|
4
|
+
module UserInit
|
5
|
+
|
6
|
+
def self.included(base)
|
7
|
+
base.class_eval do
|
8
|
+
|
9
|
+
has_many :moderatorships, :dependent => :destroy
|
10
|
+
has_many :forums, :through => :moderatorships, :order => "#{Forum.table_name}.name"
|
11
|
+
|
12
|
+
has_many :posts
|
13
|
+
has_many :topics
|
14
|
+
has_many :monitorships
|
15
|
+
has_many :monitored_topics, :through => :monitorships, :conditions => ["#{Monitorship.table_name}.active = ?", true], :order => "#{Topic.table_name}.replied_at desc", :source => :topic
|
16
|
+
|
17
|
+
#implement in your user model
|
18
|
+
def display_name
|
19
|
+
"Foo Diddly"
|
20
|
+
end
|
21
|
+
|
22
|
+
#implement in your user model
|
23
|
+
def admin?
|
24
|
+
false
|
25
|
+
end
|
26
|
+
|
27
|
+
def moderator_of?(forum)
|
28
|
+
moderatorships.count(:all, :conditions => ['forum_id = ?', (forum.is_a?(Forum) ? forum.id : forum)]) == 1
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_xml(options = {})
|
32
|
+
options[:except] ||= []
|
33
|
+
super
|
34
|
+
end
|
35
|
+
end
|
36
|
+
base.extend(ClassMethods)
|
37
|
+
end
|
38
|
+
|
39
|
+
module ClassMethods
|
40
|
+
#implement in your user model
|
41
|
+
def currently_online
|
42
|
+
false
|
43
|
+
end
|
44
|
+
|
45
|
+
def search(query, options = {})
|
46
|
+
with_scope :find => { :conditions => build_search_conditions(query) } do
|
47
|
+
options[:page] ||= nil
|
48
|
+
paginate options
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
#implmement to build search coondtitions
|
53
|
+
def build_search_conditions(query)
|
54
|
+
# query && ['LOWER(display_name) LIKE :q OR LOWER(login) LIKE :q', {:q => "%#{query}%"}]
|
55
|
+
query
|
56
|
+
end
|
57
|
+
|
58
|
+
def moderator_of?(forum)
|
59
|
+
moderatorships.count("#{Moderatorship.table_name}.id", :conditions => ['forum_id = ?', (forum.is_a?(Forum) ? forum.id : forum)]) == 1
|
60
|
+
end
|
61
|
+
|
62
|
+
def to_xml(options = {})
|
63
|
+
options[:except] ||= []
|
64
|
+
options[:except] << :email << :login_key << :login_key_expires_at << :password_hash << :openid_url << :activated << :admin
|
65
|
+
super
|
66
|
+
end
|
67
|
+
|
68
|
+
def update_posts_count
|
69
|
+
self.class.update_posts_count id
|
70
|
+
end
|
71
|
+
|
72
|
+
def update_posts_count(id)
|
73
|
+
User.update_all ['posts_count = ?', Post.count(:id, :conditions => {:user_id => id})], ['id = ?', id]
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
end
|