forked from bofh/fetsite
Interface Neuigkeiten & Attachment
This commit is contained in:
@@ -8,9 +8,15 @@
|
||||
</td>
|
||||
<% if editor %>
|
||||
<td>
|
||||
<%= link_to "Edit", edit_thema_attachment_path(a.thema,a) %>
|
||||
<%= link_to "Delete", thema_attachment_path(a.thema,a), method: "DELETE", confirm: "Sure?" %>
|
||||
|
||||
<div class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Actions</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<%= link_to ff_icon("icon-pencil")+"Edit", edit_thema_attachment_path(a.thema,a) %>
|
||||
</li><li>
|
||||
<%= link_to "Delete Attachment", thema_attachment_path(a.thema,a), method: "DELETE", confirm: "Sure?" , class: "btn-danger " %>
|
||||
</li></ul>
|
||||
</div>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
|
||||
@@ -2,19 +2,33 @@
|
||||
<% select.attachments.each_slice(6) do |row| %>
|
||||
<div class="row-fluid">
|
||||
<% row.each do |attachment|
|
||||
data_ext = attachment.datei.file.extension.downcase %>
|
||||
%>
|
||||
<div class="span2" align="center">
|
||||
<%= link_to attachment.name, edit_thema_attachment_path(@thema,attachment) %></br>
|
||||
<% if (!["jpg","png","jpeg"].find_index(data_ext).nil?) %>
|
||||
<div class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<% if attachment.image? %>
|
||||
<%= image_tag attachment.datei.thumb.url %>
|
||||
<% else %>
|
||||
<%= image_tag "pdf-logo.jpg" %>
|
||||
<% end %>
|
||||
</a>
|
||||
<% if(editor) %>
|
||||
</br><button type="button" onclick="insertAttachment(<%="\"" + attachment.datei.url + "\""%>,<%="\""+attachment.name+"\""%>)">Insert Me!</button>
|
||||
<% else %>
|
||||
</br><%= link_to 'Destroy',[@thema,attachment], method: :delete, data: { confirm: 'Are you sure?' } %>
|
||||
</br>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a href="#" onclick="insertAttachment(<%="\"" + attachment.datei.url + "\""%>,<%="\""+attachment.name+"\""%>)"> Datei einfügen</a></li>
|
||||
<% if attachment.image? %>
|
||||
<li><a type="button" onclick="insertAttachment(<%="\"" + attachment.datei.thumb_big.url + "\""%>,<%="\""+attachment.name+"\""%>)">Thumb einfügen</a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<% else %>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<%= link_to 'Destroy',[@thema,attachment], method: :delete, data: { confirm: 'Are you sure?' } %>
|
||||
</li>
|
||||
</ul> <% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
<% verw_liste.each do |thema| %>
|
||||
<li id="themen_<%= thema.id %>" class="sort" ><div class="contentbox handle" ><b><%= thema.title %></b> </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>
|
||||
<li id="themen_<%= thema.id %>" class="sort" >
|
||||
<div class="dropdown contentbox handle">
|
||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><b><%= thema.title %></b></a> <%= link_to thema_path(thema),:remote=>true do %> <%= fa_icon('eye') %> <% end %><%= link_to edit_thema_path(thema),:remote=>true do %> <%= ff_icon('icon-pencil') %> <% end %>
|
||||
|
||||
<ul class="dropdown-menu">
|
||||
<li><%= link_to thema_path(thema),:remote=>true do %> <%= fa_icon('eye') %> Show <% end %></li>
|
||||
<li><%= link_to edit_thema_path(thema),:remote=>true do %> <%= ff_icon('icon-pencil') %> Edit <% end %> </li>
|
||||
<li><%= link_to fragen_thema_path(thema),:remote=>true do %> Fragen <% end %></li>
|
||||
<li><%= link_to attachments_thema_path(thema),:remote=>true do %> Attachments <% end %></li>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user