Skip to content
Snippets Groups Projects
Commit 92c5e35e authored by azul's avatar azul
Browse files

Merge branch 'feat/8806-sort-invite-codes' into 'master'

feat: sort invite codes by last update

Closes #8806

See merge request !48
parents 3cf07b87 47df0b29
Branches
Tags
1 merge request!48feat: sort invite codes by last update
Pipeline #
......@@ -7,7 +7,9 @@ class InviteCodesController < ApplicationController
def index
@invite = InviteCode.new # for the creation form.
@invites = InviteCode.all.page(params[:page]).per(APP_CONFIG[:pagination_size])
@invites = InviteCode.by_updated_at.descending.
page(params[:page]).
per(APP_CONFIG[:pagination_size])
respond_with @invites
end
......
......@@ -12,6 +12,8 @@ class InviteCode < CouchRest::Model::Base
design do
view :by_invite_code
view :by_invite_count
view :by_created_at
view :by_updated_at
end
def initialize(attributes = {}, options = {})
......
%tr
%td
= simple_date(invite_code.updated_at)
%td
= simple_date(invite_code.created_at)
%td
......
......@@ -11,10 +11,10 @@
%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)
= table @invites, %w(updated 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
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment