@@ -86,6 +86,24 @@ |
||
| 86 | 86 |
} |
| 87 | 87 |
} |
| 88 | 88 |
} |
| 89 |
+ .panel-list {
|
|
| 90 |
+ padding: 0px; |
|
| 91 |
+ margin: 0px; |
|
| 92 |
+ li {
|
|
| 93 |
+ list-style: none; |
|
| 94 |
+ border-top: @theme-border; |
|
| 95 |
+ .theme-box-padding; |
|
| 96 |
+ p {
|
|
| 97 |
+ margin: 0 0 10px; |
|
| 98 |
+ font-family: Avenir-Light; |
|
| 99 |
+ font-size: 18px; |
|
| 100 |
+ color: #3c3f47; |
|
| 101 |
+ line-height: 21px; |
|
| 102 |
+ margin-top: 8px; |
|
| 103 |
+ } |
|
| 104 |
+ .btn { margin-top: -4px; }
|
|
| 105 |
+ } |
|
| 106 |
+ } |
|
| 89 | 107 |
.panel-divider-top { border-top: @theme-border; }
|
| 90 | 108 |
.accordion { margin-bottom: 0px; }
|
| 91 | 109 |
} |
@@ -63,6 +63,13 @@ |
||
| 63 | 63 |
p { margin-bottom: 20px; }
|
| 64 | 64 |
} |
| 65 | 65 |
|
| 66 |
+.form-submit-center-compact {
|
|
| 67 |
+ margin-top: 10px; |
|
| 68 |
+ margin-bottom: 30px; |
|
| 69 |
+ text-align: center; |
|
| 70 |
+ p { margin-bottom: 20px; }
|
|
| 71 |
+} |
|
| 72 |
+ |
|
| 66 | 73 |
// Hacks |
| 67 | 74 |
|
| 68 | 75 |
.cover-fileupload-preview {
|
@@ -2,11 +2,20 @@ class InvitesController < ApplicationController |
||
| 2 | 2 |
|
| 3 | 3 |
def invite |
| 4 | 4 |
@invite = Invite.new |
| 5 |
+ @sent_invites = Invite.where(user_id: current_user.id) |
|
| 5 | 6 |
end |
| 6 | 7 |
|
| 7 | 8 |
def send_invite_message |
| 8 | 9 |
@to = invites_params[:email] |
| 9 | 10 |
@message = invites_params[:message] |
| 11 |
+ |
|
| 12 |
+ @invite = Invite.where(email: @to).where(user_id: current_user.id).first |
|
| 13 |
+ |
|
| 14 |
+ if @invite == nil |
|
| 15 |
+ @invite = Invite.create!(email: @to, user_id: current_user.id, invitations_sent: 1, last_invitation_sent_date: Time.now) |
|
| 16 |
+ else |
|
| 17 |
+ @invite.update(invitations_sent: (@invite.invitations_sent + 1), last_invitation_sent_date: Time.now) |
|
| 18 |
+ end |
|
| 10 | 19 |
|
| 11 | 20 |
@user = User.invite!({email: @to}, current_user) do |u|
|
| 12 | 21 |
u.skip_invitation = true |
@@ -10,54 +10,76 @@ |
||
| 10 | 10 |
<% end %> |
| 11 | 11 |
<% end %> |
| 12 | 12 |
<% end %> |
| 13 |
- <%= content_tag(:div, class: 'row') do %> |
|
| 14 |
- <%= content_tag(:div, class: 'span12') do %> |
|
| 15 |
- |
|
| 16 |
- <%= bootstrap_form_for(@invite, :url => { controller: 'invites', action: 'send_invite_message' } ) do |f| %>
|
|
| 17 | 13 |
|
| 18 |
- <% # Mission Agent Details Group %> |
|
| 19 |
- <%= content_tag(:div, class: 'row') do %> |
|
| 20 |
- <% # Form - Mission Agent Details %> |
|
| 21 |
- <%= content_tag(:div, class: 'span8') do %> |
|
| 22 |
- <%= f.alert_message "Please fix the errors below." %> |
|
| 23 |
- <%= content_tag(:div, class: 'panel panel-default') do %> |
|
| 24 |
- <%= content_tag(:div, class: 'panel-body white-bg') do %> |
|
| 25 |
- <%= content_tag(:div, class: "panel-content") do %> |
|
| 26 |
- <%= content_tag(:div, class: "panel-text") do %> |
|
| 27 |
- <%= content_tag(:div, class: "form-inputs") do %> |
|
| 28 |
- <%= f.text_field :email, label: (t 'invite.email'), class: 'input-block-level' %> |
|
| 29 |
- <%= f.text_area :message, label: (t 'invite.message'), class: 'input-block-level', rows: 10 %> |
|
| 30 |
- <% end %> |
|
| 31 |
- <% end %> |
|
| 14 |
+ |
|
| 15 |
+ <%= bootstrap_form_for(@invite, :url => { controller: 'invites', action: 'send_invite_message' } ) do |f| %>
|
|
| 16 |
+ |
|
| 17 |
+ <% # Mission Agent Details Group %> |
|
| 18 |
+ <%= content_tag(:div, class: 'row') do %> |
|
| 19 |
+ <% # Form - Mission Agent Details %> |
|
| 20 |
+ <%= content_tag(:div, class: 'offset2 span8') do %> |
|
| 21 |
+ <%= f.alert_message "Please fix the errors below." %> |
|
| 22 |
+ <%= content_tag(:div, class: 'panel panel-default') do %> |
|
| 23 |
+ <%= content_tag(:div, class: 'panel-body white-bg') do %> |
|
| 24 |
+ <%= content_tag(:div, class: "panel-content") do %> |
|
| 25 |
+ <%= content_tag(:div, class: "panel-text") do %> |
|
| 26 |
+ <%= content_tag(:div, class: "form-inputs") do %> |
|
| 27 |
+ <%= f.text_field :email, label: (t 'invite.email'), class: 'input-block-level' %> |
|
| 28 |
+ <% f.text_area :message, label: (t 'invite.message'), class: 'input-block-level', rows: 10 %> |
|
| 32 | 29 |
<% end %> |
| 33 | 30 |
<% end %> |
| 34 |
- <% # Form - Submit %> |
|
| 35 |
- <%= content_tag(:div, class: "form-submit-center") do %> |
|
| 36 |
- <%= content_tag(:p) do %> |
|
| 37 |
- <%= f.submit (t 'invite.send'), class: 'btn btn-large btn-success spacer-left-small' %> |
|
| 38 |
- <% end %> |
|
| 31 |
+ <% end %> |
|
| 32 |
+ <% end %> |
|
| 33 |
+ <% # Form - Submit %> |
|
| 34 |
+ <%= content_tag(:div, class: "form-submit-center-compact") do %> |
|
| 35 |
+ <%= content_tag(:p) do %> |
|
| 36 |
+ <%= f.submit (t 'invite.send'), class: 'btn btn-large btn-success spacer-left-small' %> |
|
| 37 |
+ <% end %> |
|
| 38 |
+ <% end %> |
|
| 39 |
+ <% end %> |
|
| 40 |
+ <% end %> |
|
| 41 |
+ <% # Sidebar - Mission Agent Details %> |
|
| 42 |
+ <% content_tag(:div, class: 'span4 sidebar') do %> |
|
| 43 |
+ <%= content_tag(:div, class: 'panel panel-default sidebar-carret') do %> |
|
| 44 |
+ <%= content_tag(:div, class: 'panel-body white-bg') do %> |
|
| 45 |
+ <%= content_tag(:div, class: "panel-content") do %> |
|
| 46 |
+ <%= content_tag(:div, class: "panel-text") do %> |
|
| 47 |
+ <%= content_tag(:h3, (t 'mission_editor.agents.agent_details_help_title')) %> |
|
| 48 |
+ <%= content_tag(:div, (t 'mission_editor.agents.agent_details_help').html_safe, class: 'small-text') %> |
|
| 39 | 49 |
<% end %> |
| 40 | 50 |
<% end %> |
| 41 | 51 |
<% end %> |
| 42 |
- <% # Sidebar - Mission Agent Details %> |
|
| 43 |
- <%= content_tag(:div, class: 'span4 sidebar') do %> |
|
| 44 |
- <%= content_tag(:div, class: 'panel panel-default sidebar-carret') do %> |
|
| 45 |
- <%= content_tag(:div, class: 'panel-body white-bg') do %> |
|
| 46 |
- <%= content_tag(:div, class: "panel-content") do %> |
|
| 47 |
- <%= content_tag(:div, class: "panel-text") do %> |
|
| 48 |
- <%= content_tag(:h3, (t 'mission_editor.agents.agent_details_help_title')) %> |
|
| 49 |
- <%= content_tag(:div, (t 'mission_editor.agents.agent_details_help').html_safe, class: 'small-text') %> |
|
| 52 |
+ <% end %> |
|
| 53 |
+ <% end %> |
|
| 54 |
+ <% end %> |
|
| 55 |
+ |
|
| 56 |
+ |
|
| 57 |
+ <% end %> |
|
| 58 |
+ |
|
| 59 |
+ <% if @sent_invites != nil %> |
|
| 60 |
+ <%= content_tag(:div, class: 'row') do %> |
|
| 61 |
+ <%= content_tag(:div, class: 'offset2 span8') do %> |
|
| 62 |
+ <%= content_tag(:div, class: 'panel panel-default') do %> |
|
| 63 |
+ <%= content_tag(:div, class: 'panel-body white-bg') do %> |
|
| 64 |
+ <%= content_tag(:div, class: "panel-content") do %> |
|
| 65 |
+ <%= content_tag(:div, class: "panel-text") do %> |
|
| 66 |
+ <%= content_tag(:h2, (t 'invite.invitations_sent')) %> |
|
| 67 |
+ <% end %> |
|
| 68 |
+ <%= content_tag(:ul, class: 'panel-list') do %> |
|
| 69 |
+ <% @sent_invites.each do |invite| %> |
|
| 70 |
+ <%= content_tag(:li) do %> |
|
| 71 |
+ <%= content_tag(:p) do %> |
|
| 72 |
+ <%= invite.email %> |
|
| 73 |
+ <%= link_to((t 'invite.resend_invitation'), "#", class: 'btn btn-mini pull-right')%> |
|
| 74 |
+ <% end %> |
|
| 50 | 75 |
<% end %> |
| 51 | 76 |
<% end %> |
| 52 | 77 |
<% end %> |
| 53 | 78 |
<% end %> |
| 54 | 79 |
<% end %> |
| 55 | 80 |
<% end %> |
| 56 |
- |
|
| 57 |
- |
|
| 58 | 81 |
<% end %> |
| 59 |
- |
|
| 60 |
- |
|
| 61 | 82 |
<% end %> |
| 62 | 83 |
<% end %> |
| 84 |
+ |
|
| 63 | 85 |
<% end %> |