forked from bofh/fetsite
ADD: Dateieinbindung in TinyMCE für Attachments
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<%= semantic_form_for @attachment do |f| %>
|
||||
<%= semantic_form_for [@thema,@attachment] do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :datei, :as => :file %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @attachment %> |
|
||||
<%= link_to 'Back', attachments_path %>
|
||||
|
||||
<%= link_to 'Back', thema_attachments_path(@attachment.thema,@attachment) %>
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', attachments_path %>
|
||||
<%= link_to 'Back', @thema %>
|
||||
|
||||
@@ -8,7 +8,31 @@
|
||||
<% end %>
|
||||
<%= tinymce %>
|
||||
|
||||
|
||||
<h2>Attachments:</h2>
|
||||
<% @thema.attachments.each do |attachment| %>
|
||||
<ul>
|
||||
<li>
|
||||
<%= link_to attachment.name, edit_thema_attachment_path(@thema,attachment) %>
|
||||
<button type="button" onclick="insertAttachment(<%="\"" + attachment.datei.url + "\""%>,<%="\""+attachment.name+"\""%>)">Insert Me!</button>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<!--
|
||||
|
||||
<script>
|
||||
function insertAttachment(url) {
|
||||
|
||||
tinymce.activeEditor.setContent(tinymce.activeEditor.getContent({format : 'raw'}) + "Test");
|
||||
//editor.setContent(editor.getContent + "<img src=\"" + url + "\">")
|
||||
}
|
||||
</script>
|
||||
|
||||
-->
|
||||
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
|
||||
</p>
|
||||
<% end %>
|
||||
<%= link_to 'Neue Frage', new_frage_path %> <br/>
|
||||
<br/>
|
||||
|
||||
<%= link_to 'Neue Frage', new_frage_path %>
|
||||
<h2>Attachments:</h2>
|
||||
<% @thema.attachments.each do |attachment| %>
|
||||
<ul>
|
||||
<li>
|
||||
<%= link_to attachment.name, edit_thema_attachment_path(@thema,attachment) %> | <%= link_to 'Destroy',[@thema,attachment], method: :delete, data: { confirm: 'Are you sure?' } %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<%= link_to 'Neues Attachment', new_thema_attachment_path(@thema) %>
|
||||
<br/>
|
||||
|
||||
Reference in New Issue
Block a user