copycat 0.0.7 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/copycat_engine.css +18 -2
- data/app/controllers/copycat_translations_controller.rb +15 -12
- data/app/views/copycat_translations/edit.html.erb +7 -8
- data/config/routes.rb +1 -1
- data/lib/copycat/version.rb +1 -1
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/log/development.log +672 -5652
- data/spec/dummy/log/test.log +3397 -19790
- data/spec/dummy/tmp/cache/assets/C19/060/sprockets%2F125436f53217b7f564aa5016d1168709 +0 -0
- data/spec/dummy/tmp/cache/assets/CB3/6E0/sprockets%2F0f4c96b04436bf7ae900561753947d4c +0 -0
- data/spec/dummy/tmp/cache/assets/DA4/EE0/sprockets%2Fcd39e3d56788faea331e0f5bac67329b +0 -0
- data/spec/dummy/tmp/pids/server.pid +1 -0
- data/spec/integration/copycat_spec.rb +41 -0
- metadata +6 -4
@@ -393,6 +393,13 @@ div.edit {
|
|
393
393
|
width: 99%;
|
394
394
|
}
|
395
395
|
|
396
|
+
div.edit h2 {
|
397
|
+
float: left;
|
398
|
+
max-width: 75%;
|
399
|
+
overflow: hidden;
|
400
|
+
text-overflow: ellipsis;
|
401
|
+
}
|
402
|
+
|
396
403
|
div.edit textarea {
|
397
404
|
width: 99%;
|
398
405
|
margin-top: 1em;
|
@@ -400,7 +407,14 @@ div.edit textarea {
|
|
400
407
|
|
401
408
|
div.edit a {
|
402
409
|
display: block;
|
403
|
-
margin:
|
410
|
+
margin: 0 0 0 .5em;
|
411
|
+
}
|
412
|
+
|
413
|
+
div.edit form {
|
414
|
+
margin-bottom: 0px;
|
415
|
+
}
|
416
|
+
div.edit form.button_to {
|
417
|
+
float: right;
|
404
418
|
}
|
405
419
|
|
406
420
|
body {
|
@@ -441,7 +455,9 @@ body {
|
|
441
455
|
|
442
456
|
#notice {
|
443
457
|
height: 2em;
|
444
|
-
background-color: #
|
458
|
+
background-color: #FFD;
|
445
459
|
text-align: center;
|
460
|
+
padding-top: .5em;
|
461
|
+
margin-bottom: .5em;
|
446
462
|
}
|
447
463
|
|
@@ -22,21 +22,14 @@ class CopycatTranslationsController < ActionController::Base
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def edit
|
25
|
-
@copycat_translation = CopycatTranslation.
|
25
|
+
@copycat_translation = CopycatTranslation.find(params[:id])
|
26
26
|
end
|
27
27
|
|
28
28
|
def update
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
else
|
34
|
-
@copycat_translation = cct
|
35
|
-
render :action => 'edit'
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def help
|
29
|
+
@copycat_translation = CopycatTranslation.find(params[:id])
|
30
|
+
@copycat_translation.value = params[:copycat_translation][:value]
|
31
|
+
@copycat_translation.save!
|
32
|
+
redirect_to copycat_translations_path, :notice => "#{@copycat_translation.key} updated!"
|
40
33
|
end
|
41
34
|
|
42
35
|
def import_export
|
@@ -51,6 +44,7 @@ class CopycatTranslationsController < ActionController::Base
|
|
51
44
|
begin
|
52
45
|
CopycatTranslation.import_yaml(params["file"].tempfile)
|
53
46
|
rescue StandardError => e
|
47
|
+
logger.info "\n#{e.class}\n#{e.message}"
|
54
48
|
flash[:notice] = "There was an error processing your upload!"
|
55
49
|
render :action => 'import_export', :status => 400
|
56
50
|
else
|
@@ -58,4 +52,13 @@ class CopycatTranslationsController < ActionController::Base
|
|
58
52
|
end
|
59
53
|
end
|
60
54
|
|
55
|
+
def destroy
|
56
|
+
@copycat_translation = CopycatTranslation.find(params[:id])
|
57
|
+
notice = "#{@copycat_translation.key} deleted!"
|
58
|
+
@copycat_translation.destroy
|
59
|
+
redirect_to copycat_translations_path, :notice => notice
|
60
|
+
end
|
61
|
+
|
62
|
+
def help
|
63
|
+
end
|
61
64
|
end
|
@@ -1,10 +1,9 @@
|
|
1
1
|
<div class="edit">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
<%= link_to "Cancel", copycat_translations_path %>
|
2
|
+
<h2><%= @copycat_translation.key%></h2>
|
3
|
+
<%= button_to "Delete this item", copycat_translation_path(@copycat_translation), :method => :delete, :onclick => "return confirm('Are you sure?');" %>
|
4
|
+
<%= form_for @copycat_translation, :url => { :action => "update" } do |f| %>
|
5
|
+
<%= f.text_area :value, :rows => 12 %>
|
6
|
+
<%= f.submit "Update" %>
|
7
|
+
<% end %>
|
8
|
+
<%= link_to "Cancel", copycat_translations_path %>
|
10
9
|
</div>
|
data/config/routes.rb
CHANGED
data/lib/copycat/version.rb
CHANGED
Binary file
|