forked from railsbridge/bridge_troll
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'prompt-meetup-connect' of https://github.com/fionatay/b…
…ridge_troll into fionatay-prompt-meetup-connect Conflicts: db/schema.rb
- Loading branch information
Showing
12 changed files
with
91 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$(document).ready -> | ||
$(".alert form.button_to").bind "ajax:success", (event, data, status, xhr) -> | ||
$(event.target).closest(".alert").remove() | ||
|
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,9 @@ | ||
module Users | ||
class MeetupPromptsController < ApplicationController | ||
def destroy | ||
@meetup_prompt = MeetupPrompt.build(current_user) | ||
@meetup_prompt.destroy if @meetup_prompt | ||
head :ok | ||
end | ||
end | ||
end |
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,20 @@ | ||
class MeetupPrompt | ||
def self.build(user) | ||
return if !user || user.meetup_id || user.meetup_prompt_dismissed | ||
|
||
new(user) | ||
end | ||
|
||
def initialize(user) | ||
@user = user | ||
end | ||
|
||
def path | ||
"/users/#{@user.id}/meetup_prompt" | ||
end | ||
|
||
def destroy | ||
@user.meetup_prompt_dismissed = true | ||
@user.save | ||
end | ||
end |
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,8 @@ | ||
<% meetup_prompt = MeetupPrompt.build(current_user) %> | ||
<% if meetup_prompt %> | ||
<div class="alert alert-action-needed"> | ||
<%= button_to '×'.html_safe, meetup_prompt.path, remote: true, method: :delete, class: 'close', data: {dismiss: 'alert'} %> | ||
Connect your Meetup.com account to import information about past workshops you have attended. | ||
<%= link_to 'Connect to Meetup.com', "/auth/meetup", class: 'btn' %> | ||
</div> | ||
<% end %> |
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
5 changes: 5 additions & 0 deletions
5
db/migrate/20130505083029_add_meetup_prompt_dismissed_to_users.rb
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,5 @@ | ||
class AddMeetupPromptDismissedToUsers < ActiveRecord::Migration | ||
def change | ||
add_column :users, :meetup_prompt_dismissed, :boolean | ||
end | ||
end |
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