Modified: branches/datasets/app/controllers/data_sets_controller.rb (2842 => 2843)
--- branches/datasets/app/controllers/data_sets_controller.rb 2011-11-24 12:33:22 UTC (rev 2842)
+++ branches/datasets/app/controllers/data_sets_controller.rb 2011-11-24 14:18:59 UTC (rev 2843)
@@ -94,10 +94,13 @@
def auth
unless Authorization.is_authorized?(action_name, nil, @workflow, current_user)
+
action = ""
action = "" if action_name == "show"
- flash[:error] = "You are not authorized to #{action} this data set"
+ action = "" == "new" ? "create new data sets for this workflow" : "#{action} this data set")
+ flash[:error] = "You are not authorized to #{action}."
+
respond_to do |format|
format.html { redirect_to workflow_url(@workflow) }
end
Modified: branches/datasets/app/models/data_set.rb (2842 => 2843)
--- branches/datasets/app/models/data_set.rb 2011-11-24 12:33:22 UTC (rev 2842)
+++ branches/datasets/app/models/data_set.rb 2011-11-24 14:18:59 UTC (rev 2843)
@@ -84,12 +84,12 @@
"Summary of contents:\r\n" +
" Inputs:\r\n" +
" Text: #{stats["input"][:text]}\r\n" +
- " Files: #{stats["input"][:text]}" +
+ " Files: #{stats["input"][:files]}" +
(stats["input"][:hidden] > 0 ?
" (#{stats["input"][:hidden]} files were omitted due to insufficient privileges)\r\n" : "\r\n") +
" Outputs:\r\n" +
" Text: #{stats["output"][:text]}\r\n" +
- " Files: #{stats["output"][:text]}" +
+ " Files: #{stats["output"][:files]}" +
(stats["output"][:hidden] > 0 ?
" (#{stats["output"][:hidden]} files were omitted due to insufficient privileges)\r\n" : "\r\n")
end
Modified: branches/datasets/app/views/data_sets/_data_item.rhtml (2842 => 2843)
--- branches/datasets/app/views/data_sets/_data_item.rhtml 2011-11-24 12:33:22 UTC (rev 2842)
+++ branches/datasets/app/views/data_sets/_data_item.rhtml 2011-11-24 14:18:59 UTC (rev 2843)
@@ -7,7 +7,7 @@
<td class="port <%= port_type -%>">
<h5><img src="" <%= port_type.capitalize %> Name</h5>
<div>
- <input title="<%= port.name -%>" type="text" readonly="readonly" value="<%= port.name -%>" size="21" class="readonly"/>
+ <input title="<%= port.name -%>" type="text" readonly="readonly" value="<%= port.name -%>" size="24" class="readonly"/>
</div>
</td>
<% end %>
@@ -21,24 +21,21 @@
</div>
<% elsif data.kind_of?(Blob) %>
<div class="file_data">
- <% if Authorization.is_authorized?("show", nil, data, current_user) -%>
+ <% can_download = Authorization.is_authorized?("download", nil, data, current_user) %>
+ <% can_view = can_download || Authorization.is_authorized?("view", nil, data, current_user) %>
+ <% if can_view -%>
<div style="float:left">
<b>Title:</b> <%= link_to "#{h truncate(data.label, 70)}", file_path(data), :class => "file_link" %><br/>
<b>Type: </b> <%= h data.content_type.title %><br/>
<b>Size: </b> <%= number_to_human_size(data.content_blob.data.size) %><br/>
</div>
- <div style="float:right; width: 11em">
- <ul class="sectionIcons" style="text-align: right">
- <% if Authorization.is_authorized?("download", nil, data, current_user) -%>
- <li>
- <%= icon('download', download_file_path(data), nil, nil, 'Download') %>
- </li>
- <% else %>
- <p class="denied_text" style="text-align: center;">
- You are not authorized to download this data file.
- </p>
- <% end %>
- </ul>
+ <div class="actions">
+ <%= icon('show', file_path(data), nil, nil, 'View') %><br/>
+
+ <% if can_download %>
+ <%= icon('download', download_file_path(data), nil, nil, 'Download') %><br/>
+ <% end %>
+
</div>
<% else %>
<p class="denied_text" style="text-align: center;">
Modified: branches/datasets/app/views/data_sets/_data_item_form.rhtml (2842 => 2843)
--- branches/datasets/app/views/data_sets/_data_item_form.rhtml 2011-11-24 12:33:22 UTC (rev 2842)
+++ branches/datasets/app/views/data_sets/_data_item_form.rhtml 2011-11-24 14:18:59 UTC (rev 2843)
@@ -16,7 +16,7 @@
end
container_element = @relationship.id.nil? ? "data_item_#{port_type}_form" : "address@hidden"
- unique_id = @relationship.id.to_s || port_type
+ unique_id = (@relationship.id || port_type).to_s
%>
<td colspan="4" style="padding: 0">
Modified: branches/datasets/public/stylesheets/styles.css (2842 => 2843)
--- branches/datasets/public/stylesheets/styles.css 2011-11-24 12:33:22 UTC (rev 2842)
+++ branches/datasets/public/stylesheets/styles.css 2011-11-24 14:18:59 UTC (rev 2843)
@@ -2417,10 +2417,17 @@
.data_set input[type=text].readonly, .data_set textarea {
background-color: #FFF;
- border: 1px dashed #CCC;
+ border: 1px solid #CCC;
padding: 3px;
}
+.data_set input[type=text].readonly {
+ width: 96%;
+}
+.data_set textarea {
+ width: 97%;
+}
+
.data_set .input input[type=text].readonly, .data_set .input textarea.readonly {
background-color: #FEE;
border-color: #FBB;
@@ -2453,3 +2460,8 @@
overflow: auto;
line-height: 1.1;
}
+
+.data_set td.data .file_data .actions {
+ float: right;
+ width: 6em;
+}