forked from bofh/fetsite
attachments view
This commit is contained in:
9
app/views/attachments/_attachment.html.erb
Normal file
9
app/views/attachments/_attachment.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<% data_ext = attachment.datei.file.extension.downcase %>
|
||||
|
||||
<%= attachment.name %> </br>
|
||||
<% if (!["jpg","png","jpeg"].find_index(data_ext).nil?) %>
|
||||
<%= image_tag attachment.datei.thumb.url %>
|
||||
<% else %>
|
||||
<%= image_tag "pdf-logo.jpg" %>
|
||||
<% end %>
|
||||
|
||||
12
app/views/themen/_attachment_list.html.erb
Normal file
12
app/views/themen/_attachment_list.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<table>
|
||||
<% attachment_list.each do |a| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= render a %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to "Edit", edit_thema_attachment_path(a.thema,a) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
@@ -1,3 +1,4 @@
|
||||
<% verw_liste.each do |thema| %>
|
||||
<li id="themen_<%= thema.id %>" class="sort" ><div class="contentbox handle" ><h2><%= thema.title %></h2> </div> <%= link_to edit_thema_path(thema),:remote=>true do %> Edit <% end %> <%= link_to fragen_thema_path(thema),:remote=>true do %> Fragen <% end %></li>
|
||||
<li id="themen_<%= thema.id %>" class="sort" ><div class="contentbox handle" ><h2><%= thema.title %></h2> </div>
|
||||
<%= link_to thema_path(thema),:remote=>true do %> Show <% end %> <%= link_to edit_thema_path(thema),:remote=>true do %> Edit <% end %> <%= link_to fragen_thema_path(thema),:remote=>true do %> Fragen <% end %><%= link_to attachments_thema_path(thema),:remote=>true do %> Attachments <% end %></li>
|
||||
<% end %>
|
||||
|
||||
1
app/views/themen/attachments.js.erb
Normal file
1
app/views/themen/attachments.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('thema.show')+"</h2>")+render(:partial=>"themen/attachment_list", :object=>@attachments) )%>");
|
||||
1
app/views/themen/show.js.erb
Normal file
1
app/views/themen/show.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('thema.show')+"</h2>")+render(:partial=>"themen/small", :object=>@thema) )%>");
|
||||
@@ -28,6 +28,9 @@
|
||||
<% thema.nlinks.each do |l| %>
|
||||
<li><%= render l.neuigkeit %></li>
|
||||
<% end %>
|
||||
<% thema.nlinks.each do |l| %>
|
||||
<li><%= render l.neuigkeit %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user