-
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.
RequestHandler options from root are merged no more {}, {foo: "bar"}.…
… RequestHandler option namespace: String is added for prefixing route's URL. default Model self.responses_on_edit is added. A bit refactoring for demo is made.
- Loading branch information
classyPimp
committed
Dec 18, 2015
1 parent
00dfed6
commit 064bf29
Showing
23 changed files
with
307 additions
and
118 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
app/assets/javascripts/components/admin/dashboards/general.js.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,46 @@ | ||
module Components | ||
module Admin | ||
module Dashboards | ||
class General < RW | ||
|
||
expose | ||
|
||
def get_initial_state | ||
@blank_control_component = ->{Native(t(:div, {}))} | ||
{ | ||
current_control_component: @blank_control_component | ||
} | ||
end | ||
|
||
def render | ||
t(:div, {}, | ||
t(:div, {className: "row"}, | ||
t(:button, {onClick: ->{init_user_creation}}, "add users"), | ||
t(:button, {onClick: ->{init_users_index} }, "list users") | ||
), | ||
t(:div, {className: "row"}, | ||
t(:div, {className: "container"}, | ||
state.current_control_component.to_n | ||
) | ||
) | ||
) | ||
end | ||
|
||
def init_user_creation | ||
set_state current_control_component: Native(t(Components::Users::New, {on_create: ->(user){on_user_added(user)}, as_admin: true})) | ||
end | ||
|
||
def init_users_index | ||
set_state current_control_component: Native(t(Components::Users::Index, {as_admin: true})) | ||
end | ||
|
||
def on_user_added(user) | ||
msg = Shared::Flash::Message.new(t(:div, {}, link_to("user created press here to show", "/users/show/#{user.id}")), "success") | ||
Components::App::Main.instance.ref(:flash).rb.add_message(msg) | ||
set_state current_control_component: @blank_control_component | ||
end | ||
|
||
end | ||
end | ||
end | ||
end |
17 changes: 17 additions & 0 deletions
17
app/assets/javascripts/components/admin/dashboards/main.js.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,17 @@ | ||
module Components | ||
module Admin | ||
module Dashboards | ||
class Main < RW | ||
|
||
expose | ||
|
||
def render | ||
t(:div, {}, | ||
children | ||
) | ||
end | ||
|
||
end | ||
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
16 changes: 16 additions & 0 deletions
16
app/assets/javascripts/components/admin/users/user_edit.js.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,16 @@ | ||
module Components | ||
module Admin | ||
module Users | ||
class Edit < RW | ||
expose | ||
|
||
def render | ||
t(:div, {}, | ||
t(Components::Users::Edit, {as_admin: true, params: props.params}) | ||
) | ||
end | ||
|
||
end | ||
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
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
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
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
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
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
Oops, something went wrong.