themen ueberarbeitet attachments verwalten
This commit is contained in:
@@ -46,19 +46,29 @@ class AttachmentsController < ApplicationController
|
|||||||
# POST /attachments.json
|
# POST /attachments.json
|
||||||
def create
|
def create
|
||||||
@attachment = Attachment.new(params[:attachment])
|
@attachment = Attachment.new(params[:attachment])
|
||||||
@thema = Thema.find(params[:thema_id])
|
@thema = Thema.find_by_id(params[:thema_id])
|
||||||
@attachment.thema_id = @thema.id
|
# logger.info "gg"
|
||||||
|
@attachment.thema = @thema
|
||||||
|
@attachment.name=@attachment.datei.filename
|
||||||
@action="create"
|
@action="create"
|
||||||
logger.info "#{@attachment.inspect}"
|
|
||||||
|
|
||||||
|
# logger.info "sdf"
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @attachment.save
|
if @attachment.save
|
||||||
format.html { redirect_to @thema, notice: 'Attachment was successfully created.' }
|
format.html {
|
||||||
format.json { render json: @thema, status: :created, location: @thema }
|
render :json => [@attachment.to_jq_upload].to_json,
|
||||||
format.js { }
|
:content_type => 'text/html',
|
||||||
|
:layout => false
|
||||||
|
}
|
||||||
|
|
||||||
|
# format.html { redirect_to @thema, notice: 'Attachment was successfully created.' }
|
||||||
|
format.json { render json: {files: [@attachment.to_jq_upload]}, status: :created, location: [@thema, @attachment]}
|
||||||
|
|
||||||
else
|
else
|
||||||
format.html { render action: "new" }
|
format.html { render action: "new" }
|
||||||
format.json { render json: @attachment.errors, status: :unprocessable_entity }
|
format.json { render json: @attachment.errors, status: :unprocessable_entity }
|
||||||
format.js { render action: "new.js.erb"}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ class ThemenController < ApplicationController
|
|||||||
end
|
end
|
||||||
def verwalten
|
def verwalten
|
||||||
@thema = Thema.find(params[:id])
|
@thema = Thema.find(params[:id])
|
||||||
unless (@thema.wikiname.empty? || @thema.wikiname.nil?)
|
@attachment=Attachment.new
|
||||||
|
unless (@thema.is_wiki?)
|
||||||
redirect_to verwalten_wiki_path(Wiki.find(@thema.id))
|
redirect_to verwalten_wiki_path(Wiki.find(@thema.id))
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -58,7 +59,10 @@ class ThemenController < ApplicationController
|
|||||||
# GET /themen/1/edit
|
# GET /themen/1/edit
|
||||||
def edit
|
def edit
|
||||||
@thema = Thema.find(params[:id])
|
@thema = Thema.find(params[:id])
|
||||||
|
unless ( @thema.wikiname.nil? || @thema.wikiname.empty? )
|
||||||
|
redirect_to edit_wiki_path(Wiki.find(@thema.id))
|
||||||
|
return
|
||||||
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.js
|
format.js
|
||||||
@@ -93,6 +97,7 @@ class ThemenController < ApplicationController
|
|||||||
def attachments
|
def attachments
|
||||||
@thema = Thema.find(params[:id])
|
@thema = Thema.find(params[:id])
|
||||||
@attachments=@thema.attachments
|
@attachments=@thema.attachments
|
||||||
|
@attachment=Attachment.new
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ class WikisController < ApplicationController
|
|||||||
end
|
end
|
||||||
def edit
|
def edit
|
||||||
@wiki = Wiki.find(params[:id])
|
@wiki = Wiki.find(params[:id])
|
||||||
|
respond_to do |format|
|
||||||
|
format.html
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,22 @@
|
|||||||
|
|
||||||
class Attachment < ActiveRecord::Base
|
class Attachment < ActiveRecord::Base
|
||||||
has_paper_trail
|
has_paper_trail
|
||||||
attr_accessible :name, :datei
|
attr_accessible :name, :datei, :datei_cache
|
||||||
belongs_to :thema
|
belongs_to :thema
|
||||||
mount_uploader :datei, AttachmentUploader
|
mount_uploader :datei, AttachmentUploader
|
||||||
validates :thema, :presence => true
|
validates :thema, :presence => true
|
||||||
validates :name, :presence => true
|
validates :name, :presence => true
|
||||||
|
|
||||||
|
def to_jq_upload
|
||||||
|
{
|
||||||
|
"id" => read_attribute(:id),
|
||||||
|
"title" => read_attribute(:title),
|
||||||
|
"description" => read_attribute(:desc),
|
||||||
|
"name" => read_attribute(:title),
|
||||||
|
"size" => datei.size,
|
||||||
|
"url" => datei.url,
|
||||||
|
"thumbnail_url" => datei.thumb.url,
|
||||||
|
"delete_type" => "DELETE"
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class Thema < ActiveRecord::Base
|
|||||||
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
|
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
|
||||||
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
|
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
|
||||||
def is_wiki?
|
def is_wiki?
|
||||||
wikiname.empty? || wikiname.nil?
|
wikiname.nil? || wikiname.empty?
|
||||||
end
|
end
|
||||||
def text_first_words
|
def text_first_words
|
||||||
md = /<p>(?<text>[^\<\>]*)/.match Sanitize.clean(self.text,:elements=>['p'])
|
md = /<p>(?<text>[^\<\>]*)/.match Sanitize.clean(self.text,:elements=>['p'])
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ class AttachmentUploader < CarrierWave::Uploader::Base
|
|||||||
include CarrierWave::RMagick
|
include CarrierWave::RMagick
|
||||||
# include CarrierWave::RMagick
|
# include CarrierWave::RMagick
|
||||||
# include CarrierWave::MiniMagick
|
# include CarrierWave::MiniMagick
|
||||||
|
def root
|
||||||
|
Rails.root.join 'public/'
|
||||||
|
end
|
||||||
|
|
||||||
# Choose what kind of storage to use for this uploader:
|
# Choose what kind of storage to use for this uploader:
|
||||||
storage :file
|
storage :file
|
||||||
@@ -20,6 +23,9 @@ class AttachmentUploader < CarrierWave::Uploader::Base
|
|||||||
version :thumb do
|
version :thumb do
|
||||||
process :resize_to_fill => [64, 64]
|
process :resize_to_fill => [64, 64]
|
||||||
end
|
end
|
||||||
|
version :thumb_small do
|
||||||
|
process :resize_to_fill => [32, 32]
|
||||||
|
end
|
||||||
|
|
||||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||||
# def default_url
|
# def default_url
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<% data_ext = attachment.datei.file.extension.downcase %>
|
<% data_ext = attachment.datei.file.extension.downcase %>
|
||||||
|
|
||||||
<%= attachment.name %> </br>
|
|
||||||
<% if (!["jpg","png","jpeg"].find_index(data_ext).nil?) %>
|
<% if (!["jpg","png","jpeg"].find_index(data_ext).nil?) %>
|
||||||
<%= image_tag attachment.datei.thumb.url %>
|
<%= image_tag attachment.datei.thumb.url %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= image_tag "pdf-logo.jpg" %>
|
<%= image_tag "pdf-logo.jpg" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%= attachment.name %>
|
||||||
|
|||||||
143
app/views/attachments/_form_bulk.html.erb
Normal file
143
app/views/attachments/_form_bulk.html.erb
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<%= semantic_form_for [@thema,@attachment], :remote=>true, :html => { :multipart => true, :id => "fileupload" } do |f| %>
|
||||||
|
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span7">
|
||||||
|
<div class="fileupload-buttonbar">
|
||||||
|
<!-- The fileinput-button span is used to style the file input field as button -->
|
||||||
|
<span class="btn btn-success fileinput-button">
|
||||||
|
<i class="icon-plus icon-white"></i>
|
||||||
|
<span>Add files...</span>
|
||||||
|
<%= f.file_field :datei, :multiple=>true %>
|
||||||
|
<% f.input :thema %>
|
||||||
|
</span>
|
||||||
|
<button type="submit" class="btn btn-primary start">
|
||||||
|
<i class="icon-upload icon-white"></i>
|
||||||
|
<span>Start upload</span>
|
||||||
|
</button>
|
||||||
|
<button type="reset" class="btn btn-warning cancel">
|
||||||
|
<i class="icon-ban-circle icon-white"></i>
|
||||||
|
<span>Cancel upload</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-danger delete">
|
||||||
|
<i class="icon-trash icon-white"></i>
|
||||||
|
<span>Delete</span>
|
||||||
|
</button>
|
||||||
|
<input type="checkbox" class="toggle">
|
||||||
|
</div>
|
||||||
|
<div class="span5">
|
||||||
|
<!-- The global progress bar -->
|
||||||
|
<div class="progress progress-success progress-striped active fade">
|
||||||
|
<div class="bar" style="width:100%;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- The loading indicator is shown during image processing -->
|
||||||
|
<div class="fileupload-loading"></div>
|
||||||
|
<br>
|
||||||
|
<!-- The table listing the files available for upload/download -->
|
||||||
|
<table class="table table-striped"><tbody class="files" data-toggle="modal-lva" data-target="#modal-lva"></tbody>
|
||||||
|
</table>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
var fileUploadErrors = {
|
||||||
|
maxFileSize: 'File is too big',
|
||||||
|
minFileSize: 'File is too small',
|
||||||
|
acceptFileTypes: 'Filetype not allowed',
|
||||||
|
maxNumberOfFiles: 'Max number of files exceeded',
|
||||||
|
uploadedBytes: 'Uploaded bytes exceed file size',
|
||||||
|
emptyResult: 'Empty file upload result'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- The template to display files available for upload -->
|
||||||
|
<script id="template-upload" type="text/x-tmpl">
|
||||||
|
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
||||||
|
<tr class="template-upload fade">
|
||||||
|
<!--<td class="preview"><span class="fade"></span></td>-->
|
||||||
|
<td class="name"><span>{%=file.name %}</span></td>
|
||||||
|
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
|
||||||
|
{% if (file.error) { %}
|
||||||
|
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
|
||||||
|
{% } else if (o.files.valid && !i) { %}
|
||||||
|
<td>
|
||||||
|
<div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
|
||||||
|
</td>
|
||||||
|
<td class="start">{% if (!o.options.autoUpload) { %}
|
||||||
|
<button class="btn btn-primary">
|
||||||
|
<i class="icon-upload icon-white"></i>
|
||||||
|
<span>{%=locale.fileupload.start%}</span>
|
||||||
|
</button>
|
||||||
|
{% } %}</td>
|
||||||
|
{% } else { %}
|
||||||
|
<td colspan="2"></td>
|
||||||
|
{% } %}
|
||||||
|
<td class="cancel">{% if (!i) { %}
|
||||||
|
<button class="btn btn-warning">
|
||||||
|
<i class="icon-ban-circle icon-white"></i>
|
||||||
|
<span>{%=locale.fileupload.cancel%}</span>
|
||||||
|
</button>
|
||||||
|
{% } %}</td>
|
||||||
|
</tr>
|
||||||
|
{% } %}
|
||||||
|
</script>
|
||||||
|
<!-- The template to display files available for download -->
|
||||||
|
<script id="template-download" type="text/x-tmpl">
|
||||||
|
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
||||||
|
<tr class="template-download fade">
|
||||||
|
{% if (file.error) { %}
|
||||||
|
<td></td>
|
||||||
|
<td class="name"><span>{%=file.name%}</span></td>
|
||||||
|
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
|
||||||
|
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
|
||||||
|
{% } else { %}
|
||||||
|
<!--<td class="preview">{% if (file.thumbnail_url) { %}
|
||||||
|
<a href="{%=file.url%}" title="{%=file.name%}" rel="lva" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
|
||||||
|
{% } %}</td>-->
|
||||||
|
<td class="name">
|
||||||
|
<a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'lva'%}" download="{%=file.name%}">{%=file.name%}</a>
|
||||||
|
</td>
|
||||||
|
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
|
||||||
|
<td colspan="2"></td>
|
||||||
|
{% } %}
|
||||||
|
<td class="delete">
|
||||||
|
<button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
|
||||||
|
<i class="icon-trash icon-white"></i>
|
||||||
|
<span>{%=locale.fileupload.destroy%}</span>
|
||||||
|
</button>
|
||||||
|
<input type="checkbox" name="delete" value="1">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% } %}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
$(function () {
|
||||||
|
// Initialize the jQuery File Upload widget:
|
||||||
|
$('#fileupload').fileupload();
|
||||||
|
//
|
||||||
|
// Load existing files:
|
||||||
|
$.getJSON($('#fileupload').prop('action'), function (files) {
|
||||||
|
var fu = $('#fileupload').data('blueimpFileupload'),
|
||||||
|
template;
|
||||||
|
fu._adjustMaxNumberOfFiles(-files.length);
|
||||||
|
console.log(files);
|
||||||
|
// no Download on Upload form
|
||||||
|
//template = fu._renderDownload(files)
|
||||||
|
//.appendTo($('#fileupload .files'));
|
||||||
|
// Force reflow:
|
||||||
|
fu._reflow = fu._transition && template.length &&
|
||||||
|
template[0].offsetWidth;
|
||||||
|
template.addClass('in');
|
||||||
|
$('#loading').remove();
|
||||||
|
});
|
||||||
|
$('#attachment_datei').attr('name', 'attachment[datei]');
|
||||||
|
$('#attachment_datei').fileupload();
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -10,3 +10,5 @@
|
|||||||
<%= f.action :submit, :as => :input %>
|
<%= f.action :submit, :as => :input %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<%= tinymce %>
|
||||||
|
|||||||
@@ -10,3 +10,4 @@
|
|||||||
<%= f.action :submit, :as => :input %>
|
<%= f.action :submit, :as => :input %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%= tinymce %>
|
||||||
|
|||||||
@@ -2,11 +2,17 @@
|
|||||||
<% attachment_list.each do |a| %>
|
<% attachment_list.each do |a| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
<%= link_to a.datei.url do %>
|
||||||
<%= render a %>
|
<%= render a %>
|
||||||
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
|
<% if editor %>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to "Edit", edit_thema_attachment_path(a.thema,a) %>
|
<%= link_to "Edit", edit_thema_attachment_path(a.thema,a) %>
|
||||||
|
<%= link_to "Delete", thema_attachment_path(a.thema,a), method: "DELETE", confirm: "Sure?" %>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
3
app/views/themen/_attachment_verwalten.html.erb
Normal file
3
app/views/themen/_attachment_verwalten.html.erb
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
<%= render :partial=>"attachments/form_bulk" %>
|
||||||
|
<%= render partial: "themen/attachment_list", object:@thema.attachments ,locals: {:editor => true}%>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
|
||||||
<%= semantic_form_for @thema, :remote=>true do |f| %>
|
<%= semantic_form_for @thema, :remote=>remote do |f| %>
|
||||||
<%= f.inputs do %>
|
<%= f.inputs do %>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
|
|||||||
@@ -3,16 +3,20 @@
|
|||||||
</a>
|
</a>
|
||||||
<%= raw(small.text) %>
|
<%= raw(small.text) %>
|
||||||
<br/>
|
<br/>
|
||||||
<%= raw("<b>FAQs:</b>") unless small.fragen.empty? %>
|
|
||||||
|
|
||||||
|
<%= raw("<b>FAQs:</b>") unless small.fragen.empty? %>
|
||||||
<br/>
|
<br/>
|
||||||
<% small.fragen.each do |frage| %>
|
<% small.fragen.each do |frage| %>
|
||||||
<p>
|
<p>
|
||||||
<b> <%= frage.title %> </b> <br/>
|
<b> <%= frage.title %> </b> <br/>
|
||||||
<%= raw(frage.text) %>
|
<%= raw(frage.text) %>
|
||||||
</p>
|
</p>
|
||||||
<br/>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<%= render partial: "themen/attachment_list", object: small.attachments, locals:{editor: false} unless small.attachments.empty? %>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
|
||||||
<%
|
<%
|
||||||
@small_elements = []
|
@small_elements = []
|
||||||
@small_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>small} if can? :edit, small
|
@small_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>small} if can? :edit, small
|
||||||
|
|||||||
@@ -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") )%>");
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<div id="themaview">
|
<div id="themaview">
|
||||||
<h1>Editing thema</h1>
|
<h1>Editing thema</h1>
|
||||||
<%= render 'form' %>
|
<%= render 'form' , :locals=>{:remote=>false}, :remote=>false %>
|
||||||
</div>
|
</div>
|
||||||
</br><%= link_to 'Back', @thema %>
|
</br><%= link_to 'Back', @thema %>
|
||||||
|
|||||||
@@ -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}) )%>");
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
|
|
||||||
<h1><%= @thema.title %></h1>
|
<h1><%= @thema.title %></h1>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span6">
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<%= raw(@thema.text) %>
|
<%= raw(@thema.text) %>
|
||||||
</p>
|
</p>
|
||||||
@@ -11,16 +14,22 @@
|
|||||||
-->
|
-->
|
||||||
<%= render :partial=>'layouts/pretty_toolbar' %>
|
<%= 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' %>
|
<%= render :partial=>'themen/fragen' %>
|
||||||
<!--
|
<!--
|
||||||
<%= link_to 'Neue Frage', new_frage_path %> <br/>
|
<%= link_to 'Neue Frage', new_frage_path %> <br/>
|
||||||
-->
|
-->
|
||||||
<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 %>
|
<%= link_to I18n.t('common.back'), themengruppen_path, :class=>:btn %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<%= tinymce_assets %>
|
<%= tinymce_assets %>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<%= semantic_form_for @wiki do |f| %>
|
<%= semantic_form_for @wiki, :remote=>remote do |f| %>
|
||||||
<%= f.inputs do %>
|
<%= f.inputs do %>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<div id="themaview">
|
<div id="themaview">
|
||||||
<h1>Editing thema</h1>
|
<h1>Editing thema</h1>
|
||||||
<%= render 'form' %>
|
<%= render 'form', :remote=>false, :locals=>{:remote=>false} %>
|
||||||
</div>
|
</div>
|
||||||
</br><%= link_to 'Back', @thema %>
|
</br><%= link_to 'Back', @thema %>
|
||||||
|
|||||||
1
app/views/wikis/edit.js.erb
Normal file
1
app/views/wikis/edit.js.erb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
$("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('wiki.edit')+"</h2>")+render(:partial=>"wikis/form", :locals=>{:remote=>true}) )%>");
|
||||||
Reference in New Issue
Block a user