tomify 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/tomify/default/object.coffee +1 -2
- data/app/assets/javascripts/tomify/dynamic/global.coffee +17 -8
- data/app/assets/javascripts/tomify/dynamic/react/components/public/users/show.coffee +10 -11
- data/app/controllers/tomify/concerns/api/helpers.rb +1 -1
- data/app/controllers/tomify/concerns/default/env_helper.rb +5 -2
- data/lib/tomify/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85817602ee204d8cfd1e01ef22f6d6d6985e52e0
|
4
|
+
data.tar.gz: 0e2872d5a5f083c6950ca42666e618cd6d41e729
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a4a43d1b4077f681298b7181c7dd2d0cd4b1a1a0c75dd48bce84ca177895ec2e0c6ae1418fe263d682e8f003792af4c2f272b56712749ee80ac606c519688d4
|
7
|
+
data.tar.gz: 2b8692436626a56875500be887fadd3c6115b0c9db2b6068275ff0575c7be3c21e5617bef73fb0fbaf87c86dd6a33e0d3720c1d49cb3c21c4d28ee0fdca94f34
|
@@ -1,23 +1,32 @@
|
|
1
|
-
params = {}
|
2
|
-
query = window.location.search[1..]
|
3
|
-
for param in query.split("&")
|
4
|
-
[key, value] = param.split("=")
|
5
|
-
params[decodeURIComponent(key)] = decodeURIComponent(value)
|
6
|
-
Store.create "Params", params
|
7
1
|
Store.create "Messages", []
|
2
|
+
Store.create "Pages", []
|
3
|
+
Store.create "Params", {}
|
8
4
|
Store.create "Settings", []
|
9
5
|
Store.create "User", {}
|
10
6
|
env = Store.create "Env", {}
|
11
7
|
env.on "change", ->
|
12
8
|
current = Store.find("Env").get()
|
13
9
|
Store.find("Messages").set current.messages
|
10
|
+
Store.find("Pages").set current.pages
|
14
11
|
Store.find("Settings").set current.settings
|
15
12
|
Store.find("User").set current.user ? {}
|
16
13
|
|
17
|
-
$ ->
|
14
|
+
$ ->
|
15
|
+
params = {}
|
16
|
+
query = window.location.search[1..]
|
17
|
+
for param in query.split("&")
|
18
|
+
continue unless "=" in param
|
19
|
+
[key, value] = param.split("=")
|
20
|
+
params[decodeURIComponent(key)] = decodeURIComponent(value)
|
21
|
+
Store.find("Params").set params
|
22
|
+
Store.find("Env").set window.env
|
18
23
|
|
19
|
-
@redirect = (path) -> location.assign path || "/"
|
20
24
|
@message = (message) -> Store.find("Messages").push message
|
25
|
+
@redirect = (path) -> location.assign path || "/"
|
21
26
|
@setting = (name) ->
|
22
27
|
setting = Store.find("Settings").get().find (setting) -> setting.name == name
|
23
28
|
setting?.value
|
29
|
+
@path = (template, path) ->
|
30
|
+
page = Store.find("Pages").get().find (page) -> page.template == template
|
31
|
+
page ?= { path: path ? template }
|
32
|
+
if page.root then "/" else "/#{page.path}"
|
@@ -6,18 +6,17 @@ Component.create "Public.Users.Show",
|
|
6
6
|
render: ->
|
7
7
|
<div>
|
8
8
|
<h3>Profile</h3>
|
9
|
-
<div className="
|
10
|
-
<div className="
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<div className="col-sm-6 text-left">{@state.user.last_name}</div>
|
9
|
+
<div className="media text-left">
|
10
|
+
<div className="media-body">
|
11
|
+
<h4 className="media-heading">{@state.user.name}</h4>
|
12
|
+
<div><b>Email:</b> {@state.user.email}</div>
|
13
|
+
<div><b>Member Since:</b> {@state.user.created_at.date()}</div>
|
14
|
+
</div>
|
16
15
|
</div>
|
16
|
+
<br />
|
17
17
|
<div className="row">
|
18
|
-
<div className="
|
19
|
-
|
18
|
+
<div className="btn-group">
|
19
|
+
<a href="#" onClick={@edit} className="btn btn-primary">Edit</a>
|
20
|
+
</div>
|
20
21
|
</div>
|
21
|
-
<br />
|
22
|
-
<a href="#" onClick={@edit} className="btn btn-primary">Edit</a>
|
23
22
|
</div>
|
@@ -6,6 +6,7 @@ module Tomify::Concerns::Default::EnvHelper
|
|
6
6
|
admin: admin_pages,
|
7
7
|
public: public_pages
|
8
8
|
},
|
9
|
+
pages: pages,
|
9
10
|
settings: public_settings,
|
10
11
|
user: current_user
|
11
12
|
}
|
@@ -15,12 +16,14 @@ module Tomify::Concerns::Default::EnvHelper
|
|
15
16
|
[
|
16
17
|
{ name: "App", path: "admin/settings" },
|
17
18
|
{ name: "Pages", path: "admin/pages" },
|
18
|
-
{ name: "Sidebars", path: "admin/sidebars" },
|
19
|
-
{ name: "Uploads", path: "admin/uploads" },
|
20
19
|
{ name: "Users", path: "admin/users" }
|
21
20
|
]
|
22
21
|
end
|
23
22
|
|
23
|
+
def pages
|
24
|
+
Tomify.models.page.all.as_json(only: [:active, :name, :path, :root, :template, :parent_id])
|
25
|
+
end
|
26
|
+
|
24
27
|
def public_pages
|
25
28
|
Tomify.models.page.where(parent_id: nil).as_json(
|
26
29
|
only: [:active, :name, :path, :root],
|
data/lib/tomify/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tomify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Prats
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|