Fix for upload image component in announcement
This commit is contained in:
1 parent
8bf55a184e
commit
c856b4cdce
4 files changed
+35
-25
No files matched your search
Vendored
+18
-7
@@ -4,23 +4,31 @@
|
||||
<%= f.error_messages %>
|
||||
|
||||
<div id="sub-wiget">
|
||||
<div id="widget-picture" class="widget-box widget-size-300">
|
||||
<div id="widget-picture" class="widget-box">
|
||||
<div class="widget-action clear">
|
||||
<a class="action"><i title="Upload pictures" class="icon-exclamation-sign icon-white tip"></i></a>
|
||||
</div>
|
||||
<h3 class="widget-title"><i class="icons-picture icons-white"></i>Picture</h3>
|
||||
<div class="widget-content clear">
|
||||
<div class="control-group">
|
||||
<img class="pull-left upload-picture" src="/assets/default-img.png" />
|
||||
|
||||
<div class="controls file-upload">
|
||||
<label class="control-label btn" for="input-upload">
|
||||
Browse/選擇檔案
|
||||
<!-- <img class="pull-left upload-picture" src="/assets/default-img.png" /> -->
|
||||
<div class="upload-picture">
|
||||
<!--請程式務必將圖片尺寸加入到行內裡-->
|
||||
<% if @bulletin.image %>
|
||||
<%= image_tag @bulletin.image, :width=> "456", :height=>'700' rescue ''%>
|
||||
<% else %>
|
||||
<img class="pull-left upload-picture" src="/assets/default-img.png" />
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div class="controls file-upload input-prepend">
|
||||
<label class="control-label add-on btn" for="input-upload">
|
||||
<%= t(:browse) %>
|
||||
<%= f.file_field :image, :id => "input-upload", :class => 'upload', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>
|
||||
</label>
|
||||
<span id='fu' class="file-name"></span>
|
||||
<br>
|
||||
<input name='fu' class="input-large" type="text">
|
||||
<input name='fu' class="input-medium" type="text">
|
||||
<br>
|
||||
<% if @bulletin.image.file %>
|
||||
<%= f.check_box :remove_image %>
|
||||
@@ -31,6 +39,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="widget-date" class="widget-box widget-size-300">
|
||||
<div class="widget-action clear">
|
||||
<a href="#" class="action"><i title="Set the announcement to start and end dates" class="icon-exclamation-sign icon-white tip"></i></a>
|
||||
@@ -281,6 +291,7 @@
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "bulletin_form" %>
|
||||
<%= javascript_include_tag "inc/jquery.imagesloaded" %>
|
||||
<script>
|
||||
$('#add_bulletin_link a.add').live('click', function(){
|
||||
var new_id = $(this).prev().attr('value');
|
||||
|
||||
Reference in new issue
Block a user