rails_detail 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +165 -0
- data/README.md +3 -0
- data/Rakefile +37 -0
- data/app/assets/config/rails_detail_manifest.js +3 -0
- data/app/assets/javascripts/controllers/rails_detail_my/contents/index.ready.js +1 -0
- data/app/assets/javascripts/controllers/rails_detail_my/entity_items/index.js +45 -0
- data/app/assets/javascripts/controllers/rails_detail_my/pictures/index.ready.js +18 -0
- data/app/assets/javascripts/knowledge.js +47 -0
- data/app/assets/javascripts/rails_detail/application.js +4 -0
- data/app/assets/stylesheets/rails_detail/application.css +14 -0
- data/app/controllers/rails_detail_admin/base_controller.rb +5 -0
- data/app/controllers/rails_detail_admin/items_controller.rb +76 -0
- data/app/controllers/rails_detail_admin/lists_controller.rb +60 -0
- data/app/controllers/rails_detail_my/base_controller.rb +7 -0
- data/app/controllers/rails_detail_my/entity_items_controller.rb +51 -0
- data/app/controllers/rails_detail_my/items_controller.rb +10 -0
- data/app/controllers/rails_detail_my/knowledges_controller.rb +124 -0
- data/app/controllers/rails_detail_my/majors_controller.rb +68 -0
- data/app/controllers/rails_detail_my/minors_controller.rb +64 -0
- data/app/controllers/rails_detail_my/notes_controller.rb +47 -0
- data/app/controllers/rails_detail_my/parts_controller.rb +74 -0
- data/app/controllers/rails_detail_my/pictures_controller.rb +76 -0
- data/app/controllers/rails_detail_my/sections_controller.rb +62 -0
- data/app/controllers/rails_detail_my/solos_controller.rb +96 -0
- data/app/controllers/rails_detail_my/sources_controller.rb +79 -0
- data/app/controllers/rails_detail_my/taxon_items_controller.rb +66 -0
- data/app/controllers/rails_detail_my/wikis_controller.rb +104 -0
- data/app/models/rails_detail/concerns/content_model.rb +13 -0
- data/app/models/rails_detail/concerns/item_model.rb +24 -0
- data/app/models/rails_detail/concerns/taxon_model.rb +9 -0
- data/app/models/rails_detail/content.rb +12 -0
- data/app/models/rails_detail/contents/banner.rb +7 -0
- data/app/models/rails_detail/contents/link.rb +5 -0
- data/app/models/rails_detail/contents/note.rb +6 -0
- data/app/models/rails_detail/contents/picture.rb +7 -0
- data/app/models/rails_detail/entity_item.rb +18 -0
- data/app/models/rails_detail/item.rb +7 -0
- data/app/models/rails_detail/list.rb +6 -0
- data/app/models/rails_detail/taxon_item.rb +14 -0
- data/app/views/layouts/the_detail.html.erb +22 -0
- data/app/views/rails_detail_admin/answers/_answer.html.erb +14 -0
- data/app/views/rails_detail_admin/answers/_form.html.erb +16 -0
- data/app/views/rails_detail_admin/answers/edit.html.erb +11 -0
- data/app/views/rails_detail_admin/answers/index.html.erb +31 -0
- data/app/views/rails_detail_admin/answers/new.html.erb +22 -0
- data/app/views/rails_detail_admin/answers/show.html.erb +19 -0
- data/app/views/rails_detail_admin/base/_nav.html.erb +3 -0
- data/app/views/rails_detail_admin/items/_form.html.erb +8 -0
- data/app/views/rails_detail_admin/items/edit.html.erb +13 -0
- data/app/views/rails_detail_admin/items/index.html.erb +50 -0
- data/app/views/rails_detail_admin/items/new.html.erb +13 -0
- data/app/views/rails_detail_admin/items/show.html.erb +31 -0
- data/app/views/rails_detail_admin/lists/_form.html.erb +5 -0
- data/app/views/rails_detail_admin/lists/edit.html.erb +12 -0
- data/app/views/rails_detail_admin/lists/index.html.erb +36 -0
- data/app/views/rails_detail_admin/lists/new.html.erb +16 -0
- data/app/views/rails_detail_admin/lists/taxon.html.erb +44 -0
- data/app/views/rails_detail_admin/sections/_form.html.erb +22 -0
- data/app/views/rails_detail_admin/sections/_select.html.erb +38 -0
- data/app/views/rails_detail_admin/sections/_show_section.html.erb +22 -0
- data/app/views/rails_detail_admin/sections/edit.html.erb +17 -0
- data/app/views/rails_detail_admin/sections/index.html.erb +18 -0
- data/app/views/rails_detail_admin/sections/new.html.erb +13 -0
- data/app/views/rails_detail_admin/sources/_form.html.erb +8 -0
- data/app/views/rails_detail_admin/sources/edit.html.erb +6 -0
- data/app/views/rails_detail_admin/sources/index.html.erb +21 -0
- data/app/views/rails_detail_admin/sources/new.html.erb +5 -0
- data/app/views/rails_detail_admin/sources/show.html.erb +5 -0
- data/app/views/rails_detail_admin/wikis/_breadcrumb.html.erb +6 -0
- data/app/views/rails_detail_admin/wikis/_nav.html.erb +16 -0
- data/app/views/rails_detail_admin/wikis/_nav_index.html.erb +5 -0
- data/app/views/rails_detail_admin/wikis/_push.html.erb +10 -0
- data/app/views/rails_detail_admin/wikis/_search.html.erb +21 -0
- data/app/views/rails_detail_admin/wikis/_section.html.erb +72 -0
- data/app/views/rails_detail_admin/wikis/_solo.html.erb +26 -0
- data/app/views/rails_detail_admin/wikis/fade_form.js.erb +9 -0
- data/app/views/rails_detail_admin/wikis/index.html.erb +24 -0
- data/app/views/rails_detail_admin/wikis/show.html.erb +33 -0
- data/app/views/rails_detail_my/answers/_answer.html.erb +14 -0
- data/app/views/rails_detail_my/answers/_form.html.erb +16 -0
- data/app/views/rails_detail_my/answers/edit.html.erb +11 -0
- data/app/views/rails_detail_my/answers/index.html.erb +31 -0
- data/app/views/rails_detail_my/answers/new.html.erb +22 -0
- data/app/views/rails_detail_my/answers/show.html.erb +19 -0
- data/app/views/rails_detail_my/details/_form.html.erb +29 -0
- data/app/views/rails_detail_my/details/_major.html.erb +21 -0
- data/app/views/rails_detail_my/details/_minor.html.erb +25 -0
- data/app/views/rails_detail_my/details/_nav.html/347/232/204/345/211/257/346/234/254.erb +14 -0
- data/app/views/rails_detail_my/details/edit.html.erb +37 -0
- data/app/views/rails_detail_my/details/fade_form.js.erb +9 -0
- data/app/views/rails_detail_my/details/index.html.erb +10 -0
- data/app/views/rails_detail_my/details/search.json.jbuilder +5 -0
- data/app/views/rails_detail_my/details/show.html.erb +52 -0
- data/app/views/rails_detail_my/entity_items/_edit.html.erb +15 -0
- data/app/views/rails_detail_my/entity_items/_new.html.erb +16 -0
- data/app/views/rails_detail_my/entity_items/_taxon_item.html.erb +26 -0
- data/app/views/rails_detail_my/entity_items/create.js.erb +23 -0
- data/app/views/rails_detail_my/entity_items/destroy.js.erb +26 -0
- data/app/views/rails_detail_my/entity_items/edit.js.erb +5 -0
- data/app/views/rails_detail_my/entity_items/index.html.erb +40 -0
- data/app/views/rails_detail_my/entity_items/new.js.erb +7 -0
- data/app/views/rails_detail_my/entity_items/show.html.erb +0 -0
- data/app/views/rails_detail_my/entity_items/update.js.erb +1 -0
- data/app/views/rails_detail_my/knowledges/_form.html.erb +7 -0
- data/app/views/rails_detail_my/knowledges/_sort.html.erb +15 -0
- data/app/views/rails_detail_my/knowledges/_td.html.erb +14 -0
- data/app/views/rails_detail_my/knowledges/edit.html.erb +12 -0
- data/app/views/rails_detail_my/knowledges/index.html.erb +46 -0
- data/app/views/rails_detail_my/knowledges/new.html.erb +13 -0
- data/app/views/rails_detail_my/knowledges/new_belong.html.erb +36 -0
- data/app/views/rails_detail_my/knowledges/show.html.erb +44 -0
- data/app/views/rails_detail_my/majors/_form.html.erb +7 -0
- data/app/views/rails_detail_my/majors/_new.html.erb +5 -0
- data/app/views/rails_detail_my/majors/create.js.erb +4 -0
- data/app/views/rails_detail_my/majors/index.html.erb +39 -0
- data/app/views/rails_detail_my/majors/index2.html.erb +38 -0
- data/app/views/rails_detail_my/majors/new.html.erb +3 -0
- data/app/views/rails_detail_my/majors/new.js.erb +1 -0
- data/app/views/rails_detail_my/majors/show.html.erb +21 -0
- data/app/views/rails_detail_my/minors/_form.html.erb +7 -0
- data/app/views/rails_detail_my/minors/_new.html.erb +7 -0
- data/app/views/rails_detail_my/minors/_part.html.erb +59 -0
- data/app/views/rails_detail_my/minors/create.js.erb +10 -0
- data/app/views/rails_detail_my/minors/index.html.erb +41 -0
- data/app/views/rails_detail_my/minors/new.html.erb +1 -0
- data/app/views/rails_detail_my/minors/new.js.erb +1 -0
- data/app/views/rails_detail_my/minors/show.html.erb +22 -0
- data/app/views/rails_detail_my/notes/_add_link.html.erb +6 -0
- data/app/views/rails_detail_my/notes/_form.html.erb +4 -0
- data/app/views/rails_detail_my/notes/_new.html.erb +2 -0
- data/app/views/rails_detail_my/notes/_note.html.erb +16 -0
- data/app/views/rails_detail_my/notes/_show.html.erb +9 -0
- data/app/views/rails_detail_my/notes/create.js.erb +2 -0
- data/app/views/rails_detail_my/notes/edit.js.erb +1 -0
- data/app/views/rails_detail_my/notes/new.html.erb +2 -0
- data/app/views/rails_detail_my/notes/new.js.erb +24 -0
- data/app/views/rails_detail_my/notes/show.html.erb +2 -0
- data/app/views/rails_detail_my/notes/update.js.erb +1 -0
- data/app/views/rails_detail_my/parts/_new.html.erb +7 -0
- data/app/views/rails_detail_my/parts/_part.html.erb +59 -0
- data/app/views/rails_detail_my/parts/create.js.erb +10 -0
- data/app/views/rails_detail_my/parts/index.html.erb +39 -0
- data/app/views/rails_detail_my/parts/new.html.erb +1 -0
- data/app/views/rails_detail_my/parts/new.js.erb +1 -0
- data/app/views/rails_detail_my/parts/show.html.erb +22 -0
- data/app/views/rails_detail_my/pictures/_add_link.html.erb +6 -0
- data/app/views/rails_detail_my/pictures/_edit.html.erb +8 -0
- data/app/views/rails_detail_my/pictures/_index.html.erb +9 -0
- data/app/views/rails_detail_my/pictures/_new.html.erb +12 -0
- data/app/views/rails_detail_my/pictures/_search_form.html.erb +7 -0
- data/app/views/rails_detail_my/pictures/_show.html.erb +17 -0
- data/app/views/rails_detail_my/pictures/create.js.erb +2 -0
- data/app/views/rails_detail_my/pictures/destroy.js.erb +1 -0
- data/app/views/rails_detail_my/pictures/edit.js.erb +2 -0
- data/app/views/rails_detail_my/pictures/index.html.erb +2 -0
- data/app/views/rails_detail_my/pictures/new.html.erb +2 -0
- data/app/views/rails_detail_my/pictures/new.js.erb +1 -0
- data/app/views/rails_detail_my/pictures/show.html.erb +10 -0
- data/app/views/rails_detail_my/pictures/update.js.erb +1 -0
- data/app/views/rails_detail_my/sections/_form.html.erb +22 -0
- data/app/views/rails_detail_my/sections/_select.html.erb +38 -0
- data/app/views/rails_detail_my/sections/_show_section.html.erb +22 -0
- data/app/views/rails_detail_my/sections/edit.html.erb +17 -0
- data/app/views/rails_detail_my/sections/index.html.erb +18 -0
- data/app/views/rails_detail_my/sections/new.html.erb +13 -0
- data/app/views/rails_detail_my/solos/_new.html.erb +5 -0
- data/app/views/rails_detail_my/solos/create.js.erb +4 -0
- data/app/views/rails_detail_my/solos/edit.js.erb +1 -0
- data/app/views/rails_detail_my/solos/index.html.erb +38 -0
- data/app/views/rails_detail_my/solos/new.html.erb +3 -0
- data/app/views/rails_detail_my/solos/show.html.erb +21 -0
- data/app/views/rails_detail_my/sorts/_form.html.erb +29 -0
- data/app/views/rails_detail_my/sorts/_head.html.erb +24 -0
- data/app/views/rails_detail_my/sorts/_sort.html.erb +49 -0
- data/app/views/rails_detail_my/sorts/_sub.html.erb +16 -0
- data/app/views/rails_detail_my/sorts/edit.html.erb +14 -0
- data/app/views/rails_detail_my/sorts/edit_father.html.erb +17 -0
- data/app/views/rails_detail_my/sorts/pic.html.erb +46 -0
- data/app/views/rails_detail_my/sorts/search.json.jbuilder +6 -0
- data/app/views/rails_detail_my/sorts/show.html.erb +17 -0
- data/app/views/rails_detail_my/sorts/sub.js.erb +5 -0
- data/app/views/rails_detail_my/sources/_form.html.erb +8 -0
- data/app/views/rails_detail_my/sources/edit.html.erb +6 -0
- data/app/views/rails_detail_my/sources/index.html.erb +21 -0
- data/app/views/rails_detail_my/sources/new.html.erb +5 -0
- data/app/views/rails_detail_my/sources/show.html.erb +5 -0
- data/app/views/rails_detail_my/taxon_items/_form.html.erb +4 -0
- data/app/views/rails_detail_my/taxon_items/_new.html.erb +13 -0
- data/app/views/rails_detail_my/taxon_items/_new_list.html.erb +13 -0
- data/app/views/rails_detail_my/taxon_items/_taxon_item.html.erb +5 -0
- data/app/views/rails_detail_my/taxon_items/create.js.erb +1 -0
- data/app/views/rails_detail_my/taxon_items/destroy.js.erb +1 -0
- data/app/views/rails_detail_my/taxon_items/edit.html.erb +14 -0
- data/app/views/rails_detail_my/taxon_items/edit.js.erb +5 -0
- data/app/views/rails_detail_my/taxon_items/index.html.erb +40 -0
- data/app/views/rails_detail_my/taxon_items/new.html.erb +9 -0
- data/app/views/rails_detail_my/taxon_items/new.js.erb +28 -0
- data/app/views/rails_detail_my/taxon_items/update.js.erb +1 -0
- data/app/views/rails_detail_my/wikis/_head.html.erb +24 -0
- data/app/views/rails_detail_my/wikis/_head.html/347/232/204/345/211/257/346/234/254.erb +34 -0
- data/app/views/rails_detail_my/wikis/_sub.html.erb +16 -0
- data/app/views/rails_detail_my/wikis/create.js.erb +3 -0
- data/app/views/rails_detail_my/wikis/edit.html.erb +14 -0
- data/app/views/rails_detail_my/wikis/edit.html/347/232/204/345/211/257/346/234/254.erb +14 -0
- data/app/views/rails_detail_my/wikis/edit_father.html.erb +17 -0
- data/app/views/rails_detail_my/wikis/index.html.erb +41 -0
- data/app/views/rails_detail_my/wikis/new.js.erb +3 -0
- data/app/views/rails_detail_my/wikis/pic.html.erb +46 -0
- data/app/views/rails_detail_my/wikis/search.json.jbuilder +6 -0
- data/app/views/rails_detail_my/wikis/show.html.erb +17 -0
- data/app/views/rails_detail_my/wikis/show.html/347/232/204/345/211/257/346/234/254.erb +25 -0
- data/app/views/rails_detail_my/wikis/sub.js.erb +5 -0
- data/app/views/wikis/_form.html.erb +29 -0
- data/app/views/wikis/_head.html.erb +34 -0
- data/app/views/wikis/_nav.html.erb +2 -0
- data/app/views/wikis/_sort.html.erb +15 -0
- data/app/views/wikis/edit.html.erb +14 -0
- data/app/views/wikis/index.html.erb +20 -0
- data/app/views/wikis/new.html.erb +11 -0
- data/app/views/wikis/show.html.erb +25 -0
- data/config/locales/zh.yml +10 -0
- data/config/routes.rb +31 -0
- data/db/20171115144429_create_lists.rb +39 -0
- data/db/migrate/20150723122558_create_knowledge.rb +16 -0
- data/db/migrate_backup/20150801141208_add_parent_id_to_knowledge.rb +23 -0
- data/db/migrate_backup/20150801154145_add_column_to_wikis.rb +8 -0
- data/db/migrate_backup/20150801154531_add_position_to_knowledges.rb +6 -0
- data/db/migrate_backup/20150801163012_add_wiki_histories_to_wiki.rb +5 -0
- data/db/migrate_backup/20150802015359_change_wiki_histories_count.rb +5 -0
- data/db/migrate_backup/20150802134532_add_active_to_wikis.rb +6 -0
- data/db/migrate_backup/20150802154605_add_type_to_wiki_histroy.rb +8 -0
- data/db/migrate_backup/20150802161426_add_major_records_count_to_know.rb +6 -0
- data/db/migrate_backup/20150905144632_create_konwledage_items.rb +21 -0
- data/db/migrate_backup/20150907124021_remove_photo_id_from_items.rb +8 -0
- data/db/migrate_backup/20150919025025_rename_wiki_to_content.rb +7 -0
- data/db/migrate_backup/20151214033632_create_parts.rb +12 -0
- data/db/migrate_backup/schema.rb +186 -0
- data/lib/rails_detail.rb +26 -0
- data/lib/rails_detail/config.rb +19 -0
- data/lib/rails_detail/engine.rb +28 -0
- data/lib/rails_detail/version.rb +3 -0
- data/lib/tasks/the_detail_tasks.rake +4 -0
- data/test/controllers/knowledges_controller_test.rb +49 -0
- data/test/controllers/the_detail/pictures_controller_test.rb +48 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/system/the_detail/pictures_test.rb +41 -0
- data/test/test_helper.rb +18 -0
- data/test/the_detail_test.rb +7 -0
- metadata +346 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e2ecaa01737fbc40fa4fc6c0d3b68b3ad846bcdcead9d9b0ad13d528642b955e
|
4
|
+
data.tar.gz: e41c4f86e761bcaae83189277d682a042672b5057aec1c6b781ac5b014d4cf3f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9b8a901c81aa87c4c2a07eeebc0e6d1022b4407bc21c7ca9946472dee850d3e01ac233ceba908a450fc537695b2a25710a2a3dc31d3e741a1150d71cef7f9ece
|
7
|
+
data.tar.gz: e1d2ba516ef0ee82051714759ea1cc277db2071dbd8a9b7d3bf4d3f578c3193c241e2e046f056014d5928b729870f799b93d0b33e2b28f1f4caea92666fb9b8a
|
data/LICENSE
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
2
|
+
Version 3, 29 June 2007
|
3
|
+
|
4
|
+
Copyright (C) 2018 Mingyuan Qin.
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
6
|
+
of this license document, but changing it is not allowed.
|
7
|
+
|
8
|
+
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
11
|
+
License, supplemented by the additional permissions listed below.
|
12
|
+
|
13
|
+
0. Additional Definitions.
|
14
|
+
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
17
|
+
General Public License.
|
18
|
+
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
20
|
+
other than an Application or a Combined Work as defined below.
|
21
|
+
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
25
|
+
of using an interface provided by the Library.
|
26
|
+
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
28
|
+
Application with the Library. The particular version of the Library
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
30
|
+
Version".
|
31
|
+
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
35
|
+
based on the Application, and not on the Linked Version.
|
36
|
+
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
38
|
+
object code and/or source code for the Application, including any data
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
41
|
+
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
43
|
+
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
46
|
+
|
47
|
+
2. Conveying Modified Versions.
|
48
|
+
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
51
|
+
that uses the facility (other than as an argument passed when the
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
53
|
+
version:
|
54
|
+
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
56
|
+
ensure that, in the event an Application does not supply the
|
57
|
+
function or data, the facility still operates, and performs
|
58
|
+
whatever part of its purpose remains meaningful, or
|
59
|
+
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
61
|
+
this License applicable to that copy.
|
62
|
+
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
64
|
+
|
65
|
+
The object code form of an Application may incorporate material from
|
66
|
+
a header file that is part of the Library. You may convey such object
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
68
|
+
material is not limited to numerical parameters, data structure
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
71
|
+
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
73
|
+
Library is used in it and that the Library and its use are
|
74
|
+
covered by this License.
|
75
|
+
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
77
|
+
document.
|
78
|
+
|
79
|
+
4. Combined Works.
|
80
|
+
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
82
|
+
taken together, effectively do not restrict modification of the
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
85
|
+
the following:
|
86
|
+
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
88
|
+
the Library is used in it and that the Library and its use are
|
89
|
+
covered by this License.
|
90
|
+
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
92
|
+
document.
|
93
|
+
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
95
|
+
execution, include the copyright notice for the Library among
|
96
|
+
these notices, as well as a reference directing the user to the
|
97
|
+
copies of the GNU GPL and this license document.
|
98
|
+
|
99
|
+
d) Do one of the following:
|
100
|
+
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
102
|
+
License, and the Corresponding Application Code in a form
|
103
|
+
suitable for, and under terms that permit, the user to
|
104
|
+
recombine or relink the Application with a modified version of
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
107
|
+
Corresponding Source.
|
108
|
+
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
111
|
+
a copy of the Library already present on the user's computer
|
112
|
+
system, and (b) will operate properly with a modified version
|
113
|
+
of the Library that is interface-compatible with the Linked
|
114
|
+
Version.
|
115
|
+
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
117
|
+
be required to provide such information under section 6 of the
|
118
|
+
GNU GPL, and only to the extent that such information is
|
119
|
+
necessary to install and execute a modified version of the
|
120
|
+
Combined Work produced by recombining or relinking the
|
121
|
+
Application with a modified version of the Linked Version. (If
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
126
|
+
for conveying Corresponding Source.)
|
127
|
+
|
128
|
+
5. Combined Libraries.
|
129
|
+
|
130
|
+
You may place library facilities that are a work based on the
|
131
|
+
Library side by side in a single library together with other library
|
132
|
+
facilities that are not Applications and are not covered by this
|
133
|
+
License, and convey such a combined library under terms of your
|
134
|
+
choice, if you do both of the following:
|
135
|
+
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
137
|
+
on the Library, uncombined with any other library facilities,
|
138
|
+
conveyed under the terms of this License.
|
139
|
+
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
141
|
+
is a work based on the Library, and explaining where to find the
|
142
|
+
accompanying uncombined form of the same work.
|
143
|
+
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
145
|
+
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
148
|
+
versions will be similar in spirit to the present version, but may
|
149
|
+
differ in detail to address new problems or concerns.
|
150
|
+
|
151
|
+
Each version is given a distinguishing version number. If the
|
152
|
+
Library as you received it specifies that a certain numbered version
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
154
|
+
applies to it, you have the option of following the terms and
|
155
|
+
conditions either of that published version or of any later version
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
160
|
+
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
164
|
+
permanent authorization for you to choose that version for the
|
165
|
+
Library.
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'RailsDetail'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
Bundler::GemHelper.install_tasks
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'lib'
|
31
|
+
t.libs << 'test'
|
32
|
+
t.pattern = 'test/**/*_test.rb'
|
33
|
+
t.verbose = false
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
task default: :test
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require input-attachment
|
@@ -0,0 +1,45 @@
|
|
1
|
+
$('.ui.slider.checkbox').checkbox({
|
2
|
+
onChecked: function(){
|
3
|
+
var url = this.dataset['url'];
|
4
|
+
var params = {
|
5
|
+
method: 'POST',
|
6
|
+
credentials: 'include',
|
7
|
+
headers: {
|
8
|
+
'Content-Type': 'application/json',
|
9
|
+
'X-CSRF-Token': document.head.querySelector("[name=csrf-token]").content
|
10
|
+
},
|
11
|
+
body: JSON.stringify({
|
12
|
+
taxon_item_id: this.value
|
13
|
+
})
|
14
|
+
};
|
15
|
+
fetch(url, params).then(function(response) {
|
16
|
+
return response.text()
|
17
|
+
}).then(function(response) {
|
18
|
+
var script = document.createElement('script');
|
19
|
+
script.text = response;
|
20
|
+
document.head.appendChild(script).parentNode.removeChild(script);
|
21
|
+
}).catch(function(ex) {
|
22
|
+
console.log('parsing failed', ex)
|
23
|
+
})
|
24
|
+
},
|
25
|
+
onUnchecked: function(){
|
26
|
+
var url = this.dataset['url'];
|
27
|
+
var params = {
|
28
|
+
method: 'DELETE',
|
29
|
+
credentials: 'include',
|
30
|
+
headers: {
|
31
|
+
'Content-Type': 'application/javascript',
|
32
|
+
'X-CSRF-Token': document.head.querySelector("[name=csrf-token]").content
|
33
|
+
}
|
34
|
+
};
|
35
|
+
fetch(url, params).then(function(response) {
|
36
|
+
return response.text()
|
37
|
+
}).then(function(response) {
|
38
|
+
var script = document.createElement('script');
|
39
|
+
script.text = response;
|
40
|
+
document.head.appendChild(script).parentNode.removeChild(script);
|
41
|
+
}).catch(function(ex) {
|
42
|
+
console.log('parsing failed', ex)
|
43
|
+
})
|
44
|
+
}
|
45
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
//= require input-attachment
|
2
|
+
|
3
|
+
class HelloController extends Stimulus.Controller {
|
4
|
+
greet() {
|
5
|
+
console.log("Hellos, Stimulus!", this.element)
|
6
|
+
}
|
7
|
+
|
8
|
+
connect() {
|
9
|
+
console.log("Connects, Stimulus!", this.element)
|
10
|
+
var self = this;
|
11
|
+
attachToPreview({
|
12
|
+
fileInput: 'picture_file'
|
13
|
+
});
|
14
|
+
}
|
15
|
+
}
|
16
|
+
HelloController.targets = ['src']
|
17
|
+
const application = Stimulus.Application.start()
|
18
|
+
application.register('attachment', HelloController)
|
@@ -0,0 +1,47 @@
|
|
1
|
+
|
2
|
+
$.fn.search.settings.templates.knowledge = function(response) {
|
3
|
+
var html = '';
|
4
|
+
|
5
|
+
if(response.results !== undefined) {
|
6
|
+
|
7
|
+
// each result
|
8
|
+
$.each(response.results, function(index, result) {
|
9
|
+
if(result.url) {
|
10
|
+
html += '<a class="result" href="' + result.url + '">';
|
11
|
+
}
|
12
|
+
else {
|
13
|
+
html += '<a class="result">';
|
14
|
+
}
|
15
|
+
if(result.image !== undefined) {
|
16
|
+
html += ''
|
17
|
+
+ '<div class="image">'
|
18
|
+
+ ' <img src="' + result.image + '">'
|
19
|
+
+ '</div>'
|
20
|
+
;
|
21
|
+
}
|
22
|
+
html += '<div class="content">';
|
23
|
+
if(result.price !== undefined) {
|
24
|
+
html += '<div class="price">' + result.price + '</div>';
|
25
|
+
}
|
26
|
+
if(result.title !== undefined) {
|
27
|
+
html += '<div class="title">' + result.title + '</div>';
|
28
|
+
}
|
29
|
+
if(result.description !== undefined) {
|
30
|
+
html += '<div class="description">' + result.description + '</div>';
|
31
|
+
}
|
32
|
+
html += ''
|
33
|
+
+ '</div>'
|
34
|
+
;
|
35
|
+
html += '</a>';
|
36
|
+
});
|
37
|
+
|
38
|
+
if(response.action) {
|
39
|
+
html += ''
|
40
|
+
+ '<a href="' + response.action.url + '" class="action">'
|
41
|
+
+ response.action.text
|
42
|
+
+ '</a>';
|
43
|
+
}
|
44
|
+
return html;
|
45
|
+
}
|
46
|
+
return false;
|
47
|
+
};
|
@@ -0,0 +1,76 @@
|
|
1
|
+
class RailsDetailAdmin::ItemsController < RailsDetailAdmin::BaseController
|
2
|
+
before_action :set_list
|
3
|
+
before_action :set_item, only: [:show, :edit, :update, :destroy]
|
4
|
+
|
5
|
+
def index
|
6
|
+
@items = @list.items.page(params[:page])
|
7
|
+
end
|
8
|
+
|
9
|
+
def new
|
10
|
+
@item = @list.items.build
|
11
|
+
end
|
12
|
+
|
13
|
+
def create
|
14
|
+
@item = @list.items.build item_params
|
15
|
+
|
16
|
+
respond_to do |format|
|
17
|
+
if @item.save
|
18
|
+
@item.logo.attach(logo_params) if logo_params.present?
|
19
|
+
format.html { redirect_to admin_list_items_url(params[:list_id]), :notice => '商品描述创建成功' }
|
20
|
+
format.json { render json: @item, status: :created, location: @item }
|
21
|
+
else
|
22
|
+
format.html { render action: "new" }
|
23
|
+
format.json { render json: @item.errors, status: :unprocessable_entity }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def show
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
def edit
|
33
|
+
@list = @item.list
|
34
|
+
end
|
35
|
+
|
36
|
+
def update
|
37
|
+
@item.logo.attach(logo_params) if logo_params.present?
|
38
|
+
|
39
|
+
respond_to do |format|
|
40
|
+
if @item.update item_params
|
41
|
+
format.html { redirect_to admin_list_items_url(@item.list_id), notice: '更新成功' }
|
42
|
+
format.json { head :no_content }
|
43
|
+
else
|
44
|
+
format.html { render action: "edit" }
|
45
|
+
format.json { render json: @item.errors, status: :unprocessable_entity }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def destroy
|
51
|
+
@item.destroy
|
52
|
+
|
53
|
+
respond_to do |format|
|
54
|
+
format.html { redirect_to admin_list_items_url(@item.list_id) }
|
55
|
+
format.json { head :no_content }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
def set_list
|
61
|
+
@list = List.find params[:list_id]
|
62
|
+
end
|
63
|
+
|
64
|
+
def set_item
|
65
|
+
@item = Item.find params[:id]
|
66
|
+
end
|
67
|
+
|
68
|
+
def item_params
|
69
|
+
params[:item].permit(:name, :logo, :desc, :key)
|
70
|
+
end
|
71
|
+
|
72
|
+
def logo_params
|
73
|
+
params.fetch(:item, {}).permit(:logo).fetch(:logo, {})
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|