-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
177 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# [CaptainFact App] CF | ||
|
||
This is CaptainFact main library. It holds most helpers and functions used to | ||
manipulate data from DB. | ||
|
||
## Secrets | ||
|
||
Following secrets must be configured in production: | ||
|
||
- frontend_url | ||
- youtube_api_key | ||
- facebook_app_id | ||
- facebook_app_secret | ||
- secret_key_base | ||
- mailgun_domain | ||
- mailgun_api_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Votre invitation pour rejoindre CaptainFact est prête ! | ||
|
||
Pour créer un compte dès maintenant, utilisez votre lien d'invitation unique : | ||
<%= frontend_url() %>/signup?invitation_token=<%= @invitation_token %> | ||
<%= invitation_url(@invitation_token) %> | ||
|
||
A très vite ! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,12 @@ Welcome to CaptainFact.io!<br> | |
<br> | ||
To confirm your email and gain a bonus of | ||
+<%= @confirm_email_reputation %> reputation, click on the following link: | ||
<a href="<%= frontend_url() %>/confirm_email/<%= @user.email_confirmation_token %>"> | ||
<a href="<%= confirm_email_url(@user.email_confirmation_token) %>"> | ||
Confirm my email | ||
</a> | ||
<br><br> | ||
You can learn more about how the system works by | ||
checking <a href="<%= frontend_url() %>/help">the help pages</a>. | ||
checking <a href="<%= help_url() %>">the help pages</a>. | ||
<br><br> | ||
Feel free to contact us | ||
at <a href="mailto:[email protected]">[email protected]</a>.<br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,10 @@ Welcome to CaptainFact.io! | |
To confirm your email and gain a bonus of | ||
+<%= @confirm_email_reputation %> reputation, click on the following link: | ||
|
||
<%= frontend_url() %>/confirm_email/<%= @user.email_confirmation_token %> | ||
<%= confirm_email_url(@user.email_confirmation_token) %> | ||
|
||
You can learn more about how the system works and the whys of CaptainFact by | ||
checking the help pages at <%= frontend_url() %>/help | ||
checking the help pages at <%= help_url() %> | ||
|
||
Feel free to contact us at [email protected] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,12 @@ Bienvenue sur CaptainFact !<br> | |
<br> | ||
Pour confirmer votre adresse email et obtenir un bonus de | ||
+<%= @confirm_email_reputation %> de réputation, cliquez sur le lien suivant : | ||
<a href="<%= frontend_url() %>/confirm_email/<%= @user.email_confirmation_token %>"> | ||
<a href="<%= confirm_email_url(@user.email_confirmation_token) %>"> | ||
Confirmer mon adresse email | ||
</a> | ||
<br><br> | ||
Vous pouvez en apprendre plus sur le fonctionnement du système en | ||
allant voir les <a href="<%= frontend_url() %>/help">pages d'aide</a>. | ||
allant voir les <a href="<%= help_url() %>">pages d'aide</a>. | ||
<br><br> | ||
Vous pouvez également nous contacter | ||
sur <a href="mailto:[email protected]">[email protected]</a>.<br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,11 @@ Bienvenue sur CaptainFact ! | |
Pour confirmer votre adresse email et obtenir un bonus de | ||
+<%= @confirm_email_reputation %> de réputation, cliquez sur le lien suivant : | ||
|
||
<%= frontend_url() %>/confirm_email/<%= @user.email_confirmation_token %> | ||
<%= confirm_email_url(@user.email_confirmation_token) %> | ||
|
||
Vous pouvez en apprendre plus sur le fonctionnement du système en | ||
allant voir les pages d'aide : <%= frontend_url() %>/help | ||
allant voir les pages d'aide : <%= help_url() %> | ||
|
||
Vous pouvez également nous contacter [email protected] | ||
|
||
Bon fact-checking ! | ||
Bon fact-checking ! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
defmodule CF.Utils.FrontendRouter do | ||
@moduledoc """ | ||
Generate routes matching Frontend URL. | ||
""" | ||
|
||
alias DB.Schema.User | ||
alias DB.Schema.Speaker | ||
alias DB.Schema.Comment | ||
|
||
@doc """ | ||
Base frontend URL | ||
""" | ||
def base_url, do: Application.get_env(:cf, :frontend_url) | ||
|
||
@doc """ | ||
Build an url for given path | ||
""" | ||
def url(path \\ "") | ||
def url("/" <> path), do: base_url() <> path | ||
def url(path), do: base_url() <> path | ||
|
||
@doc """ | ||
User's profile page URL | ||
""" | ||
def user_url(%User{username: username}), do: url("u/#{username}") | ||
|
||
@doc """ | ||
Video URL | ||
""" | ||
def video_url(video_hash_id), do: url("videos/#{video_hash_id}") | ||
|
||
@doc """ | ||
Comment's URL | ||
""" | ||
def statement_url(video_hash_id, statement_id), | ||
do: video_url(video_hash_id) <> "?statement=#{statement_id}" | ||
|
||
@doc """ | ||
Comment's URL | ||
""" | ||
def comment_url(video_hash_id, %Comment{statement: statement}), | ||
do: statement_url(video_hash_id, statement.id) | ||
|
||
@doc """ | ||
Speaker URL | ||
""" | ||
def speaker_url(%Speaker{slug: slug, id: id}), | ||
do: url("s/#{slug || id}") | ||
|
||
@doc """ | ||
URL to unsubscribe from newsletter | ||
""" | ||
def unsubscribe_newsletter_url(newsletter_subscription_token), | ||
do: url("newsletter/unsubscribe/#{newsletter_subscription_token}") | ||
|
||
@doc """ | ||
URL to confirm email | ||
""" | ||
def confirm_email_url(email_confirmation_token), | ||
do: url("confirm_email/#{email_confirmation_token}") | ||
|
||
@doc """ | ||
URL to reset user password | ||
""" | ||
def reset_password_url(reset_password_token), | ||
do: url("reset_password/confirm/#{reset_password_token}") | ||
|
||
@doc """ | ||
URL to help pages | ||
""" | ||
def help_url(), | ||
do: url("help") | ||
|
||
@doc """ | ||
Invitation URL | ||
""" | ||
def invitation_url(token), | ||
do: url("signup?invitation_token=#{token}") | ||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.