summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/invite_codes/_invite_code.html.haml9
-rw-r--r--app/views/invite_codes/index.html.haml20
-rw-r--r--app/views/layouts/_header.html.haml2
3 files changed, 30 insertions, 1 deletions
diff --git a/app/views/invite_codes/_invite_code.html.haml b/app/views/invite_codes/_invite_code.html.haml
new file mode 100644
index 0000000..a3c420d
--- /dev/null
+++ b/app/views/invite_codes/_invite_code.html.haml
@@ -0,0 +1,9 @@
+%tr
+ %td
+ = simple_date(invite_code.created_at)
+ %td
+ %input.invite-code{:value => invite_code.invite_code}
+ %td
+ = "#{invite_code.invite_count}/#{invite_code.max_uses}"
+ %td
+ = btn t(".destroy", cascade: true), invite_code_path(invite_code), :method => 'delete'
diff --git a/app/views/invite_codes/index.html.haml b/app/views/invite_codes/index.html.haml
new file mode 100644
index 0000000..40fccdf
--- /dev/null
+++ b/app/views/invite_codes/index.html.haml
@@ -0,0 +1,20 @@
+- @show_navigation = false
+
+= form_for @invite, :url => { :action => "create" } do |f|
+ %table
+ %tr
+ %td= t "code"
+ %td= t "uses"
+ %td
+ %tr
+ %td= f.text_field :invite_code, style: 'width: 10em'
+ %td= f.text_field :max_uses, style: 'width: 4em'
+ %td= f.submit t("helpers.submit.invites.create"), style: 'margin-bottom: 10px', class: 'btn btn-default'
+
+= table @invites, %w(created code uses actions)
+
+-# select the text of the invite code when you click on it:
+:javascript
+ $("input.invite-code").focus(function(){
+ this.select();
+ }); \ No newline at end of file
diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml
index fd654d8..6263bc3 100644
--- a/app/views/layouts/_header.html.haml
+++ b/app/views/layouts/_header.html.haml
@@ -1,7 +1,7 @@
- if admin?
%ul.nav.nav-pills.admin-area
= render partial: 'common/navigation_item',
- collection: [:users, :identities, :tickets]
+ collection: [:users, :identities, :invite_codes, :tickets]
= link_to_navigation :logout, logout_path, :method => :delete
- if @user && @show_navigation
.lead