@@ -15,36 +15,34 @@ def initialize(snippet)
15
15
16
16
def view_template
17
17
turbo_stream . update "flash" , partial : "application/flash"
18
- div ( class : "grid -content" ) do
18
+ div ( class : "section -content" ) do
19
19
form_with (
20
20
model : [ :share , snippet ] ,
21
- class : "grid -content" ,
21
+ class : "section -content" ,
22
22
data : {
23
23
controller : "snippet-preview" ,
24
24
action : "snippet-editor:edit-finish->snippet-preview#preview"
25
25
}
26
26
) do |form |
27
27
errors
28
28
29
- div ( class : "grid-cols-12" ) do
30
- div ( class : "snippet-background" ) do
31
- render CodeBlock ::Container . new ( language : language , class : "snippet" ) do
32
- render CodeBlock ::Header . new do
33
- label ( class : "sr-only" , for : "snippet[filename]" ) { "Filename" }
34
- input ( type : "text" , name : "snippet[filename]" , value : filename )
35
- end
29
+ div ( class : "snippet-background" ) do
30
+ render CodeBlock ::Container . new ( language : language , class : "snippet" ) do
31
+ render CodeBlock ::Header . new do
32
+ label ( class : "sr-only" , for : "snippet[filename]" ) { "Filename" }
33
+ input ( type : "text" , name : "snippet[filename]" , value : filename )
34
+ end
36
35
37
- turbo_frame_tag dom_id ( snippet , :code_block ) do
38
- render CodeBlock ::Body . new ( data : { controller : "snippet-editor" } ) do
39
- div ( class : "grid-stack" ) do
40
- render CodeBlock ::Code . new ( source , language : language , data : { snippet_editor_target : "source" } )
41
- label ( class : "sr-only" , for : "snippet[source]" ) { "Source" }
42
- div ( class : "code-editor autogrow-wrapper" ) do
43
- textarea (
44
- name : "snippet[source]" ,
45
- data : { snippet_editor_target : "textarea" }
46
- ) { source }
47
- end
36
+ turbo_frame_tag dom_id ( snippet , :code_block ) do
37
+ render CodeBlock ::Body . new ( data : { controller : "snippet-editor" } ) do
38
+ div ( class : "grid-stack" ) do
39
+ render CodeBlock ::Code . new ( source , language : language , data : { snippet_editor_target : "source" } )
40
+ label ( class : "sr-only" , for : "snippet[source]" ) { "Source" }
41
+ div ( class : "code-editor autogrow-wrapper" ) do
42
+ textarea (
43
+ name : "snippet[source]" ,
44
+ data : { snippet_editor_target : "textarea" }
45
+ ) { source }
48
46
end
49
47
end
50
48
end
@@ -74,12 +72,15 @@ def view_template
74
72
end
75
73
76
74
if @snippet . persisted?
77
- flex_block do
78
- button_to "Destroy this snippet" ,
79
- share_snippet_path ( @snippet ) , method : :delete ,
80
- data : { confirm : "Are you sure?" } ,
81
- class : "button warn" ,
82
- form : { style : "margin-left: auto" } # move to the right
75
+ br
76
+ div do
77
+ flex_block do
78
+ button_to "Destroy this snippet" ,
79
+ share_snippet_path ( @snippet ) , method : :delete ,
80
+ data : { confirm : "Are you sure?" } ,
81
+ class : "button warn"
82
+ # form: {style: "margin-left: auto"} # move to the right
83
+ end
83
84
end
84
85
end
85
86
end
0 commit comments