rtrain 0.2.5 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -0
  3. data/README.md +59 -0
  4. data/docs-img/quick_demo_inputs.md +36 -0
  5. data/docs-img/rtrain-placeholder.png +0 -0
  6. data/lib/generators/ajax_files/_delete.html.erb +16 -0
  7. data/lib/generators/ajax_files/_edit.html.erb +4 -0
  8. data/lib/generators/ajax_files/_form.html.erb +24 -0
  9. data/lib/generators/ajax_files/_index.html.erb +10 -0
  10. data/lib/generators/ajax_files/_new.html.erb +4 -0
  11. data/lib/generators/ajax_files/_save.js.erb +9 -0
  12. data/lib/generators/ajax_files/create.js.erb +1 -0
  13. data/lib/generators/ajax_files/delete.js.erb +2 -0
  14. data/lib/generators/ajax_files/destroy.js.erb +1 -0
  15. data/lib/generators/ajax_files/edit.js.erb +6 -0
  16. data/lib/generators/ajax_files/index.html.erb +25 -0
  17. data/lib/generators/ajax_files/new.js.erb +6 -0
  18. data/lib/generators/ajax_files/update.js.erb +1 -0
  19. data/lib/generators/controllers/ajax_controller.rb +51 -0
  20. data/lib/generators/controllers/main_controller.rb +5 -0
  21. data/lib/generators/controllers/sessions_app_controller.rb +11 -0
  22. data/lib/generators/controllers/user_sessions_controller.rb +27 -0
  23. data/lib/generators/controllers/users_controller.rb +21 -0
  24. data/lib/generators/models/user.rb +5 -0
  25. data/lib/generators/models/user_session.rb +2 -0
  26. data/lib/generators/rtrain/install_generator.rb +421 -0
  27. data/lib/generators/sessions/sessions_routes.rb +6 -0
  28. data/lib/generators/shared/_errors.html.erb +13 -0
  29. data/lib/generators/templates/ajax.scss +137 -0
  30. data/lib/generators/templates/forms.scss +35 -0
  31. data/lib/generators/templates/home.html.erb +21 -0
  32. data/lib/generators/templates/nav-bar.scss +25 -0
  33. data/lib/generators/templates/rtrain-application.html.erb +18 -0
  34. data/lib/generators/templates/rtrain_scaffold.scss +132 -0
  35. data/lib/generators/templates/sign-in.scss +31 -0
  36. data/lib/generators/user_sessions/new.html.erb +22 -0
  37. data/lib/generators/users/new.html.erb +22 -0
  38. data/lib/rtrain.rb +2 -0
  39. data/rtrain-0.0.1.gem +0 -0
  40. data/rtrain-0.0.2.gem +0 -0
  41. data/rtrain-0.0.3.gem +0 -0
  42. data/rtrain-0.0.4.gem +0 -0
  43. data/rtrain-0.0.5.gem +0 -0
  44. data/rtrain-0.0.6.gem +0 -0
  45. data/rtrain-0.0.7.gem +0 -0
  46. data/rtrain-0.0.8.gem +0 -0
  47. data/rtrain-0.0.9.gem +0 -0
  48. data/rtrain-0.1.0.gem +0 -0
  49. data/rtrain-0.1.1.gem +0 -0
  50. data/rtrain-0.1.2.gem +0 -0
  51. data/rtrain-0.1.3.gem +0 -0
  52. data/rtrain-0.1.4.gem +0 -0
  53. data/rtrain-0.1.5.gem +0 -0
  54. data/rtrain-0.1.6.gem +0 -0
  55. data/rtrain-0.1.7.gem +0 -0
  56. data/rtrain-0.1.8.gem +0 -0
  57. data/rtrain-0.1.9.gem +0 -0
  58. data/rtrain-0.2.0.gem +0 -0
  59. data/rtrain-0.2.1.gem +0 -0
  60. data/rtrain-0.2.2.gem +0 -0
  61. data/rtrain-0.2.3.gem +0 -0
  62. data/rtrain-0.2.4.gem +0 -0
  63. data/rtrain-0.2.5.gem +0 -0
  64. data/rtrain-0.2.6.gem +0 -0
  65. data/rtrain.gemspec +4 -4
  66. metadata +68 -5
@@ -0,0 +1,421 @@
1
+ module Rtrain
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ desc "Creates a generator for Rtrain to style scaffold tables."
5
+ class_option :copy_css, type: :boolean, desc: 'Write some nice CSS for scaffold, comments out original scaffold css'
6
+ class_option :add_nav, type: :boolean, desc: 'Makes a wicked sweet nav bar for your rails app'
7
+ class_option :add_homepage, type: :boolean, desc: 'Adds a home page controller and view and updates it to be the root URL'
8
+ class_option :add_user_sessions, type: :boolean, desc: 'Builds user and user sessions models, adds Sign-up and sign-in links to application layout, requires login before records can be added to a form'
9
+ class_option :ajaxify, type: :boolean, desc: 'Overhauls all views into ajax-ready form input'
10
+
11
+ def require_gems
12
+ gem('authlogic')
13
+ gem('ffaker')
14
+ end
15
+
16
+ def gem_info
17
+ return if options.copy_css? || options.add_nav? || options.add_homepage? || options.add_user_sessions? || options.ajaxify?
18
+ puts "
19
+ ----------------------------------------------------
20
+ Rtrain needs an argument to continue.
21
+ Please re-run the install generator with one of the
22
+ following options:
23
+ \n
24
+ --copy_css
25
+ --add_nav
26
+ --add_homepage
27
+ --add_user_sessions
28
+ --ajaxify
29
+ \n
30
+ Refer to the README at https://github.com/lynnd335/rtrain
31
+ for details and illustrations of each option's executions
32
+ ----------------------------------------------------
33
+ "
34
+ end
35
+
36
+ def run_rtrain
37
+
38
+
39
+ dir = File.dirname(__FILE__)
40
+
41
+ ##create rtrain logfile or open it if it already exists
42
+ if !File.exist?("rtrain_log.txt")
43
+ rtrain_log = File.new("rtrain_log.txt", "a")
44
+ puts "\n
45
+ ----------------------------------------------------
46
+ Rtrain logfile created in main directory of app
47
+ ----------------------------------------------------
48
+ \n
49
+ "
50
+ else
51
+ rtrain_log = open("rtrain_log.txt", "a")
52
+ end
53
+ rtrain_log_read = open(rtrain_log).read
54
+ ##end create rtrain logfile
55
+
56
+ ##add lines to config/routes.rb for auth
57
+ routes_rb = open("config/routes.rb").read
58
+ if !routes_rb.match("#session routes here")
59
+ routes_rb['#'] = "\n#session routes here\n#"
60
+ end
61
+ routes_rb_write = open("config/routes.rb", "w")
62
+ routes_rb_write.write(routes_rb)
63
+ routes_rb_write.close
64
+ ##end
65
+
66
+ ##Begin Copy CSS
67
+
68
+ if options[:copy_css]
69
+ stylesheets = "app/assets/stylesheets/"
70
+ new_css = ["../templates/rtrain_scaffold.scss","../templates/forms.scss"]
71
+
72
+ new_css.each do |n|
73
+ new_css_path = File.join(dir, n)
74
+ FileUtils.cp(new_css_path, stylesheets)
75
+ end
76
+ if !rtrain_log_read.match('_copy_css_run')
77
+ scaffold = open("app/assets/stylesheets/scaffolds.scss").read
78
+ old_css = open("app/assets/stylesheets/scaffolds.scss", "w")
79
+ old_css.write("/*\n" + scaffold + "\n*/")
80
+ old_css.close
81
+ end
82
+ puts "
83
+ ----------------------------------------------------
84
+ Rtrain Scaffold and forms css documents now active in app/assets/stylesheets/
85
+ ----------------------------------------------------
86
+ "
87
+
88
+ open(rtrain_log, 'a') { |f| f.puts Time.now().to_s() + "_copy_css_run\n"}
89
+ end
90
+
91
+ ##end copy css
92
+
93
+ ##begin add nvigation bar
94
+
95
+ if options[:add_nav]
96
+ read_applayout = open("app/views/layouts/application.html.erb").read
97
+ app_name = read_applayout.split("<title>")[1].split("</title>")[0]
98
+ app_name = "\n<h1>"+app_name+"</h1>\n"
99
+ tables = ActiveRecord::Base.connection.tables[1..-1]
100
+ list_items = []
101
+ tables.each do |t|
102
+ if t != 'users'
103
+ link = "<li><%=link_to '" + t.titleize + "'," + t + "_path%></li>"
104
+ list_items.push(link)
105
+ end
106
+ end
107
+
108
+ nav = "\n<div id='main-navbar'>\n\t<ul id='menu'>\n\t\t" + list_items.join("\n\t\t") + "\n\t</ul>\n</div>\t\n\n\n"
109
+
110
+
111
+ ##check to see if add_nav has already been run, update via overwrite if true, add if else
112
+
113
+ if rtrain_log_read.match('_nav_added')
114
+ old_menu = read_applayout.split("<ul id='menu'>")[1].split("</ul>")[0]
115
+ if rtrain_log_read.match('_main_view_controller_added')
116
+ list_items.unshift("<li><%=link_to 'Main', '/'%></li>")
117
+ end
118
+ new_menu = list_items.join("\n\t\t")
119
+ read_applayout [old_menu] = new_menu
120
+ new_applayout = open("app/views/layouts/application.html.erb", "w")
121
+ new_applayout.write(read_applayout)
122
+ new_applayout.close
123
+ open(rtrain_log, 'a') { |f| f.puts Time.now().to_s() + "_nav_updated-" + tables.to_s() + "\n"}
124
+ puts "
125
+ ----------------------------------------------------
126
+ Rtrain Nav Bar updated app/views/layouts/application.html.erb\n
127
+ ----------------------------------------------------
128
+ "
129
+ else
130
+ new_layout = read_applayout.split("<body>")
131
+ read_applayout = open("app/views/layouts/application.html.erb", "w")
132
+ read_applayout.write(new_layout[0] + "<body>" + app_name + nav + new_layout[1])
133
+ read_applayout.close
134
+ ###
135
+ nav_css = "../templates/nav-bar.scss"
136
+ nav_css_path = File.join(dir, nav_css)
137
+ stylesheets = "app/assets/stylesheets/"
138
+ FileUtils.cp(nav_css_path, stylesheets)
139
+ puts "
140
+ ----------------------------------------------------
141
+ Rtrain Nav Bar and App Title now active in app/views/layouts/application.html.erb\n
142
+
143
+ IMPORTANT! Be extra careful re-running this command, as it will overwrite to the default styling
144
+ ----------------------------------------------------
145
+ "
146
+ open(rtrain_log, 'a') { |f| f.puts Time.now().to_s() + "_nav_added-" + tables.to_s() + "\n"}
147
+ end
148
+ # new_applayout.close
149
+ end
150
+
151
+ ##end add navigation bar
152
+
153
+ ##begin add main page
154
+
155
+ if options[:add_homepage]
156
+ FileUtils.mkdir("app/views/main/")
157
+
158
+ home_page = "../templates/home.html.erb"
159
+ home_page_path = File.join(dir, home_page)
160
+ main_view_dir = "app/views/main/"
161
+ FileUtils.cp(home_page_path, main_view_dir)
162
+
163
+ main = "../controllers/main_controller.rb"
164
+ main_path = File.join(dir, main)
165
+ controllers = "app/controllers"
166
+ FileUtils.cp(main_path, controllers)
167
+
168
+ root = open("config/routes.rb").read
169
+ root ["# root 'welcome#index'"] = "root 'main#show', page: 'home'
170
+ get '/main/:page' => 'pages#show'"
171
+ routes = open("config/routes.rb","w")
172
+ routes.write(root)
173
+ routes.close
174
+
175
+ puts "
176
+ ----------------------------------------------------
177
+ Rtrain Homepage Now Active and set as root URL, re-run '--add_nav' to have link appear in nav bar
178
+ ----------------------------------------------------
179
+ "
180
+ open(rtrain_log, 'a') { |f| f.puts Time.now().to_s() + "_main_view_controller_added" + "\n"}
181
+ end
182
+
183
+ ##end add homepage
184
+
185
+ ##begin add sessions
186
+
187
+
188
+ if options[:add_user_sessions]
189
+ if !rtrain_log_read.match('_user_sessions_added')
190
+
191
+ FileUtils.mkdir("app/views/users/")
192
+ new_users = "../users/new.html.erb"
193
+ new_users_path = File.join(dir, new_users)
194
+ new_users_dir = "app/views/users/"
195
+ FileUtils.cp(new_users_path, new_users_dir)
196
+
197
+ FileUtils.mkdir("app/views/user_sessions/")
198
+ new_user_sessions = "../user_sessions/new.html.erb"
199
+ new_user_sessions_path = File.join(dir, new_user_sessions)
200
+ new_user_sessions_dir = "app/views/user_sessions/"
201
+ FileUtils.cp(new_user_sessions_path, new_user_sessions_dir)
202
+
203
+ FileUtils.mkdir("app/views/shared/")
204
+ errors = "../shared/_errors.html.erb"
205
+ errors_path = File.join(dir, errors)
206
+ errors_dir = "app/views/shared/"
207
+ FileUtils.cp(errors_path, errors_dir)
208
+
209
+ models = ["../models/user.rb","../models/user_session.rb"]
210
+ controllers = ["../controllers/users_controller.rb","../controllers/user_sessions_controller.rb","../controllers/sessions_app_controller.rb"]
211
+
212
+ models.each do |m|
213
+ models_path = File.join(dir, m)
214
+ models_dir = "app/models/"
215
+ FileUtils.cp(models_path, models_dir)
216
+ end
217
+
218
+ controllers.each do |c|
219
+ controllers_path = File.join(dir, c)
220
+ controllers_dir = "app/controllers/"
221
+ FileUtils.cp(controllers_path, controllers_dir)
222
+ end
223
+
224
+ sessions_app_controller = open("app/controllers/sessions_app_controller.rb").read
225
+ app_controller = open("app/controllers/application_controller.rb").read
226
+
227
+ if app_controller.match("private")
228
+ app_controller ["private"] = "private" + "\n" + sessions_app_controller
229
+ else
230
+ app_controller[app_controller.rindex('end')...(app_controller.rindex('end') + 'end'.length)] = app_controller + "private" + sessions_app_controller
231
+ end
232
+
233
+ current_app_controller = open("app/controllers/application_controller.rb", "w")
234
+ current_app_controller.write(app_controller)
235
+ current_app_controller.close
236
+
237
+
238
+ session_css = "../templates/sign-in.scss"
239
+ session_css_path = File.join(dir, session_css)
240
+ stylesheets = "app/assets/stylesheets/"
241
+ FileUtils.cp(session_css_path, stylesheets)
242
+ applayout = open("app/views/layouts/application.html.erb").read
243
+ new_layout = applayout.split("<body>")
244
+ session_links = "
245
+ <div id='signin-bar'>
246
+ <% if current_user %>
247
+ <span><%= current_user.email %></span>&nbsp;&nbsp;|&nbsp;&nbsp;
248
+ <%= link_to 'Sign Out', sign_out_path, method: :delete %>
249
+ <% else %>
250
+ <%=link_to 'Sign Up', new_user_path%>&nbsp;&nbsp;|&nbsp;&nbsp;
251
+ <%= link_to 'Sign In', sign_in_path %>
252
+ <% end %>
253
+ </div>\n"
254
+ new_applayout = open("app/views/layouts/application.html.erb", "w")
255
+ new_applayout.write(new_layout[0] + "<body>\n" + session_links + new_layout[1])
256
+ new_applayout.close
257
+ forms = Dir.glob("app/**/_form.html.erb")
258
+ session_check = "
259
+ <%if !current_user%>
260
+ <div id='blank'>
261
+ <div id='alert'>
262
+ <h3>Must be SIGNED IN to add item!</h3>
263
+ </div>
264
+ </div>
265
+ <%end%>\n"
266
+
267
+ forms.each do |f|
268
+ content = open(f).read
269
+ form_erb = open(f,"w")
270
+ form_erb.write(session_check + content)
271
+ form_erb.close
272
+ end
273
+
274
+ sesh = "
275
+ resources :users, only: [:new, :create]
276
+
277
+ resources :user_sessions, only: [:create, :destroy]
278
+
279
+ delete '/sign_out', to: 'user_sessions#destroy', as: :sign_out
280
+ get '/sign_in', to: 'user_sessions#new', as: :sign_in
281
+ "
282
+
283
+ sesh_route = open("config/routes.rb").read
284
+ sesh_route ["#session routes here"] = sesh
285
+ routes = open("config/routes.rb","w")
286
+ routes.write(sesh_route)
287
+ routes.close
288
+
289
+ system("rails g migration CreateUser email:string crypted_password:string password_salt:string persistence_token:string")
290
+ mig = Dir.glob("db/migrate/**.rb")[-1]
291
+ mig_read = open(mig).read
292
+ mig_read ["end"] = "\nt.timestamps null: false
293
+ end
294
+ add_index :users, :email, unique: true"
295
+ mig_write = open(mig, 'w')
296
+ mig_write.write(mig_read)
297
+ mig_write.close
298
+
299
+
300
+ system("bundle exec rake db:migrate")
301
+ puts "
302
+ ----------------------------------------------------
303
+ Rtrain User Sessions Now Active
304
+ ----------------------------------------------------
305
+ "
306
+ open(rtrain_log, 'a') { |f| f.puts Time.now().to_s() + "_user_sessions_added" + "\n"}
307
+ else
308
+ puts "
309
+ ----------------------------------------------------
310
+ Rtrain User Sessions Already Active - Cannot re-run!
311
+ ----------------------------------------------------
312
+ "
313
+ end
314
+ end
315
+
316
+ ##end users sessions install
317
+
318
+ ##begin ajaxify
319
+
320
+ if options[:ajaxify]
321
+
322
+ ajax_css = "../templates/ajax.scss"
323
+ ajax_css_path = File.join(dir, ajax_css)
324
+ stylesheets = "app/assets/stylesheets/"
325
+ FileUtils.cp(ajax_css_path, stylesheets)
326
+
327
+ ajax_files = ["../ajax_files/_delete.html.erb", "../ajax_files/_edit.html.erb", "../ajax_files/_form.html.erb", "../ajax_files/_index.html.erb", "../ajax_files/_new.html.erb", "../ajax_files/_save.js.erb", "../ajax_files/create.js.erb", "../ajax_files/delete.js.erb", "../ajax_files/destroy.js.erb", "../ajax_files/edit.js.erb", "../ajax_files/index.html.erb", "../ajax_files/new.js.erb", "../ajax_files/update.js.erb"]
328
+
329
+ tables = ActiveRecord::Base.connection.tables.map{|x|x.classify.safe_constantize}.compact
330
+
331
+ controllers = (tables.map{|x|x.name.downcase.pluralize + "_controller.rb"} - ["users_controller.rb"]).join(", ")
332
+
333
+ stamp = (Time.now).to_s
334
+ FileUtils.mkdir("rtrain_temp-" + stamp + "/")
335
+ ajax_controller = "../controllers/ajax_controller.rb"
336
+ ajax_controller_path = File.join(dir, ajax_controller)
337
+ rtrain_temp = "rtrain_temp-" + stamp + "/"
338
+ FileUtils.cp(ajax_controller_path, rtrain_temp)
339
+
340
+ tables.each_with_index do |t, i|
341
+ if t.name != "User"
342
+
343
+ t_cols = tables[i].columns.map{|x|x.name}
344
+ t_cols -= ["id", "created_at", "updated_at"]
345
+ view_dir = 'app/views/' + t.name.downcase.pluralize + '/'
346
+
347
+ FileUtils.rm_rf(Dir.glob(view_dir + "*"))
348
+
349
+ ajax_files.each do |a|
350
+ ajax_files_path = File.join(dir, a)
351
+ FileUtils.cp(ajax_files_path, view_dir)
352
+ end
353
+
354
+ docs = Dir[view_dir + "*"]
355
+
356
+ def replacer(txt,filler,replace)
357
+ if txt.match(filler)
358
+ txt.gsub! filler, replace
359
+ end
360
+ end
361
+
362
+
363
+ new_controller_read = open("rtrain_temp-" + stamp + "/ajax_controller.rb").read
364
+ controller_read = open("app/controllers/" + t.name.downcase.pluralize + "_controller.rb").read
365
+ old_controller = "app/controllers/" + t.name.downcase.pluralize + "_controller.rb"
366
+
367
+ FileUtils.cp(old_controller, rtrain_temp)
368
+
369
+
370
+ controller_write = open("app/controllers/" + t.name.downcase.pluralize + "_controller.rb", "w")
371
+
372
+ replacer(new_controller_read,"rt_mod_cap_plur",t.name.capitalize.pluralize)
373
+ replacer(new_controller_read,"rt_mod_low_plur",t.name.downcase.pluralize)
374
+ replacer(new_controller_read,"rt_mod_cap",t.name.capitalize)
375
+ replacer(new_controller_read,"rt_mod_low",t.name.downcase)
376
+ replacer(new_controller_read,"<-- permit_cols -->",t_cols.map{|c|":"+c}.join(", "))
377
+
378
+ controller_write.write(new_controller_read)
379
+ controller_write.close
380
+
381
+ docs.each do |doc|
382
+ doc_read = open(doc).read
383
+ doc_write = open(doc,"w")
384
+
385
+ replacer(doc_read,"rt_mod_cap_plur",t.name.capitalize.pluralize)
386
+ replacer(doc_read,"rt_mod_low_plur",t.name.downcase.pluralize)
387
+ replacer(doc_read,"rt_mod_cap",t.name.capitalize)
388
+ replacer(doc_read,"rt_mod_low",t.name.downcase)
389
+ replacer(doc_read,"<!-- rt_mod_cols -->",t_cols.map{|c|"<td><%= "+t.name.downcase + "." + c.downcase + " %></td>"}.join("\n\t\t\t"))
390
+ replacer(doc_read,"<!-- rt_mod_hdr_cols -->",t_cols.map{|c|"<td>" + c.capitalize + "</td>"}.join("\n\t\t\t"))
391
+ replacer(doc_read,"<!-- rt_mod_fields -->",t_cols.map{|c|"<div class='field'>\n\t<%= f.label :" + c.downcase + " %><br>\n<%= f.text_field :" + c.downcase + '%></div>'}.join("\n\t\t\t"))
392
+ replacer(doc_read,"rt_mod_1st_col",t_cols[0].capitalize)
393
+
394
+ doc_write.write(doc_read)
395
+ doc_write.close
396
+
397
+ end
398
+
399
+ end
400
+ end
401
+ puts "
402
+ ----------------------------------------------------
403
+ Rails App Views and Controllers Ajaxified
404
+
405
+ NOTE: " + controllers + " have each been overwritten.
406
+
407
+ The prior existing versions of those files have been
408
+ copied into the directory named " + rtrain_temp + "in
409
+ the main directory of this app and can be found there.
410
+ ----------------------------------------------------
411
+ "
412
+ open(rtrain_log, 'a') { |f| f.puts Time.now().to_s() + "_ajaxified" + "\n"}
413
+ end
414
+
415
+ ##end ajaxify
416
+
417
+ rtrain_log.close
418
+ end
419
+ end
420
+ end
421
+ end
@@ -0,0 +1,6 @@
1
+ resources :users, only: [:new, :create]
2
+
3
+ resources :user_sessions, only: [:create, :destroy]
4
+
5
+ delete '/sign_out', to: 'user_sessions#destroy', as: :sign_out
6
+ get '/sign_in', to: 'user_sessions#new', as: :sign_in
@@ -0,0 +1,13 @@
1
+ <% if object.errors.any? %>
2
+ <div class="panel panel-warning errors">
3
+ <div class="panel-heading">
4
+ <h5><i class="glyphicon glyphicon-exclamation-sign"></i> Found errors while saving</h5>
5
+ </div>
6
+
7
+ <ul class="panel-body">
8
+ <% object.errors.full_messages.each do |msg| %>
9
+ <li><%= msg %></li>
10
+ <% end %>
11
+ </ul>
12
+ </div>
13
+ <% end %>
@@ -0,0 +1,137 @@
1
+ .modal{
2
+ background-color: white;
3
+ z-index: 999;
4
+ border:4px solid #CCC;
5
+ width:600px;
6
+ height:auto;
7
+ position:absolute;
8
+ left:25%;
9
+ top:15%;
10
+ margin:-25px 0 0 -50px;
11
+ background-color: white;
12
+ min-width: 30px;
13
+ min-height: 30px;
14
+ overflow: hidden;
15
+ z-index: 1000;
16
+ }
17
+ #modal-resizable
18
+ {
19
+ width:600px;
20
+ height: auto;
21
+ border: 8px solid #000000;
22
+ }
23
+ .modal-dialog{
24
+ width: 100%;
25
+ height: 100%;
26
+ }
27
+ .modal-header{
28
+ vertical-align: top;
29
+ float: top;
30
+ height: 20px;
31
+ background-color: black;
32
+ min-height: 20px;
33
+ padding: 2px;
34
+ vertical-align: top;
35
+ font-family: helvetica, arial;
36
+ font-size:15px;
37
+ white-space:pre-wrap;
38
+ color: white;
39
+ }
40
+ .modalheader-text{
41
+ font-family: helvetica, arial;
42
+ font-size:15px;
43
+ white-space:pre-wrap;
44
+ color: white;
45
+ top: 1%;
46
+ left: 1%;
47
+ position: absolute;
48
+ }
49
+ .modal-content{
50
+ background-color: white;
51
+ width: 100%;
52
+ height: 100%;
53
+ outline: none;
54
+ margin: 10px;
55
+ overflow: hidden;
56
+ padding: 2px;
57
+ }
58
+
59
+ .xbutton{
60
+ padding: 4px;
61
+ display: inline;
62
+ float: right;
63
+ }
64
+
65
+ .icon{
66
+ padding: 4px;
67
+ display: inline;
68
+
69
+ }
70
+
71
+ .modal-inner{
72
+ text-align: center;
73
+ }
74
+
75
+ .ui-resizable-handle
76
+ {
77
+ width: 9px;
78
+ height: 9px;
79
+
80
+ z-index: 2;
81
+ }
82
+ .ui-resizable-se
83
+ {
84
+ right: -5px;
85
+ bottom: -5px;
86
+ }
87
+ .ui-resizable-n {
88
+ cursor: n-resize;
89
+ height: 7px;
90
+ width: 100%;
91
+ top: 0px;
92
+ left: 0;
93
+ /*border-top: 1px solid #000000;*/
94
+ }
95
+
96
+ .ui-resizable-s {
97
+ cursor: s-resize;
98
+ height: 7px;
99
+ width: 100%;
100
+ bottom: 0px;
101
+ left: 0;
102
+ /*border-bottom: 1px solid #000000;*/
103
+ }
104
+
105
+ .ui-resizable-e {
106
+ cursor: e-resize;
107
+ width: 7px;
108
+ right: 0px;
109
+ top: 0;
110
+ height: 100%;
111
+ /*border-right: 1px solid #000000;*/
112
+ }
113
+
114
+ .ui-resizable-w {
115
+ cursor: w-resize;
116
+ width: 7px;
117
+ left: 0px;
118
+ top: 0;
119
+ height: 100%;
120
+ /*border-left: 1px solid #000000;*/
121
+ }
122
+
123
+ .ajax-form-button{
124
+ width: 40%;
125
+ background-color: #3a3a3a;
126
+ color: white;
127
+ padding: 14px 20px;
128
+ border: none;
129
+ border-radius: 4px;
130
+ cursor: pointer;
131
+ font-weight: bold;
132
+ font-size: 16px;
133
+ margin-top: 8px;
134
+ display: inline-block;
135
+ text-decoration: none;
136
+ text-align: center;
137
+ }
@@ -0,0 +1,35 @@
1
+ label{
2
+ font-size: 16px;
3
+ font-weight: bold;
4
+ margin-top: 4px;
5
+ }
6
+
7
+ input[type=text], select {
8
+ width: 90%;
9
+ padding: 12px 20px;
10
+ display: inline-block;
11
+ border: 1px solid #ccc;
12
+ border-radius: 4px;
13
+ box-sizing: border-box;
14
+ }
15
+ textarea{
16
+ width: 90%;
17
+ height: 150px;
18
+ padding: 12px 20px;
19
+ box-sizing: border-box;
20
+ border: 2px solid #ccc;
21
+ border-radius: 4px;
22
+ resize: none;
23
+ }
24
+ input[type=submit] {
25
+ width: 90%;
26
+ background-color: #3a3a3a;
27
+ color: white;
28
+ padding: 14px 20px;
29
+ border: none;
30
+ border-radius: 4px;
31
+ cursor: pointer;
32
+ font-weight: bold;
33
+ font-size: 16px;
34
+ margin-top: 8px;
35
+ }
@@ -0,0 +1,21 @@
1
+ <div style="width:80%;left:10%;position:absolute">
2
+
3
+ <h1>Main Page</h1>
4
+ <h3>Hey there! Welcome to my new Rails app! I'm coding up something pretty cool, so check back soon!</h3>
5
+
6
+ <img width="100%" src="http://i.imgur.com/3qtQMoS.png">
7
+ <hr>
8
+ <h3>FILLER TEXT - PLEASE REPLACE UNLESS YOU LIKE HIPSTER IPSUM</h3>
9
+ <p>
10
+ Neutra farm-to-table schlitz slow-carb, pinterest pabst helvetica man bun PBR&B deep v salvia small batch brooklyn. Locavore swag artisan single-origin coffee. Neutra selvage waistcoat, pitchfork chia PBR&B thundercats skateboard meditation flannel chillwave organic pinterest. Keffiyeh freegan cray PBR&B mlkshk. Pop-up cronut freegan, cornhole venmo whatever brunch four dollar toast iPhone pitchfork chillwave. Banjo direct trade yr banh mi tacos. Bushwick photo booth next level typewriter squid ugh.
11
+ </p>
12
+ <p>
13
+ Pitchfork letterpress direct trade migas, gochujang chia austin crucifix green juice. Sustainable beard swag, kogi next level wolf hoodie mlkshk ethical thundercats DIY bicycle rights 8-bit gluten-free brooklyn. Narwhal humblebrag +1 keytar cardigan pickled. Synth fixie slow-carb letterpress echo park drinking vinegar. Lo-fi blog pitchfork sartorial, before they sold out bushwick vegan sustainable polaroid lomo kitsch craft beer. Pitchfork vinyl scenester trust fund, ethical food truck slow-carb. Church-key pop-up portland keffiyeh, flannel aesthetic ramps gentrify cronut.
14
+ </p>
15
+ <p>
16
+ Brooklyn pork belly farm-to-table, semiotics YOLO locavore tacos swag franzen hammock stumptown bushwick blue bottle next level. Shoreditch everyday carry pickled, etsy synth typewriter craft beer. Butcher pabst wayfarers, pitchfork kogi vegan chambray. Butcher master cleanse vinyl dreamcatcher, salvia irony 3 wolf moon whatever keffiyeh messenger bag typewriter. Kinfolk dreamcatcher chambray, ethical meggings kickstarter man braid swag seitan flannel fashion axe tilde readymade venmo. Yr pour-over cardigan organic, gastropub quinoa actually jean shorts typewriter bespoke. Selfies XOXO tacos plaid, brooklyn cred schlitz.
17
+ </p>
18
+ <p>
19
+ Truffaut farm-to-table raw denim lumbersexual. Kitsch biodiesel venmo kickstarter. Pour-over kombucha street art tumblr. Jean shorts banh mi flexitarian lo-fi letterpress shabby chic. Fingerstache meditation quinoa farm-to-table, kogi vice whatever etsy. Tousled organic brunch, deep v pour-over literally schlitz bitters mumblecore pug cray next level. Meggings vegan tattooed farm-to-table affogato.
20
+ </p>
21
+ </div>
@@ -0,0 +1,25 @@
1
+ #main-navbar{
2
+ height: 25px;
3
+ width: 95%;
4
+ background-color: black
5
+ }
6
+ ul#menu {
7
+ bottom: -10%;
8
+ position: relative;
9
+ }
10
+
11
+ ul#menu li {
12
+ display: inline;
13
+ }
14
+
15
+ ul#menu li a {
16
+ background-color: black;
17
+ color: white;
18
+ text-decoration: none;
19
+ padding: 0px 35px;
20
+ font-size: 18px;
21
+ }
22
+
23
+ ul#menu li a:hover {
24
+ background-color: orange;
25
+ }
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
5
+ <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
6
+ <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
7
+ <title>app-name</title>
8
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
9
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
10
+ <%= csrf_meta_tags %>
11
+ </head>
12
+ <body>
13
+
14
+ <%= yield %>
15
+
16
+ </body>
17
+ </html>
18
+