-
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.
Better interface for admins & redirects.
- Loading branch information
1 parent
eeb375e
commit 60359bb
Showing
6 changed files
with
78 additions
and
67 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 |
---|---|---|
@@ -1,2 +1 @@ | ||
#= require chr/admins | ||
#= require chr/redirects | ||
#= require_tree ./ants |
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,53 @@ | ||
class @AntsAdmins | ||
constructor: (title='Admins', apiPath='/admin') -> | ||
config = | ||
title: title | ||
showWithParent: true | ||
|
||
arrayStore: new RailsArrayStore({ | ||
resource: 'admin' | ||
path: "#{ apiPath }/admins" | ||
sortBy: 'name' | ||
searchable: true | ||
}) | ||
|
||
formSchema: | ||
name: | ||
type: 'string' | ||
required: true | ||
label: "Name" | ||
placeholder: 'Full name' | ||
onInitialize: (input) -> | ||
if input.object | ||
input.$el.removeClass 'input-required' | ||
input.config.disabled = true | ||
input._add_disabled() | ||
|
||
email: | ||
type: 'string' | ||
required: true | ||
placeholder: 'Email' | ||
|
||
onInitialize: (input) -> | ||
if input.object | ||
input.$el.removeClass 'input-required' | ||
input.config.disabled = true | ||
input._add_disabled() | ||
|
||
input.$actions =$ "<span class='input-actions'></span>" | ||
input.$avatarBtn =$ "<a href='https://en.gravatar.com/' target='_blank'>Update avatar</a>" | ||
input.$label.append input.$actions | ||
input.$actions.append input.$avatarBtn | ||
|
||
password: | ||
type: 'password' | ||
required: true | ||
placeholder: 'Password' | ||
onInitialize: (input) -> | ||
if input.object | ||
input.$el.removeClass 'input-required' | ||
input.$label.html 'Change Password' | ||
input.config.placeholder = 'Type new password here to update the current one' | ||
input._add_placeholder() | ||
|
||
return config |
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,23 @@ | ||
class @AntsRedirects | ||
constructor: (title='Redirects', apiPath='/admin') -> | ||
config = | ||
title: title | ||
showWithParent: true | ||
|
||
onViewShow: (view) -> | ||
if view.object | ||
view.$linkBtn =$ "<a href='#{ view.object.path_from }' class='link open' target='_blank'>Open</a>" | ||
view.$header.append view.$linkBtn | ||
|
||
arrayStore: new RailsArrayStore({ | ||
resource: 'redirect' | ||
path: "#{ apiPath }/redirects" | ||
sortBy: 'path_from' | ||
searchable: true | ||
}) | ||
|
||
formSchema: | ||
path_from: { type: 'string', label: 'From', placeholder: '/redirect-from-path', required: true } | ||
path_to: { type: 'url', label: 'To', placeholder: '/redirect-to-path', required: true } | ||
|
||
return config |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,3 +1,3 @@ | ||
module Ants | ||
VERSION = "0.2.2" | ||
VERSION = "0.2.3" | ||
end |