Skip to content

Commit f8ce4dc

Browse files
author
Andreas Zuber
committed
some small changes on the views and a new css for a great look.
1 parent b49eb79 commit f8ce4dc

File tree

17 files changed

+479
-60
lines changed

17 files changed

+479
-60
lines changed

app/controllers/admin/uploads_controller.rb

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ def show
1919
end
2020
end
2121

22-
# GET /admin/uploads/1/edit
23-
def edit
24-
@upload = Upload.find(params[:id])
25-
end
26-
2722
# GET /admin/uploads
2823
# GET /admin/uploads.xml
2924
def index
@@ -35,23 +30,6 @@ def index
3530
end
3631
end
3732

38-
# PUT /admin/uploads/1
39-
# PUT /admin/uploads/1.xml
40-
def update
41-
@upload = Upload.find(params[:id])
42-
43-
respond_to do |format|
44-
if @upload.update_attributes(params[:upload])
45-
flash[:notice] = 'Upload was successfully updated.'
46-
format.html { redirect_to([:admin, @upload]) }
47-
format.xml { head :ok }
48-
else
49-
format.html { render :action => "edit" }
50-
format.xml { render :xml => @upload.errors, :status => :unprocessable_entity }
51-
end
52-
end
53-
end
54-
5533
# DELETE /admin/uploads/1
5634
# DELETE /admin/uploads/1.xml
5735
def destroy

app/views/admin/uploads/index.html.erb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@
22

33
<table>
44
<tr>
5+
<th>Post date</th>
56
<th>Filename</th>
7+
<th>Type</th>
68
<th>Description</th>
7-
<th>Hash key</th>
8-
<th>Content type</th>
9-
<th>Created at</th>
9+
<th>Actions</th>
1010
</tr>
1111

1212
<% for upload in @uploads %>
13-
<tr>
13+
<tr class="<%= cycle("row-a","row-b") %>">
14+
<td><%=h upload.created_at %></td>
1415
<td><%=h upload.filename %></td>
15-
<td><%=h upload.description %></td>
16-
<td><%=h upload.hash_key %></td>
1716
<td><%=h upload.content_type %></td>
18-
<td><%=h upload.created_at %></td>
19-
<td><%= link_to 'Show', [:admin, upload] %></td>
20-
<td><%= link_to 'Edit', edit_admin_upload_path(upload) %></td>
21-
<td><%= link_to 'Destroy', [:admin, upload], :confirm => 'Are you sure?', :method => :delete %></td>
17+
<td><%=h upload.description %></td>
18+
<td><%= link_to 'Show', [:admin, upload] %>,
19+
<%= link_to 'Delete', [:admin, upload], :confirm => 'Are you sure?', :method => :delete %></td>
2220
</tr>
2321
<% end %>
2422
</table>

app/views/admin/uploads/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<p>
1212
<b>This is the URL to download your file:</b><br/>
1313
<% download_url = root_url + 'downloads/' + @upload.hash_key + '/' + @upload.filename %>
14-
<a href="<%=h download_url%>"><h3><%=h download_url%></h3></a>
14+
<a href="<%=h download_url%>"><b><%=h download_url%></b></a>
1515
</p>
1616

1717
<%= link_to 'Back', admin_uploads_path %>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3+
4+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5+
<head>
6+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7+
<meta name="Robots" content="noindex,nofollow" />
8+
<title>Uploads: <%= controller.action_name %></title>
9+
<%= stylesheet_link_tag 'PixelGreen' %>
10+
</head>
11+
<body>
12+
13+
<div id="wrap">
14+
<div id="header"><div id="header-content">
15+
<h1 id="logo">File<span class="gray">Paste</span></h1>
16+
<h2 id="slogan">pastebin for files ...</h2>
17+
18+
<!-- Menu Tabs -->
19+
<ul>
20+
<li><a href=<%=h root_url + 'uploads/new' %> id="current">upload new file</a></li>
21+
<li><a href=<%=h root_url + 'admin/uploads' %> id="current">list files</a></li>
22+
</ul>
23+
</div>
24+
</div>
25+
26+
<div id="content-wrap">
27+
<div id="content">
28+
<div id="sidebar" >
29+
30+
<div class="sidebox">
31+
32+
<h1>Usage</h1>
33+
34+
<p><%= @filepaste_settings['general']['help_text'] %></p>
35+
36+
</div>
37+
</div>
38+
39+
<div id="main">
40+
<p style="color: green"><%= flash[:notice] %></p>
41+
42+
<%= yield %>
43+
</div>
44+
</div>
45+
</div>
46+
</body>
47+
</html>

app/views/layouts/uploads.html.erb

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/views/uploads/downloadinfo.html.erb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,5 @@
1111
<p>
1212
<b>This is the URL to download your file:</b><br/>
1313
<% download_url = root_url + 'downloads/' + @upload.hash_key + '/' + @upload.filename %>
14-
<a href="<%=h download_url%>"><h3><%=h download_url%></h3></a>
14+
<a href="<%=h download_url%>"><b><%=h download_url%></b></a>
1515
</p>
16-
17-
<%= link_to 'Upload new File', new_upload_path %>

app/views/uploads/new.html.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
<% form_for :uploads, :url => { :action => 'create' }, :html => { :multipart => true } do |f| %>
44
<%= f.error_messages %>
55

6-
<p>
7-
<%= f.label :description %><br />
8-
<%= f.text_area :description %>
9-
</p>
106
<p>
117
<%= f.label 'Path to File' %><br />
128
<%= f.file_field 'file' %>
139
</p>
1410
<p>
15-
<%= f.submit "Create" %>
11+
<%= f.label :description %><br />
12+
<%= f.text_area :description %>
13+
</p>
14+
<p>
15+
<%= f.submit "Upload" %>
1616
</p>
1717
<% end %>
1818

config/settings.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11

22
general:
3-
hash_length: "32"
3+
title: "FilePaste Server"
4+
greeting: "Welcome to our FilePaste Server"
5+
hash_length: "16"
6+
help_text: "<ul>
7+
<li>Press the 'Browse...' button</li>
8+
<li>Select the file you want to share</li>
9+
<li>Write a short discription about what this file is for</li>
10+
<li>Press the 'Upload' button<li>
11+
<li>Uploading may take a while, this depends on the size of your file</li>
12+
<li>As soon as the file is uploadet, you get the link where you can download the
13+
File. Please copy this link NOW.</li>
14+
<li>Share the link with the people that want to download the file</li>
15+
</ul>
16+
</p><p>
17+
Please notice that hidding the file like FilePaste does is not a good way to prevent others from
18+
stealing your data. If you share sensitive data, please take additional actions like encryption
19+
to ensure security. For file encryption, take a look at
20+
<a href=\"http://www.gnupg.org/\">http://www.gnupg.org/</a>"
421

5-
ldap_settings:
22+
ldap:
623
host: "ldap.yourserver.com"
724
port: "389"
825
base: "dc=your,dc=base"

public/images/bg.jpg

471 Bytes
Loading

public/images/bullet.gif

281 Bytes
Loading

0 commit comments

Comments
 (0)