cantango_editor 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/.rspec +2 -0
  2. data/Gemfile +26 -0
  3. data/Gemfile.lock +177 -0
  4. data/MIT-LICENSE +20 -0
  5. data/README.md +80 -0
  6. data/Rakefile +54 -0
  7. data/VERSION +1 -0
  8. data/app/assets/images/cantango_editor/+.png +0 -0
  9. data/app/assets/images/cantango_editor/-.png +0 -0
  10. data/app/assets/images/cantango_editor/.gitkeep +0 -0
  11. data/app/assets/images/cantango_editor/bg-1.gif +0 -0
  12. data/app/assets/images/cantango_editor/bg-2.gif +0 -0
  13. data/app/assets/images/cantango_editor/bg-model.png +0 -0
  14. data/app/assets/images/cantango_editor/bg.gif +0 -0
  15. data/app/assets/images/cantango_editor/bg_action.gif +0 -0
  16. data/app/assets/images/cantango_editor/bg_action.png +0 -0
  17. data/app/assets/images/cantango_editor/bg_can.gif +0 -0
  18. data/app/assets/images/cantango_editor/bg_can.png +0 -0
  19. data/app/assets/images/cantango_editor/bg_cannot.gif +0 -0
  20. data/app/assets/images/cantango_editor/bg_cannot.png +0 -0
  21. data/app/assets/images/cantango_editor/button-top-r.png +0 -0
  22. data/app/assets/images/cantango_editor/button-top.png +0 -0
  23. data/app/assets/images/cantango_editor/cantangologo.png +0 -0
  24. data/app/assets/images/cantango_editor/cantangologo_big.png +0 -0
  25. data/app/assets/images/cantango_editor/cantangologo_big2.png +0 -0
  26. data/app/assets/images/cantango_editor/cantangologo_big3.png +0 -0
  27. data/app/assets/images/cantango_editor/ico-uc.png +0 -0
  28. data/app/assets/images/cantango_editor/images/ui-bg_diagonal-maze_20_6e4f1c_10x10.png +0 -0
  29. data/app/assets/images/cantango_editor/images/ui-bg_diagonal-maze_40_000000_10x10.png +0 -0
  30. data/app/assets/images/cantango_editor/images/ui-bg_fine-grain_10_eceadf_60x60.png +0 -0
  31. data/app/assets/images/cantango_editor/images/ui-bg_fine-grain_10_f8f7f6_60x60.png +0 -0
  32. data/app/assets/images/cantango_editor/images/ui-bg_fine-grain_15_eceadf_60x60.png +0 -0
  33. data/app/assets/images/cantango_editor/images/ui-bg_fine-grain_15_f7f3de_60x60.png +0 -0
  34. data/app/assets/images/cantango_editor/images/ui-bg_fine-grain_15_ffffff_60x60.png +0 -0
  35. data/app/assets/images/cantango_editor/images/ui-bg_fine-grain_65_654b24_60x60.png +0 -0
  36. data/app/assets/images/cantango_editor/images/ui-bg_fine-grain_68_b83400_60x60.png +0 -0
  37. data/app/assets/images/cantango_editor/images/ui-icons_222222_256x240.png +0 -0
  38. data/app/assets/images/cantango_editor/images/ui-icons_3572ac_256x240.png +0 -0
  39. data/app/assets/images/cantango_editor/images/ui-icons_8c291d_256x240.png +0 -0
  40. data/app/assets/images/cantango_editor/images/ui-icons_b83400_256x240.png +0 -0
  41. data/app/assets/images/cantango_editor/images/ui-icons_fbdb93_256x240.png +0 -0
  42. data/app/assets/images/cantango_editor/images/ui-icons_ffffff_256x240.png +0 -0
  43. data/app/assets/images/cantango_editor/line2.png +0 -0
  44. data/app/assets/images/cantango_editor/line3.png +0 -0
  45. data/app/assets/images/cantango_editor/panel-l.gif +0 -0
  46. data/app/assets/images/cantango_editor/panel-l.png +0 -0
  47. data/app/assets/images/cantango_editor/panel-r.gif +0 -0
  48. data/app/assets/images/cantango_editor/panel-r.png +0 -0
  49. data/app/assets/images/cantango_editor/panel.gif +0 -0
  50. data/app/assets/images/cantango_editor/panel.png +0 -0
  51. data/app/assets/images/cantango_editor/remember.png +0 -0
  52. data/app/assets/images/cantango_editor/sexy.png +0 -0
  53. data/app/assets/images/cantango_editor/x.png +0 -0
  54. data/app/assets/images/cantango_editor/xx.png +0 -0
  55. data/app/assets/javascripts/cantango_editor/application.js +59 -0
  56. data/app/assets/javascripts/cantango_editor/jquery.collapse.js +149 -0
  57. data/app/assets/javascripts/cantango_editor/jquery.cookie.js +96 -0
  58. data/app/assets/javascripts/cantango_editor/jquery.ui/jquery-ui-1.8.16.custom.js +996 -0
  59. data/app/assets/javascripts/cantango_editor/jquery.ui/jquery.ui.selectmenu.js +802 -0
  60. data/app/assets/stylesheets/cantango_editor/.main.css +157 -0
  61. data/app/assets/stylesheets/cantango_editor/application.css +7 -0
  62. data/app/assets/stylesheets/cantango_editor/areset.css +53 -0
  63. data/app/assets/stylesheets/cantango_editor/clearing.css +52 -0
  64. data/app/assets/stylesheets/cantango_editor/jquery-ui-1.8.16.custom.css +290 -0
  65. data/app/assets/stylesheets/cantango_editor/jquery.ui.selectmenu.css +30 -0
  66. data/app/assets/stylesheets/cantango_editor/main.css +294 -0
  67. data/app/assets/stylesheets/cantango_editor/text.css +97 -0
  68. data/app/controllers/cantango_editor/application_controller.rb +12 -0
  69. data/app/controllers/cantango_editor/permissions_controller.rb +47 -0
  70. data/app/helpers/cantango_editor/application_helper.rb +49 -0
  71. data/app/models/cantango_editor/categories.rb +52 -0
  72. data/app/models/cantango_editor/category.rb +21 -0
  73. data/app/models/cantango_editor/permissions.rb +119 -0
  74. data/app/views/cantango_editor/permissions/_footer.html.erb +4 -0
  75. data/app/views/cantango_editor/permissions/_header.html.erb +7 -0
  76. data/app/views/cantango_editor/permissions/_menu.html.erb +7 -0
  77. data/app/views/cantango_editor/permissions/_new_categories_select.html.erb +5 -0
  78. data/app/views/cantango_editor/permissions/_new_custom_targets.html.erb +5 -0
  79. data/app/views/cantango_editor/permissions/_new_targets_select.html.erb +5 -0
  80. data/app/views/cantango_editor/permissions/_permissions_form.html.erb +63 -0
  81. data/app/views/cantango_editor/permissions/index.html.erb +5 -0
  82. data/app/views/cantango_editor/permissions/index.js.erb +2 -0
  83. data/app/views/cantango_editor/permissions/new_category.js.erb +3 -0
  84. data/app/views/cantango_editor/permissions/new_custom_target.js.erb +2 -0
  85. data/app/views/cantango_editor/permissions/new_target.js.erb +4 -0
  86. data/app/views/cantango_editor/permissions/notes.html.erb +19 -0
  87. data/app/views/cantango_editor/permissions/preview_raw.html.erb +3 -0
  88. data/app/views/cantango_editor/permissions/temp _permissions_form.html.erb +55 -0
  89. data/app/views/layouts/cantango_editor/application.html.erb +14 -0
  90. data/cantango_editor.gemspec +258 -0
  91. data/config/routes.rb +15 -0
  92. data/lib/array.rb +11 -0
  93. data/lib/cantango_editor.rb +25 -0
  94. data/lib/cantango_editor/configuration.rb +34 -0
  95. data/lib/cantango_editor/engine.rb +11 -0
  96. data/lib/cantango_editor/version.rb +3 -0
  97. data/lib/permissions_hash.rb +80 -0
  98. data/lib/tasks/cantango-editor_tasks.rake +4 -0
  99. data/lib/time_precise.rb +7 -0
  100. data/script/rails +6 -0
  101. data/spec/cantango_editor/configuration/configuration_spec.rb +33 -0
  102. data/spec/cantango_editor/models/permissions_spec.rb +9 -0
  103. data/spec/cantango_editor_spec.rb +17 -0
  104. data/spec/dummy/Rakefile +7 -0
  105. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  106. data/spec/dummy/app/assets/javascripts/main.js +2 -0
  107. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  108. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  109. data/spec/dummy/app/controllers/main_controller.rb +5 -0
  110. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  111. data/spec/dummy/app/helpers/main_helper.rb +2 -0
  112. data/spec/dummy/app/mailers/.gitkeep +0 -0
  113. data/spec/dummy/app/models/.gitkeep +0 -0
  114. data/spec/dummy/app/models/admin.rb +5 -0
  115. data/spec/dummy/app/models/article.rb +2 -0
  116. data/spec/dummy/app/models/comment.rb +2 -0
  117. data/spec/dummy/app/models/concerto.rb +2 -0
  118. data/spec/dummy/app/models/guest.rb +14 -0
  119. data/spec/dummy/app/models/improvisation.rb +2 -0
  120. data/spec/dummy/app/models/post.rb +2 -0
  121. data/spec/dummy/app/models/song.rb +2 -0
  122. data/spec/dummy/app/models/tune.rb +2 -0
  123. data/spec/dummy/app/models/user.rb +11 -0
  124. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  125. data/spec/dummy/app/views/main/index.html.erb +3 -0
  126. data/spec/dummy/config.ru +4 -0
  127. data/spec/dummy/config/application.rb +53 -0
  128. data/spec/dummy/config/boot.rb +10 -0
  129. data/spec/dummy/config/categories.yml +10 -0
  130. data/spec/dummy/config/database.yml +25 -0
  131. data/spec/dummy/config/environment.rb +5 -0
  132. data/spec/dummy/config/environments/development.rb +30 -0
  133. data/spec/dummy/config/environments/production.rb +60 -0
  134. data/spec/dummy/config/environments/test.rb +39 -0
  135. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  136. data/spec/dummy/config/initializers/cantango.rb +4 -0
  137. data/spec/dummy/config/initializers/cantango_editor.rb +4 -0
  138. data/spec/dummy/config/initializers/devise.rb +210 -0
  139. data/spec/dummy/config/initializers/inflections.rb +10 -0
  140. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  141. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  142. data/spec/dummy/config/initializers/session_store.rb +8 -0
  143. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  144. data/spec/dummy/config/locales/devise.en.yml +58 -0
  145. data/spec/dummy/config/locales/en.yml +5 -0
  146. data/spec/dummy/config/permissions.yml.save +59 -0
  147. data/spec/dummy/config/routes.rb +15 -0
  148. data/spec/dummy/db/development.sqlite3 +0 -0
  149. data/spec/dummy/db/migrate/20111018203622_create_posts.rb +9 -0
  150. data/spec/dummy/db/migrate/20111018203648_create_articles.rb +9 -0
  151. data/spec/dummy/db/migrate/20111018203800_create_comments.rb +9 -0
  152. data/spec/dummy/db/migrate/20111018203817_create_songs.rb +9 -0
  153. data/spec/dummy/db/migrate/20111018203827_create_tunes.rb +9 -0
  154. data/spec/dummy/db/migrate/20111018203859_create_concertos.rb +9 -0
  155. data/spec/dummy/db/migrate/20111018203917_create_improvisations.rb +9 -0
  156. data/spec/dummy/db/migrate/20111019122217_devise_create_users.rb +28 -0
  157. data/spec/dummy/db/schema.rb +58 -0
  158. data/spec/dummy/db/test.sqlite3 +0 -0
  159. data/spec/dummy/lib/assets/.gitkeep +0 -0
  160. data/spec/dummy/log/.gitkeep +0 -0
  161. data/spec/dummy/public/404.html +26 -0
  162. data/spec/dummy/public/422.html +26 -0
  163. data/spec/dummy/public/500.html +26 -0
  164. data/spec/dummy/public/favicon.ico +0 -0
  165. data/spec/dummy/script/rails +6 -0
  166. data/spec/integration/navigation_spec.rb +18 -0
  167. data/spec/permissions_hash_spec.rb +63 -0
  168. data/spec/requests/requests_spec.rb +9 -0
  169. data/spec/spec_helper.rb +16 -0
  170. metadata +416 -0
@@ -0,0 +1,30 @@
1
+ /* Selectmenu
2
+ ----------------------------------*/
3
+ .ui-selectmenu { display: block; display: inline-block; position: relative; height: 2.2em; vertical-align: middle; text-decoration: none; overflow: hidden; zoom: 1; }
4
+ .ui-selectmenu-icon { position:absolute; right:6px; margin-top:-8px; top: 50%; }
5
+ .ui-selectmenu-menu { padding:0; margin:0; list-style:none; position:absolute; top: 0; display: none; overflow: auto; z-index: 1005;} /* z-index: 1005 to make selectmenu work with dialog */
6
+ .ui-selectmenu-open { display: block; }
7
+ .ui-selectmenu-menu-popup { margin-top: -1px; }
8
+ .ui-selectmenu-menu-dropdown { }
9
+ .ui-selectmenu-menu li { padding:0; margin:0; display: block; border-top: 1px dotted transparent; border-bottom: 1px dotted transparent; border-right-width: 0 !important; border-left-width: 0 !important; font-weight: normal !important; }
10
+ .ui-selectmenu-menu li a,.ui-selectmenu-status { line-height: 1.4em; display: block; padding: .405em 1em; outline:none; text-decoration:none; }
11
+ .ui-selectmenu-menu li.ui-state-disabled a, .ui-state-disabled { cursor: default; }
12
+ .ui-selectmenu-menu li.ui-selectmenu-hasIcon a,
13
+ .ui-selectmenu-hasIcon .ui-selectmenu-status { padding-left: 20px; position: relative; margin-left: 5px; }
14
+ .ui-selectmenu-menu li .ui-icon, .ui-selectmenu-status .ui-icon { position: absolute; top: 1em; margin-top: -8px; left: 0; }
15
+ .ui-selectmenu-status { line-height: 1.4em; }
16
+ .ui-selectmenu-open li.ui-selectmenu-item-focus a { }
17
+ .ui-selectmenu-open li.ui-selectmenu-item-selected { }
18
+ .ui-selectmenu-menu li span,.ui-selectmenu-status span { display:block; margin-bottom: .2em; }
19
+ .ui-selectmenu-menu li .ui-selectmenu-item-header { font-weight: bold; }
20
+ .ui-selectmenu-menu li .ui-selectmenu-item-content { }
21
+ .ui-selectmenu-menu li .ui-selectmenu-item-footer { opacity: .8; }
22
+ /* for optgroups */
23
+ .ui-selectmenu-menu .ui-selectmenu-group { font-size: 1em; }
24
+ .ui-selectmenu-menu .ui-selectmenu-group .ui-selectmenu-group-label { line-height: 1.4em; display:block; padding: .6em .5em 0; font-weight: bold; }
25
+ .ui-selectmenu-menu .ui-selectmenu-group ul { margin: 0; padding: 0; }
26
+ /* IE6 workaround (dotted transparent borders) */
27
+ * html .ui-selectmenu-menu li { border-color: pink; filter:chroma(color=pink); width:100%; }
28
+ * html .ui-selectmenu-menu li a { position: relative }
29
+ /* IE7 workaround (opacity disabled) */
30
+ *+html .ui-state-disabled, *+html .ui-state-disabled a { color: silver; }
@@ -0,0 +1,294 @@
1
+ /* Highlight not-done links */
2
+ a[href^="##"] {
3
+ padding-right:14px !important; color:#888 !important;
4
+ background:url(/assets/cantango_editor/ico-uc.png) center right no-repeat; cursor:default;
5
+ }
6
+
7
+ /* Basic */
8
+
9
+ body
10
+ {
11
+ background:url(/assets/cantango_editor/bg.gif);
12
+ margin:40px;
13
+ }
14
+
15
+ a, a:link, a:visited {text-decoration:none; }
16
+ a:hover {text-decoration:none;}
17
+
18
+ /* Header */
19
+
20
+ .header {height:62px; background:url(/assets/cantango_editor/panel.gif); padding:0; min-width:900px;}
21
+ .header-l {height:62px; width:40px; float:left; background:url(/assets/cantango_editor/panel-l.gif) left;}
22
+ .header-r {height:62px; width:40px; float:right; background:url(/assets/cantango_editor/panel-r.gif) right;}
23
+ .header H1 {
24
+ float:left; margin-top:21px;
25
+ font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-size:18px; font-weight:normal;}
26
+ .header H1 a, .header H1 a:link, .header H1 a:visited {color:#fff; text-shadow:0 -1px 1px #525239;}
27
+ .header H1 a:hover {color:#ffffcc;}
28
+ .header H1 span a, .header H1 span a:link, .header H1 span a:visited {color:#000; text-shadow:none;}
29
+ .header H1 span a:hover {color:#666;}
30
+
31
+ ul.topmenu {float:right; padding:0; list-style:none; margin-top:15px;}
32
+ ul.topmenu li {float:left; list-style:none; padding:0; padding-right:11px; height:31px;
33
+ background:url(/assets/cantango_editor/button-top-r.png) right no-repeat;
34
+ margin-left: 10px;}
35
+ ul.topmenu li a {
36
+ display:block; height:20px; padding:7px 0 4px 11px;
37
+ background:url(/assets/cantango_editor/button-top.png) left no-repeat;
38
+ color:#666633; text-shadow:0 1px 1px #e8e8cf;}
39
+ ul.topmenu li a:hover {color:#000;}
40
+
41
+ /* Footer */
42
+ .footer {
43
+ height:50px;
44
+ background:url(/assets/cantango_editor/line2.png) top repeat-x;
45
+ padding-top:10px;
46
+ margin-top:90px;
47
+ }
48
+ .remember {
49
+ background:url(/assets/cantango_editor/remember.png) repeat-x;
50
+ padding:7px 10px;
51
+ font-size:14px;
52
+ color:#666633;
53
+ text-shadow:0 1px 1px #f8f8e7;
54
+ float:left;
55
+ }
56
+ .footer .logo {
57
+ background:url(/assets/cantango_editor/cantangologo.png) top right no-repeat;
58
+ height:50px; width:140px;
59
+ float:right;
60
+ }
61
+ .logobig {
62
+ background:url(/assets/cantango_editor/cantangologo_big.png) 0 0 no-repeat;
63
+ height:95px; width:171px;
64
+ //float:right;
65
+ margin-top:20px;
66
+ }
67
+
68
+ .logobig2 {
69
+ background:url(/assets/cantango_editor/cantangologo_big2.png) 0 0 no-repeat;
70
+ height:95px; width:200px;
71
+ //float:right;
72
+ margin-top:20px;
73
+ }
74
+
75
+ .logobig3 {
76
+ background:url(/assets/cantango_editor/cantangologo_big3.png) 0 0 no-repeat;
77
+ height:95px; width:200px;
78
+ //float:right;
79
+ margin-top:20px;
80
+ }
81
+
82
+ /* Permissions table */
83
+ table {border-collapse: collapse;}
84
+ table .models_cell { width:350px;border:1px solid #eee; }
85
+ table .actions_cell { color:grey }
86
+
87
+
88
+
89
+ /* Structure */
90
+
91
+ .permissions_form {padding:0 40px;}
92
+
93
+ .inner {
94
+ padding:10px;}
95
+ .wrapper {
96
+ margin:1px 0;
97
+ background:url(/assets/cantango_editor/line3.png) top repeat-x;
98
+ }
99
+ .wrapper H3 {
100
+ margin-bottom:0; padding:10px 30px 15px;
101
+ font-size:18px; font-weight:normal;
102
+ color:#fbfbc9;
103
+ text-shadow:0 -1px 1px #6e6e5a;
104
+ }
105
+ .wrapper H3.active {background:url(/assets/cantango_editor/+.png) 7px 11px no-repeat;}
106
+ .wrapper H3.inactive {background:url(/assets/cantango_editor/-.png) 7px 11px no-repeat;}
107
+ .wrapper H3 a, .wrapper H3 a:link, .wrapper H3 a:visited {color:#fff;}
108
+ .wrapper H3 a:hover {color:#ffffcc;}
109
+ .wrapper H3.active a, .wrapper H3.active a:link, .wrapper H3.active a:visited {color:#ffff99;}
110
+
111
+
112
+ .section_line_wr {margin-bottom:20px;}
113
+ .section_h_action {width:9%;//float:left; padding:1px; display:table-cell;}
114
+ .section_h_can, .section_h_cannot { display:table-cell;
115
+ //float:left;
116
+ width:45%; text-align:center;
117
+ padding:0 0 4px 0;
118
+ color:#666633; text-shadow:0 1px 1px #e4e4cf;
119
+ font-family:Tahoma; font-size:10px; font-weight:bold;
120
+ text-transform:uppercase;
121
+ letter-spacing:5px;}
122
+
123
+ .section_line {display:table; width:100%; margin-bottom:2px; min-width:800px;}
124
+ .section_line_action, .section_line_can, .section_line_cannot {
125
+ border-radius: 7px;
126
+ -moz-border-radius: 7px;
127
+ -webkit-border-radius: 7px;
128
+ display:table-cell;
129
+ padding:10px;
130
+ }
131
+ .section_line_null {display:table-cell; width:2px;}
132
+ .section_line_action {
133
+ background:url(/assets/cantango_editor/bg_action.png);
134
+ width:8,5%; //text-align:right; text-align:center; text-transform:uppercase; font-size:11px;
135
+ text-shadow:0 1px 1px #e7e7c7;
136
+ vertical-align:middle;
137
+ //margin:0 2px 2px 0; //float:left;}
138
+ .section_line_can {
139
+ background:url(/assets/cantango_editor/bg_can.png);
140
+ width:46%; //margin:0 2px 2px 0; //float:left;
141
+ padding:10px;}
142
+ .section_line_cannot {
143
+ background:url(/assets/cantango_editor/bg_cannot.png);
144
+ width:45%; //margin-right:2px; //float:left;
145
+ padding:10px;}
146
+
147
+
148
+ h2.permissions_type {
149
+ margin:30px 0 22px 0;
150
+ padding:15px 0 0;
151
+ background:url(/assets/cantango_editor/line2.png) top repeat-x;
152
+ font-size:24px;
153
+ color:#000;
154
+ text-shadow:0 1px 1px #ffffcc;
155
+ }
156
+
157
+ /* Content */
158
+
159
+
160
+ .delete_target_section {display:none;}
161
+ .delete_target_link {
162
+ display:inline-block;
163
+ width:16px;
164
+ height:16px;
165
+ background:url(/assets/cantango_editor/xx.png) 0 0 no-repeat;
166
+ margin-bottom:-4px;
167
+ margin-left:4px;
168
+ margin-right:-6px;
169
+ }
170
+ .models_select_close_link {
171
+ display:inline-block;
172
+ width:16px;
173
+ height:16px;
174
+ background:url(/assets/cantango_editor/xx.png) 0 0 no-repeat;
175
+ margin-bottom:-4px;
176
+ }
177
+ a.delete_target_link:hover,
178
+ a.models_select_close_link:hover {
179
+ background:url(/assets/cantango_editor/xx.png) 0 -16px no-repeat;}
180
+
181
+ .sexy_buttons {//visibility:hidden; opacity:0.3; margin-bottom:-10px;}
182
+ .new_target_link {}
183
+ .add_model {
184
+ display:inline-block;
185
+ height:19px;
186
+ width:50px;
187
+ background:url(/assets/cantango_editor/sexy.png) 0 0 no-repeat;}
188
+ .add_category {
189
+ display:inline-block;
190
+ height:19px;
191
+ width:60px;
192
+ background:url(/assets/cantango_editor/sexy.png) -55px 0 no-repeat;}
193
+ .add_custom {
194
+ display:inline-block;
195
+ height:19px;
196
+ width:53px;
197
+ background:url(/assets/cantango_editor/sexy.png) -120px 0 no-repeat;}
198
+ .add_model:hover {background-position:0 -19px;}
199
+ .add_category:hover {background-position: -55px -19px;}
200
+ .add_custom:hover {background-position:-120px -19px;}
201
+
202
+ /* Targets representation */
203
+
204
+ .models_ololo {
205
+
206
+ }
207
+ .models_line {
208
+ display:inline-block;
209
+ color: #222;
210
+ font-family:monospace;
211
+ font-weight:bold;
212
+ font-size:14px;
213
+ line-height:22px;
214
+ background:url(/assets/cantango_editor/bg-model.png) 0 0 repeat-x;
215
+ //border:1px solid #aeae8d;
216
+ margin:2px 0;
217
+ padding:0 10px;
218
+ border-radius: 16px;
219
+ -moz-border-radius: 16px;
220
+ -webkit-border-radius: 16px;}
221
+
222
+ .models_line .model_category {
223
+ color: #555; font-style: italic;
224
+ letter-spacing:3px;
225
+ }
226
+ .models_line.first {}
227
+ .models_line.last {margin-bottom:5px;}
228
+
229
+ .model_regex_slash { color: #669900; font-size:18px; font-weight:bold; margin:0 2px;}
230
+
231
+ .model_relationship_equals { color: #ffcc00; font-size:18px; font-weight: bold; margin:0 2px; }
232
+ .model_relationship_sharp { color: #cc3333; font-size:18px; font-weight: bold; margin:0 2px;}
233
+
234
+ .model_ownership_sharp { color: #cc3333; font-size:18px; font-weight: bold; margin:0 2px;}
235
+
236
+ .new_target_area {}
237
+
238
+ input.models_select {
239
+ margin:10px 0;
240
+ width:300px;
241
+
242
+ -moz-transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;
243
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset;
244
+
245
+
246
+ border: 1px solid #e9e9b4;
247
+ background-color:#d5d5b8;
248
+ border-radius: 6px;
249
+ -moz-border-radius: 6px;
250
+ -webkit-border-radius: 6px;
251
+ color: #666;
252
+ font-family:monospace;
253
+ display: inline-block;
254
+ font-size: 14px;
255
+ height: 18px;
256
+ line-height: 18px;
257
+ padding: 4px;
258
+
259
+ }
260
+ input.models_select:focus {
261
+ outline: 0;
262
+ border-color: rgba(230, 230, 180, 0.8);
263
+ -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(255, 255, 130, 0.6);
264
+ -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(255, 255, 130, 0.6);
265
+ box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(255, 255, 130, 0.6);
266
+ }
267
+
268
+ .ui-selectmenu {
269
+ margin:8px 0 12px;
270
+ }
271
+ .ui-widget {
272
+ font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
273
+ //font-size: 12px;
274
+ }
275
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
276
+ background: url(/assets/cantango_editor/bg.gif) repeat scroll 50% 50% #F8F7F6;
277
+ border: 1px solid #99997f;
278
+ color: #654B24;
279
+ font-weight: bold;
280
+ }
281
+ .ui-widget-content {
282
+ background: url(/assets/cantango_editor/bg-2.gif) repeat scroll 50% 50% #F8F7F6;
283
+ border: 1px solid #bbbb98;
284
+ color: #1F1F1F;
285
+ }
286
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
287
+ border: 1px solid #99997f; background: url(/assets/cantango_editor/bg-1.gif) repeat scroll 50% 50% #F8F7F6;
288
+ font-weight: bold; color: #ffffff; }
289
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
290
+ border: 1px solid #99997f; background: url(/assets/cantango_editor/bg-2.gif) repeat scroll 50% 50% #F8F7F6;
291
+ font-weight: bold; color: #140f06; }
292
+
293
+
294
+
@@ -0,0 +1,97 @@
1
+ @charset "utf-8";
2
+
3
+ /* =Basic HTML
4
+ --------------------------------------------------------------------------------*/
5
+
6
+ body, html
7
+ {
8
+ font: 12px "Trebuchet MS", 'Liberation Sans', FreeSans, sans-serif;
9
+ line-height:140%;
10
+ }
11
+
12
+
13
+ a:focus
14
+ {
15
+ outline: 1px dotted invert;
16
+ }
17
+
18
+ hr
19
+ {
20
+ border-color: #ccc;
21
+ border-style: solid;
22
+ border-width: 1px 0 0;
23
+ clear: both;
24
+ height: 0;
25
+ }
26
+
27
+ /* =Headings
28
+ --------------------------------------------------------------------------------*/
29
+
30
+ h1,
31
+ h2,
32
+ h3,
33
+ h4,
34
+ h5,
35
+ h6 { font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;}
36
+
37
+ h1
38
+ {
39
+ font-size: 30px;
40
+ }
41
+
42
+ h2
43
+ {
44
+ font-size: 18px;
45
+ font-weight:normal;
46
+ }
47
+
48
+ h3
49
+ {
50
+ font-size: 14px;
51
+ font-weight:bold;
52
+ color:#666;
53
+ }
54
+
55
+ h4
56
+ {
57
+ font-size: 14px;
58
+ color:#666;
59
+ }
60
+
61
+
62
+ /* =Spacing
63
+ --------------------------------------------------------------------------------*/
64
+
65
+ ol
66
+ {
67
+ list-style: decimal;
68
+ }
69
+
70
+ ul
71
+ {
72
+ list-style: square;
73
+ }
74
+
75
+ li
76
+ {
77
+ margin-left: 30px;
78
+ }
79
+
80
+ p,
81
+ dl,
82
+ hr,
83
+ h1,
84
+ h2,
85
+ h3,
86
+ h4,
87
+ h5,
88
+ h6,
89
+ ol,
90
+ ul,
91
+ pre,
92
+ table,
93
+ address,
94
+ fieldset
95
+ {
96
+ margin-bottom: 20px;
97
+ }
@@ -0,0 +1,12 @@
1
+ module CantangoEditor
2
+ class ApplicationController < ActionController::Base
3
+
4
+ helper_method :app_name
5
+
6
+ private
7
+
8
+ def app_name
9
+ Rails.application.class.parent_name
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,47 @@
1
+ module CantangoEditor
2
+ class PermissionsController < ApplicationController
3
+
4
+ before_filter :process_params, :only => [:new_target, :new_category, :new_custom_target]
5
+
6
+ def index
7
+ @actions = Permissions.actions_available
8
+ @models = Permissions.models_available
9
+ @permission_types = Permissions.permission_types_available
10
+ @permission_groups = Permissions.permission_groups_available
11
+ @permissions = Permissions.yml_file_content
12
+
13
+ respond_to do |format|
14
+ format.html
15
+ format.js { render 'index.js.erb' }
16
+ end
17
+ end
18
+
19
+ def update
20
+ Permissions.update_permissions! params
21
+
22
+ index
23
+ end
24
+
25
+
26
+ def process_params
27
+ [:ptype, :pgroup, :can_action, :crud_action].each do |param|
28
+ instance_variable_set("@#{param}", params[param])
29
+ end
30
+ end
31
+
32
+ def new_custom_target
33
+ end
34
+
35
+ def new_target
36
+ @new_targets_available = Permissions.models_available_names - params[:existing_targets].to_a
37
+ end
38
+
39
+ def new_category
40
+ @new_categories_available = Categories.available_except(params[:existing_targets].to_a)
41
+ end
42
+
43
+ def preview_raw
44
+ @permissions_content = Permissions.raw_file_content
45
+ end
46
+ end
47
+ end