This commit is contained in:
Shahor 2013-02-20 22:55:13 +01:00
commit 7aad3bb3de
7 changed files with 62 additions and 42 deletions

View File

@ -1,54 +1,58 @@
<a href="http://www.discourse.org/">![Logo](https://raw.github.com/discourse/discourse/master/images/discourse.png)</a> <a href="http://www.discourse.org/">![Logo](https://raw.github.com/discourse/discourse/master/images/discourse.png)</a>
Discourse is the 100% open source, next-generation discussion platform built for the next 10 years of the Internet. Discourse is the 100% open source, next-generation discussion platform built for the next decade of the Internet.
Whenever you need ... Whenever you need ...
* a mailing list - a mailing list
* a forum to discuss something - a forum to discuss something
* a chat room where you can type paragraphs - a chat room where you can type paragraphs
... consider Discourse. ... consider Discourse.
## Getting Started ## Getting Started
If you're interested in helping us develop Discourse, please start with our **[Discourse Vagrant Developer Guide](https://github.com/discourse/discourse/blob/master/docs/VAGRANT.md)**, which includes instructions to get up and running in a development environment using a virtual machine. It's the easiest way to hack on Discourse. If you're interested in helping us develop Discourse, please start with our **[Discourse Vagrant Developer Guide](https://github.com/discourse/discourse/blob/master/docs/VAGRANT.md)**, which includes instructions to get up and running in a development environment using a virtual machine. It's the easiest way to hack on Discourse!
If you're familiar with how Rails works and are comfortable setting up your own environment, you can use our **[Discourse Advanced Developer Guide](https://github.com/discourse/discourse/blob/master/docs/DEVELOPER-ADVANCED.md)** If you're familiar with how Rails works and are comfortable setting up your own environment, use our **[Discourse Advanced Developer Guide](https://github.com/discourse/discourse/blob/master/docs/DEVELOPER-ADVANCED.md)**.
### Requirements ### Requirements
* PostgreSQL 9.1+ - Ruby 1.9.3+
* Redis 2+ - PostgreSQL 9.1+
- Redis 2.6+
## Vision ## Vision
This is the **Civilized Discourse Construction Kit**, a fully open-source package of forum software that is free to use and contribute to. Discourse embraces the changes that are necessary to evolve forum software, namely: Discourse is a **Civilized Discourse Construction Kit**, an 100% open-source discussion platform that is free for everyone to use and contribute to -- forever.
* A **flattened discussion**, which avoids the pains of threaded forums, and delivers a more robust, intuitive interface to join a conversation at any point. Key Discourse mission goals:
* A **self-learning system**, capable of examining the behavior of the community, and adapting to budding moderators and forum trolls alike.
* A **seamless web-only** interface that delivers usability on both the desktop and the tablet, without the need for a native app.
* A **contemporary, robust technology stack**, so that both users and administrators alike have another choice BESIDES php.
The Discourse team wishes to **foster an active community of contributors**, all of whom commit to delivering this continued vision, and ensure that online discussions can grow and thrive in an Internet age dominated by micro-blogging and diminishing attention spans. - A **flattened, endlessly scrolling discussion**, avoiding the akwardness of traditionally threaded and paginated discussion, while allowing replies to be expanded in place for additional context.
- A **user trust system** that grants users additional rights to assist in moderating the forum as they participate in good faith over time. The goal is for the forum to be nearly self-moderating in the absence of any formal moderators, although excellent moderators accelerate the process greatly.
- An **advanced JavaScript app** which runs in modern browsers and works identically on desktop and tablet, without the need for a native app.
- A **contemporary, robust technology stack**, free of legacy PHP and MySQL constraints limiting developers and administrators.
The Discourse team wishes to **foster an active community of contributors**, all of whom commit to delivering this continued vision, ensuring that free, unfettered online discussion can grow and thrive in an Internet age dominated by micro-blogging, and diminishing attention spans. Online discussion belongs to all of us, not just huge corporate websites.
This vision translates to the following functional commitments: This vision translates to the following functional commitments:
1. Support all contemporary browsers on the desktop: 1. Support only modern browsers on the desktop:
* Internet Explorer 9.0, 10.0+ - Internet Explorer 9.0, 10.0+
* Firefox 16+ - Firefox 16+
* Google Chrome *infinite* - Google Chrome 23+
- Safari 5+
2. Supporting the latest generation of tablets: 2. Support the latest generation of tablets, 7" or larger
* iPad 2+ - iPad 2+
* Android 4.1+ on 7" and 10" - Android 4.1+
* Windows 8 - Windows 8
3. Deliver support for the latest generation of small screen mobile/smartphones *as soon as possible*:
3. Deliver support for mobile/smartphones *as soon as possible*: - Windows Phone 8
* Windows Phone 8 - iOS 5+
* iPhone 4+ - Android 4.0+
* Android 4.0+
## Contributing ## Contributing
@ -58,20 +62,20 @@ This vision translates to the following functional commitments:
Discourse is **100% free** and **open-source**. We encourage and support an active, healthy community that Discourse is **100% free** and **open-source**. We encourage and support an active, healthy community that
accepts contributions from the public, and we'd like you to be a part of that community. accepts contributions from the public, and we'd like you to be a part of that community.
In order to be prepared for contributing to Discourse, please: Before contributing to Discourse, please:
1. Review the **VISION** section above, which will help you understand the needs of the team, and the focus of the project, 1. Review the **VISION** section above, which will help you understand the needs of the team, and the focus of the project,
2. Read & sign the **[Electronic Discourse Forums Contribution License Agreement](https://docs.google.com/a/discourse.org/spreadsheet/viewform?formkey=dGUwejFfbDhDYXR4bVFMRG1TUENqLWc6MQ)**, to confirm you've read and acknowledged the legal aspects of your contributions, and 2. Read and sign the **[Electronic Discourse Forums Contribution License Agreement](https://docs.google.com/a/discourse.org/spreadsheet/viewform?formkey=dGUwejFfbDhDYXR4bVFMRG1TUENqLWc6MQ)**, to confirm you've read and acknowledged the legal aspects of your contributions, and
3. Dig into **[CONTRIBUTING.MD](https://github.com/discourse/discourse/blob/master/docs/CONTRIBUTING.md)**, which houses all of the necessary info to: 3. Dig into **[CONTRIBUTING.MD](https://github.com/discourse/discourse/blob/master/docs/CONTRIBUTING.md)**, which houses all of the necessary info to:
* submit bugs, - submit bugs,
* request new features, and - request new features, and
* step you through the entire process of preparing your code for a Pull Request. - step you through the entire process of preparing your code for a Pull Request.
**We look forward to seeing your cool stuff!** **We look forward to seeing your cool stuff!**
## Expertise ## Expertise
Discourse implements a variety of open source tech. You may wish to familiarize yourself with the various components that Discourse is built on, in order to be an effective contributor: In order to be an effective contributor, familiarize yourself with the various open source omponents that Discourse is built on:
### Languages/Frameworks ### Languages/Frameworks
@ -97,9 +101,9 @@ Releases will be numbered with the following format:
And constructed with the following guidelines: And constructed with the following guidelines:
* Breaking backward compatibility bumps the major (and resets the minor and patch) - Breaking backward compatibility bumps the major (and resets the minor and patch)
* New additions without breaking backward compatibility bumps the minor (and resets the patch) - New additions without breaking backward compatibility bumps the minor (and resets the patch)
* Bug fixes and misc changes bumps the patch - Bug fixes and misc changes bumps the patch
For more information on SemVer, please visit http://semver.org/. For more information on SemVer, please visit http://semver.org/.

View File

@ -86,7 +86,7 @@ window.Discourse.LoginView = window.Discourse.ModalBodyView.extend Discourse.Pre
accountEmail: options['email'] accountEmail: options['email']
accountUsername: options['username'] accountUsername: options['username']
accountName: options['name'] accountName: options['name']
authOptions: options authOptions: Em.Object.create(options)
mouseMove: (e) -> mouseMove: (e) ->
@set('lastX', e.screenX) @set('lastX', e.screenX)

View File

@ -200,6 +200,7 @@
section.post-menu-area { section.post-menu-area {
.discourse-no-touch & { .discourse-no-touch & {
opacity: 0.2; opacity: 0.2;
@include fade-soft(1s);
} }
} }

View File

@ -160,6 +160,14 @@
} }
} }
@mixin fade-soft($time: 1s) {
transition: opacity $time ease-in-out;
-moz-transition: opacity $time ease-in-out;
-webkit-transition: opacity $time ease-in-out;
-ms-transition: opacity $time ease-in-out;
-o-transition: opacity $time ease-in-out;
}
@mixin visible { @mixin visible {
opacity: 1; opacity: 1;
visibility: visible; visibility: visible;

View File

@ -27,7 +27,7 @@ class User < ActiveRecord::Base
validates_presence_of :email validates_presence_of :email
validates_uniqueness_of :email validates_uniqueness_of :email
validate :username_validator validate :username_validator
validate :email_validator validate :email_validator, :if => :email_changed?
validate :password_validator validate :password_validator
before_save :cook before_save :cook
@ -506,7 +506,7 @@ class User < ActiveRecord::Base
end end
def email_validator def email_validator
if new_record? and (setting = SiteSetting.email_domains_blacklist).present? if (setting = SiteSetting.email_domains_blacklist).present?
domains = setting.gsub('.', '\.') domains = setting.gsub('.', '\.')
regexp = Regexp.new("@(#{domains})", true) regexp = Regexp.new("@(#{domains})", true)
if self.email =~ regexp if self.email =~ regexp

View File

@ -2,7 +2,7 @@ module Discourse
module VERSION #:nodoc: module VERSION #:nodoc:
MAJOR = 0 MAJOR = 0
MINOR = 8 MINOR = 8
TINY = 0 TINY = 1
PRE = nil PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.') STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')

View File

@ -484,6 +484,13 @@ describe User do
SiteSetting.stubs(:email_domains_blacklist).returns('fakemail.com') SiteSetting.stubs(:email_domains_blacklist).returns('fakemail.com')
u.should be_valid u.should be_valid
end end
it 'should be used when email is being changed' do
SiteSetting.stubs(:email_domains_blacklist).returns('mailinator.com')
u = Fabricate(:user, email: 'good@gmail.com')
u.email = 'nope@mailinator.com'
u.should_not be_valid
end
end end
describe 'passwords' do describe 'passwords' do