themen ueberarbeitet attachments verwalten

This commit is contained in:
2014-06-09 23:14:05 +05:30
parent babbfb7d73
commit 6451c0f175
22 changed files with 245 additions and 38 deletions

View File

@@ -2,11 +2,17 @@
<% attachment_list.each do |a| %>
<tr>
<td>
<%= link_to a.datei.url do %>
<%= render a %>
<% end %>
</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?" %>
</td>
<% end %>
</tr>
<% end %>
</table>

View File

@@ -0,0 +1,3 @@
<%= render :partial=>"attachments/form_bulk" %>
<%= render partial: "themen/attachment_list", object:@thema.attachments ,locals: {:editor => true}%>

View File

@@ -2,7 +2,7 @@
<div class="container-fluid">
<%= semantic_form_for @thema, :remote=>true do |f| %>
<%= semantic_form_for @thema, :remote=>remote do |f| %>
<%= f.inputs do %>
<div class="row-fluid">
<div class="span6">

View File

@@ -1,18 +1,22 @@
<a name="thema_<%=small.id%>" href="#<%=small.id%>">
<h2><%= small.title %></h2>
</a>
<a name="thema_<%=small.id%>" href="#<%=small.id%>">
<h2><%= small.title %></h2>
</a>
<%= raw(small.text) %>
<br/>
<%= raw("<b>FAQs:</b>") unless small.fragen.empty? %>
<%= raw("<b>FAQs:</b>") unless small.fragen.empty? %>
<br/>
<% small.fragen.each do |frage| %>
<p>
<b> <%= frage.title %> </b> <br/>
<%= raw(frage.text) %>
<b> <%= frage.title %> </b> <br/>
<%= raw(frage.text) %>
</p>
<br/>
<% end %>
<%= render partial: "themen/attachment_list", object: small.attachments, locals:{editor: false} unless small.attachments.empty? %>
<br/>
<%
@small_elements = []
@small_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>small} if can? :edit, small

View File

@@ -1 +1 @@
$("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('thema.show')+"</h2>")+render(:partial=>"themen/attachment_list", :object=>@attachments) )%>");
$("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('thema.show')+"</h2>")+render(:partial=>"themen/attachment_verwalten") )%>");

View File

@@ -1,5 +1,5 @@
<div id="themaview">
<h1>Editing thema</h1>
<%= render 'form' %>
<%= render 'form' , :locals=>{:remote=>false}, :remote=>false %>
</div>
</br><%= link_to 'Back', @thema %>

View File

@@ -1 +1 @@
$("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('thema.edit')+"</h2>")+render(:partial=>"themen/form") )%>");
$("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('thema.edit')+"</h2>")+render(:partial=>"themen/form", :locals=>{:remote=>true}) )%>");

View File

@@ -1,6 +1,9 @@
<p id="notice"><%= notice %></p>
<h1><%= @thema.title %></h1>
<div class="container-fluid">
<div class="row-fluid">
<div class="span6">
<p>
<%= raw(@thema.text) %>
</p>
@@ -11,16 +14,22 @@
-->
<%= render :partial=>'layouts/pretty_toolbar' %>
<h2><%= I18n.t('attachment.title')%>:</h2>
<div id="attachmentform">
</div>
<%= render partial: "attachment_verwalten" %>
<%= render :partial => "themen/select", :object => @thema, :locals=>{:editor => :false} %>
</div>
<div class="span6">
<%= render :partial=>'themen/fragen' %>
<!--
<%= link_to 'Neue Frage', new_frage_path %> <br/>
-->
<br/>
<h2><%= I18n.t('attachment.title')%>:</h2>
<div id="attachmentform">
</div>
<%= link_to new_thema_attachment_path(@thema) ,:remote=>true do %> new Attachment <% end %>
<%= render :partial => "themen/select", :object => @thema, :locals=>{:editor => :false} %>
<%= link_to I18n.t('common.back'), themengruppen_path, :class=>:btn %>
</div>
</div>
</div>