sufia 1.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +0 -3
- data/Gemfile +1 -0
- data/Releasing_sufia.md +3 -0
- data/SUFIA_VERSION +1 -0
- data/app/assets/javascripts/sufia.js +22 -24
- data/app/assets/javascripts/sufia/batch_select_all.js +2 -0
- data/app/assets/javascripts/sufia/fileupload.js +6 -0
- data/app/assets/javascripts/sufia/uploader.js +165 -0
- data/app/assets/javascripts/terms_of_service.js +36 -30
- data/app/assets/stylesheets/{scholarsphere-bootstrap.css → application-bootstrap.css} +0 -0
- data/app/assets/stylesheets/sufia.css.scss +1 -1
- data/app/controllers/batch_controller.rb +1 -0
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +2 -1
- data/app/helpers/generic_file_helper.rb +17 -0
- data/{lib/sufia → app}/jobs/content_delete_event_job.rb +0 -0
- data/{lib/sufia → app}/jobs/content_deposit_event_job.rb +0 -0
- data/{lib/sufia → app}/jobs/content_new_version_event_job.rb +0 -0
- data/{lib/sufia → app}/jobs/content_restored_version_event_job.rb +0 -0
- data/{lib/sufia → app}/jobs/content_update_event_job.rb +0 -0
- data/{lib/sufia → app}/jobs/event_job.rb +0 -0
- data/{lib/sufia → app}/jobs/user_edit_profile_event_job.rb +0 -0
- data/{lib/sufia → app}/jobs/user_follow_event_job.rb +0 -0
- data/{lib/sufia → app}/jobs/user_unfollow_event_job.rb +0 -0
- data/app/models/contact_form.rb +2 -2
- data/app/views/_ga.html.erb +2 -2
- data/app/views/batch_edits/_batch_edits_actions.html.erb +1 -0
- data/app/views/batch_edits/_check_all.html.erb +1 -2
- data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
- data/app/views/dashboard/_batch_edits_actions.html.erb +2 -0
- data/app/views/dashboard/_sort_and_per_page.html.erb +1 -1
- data/app/views/generic_files/_breadcrumbs.html.erb +5 -1
- data/app/views/generic_files/_descriptions.html.erb +6 -4
- data/app/views/generic_files/_dropbox_import.html.erb +3 -0
- data/app/views/generic_files/_field_display.html.erb +12 -0
- data/app/views/generic_files/_field_form.html.erb +1 -1
- data/app/views/generic_files/_multiple_upload.html.erb +4 -135
- data/app/views/generic_files/_permission_form.html.erb +5 -5
- data/app/views/generic_files/_show_descriptions.html.erb +6 -14
- data/app/views/generic_files/_show_details.html.erb +2 -2
- data/app/views/generic_files/edit_fields/_resource_type.html.erb +9 -0
- data/app/views/generic_files/edit_fields/_rights.html.erb +1 -1
- data/app/views/generic_files/edit_fields/_type.html.erb +4 -1
- data/app/views/generic_files/new.html.erb +18 -1
- data/app/views/generic_files/show_fields/_default.html.erb +12 -0
- data/app/views/generic_files/upload/_agreement.html.erb +5 -0
- data/app/views/generic_files/upload/_alerts.html.erb +19 -0
- data/app/views/generic_files/upload/_dropbox_chooser.html.erb +39 -0
- data/app/views/generic_files/upload/_form.html.erb +6 -0
- data/app/views/generic_files/upload/_form_fields.html.erb +47 -0
- data/app/views/generic_files/upload/_script_templates.html.erb +61 -0
- data/app/views/generic_files/upload/_tos_checkbox.html.erb +3 -0
- data/app/views/layouts/_head-tag-content.html.erb +22 -0
- data/app/views/layouts/{hydra-head.html.erb → homepage.html.erb} +3 -44
- data/app/views/layouts/sufia-one-column.html.erb +43 -0
- data/app/views/layouts/sufia-two-column.html.erb +45 -0
- data/app/views/static/agreement.html.erb +12 -11
- data/app/views/static/mendeley.html.erb +2 -2
- data/app/views/static/terms.html.erb +11 -11
- data/app/views/static/zotero.html.erb +2 -2
- data/config/initializers/sufia_events.rb +3 -0
- data/config/locales/sufia.en.yml +3 -6
- data/features/step_definitions/{scholarsphere.rb → sufia.rb} +0 -0
- data/lib/generators/sufia/sufia_generator.rb +1 -1
- data/lib/generators/sufia/templates/config/resque_config.rb +1 -1
- data/lib/generators/sufia/templates/config/sufia.rb +3 -0
- data/lib/sufia.rb +1 -50
- data/lib/sufia/batch_edits_controller_behavior.rb +4 -0
- data/lib/sufia/controller.rb +13 -0
- data/lib/sufia/dashboard_controller_behavior.rb +3 -2
- data/lib/sufia/files_controller_behavior.rb +35 -12
- data/lib/sufia/version.rb +1 -1
- data/spec/controllers/batch_edits_controller_spec.rb +2 -2
- data/spec/controllers/generic_files_controller_spec.rb +37 -1
- data/spec/models/generic_file_spec.rb +6 -6
- data/spec/models/properties_datastream_spec.rb +8 -7
- data/spec/models/transcode_audio_job_spec.rb +1 -1
- data/spec/models/transcode_video_job_spec.rb +1 -1
- data/spec/views/batch_edits/check_all_spec.rb +22 -0
- data/sufia-models/.gitignore +17 -0
- data/sufia-models/Gemfile +4 -0
- data/sufia-models/LICENSE.md +177 -0
- data/sufia-models/README.md +39 -0
- data/sufia-models/Rakefile +1 -0
- data/{app → sufia-models/app}/models/batch.rb +2 -4
- data/{app → sufia-models/app}/models/checksum_audit_log.rb +3 -4
- data/{app → sufia-models/app}/models/datastreams/batch_rdf_datastream.rb +0 -0
- data/{app → sufia-models/app}/models/datastreams/file_content_datastream.rb +0 -0
- data/{app → sufia-models/app}/models/datastreams/fits_datastream.rb +0 -0
- data/{app → sufia-models/app}/models/datastreams/generic_file_rdf_datastream.rb +12 -12
- data/{app → sufia-models/app}/models/datastreams/paranoid_rights_datastream.rb +0 -15
- data/{app → sufia-models/app}/models/datastreams/properties_datastream.rb +1 -2
- data/{app → sufia-models/app}/models/domain_term.rb +0 -0
- data/{app → sufia-models/app}/models/follow.rb +0 -0
- data/{app → sufia-models/app}/models/generic_file.rb +0 -0
- data/{app → sufia-models/app}/models/geo_names_resource.rb +0 -0
- data/{app → sufia-models/app}/models/group.rb +0 -0
- data/{app → sufia-models/app}/models/local_authority.rb +0 -0
- data/{app → sufia-models/app}/models/local_authority_entry.rb +0 -0
- data/{app → sufia-models/app}/models/single_use_link.rb +0 -0
- data/{app → sufia-models/app}/models/subject_local_authority_entry.rb +0 -0
- data/{app → sufia-models/app}/models/trophy.rb +0 -0
- data/{app → sufia-models/app}/models/version_committer.rb +0 -0
- data/sufia-models/config/locales/sufia.en.yml +6 -0
- data/sufia-models/lib/sufia/models.rb +34 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/active_fedora/redis.rb +0 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/active_record/redis.rb +0 -0
- data/{lib → sufia-models/lib/sufia/models}/active_support/core_ext/marshal.rb +0 -0
- data/sufia-models/lib/sufia/models/engine.rb +61 -0
- data/sufia-models/lib/sufia/models/file_content.rb +9 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/file_content/extract_metadata.rb +2 -2
- data/{lib/sufia → sufia-models/lib/sufia/models}/file_content/versions.rb +0 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file.rb +3 -34
- data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/actions.rb +16 -1
- data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/audit.rb +1 -1
- data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/characterization.rb +1 -2
- data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/export.rb +0 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/permissions.rb +0 -1
- data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/thumbnail.rb +3 -3
- data/sufia-models/lib/sufia/models/generic_file/web_form.rb +45 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/id_service.rb +11 -7
- data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/audit_job.rb +0 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/batch_update_job.rb +0 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/characterize_job.rb +0 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/ffmpeg_transcode_job.rb +3 -3
- data/sufia-models/lib/sufia/models/jobs/import_url_job.rb +55 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/resolrize_job.rb +0 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/transcode_audio_job.rb +0 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/transcode_video_job.rb +0 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/unzip_job.rb +16 -4
- data/{lib/sufia → sufia-models/lib/sufia/models}/model_methods.rb +0 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/noid.rb +1 -1
- data/{lib/sufia/queue → sufia-models/lib/sufia/models}/resque.rb +0 -2
- data/{lib/sufia → sufia-models/lib/sufia/models}/solr_document_behavior.rb +0 -0
- data/{lib/sufia → sufia-models/lib/sufia/models}/user.rb +1 -1
- data/{lib/sufia → sufia-models/lib/sufia/models}/utils.rb +0 -0
- data/sufia-models/lib/sufia/models/version.rb +5 -0
- data/sufia-models/lib/tasks/sufia-models_tasks.rake +7 -0
- data/sufia-models/sufia-models.gemspec +44 -0
- data/sufia.gemspec +2 -12
- data/tasks/release.rake +90 -0
- data/tasks/sufia-dev.rake +1 -1
- data/tasks/sufia.rake +1 -3
- metadata +118 -238
- data/app/views/generic_files/show_fields/_based_near.html.erb +0 -12
- data/app/views/generic_files/show_fields/_contributor.html.erb +0 -12
- data/app/views/generic_files/show_fields/_creator.html.erb +0 -12
- data/app/views/generic_files/show_fields/_date_created.html.erb +0 -12
- data/app/views/generic_files/show_fields/_description.html.erb +0 -12
- data/app/views/generic_files/show_fields/_identifier.html.erb +0 -9
- data/app/views/generic_files/show_fields/_language.html.erb +0 -9
- data/app/views/generic_files/show_fields/_publisher.html.erb +0 -12
- data/app/views/generic_files/show_fields/_related_url.html.erb +0 -11
- data/app/views/generic_files/show_fields/_resource_type.html.erb +0 -9
- data/app/views/generic_files/show_fields/_rights.html.erb +0 -9
- data/app/views/generic_files/show_fields/_subject.html.erb +0 -12
- data/app/views/generic_files/show_fields/_tag.html.erb +0 -9
- data/app/views/generic_files/show_fields/_title.html.erb +0 -12
- data/lib/sufia/file_content.rb +0 -8
- data/lib/sufia/generic_file/web_form.rb +0 -15
- data/vendor/assets/javascripts/fileupload.js +0 -6
- data/vendor/assets/javascripts/fileupload/application.js +0 -185
- data/vendor/assets/javascripts/fileupload/jquery-ui-1.8.14.custom.min.js +0 -76
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/app/models/contact_form.rb
CHANGED
|
@@ -35,8 +35,8 @@ class ContactForm < MailForm::Base
|
|
|
35
35
|
def headers
|
|
36
36
|
{
|
|
37
37
|
:subject => "Contact Form:#{subject}",
|
|
38
|
-
:to => Sufia
|
|
39
|
-
:from => Sufia
|
|
38
|
+
:to => Sufia.config.contact_email,
|
|
39
|
+
:from => Sufia.config.from_email
|
|
40
40
|
}
|
|
41
41
|
end
|
|
42
42
|
end
|
data/app/views/_ga.html.erb
CHANGED
|
@@ -15,8 +15,8 @@ limitations under the License.
|
|
|
15
15
|
%>
|
|
16
16
|
|
|
17
17
|
<%
|
|
18
|
-
if Sufia
|
|
19
|
-
tracking_id = Sufia
|
|
18
|
+
if Sufia.config.respond_to? :google_analytics_id
|
|
19
|
+
tracking_id = Sufia.config.google_analytics_id
|
|
20
20
|
%>
|
|
21
21
|
<script type="text/javascript">
|
|
22
22
|
var _gaq = _gaq || [];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<li data-behavior="batch-edit-select-abc" data-state="on"><a href="#"><i class="icon-ok"></i> Select ABC</a></li>
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
<%= check_box_tag 'check_all', 'yes', @all_checked, :disabled => ((@batch_size_on_other_page + @document_list.count) > @max_batch_size) %>
|
|
4
4
|
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="icon-cog" title="click for selection options"></span></a>
|
|
5
5
|
<ul class="dropdown-menu">
|
|
6
|
-
|
|
7
|
-
<li data-behavior="batch-edit-select-page" data-state="off"><a href="#"><i class=""></i> Select Current Page</a></li>
|
|
6
|
+
<%= render partial:'batch_edits_actions' %>
|
|
8
7
|
</ul>
|
|
9
8
|
</div>
|
|
10
9
|
<% end %>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<strong>Show</strong> <%= select_tag(:per_page, options_for_select(['10', '20', '50', '100'], h(params[:per_page])), :title => "Number of results to display per page", :class => "input-small") %> per page
|
|
10
10
|
<% end %>
|
|
11
11
|
<%= search_as_hidden_fields(:omit_keys => [:per_page, :sort]) %>
|
|
12
|
-
<button class="btn btn-primary"><i class="icon-refresh"></i>
|
|
12
|
+
<button class="btn btn-primary"><i class="icon-refresh"></i> Refresh</button>
|
|
13
13
|
|
|
14
14
|
</div>
|
|
15
15
|
<% end %>
|
|
@@ -28,7 +28,7 @@ limitations under the License.
|
|
|
28
28
|
<% end %>
|
|
29
29
|
<%= search_as_hidden_fields(:omit_keys => [:per_page, :sort]) %>
|
|
30
30
|
|
|
31
|
-
<button class="btn btn-primary"><i class="icon-refresh"></i>
|
|
31
|
+
<button class="btn btn-primary"><i class="icon-refresh"></i> Refresh</button>
|
|
32
32
|
<% end unless sort_fields.empty? %>
|
|
33
33
|
<% end %>
|
|
34
34
|
</div>
|
|
@@ -13,6 +13,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
%>
|
|
16
|
+
|
|
17
|
+
<%# convert class variable to a local variable if the local hasn't been set %>
|
|
18
|
+
<% generic_file = @generic_file unless generic_file %>
|
|
19
|
+
|
|
16
20
|
<div class="breadcrumbs">
|
|
17
21
|
<%
|
|
18
22
|
include_file = true if include_file.blank?
|
|
@@ -28,7 +32,7 @@ limitations under the License.
|
|
|
28
32
|
crumbs << link_to('Back to search results', request.referer)
|
|
29
33
|
end
|
|
30
34
|
|
|
31
|
-
crumbs <<
|
|
35
|
+
crumbs << generic_file.title.first if include_file
|
|
32
36
|
|
|
33
37
|
crumbs.each do |crumb| %>
|
|
34
38
|
<% if crumb == crumbs.last %>
|
|
@@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
%>
|
|
16
16
|
|
|
17
|
+
<%# convert class variable to a local variable if the local hasn't been set %>
|
|
18
|
+
<% generic_file = @generic_file unless generic_file %>
|
|
19
|
+
|
|
17
20
|
<div id="descriptions_display" class="tab-pane active">
|
|
18
|
-
<%= form_for
|
|
21
|
+
<%= form_for generic_file, :url => sufia.generic_file_path, :html => {:multipart => true, :class => 'form-horizontal'} do |f| %>
|
|
19
22
|
<%= hidden_field_tag('redirect_tab', 'descriptions') %>
|
|
20
23
|
<h2 class="non lower">Descriptions <small class="pull-right"><span class="error">*</span> indicates required fields</small> </h2>
|
|
21
24
|
<div class="well">
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<%= render :partial => "generic_files/field_form", :locals => { :generic_file => @generic_file, :f =>f, :render_req => true, :key => term } %>
|
|
26
|
+
<% (generic_file.terms_for_editing).each do |term| %>
|
|
27
|
+
<%= render :partial => "generic_files/field_form", :locals => { generic_file: generic_file, f: f, render_req: true, key: term } %>
|
|
26
28
|
<% end %>
|
|
27
29
|
|
|
28
30
|
</div><!-- /well -->
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
<% end %>
|
|
10
10
|
|
|
11
11
|
<% vals.to_ary.each_with_index do |v, index| %>
|
|
12
|
-
<%= render_edit_field_partial(key, f:f, v: v, index: index, render_req: render_req) %>
|
|
12
|
+
<%= render_edit_field_partial(key, record: generic_file, f:f, v: v, index: index, render_req: render_req) %>
|
|
13
13
|
<% end %>
|
|
14
14
|
</div><!-- /control-group -->
|
|
@@ -1,135 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<div class="alert alert-info hide" id="redirect-loc" type="text/x-jquery-tmpl">
|
|
6
|
-
<%=sufia.batch_edit_path(@batch_noid)%>
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
<div id="upload_tooltip"><%= t('sufia.upload_tooltip') %></div>
|
|
10
|
-
|
|
11
|
-
<div class="alert alert-info hide" id="success">
|
|
12
|
-
You have successfully uploaded some of your files. Either continue to upload or edit use the links below to abandon the rest of your added files.
|
|
13
|
-
<p>
|
|
14
|
-
<%= link_to 'Add Descriptions', sufia.batch_edit_path(@batch_noid), :class=>'btn' %>
|
|
15
|
-
</p>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div class="alert hide" id="fail">
|
|
19
|
-
There was a problem during upload. Please click the "Start Upload" button or <%= link_to 'start over', sufia.new_generic_file_path %>
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
<div class="alert hide" id="partial_fail">
|
|
23
|
-
One or more files did not upload successfully. To continue using the files uploaded use one of the links below.<br />
|
|
24
|
-
<%= link_to 'Add Descriptions', sufia.batch_edit_path(@batch_noid), :class=>'btn' %>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<div class="alert hide" id="errmsg"> </div>
|
|
28
|
-
|
|
29
|
-
<!-- The file upload form used as target for the file upload widget -->
|
|
30
|
-
<%= form_for(@generic_file, :url => sufia.generic_files_path, :html => {:multipart => true, :class => 'form-horizontal well', :id => 'fileupload'}) do |f| %>
|
|
31
|
-
<%= hidden_field_tag(:total_upload_size, 0) %>
|
|
32
|
-
<%= hidden_field_tag(:relative_path) %>
|
|
33
|
-
<%= hidden_field_tag(:batch_id, @batch_noid) %>
|
|
34
|
-
<label class="checkbox">
|
|
35
|
-
<%= check_box_tag 'terms_of_service' %> I have read and do agree
|
|
36
|
-
to <%= link_to t('sufia.deposit_agreement'),
|
|
37
|
-
'/agreement/', :target => "_blank" %>.
|
|
38
|
-
</label>
|
|
39
|
-
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
|
|
40
|
-
<div class="row fileupload-buttonbar">
|
|
41
|
-
<div class="span70">
|
|
42
|
-
<!-- The fileinput-button span is used to style the file input field as button -->
|
|
43
|
-
<span class="btn btn-success fileinput-button">
|
|
44
|
-
<i class="icon-plus icon-white"></i>
|
|
45
|
-
<span>Select files...</span>
|
|
46
|
-
<input type="file" name="files[]" multiple />
|
|
47
|
-
</span>
|
|
48
|
-
<% ua = request.env['HTTP_USER_AGENT'] %>
|
|
49
|
-
<% if !!(ua =~ /Chrome/) %>
|
|
50
|
-
<span class="btn btn-success fileinput-button">
|
|
51
|
-
<i class="icon-plus icon-white"></i>
|
|
52
|
-
<span>Select folder...</span>
|
|
53
|
-
<input type="file" name="files[]" directory webkitdirectory mozdirectory />
|
|
54
|
-
</span>
|
|
55
|
-
<% end %>
|
|
56
|
-
<span id="main_upload_start_span">
|
|
57
|
-
<button type="submit" class="btn btn-primary start" id='main_upload_start'>
|
|
58
|
-
<i class="icon-upload icon-white"></i>
|
|
59
|
-
<span>Start upload</span>
|
|
60
|
-
</button>
|
|
61
|
-
</span>
|
|
62
|
-
<button type="reset" class="btn btn-warning cancel">
|
|
63
|
-
<i class="icon-ban-circle icon-white"></i>
|
|
64
|
-
<span>Cancel upload</span>
|
|
65
|
-
</button>
|
|
66
|
-
</div>
|
|
67
|
-
<div class="span50">
|
|
68
|
-
<!-- The global progress bar -->
|
|
69
|
-
<div class="progress progress-success progress-striped active fade">
|
|
70
|
-
<div class="bar" style="width:0%;"></div>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
<!-- The loading indicator is shown during image processing -->
|
|
75
|
-
<div class="fileupload-loading"></div>
|
|
76
|
-
<br />
|
|
77
|
-
<!-- The table listing the files available for upload/download -->
|
|
78
|
-
<table id="file-table" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
|
|
79
|
-
<% end %>
|
|
80
|
-
|
|
81
|
-
<!-- The template to display files available for upload -->
|
|
82
|
-
<script id="template-upload" type="text/x-jquery-tmpl">
|
|
83
|
-
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
|
84
|
-
|
|
85
|
-
<tr class="template-upload fade">
|
|
86
|
-
<td class="preview"><span class="fade"></span></td>
|
|
87
|
-
<td class="name"><span>{%=file.name%}</span></td>
|
|
88
|
-
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
|
|
89
|
-
{% if (file.error) { %}
|
|
90
|
-
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
|
|
91
|
-
{% } else if (o.files.valid && !i) { %}
|
|
92
|
-
<td>
|
|
93
|
-
<div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
|
|
94
|
-
</td>
|
|
95
|
-
<td class="start">{% if (!o.options.autoUpload) { %}
|
|
96
|
-
<button class="btn btn-primary hide">
|
|
97
|
-
<i class="icon-upload icon-white"></i>
|
|
98
|
-
<span>{%=locale.fileupload.start%}</span>
|
|
99
|
-
</button>
|
|
100
|
-
{% } %}</td>
|
|
101
|
-
{% } else { %}
|
|
102
|
-
<td colspan="2"></td>
|
|
103
|
-
{% } %}
|
|
104
|
-
<td class="cancel">{% if (!i) { %}
|
|
105
|
-
<button class="btn btn-warning">
|
|
106
|
-
<i class="icon-ban-circle icon-white"></i>
|
|
107
|
-
<span>{%=locale.fileupload.cancel%}</span>
|
|
108
|
-
</button>
|
|
109
|
-
{% } %}</td>
|
|
110
|
-
</tr>
|
|
111
|
-
{% } %}
|
|
112
|
-
</script>
|
|
113
|
-
<!-- The template to display files available for download -->
|
|
114
|
-
<script id="template-download" type="text/x-jquery-tmpl">
|
|
115
|
-
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
|
116
|
-
<tr class="template-download fade">
|
|
117
|
-
{% if (file.error) { %}
|
|
118
|
-
<td><span></span></td>
|
|
119
|
-
<td class="name"><span>{%=file.name%}</span></td>
|
|
120
|
-
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
|
|
121
|
-
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
|
|
122
|
-
{% } else { %}
|
|
123
|
-
<td class="preview">
|
|
124
|
-
{% if (file.thumbnail_url) { %} <span class="label label-success">Success</span> {% } %}
|
|
125
|
-
</td>
|
|
126
|
-
<td class="name">
|
|
127
|
-
{%=file.name%}
|
|
128
|
-
<!--a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}" target="_blank">{%=file.name%}</a-->
|
|
129
|
-
</td>
|
|
130
|
-
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
|
|
131
|
-
<td colspan="2"></td>
|
|
132
|
-
{% } %}
|
|
133
|
-
</tr>
|
|
134
|
-
{% } %}
|
|
135
|
-
</script>
|
|
1
|
+
<%= render partial: 'generic_files/upload/agreement' %>
|
|
2
|
+
<%= render partial: 'generic_files/upload/alerts' %>
|
|
3
|
+
<%= render partial: 'generic_files/upload/form' %>
|
|
4
|
+
<%= render partial: 'generic_files/upload/script_templates' %>
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
<div class="input-append">
|
|
79
79
|
<p class="help-block">Enter <%=t('sufia.account_label') %> (one at a time)</p>
|
|
80
80
|
<%= text_field_tag 'new_user_name_skel', nil, :class => "span29" %><span class="add-on"><%=t('sufia.directory.suffix') %></span>
|
|
81
|
-
<%= select_tag 'new_user_permission_skel', options_for_select(Sufia
|
|
81
|
+
<%= select_tag 'new_user_permission_skel', options_for_select(Sufia.config.permission_levels), :class=> 'span17' %>
|
|
82
82
|
<button class="btn btn-mini btn-inverse" id="add_new_user_skel"><i class="icon-plus-sign"></i> Add</button>
|
|
83
83
|
<br /> <span id="directory_user_result"></span>
|
|
84
84
|
</div>
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
<div id="new-group" >
|
|
89
89
|
<div class="input-append">
|
|
90
90
|
<%= select_tag 'new_group_name_skel', options_for_select(["Select a group"] + groups), :class => 'span38' %>
|
|
91
|
-
<%= select_tag 'new_group_permission_skel', options_for_select(Sufia
|
|
91
|
+
<%= select_tag 'new_group_permission_skel', options_for_select(Sufia.config.permission_levels), :class => 'span17' %>
|
|
92
92
|
<button class="btn btn-mini btn-inverse" id="add_new_group_skel" ><i class="icon-plus-sign"></i> Add</button>
|
|
93
93
|
<br /><span id="directory_group_result"></span>
|
|
94
94
|
</div>
|
|
@@ -103,18 +103,18 @@
|
|
|
103
103
|
<tr id="file_permissions">
|
|
104
104
|
<td><%= label_tag :owner_access, "Depositor (<span id=\"file_owner\">#{link_to_profile depositor}</span>)".html_safe, :class=>"control-label" %></td>
|
|
105
105
|
<td>
|
|
106
|
-
<%= Sufia
|
|
106
|
+
<%= Sufia.config.owner_permission_levels.keys[0] %>
|
|
107
107
|
</td>
|
|
108
108
|
</tr>
|
|
109
109
|
<% gf.permissions.each do |permission| %>
|
|
110
|
-
|
|
110
|
+
<%# skip the public, penn state (aka registered), and depositor perms as they are displayed first at the top %>
|
|
111
111
|
<% next if permission[:name].downcase == 'public' %>
|
|
112
112
|
<% next if permission[:name].downcase == 'registered' %>
|
|
113
113
|
<% next if permission[:name].downcase == depositor %>
|
|
114
114
|
<tr>
|
|
115
115
|
<td><%= label_tag "generic_file[permissions][#{permission[:type]}][#{permission[:name]}]", permission[:name], :class=>"control-label" %></td>
|
|
116
116
|
<td>
|
|
117
|
-
<%= select_tag "generic_file[permissions][#{permission[:type]}][#{permission[:name]}]", options_for_select(Sufia
|
|
117
|
+
<%= select_tag "generic_file[permissions][#{permission[:type]}][#{permission[:name]}]", options_for_select(Sufia.config.permission_levels, permission[:access]), :class=>'span20 select_perm' %>
|
|
118
118
|
<button class="btn close remove_perm">X</button>
|
|
119
119
|
</td>
|
|
120
120
|
</tr>
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
+
<%# convert class variable to a local variable if the local hasn't been set %>
|
|
2
|
+
<% generic_file = @generic_file unless generic_file %>
|
|
3
|
+
|
|
1
4
|
<h2 class="non lower">Descriptions</h2>
|
|
2
5
|
<table class="table table-striped"><!-- class="verticalheadings"> -->
|
|
3
6
|
<tbody>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<%= render :partial=>'generic_files/show_fields/related_url' %>
|
|
8
|
-
<%= render :partial=>'generic_files/show_fields/based_near' %>
|
|
9
|
-
<%= render :partial=>'generic_files/show_fields/description' %>
|
|
10
|
-
<%= render :partial=>'generic_files/show_fields/language' %>
|
|
11
|
-
<%= render :partial=>'generic_files/show_fields/resource_type' %>
|
|
12
|
-
<%= render :partial=>'generic_files/show_fields/publisher' %>
|
|
13
|
-
<%= render :partial=>'generic_files/show_fields/rights' %>
|
|
14
|
-
<%= render :partial=>'generic_files/show_fields/subject' %>
|
|
15
|
-
<%= render :partial=>'generic_files/show_fields/tag' %>
|
|
16
|
-
<%= render :partial=>'generic_files/show_fields/identifier' %>
|
|
17
|
-
<%= render :partial=>'generic_files/show_fields/date_created' %>
|
|
7
|
+
<% (generic_file.terms_for_display - [:resource_type]).each do |term| %>
|
|
8
|
+
<%= render_show_field_partial(term, generic_file: generic_file) %>
|
|
9
|
+
<% end %>
|
|
18
10
|
</tbody>
|
|
19
11
|
</table> <!-- /verticalheadings -->
|
|
20
12
|
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
<% label = label.humanize %>
|
|
52
52
|
<% if values.is_a? Array %>
|
|
53
53
|
<% length = values.length %>
|
|
54
|
-
<% length = Sufia
|
|
54
|
+
<% length = Sufia.config.fits_message_length-1 if term == :status_message && values.length > Sufia.config.fits_message_length-1 %>
|
|
55
55
|
<% values[0..length].each_with_index do |value, idx| %>
|
|
56
56
|
<% next if value.empty? %>
|
|
57
57
|
<%= "#{label}: #{value.truncate(250)}" %>
|
|
58
58
|
<%= "<br />".html_safe unless idx == length %>
|
|
59
59
|
<% end %>
|
|
60
60
|
<% if length != values.length %>
|
|
61
|
-
<%= render :partial => "generic_files/extra_fields_modal", :locals=>{:name=>term, :values=> values, :start=>Sufia
|
|
61
|
+
<%= render :partial => "generic_files/extra_fields_modal", :locals=>{:name=>term, :values=> values, :start=>Sufia.config.fits_message_length}%>
|
|
62
62
|
<% end %>
|
|
63
63
|
<% else %>
|
|
64
64
|
<%= "#{label}: #{values.truncate(250)}" %><br />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<%# convert class variable to a local variable if the local hasn't been set %>
|
|
2
|
+
<% generic_file = @generic_file unless generic_file %>
|
|
3
|
+
|
|
4
|
+
<div class="controls">
|
|
5
|
+
<p class="help-block">You may select multiple types to apply<p>
|
|
6
|
+
<%= f.select "resource_type", options_for_select(Sufia.config.resource_types.keys, generic_file.resource_type), {}, {:multiple=>true, :size=>7} %>
|
|
7
|
+
<%= help_icon(:resource_type) %>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div class="controls" <% if index == 0%> id="additional_<%= key.to_s %>_clone" <% end %>>
|
|
2
|
-
<% choices = Sufia
|
|
2
|
+
<% choices = Sufia.config.cc_licenses %>
|
|
3
3
|
<% choices = {""=>""}.merge(choices) %>
|
|
4
4
|
<%= f.select "rights", options_for_select(choices, v) %>
|
|
5
5
|
<%= render :partial=>"generic_files/edit_fields/suffix", :locals=>{key: key, index: index} %>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
<%# convert class variable to a local variable if the local hasn't been set %>
|
|
2
|
+
<% generic_file = @generic_file unless generic_file %>
|
|
3
|
+
|
|
1
4
|
<div class="control-group">
|
|
2
5
|
<%= f.label :resource_type, "Resource Types", :class=>"control-label", :for=>"resource_type" %>
|
|
3
6
|
<div class="controls">
|
|
4
7
|
<p class="help-block">You may select multiple types to apply<p>
|
|
5
|
-
<%= f.select "resource_type", options_for_select(Sufia
|
|
8
|
+
<%= f.select "resource_type", options_for_select(Sufia.config.resource_types.keys, generic_file.resource_type), {}, {:multiple=>true, :size=>7} %>
|
|
6
9
|
<%= help_icon(:resource_type) %>
|
|
7
10
|
</div>
|
|
8
11
|
</div><!-- /control-group -->
|
|
@@ -16,4 +16,21 @@ limitations under the License.
|
|
|
16
16
|
|
|
17
17
|
<h2>Upload</h2>
|
|
18
18
|
<%# using partials rather than inlining, so implementers can add or change stuff on this page without much duplication %>
|
|
19
|
-
|
|
19
|
+
<ul class="nav nav-tabs">
|
|
20
|
+
<li class="active"><a href="#local" data-toggle="tab"><i class="icon-desktop"></i> My Computer</a></li>
|
|
21
|
+
<% if Sufia.config.dropbox_api_key %>
|
|
22
|
+
<li><a href="#dropbox" data-toggle="tab"><i class="icon-inbox"></i> Dropbox</a></li>
|
|
23
|
+
<% end %>
|
|
24
|
+
</ul>
|
|
25
|
+
|
|
26
|
+
<div class="tab-content">
|
|
27
|
+
<div class="tab-pane active" id="local">
|
|
28
|
+
<%= render partial: 'multiple_upload' %>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<% if Sufia.config.dropbox_api_key %>
|
|
32
|
+
<div class="tab-pane" id="dropbox">
|
|
33
|
+
<%= render partial: 'dropbox_import' %>
|
|
34
|
+
</div>
|
|
35
|
+
<% end %>
|
|
36
|
+
</div>
|