Commit 05d5b66a
Changed files (3)
app
views
app/views/photos/_form.html.erb
@@ -1,7 +1,7 @@
<% content_for :javascript do %>
<script type="text/javascript" charset="utf-8">
$(function () {
- $('#fileupload').fileupload();
+ $('#fileupload').fileupload({autoUpload:true});
$('#fileupload').fileupload( 'option', 'redirect', window.location.href.replace( /\/[^\/]*$/, '/cors/result.html?%s'));
$('#fileupload').each(function () {
var that = this;
@@ -14,16 +14,15 @@
});
</script>
<% end %>
-
<div>
<%= form_for [@creation, @photo], :html => { :multipart => true, :id => "fileupload" } do |f| %>
<div class="row fileupload-buttonbar">
- <div class="span3">
- <span class="btn btn-success fileinput-button"><i class="icon-plus icon-white"></i><span>Add images...</span><%= f.file_field :image %></span>
- </div>
- <div class="span9">
+ <div class="span10">
<div class="progress progress-success progress-striped active fade"><div class="bar" style="width:0%;"></div></div>
</div>
+ <div class="span2">
+ <span class="btn btn-success fileinput-button"><i class="icon-plus icon-white"></i><span> Add image...</span><%= f.file_field :image %></span>
+ </div>
</div>
<div class="fileupload-loading"></div>
<br>
@@ -91,10 +90,9 @@
<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>Delete</span>
+ <span>REMOVE</span>
</button>
</td>
</tr>
{% } %}
</script>
-
app/views/photos/_photo.html.erb
@@ -1,1 +0,0 @@
-<li> <%= image_tag photo.image_url(:thumb) if photo.image? %> <%= link_to "Delete", creation_photo_path(@creation, photo), :method => :delete, :confirm => "Are you sure?" %> </li>
app/views/photos/new.html.erb
@@ -1,7 +1,21 @@
<% provide(:title, "upload photo") -%>
<% content_for :page_header do -%>
- <h1>Upload Photos</h1>
+ <% if(@creation.is_restricted) -%>
+ <div style="float:right;">
+ <%= image_tag "ratedr.jpg", :class => "span1" %>
+ </div>
+ <% end -%>
+ <h1> <%= @creation.name %> <small> submitted by <%= link_to @creation.user.name, profile_path(@creation.user) %> on <%= @creation.created_at.to_s :foomat %> </small> </h1>
+ <% @creation.categories.each do |category| %>
+ <a href="/categories/<%= category.slug %>"><span class="label"><%= category.name %></span></a>
+ <% end %>
<% end -%>
+<div class="row">
+ <div class="span12">
+ <hr />
+ <p><%= @creation.story %></p>
+ </div>
+</div>
<div class="row">
<div class="span12">
<%= render 'form' %>