Module: Hydra::HydraHelperBehavior
Instance Method Summary
collapse
#all_edit_partials, #find_workflow_step_by_name, #first_step_in_workflow, #get_af_model_from_params, #get_af_model_from_solr, included, #last_step_in_workflow, #model_config, #next_step, #next_step_in_workflow, #previous_show_partials, #validate_workflow_step, #workflow_config, #workflow_partial_for_step
Instance Method Details
#document_fedora_show_html_title ⇒ Object
36
37
38
|
# File 'app/helpers/hydra/hydra_helper_behavior.rb', line 36
def document_fedora_show_html_title
@document.datastreams["descMetadata"].title_values.first
end
|
#edit_and_browse_links ⇒ Object
8
9
10
11
12
13
14
15
16
|
# File 'app/helpers/hydra/hydra_helper_behavior.rb', line 8
def edit_and_browse_links
result = ""
if params[:action] == "edit"
result << "<a href=\"#{catalog_path(@document[:id], :viewing_context=>"browse")}\" class=\"browse toggle\">Switch to browse view</a>"
else
result << "<a href=\"#{edit_catalog_path(@document[:id], :viewing_context=>"edit")}\" class=\"edit toggle\">Switch to edit view</a>"
end
return result.html_safe
end
|
#grouping_facet ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'app/helpers/hydra/hydra_helper_behavior.rb', line 19
def grouping_facet
Deprecation.warn Hydra::HydraHelperBehavior, "Grouping facet will be removed in hydra-file-access 6.0"
fields = Hash[sort_fields]
case h(params[:sort])
when fields['date -']
'year_facet'
when fields['date +']
'year_facet'
when fields['document type']
'medium_t'
when fields['location']
'series_facet'
else
nil
end
end
|
#render_all_workflow_steps ⇒ Object
54
55
56
|
# File 'app/helpers/hydra/hydra_helper_behavior.rb', line 54
def render_all_workflow_steps
all_edit_partials.map{|partial| render partial}.join
end
|
#render_previous_workflow_steps ⇒ Object
41
42
43
|
# File 'app/helpers/hydra/hydra_helper_behavior.rb', line 41
def render_previous_workflow_steps
previous_show_partials(params[:wf_step]).map{|partial| render partial}.join
end
|
#render_submission_workflow_step ⇒ Object
45
46
47
48
49
50
51
|
# File 'app/helpers/hydra/hydra_helper_behavior.rb', line 45
def render_submission_workflow_step
if params.has_key?(:wf_step)
render workflow_partial_for_step(params[:wf_step])
else
render workflow_partial_for_step(first_step_in_workflow)
end
end
|
#submit_name ⇒ Object
58
59
60
61
62
63
64
65
66
|
# File 'app/helpers/hydra/hydra_helper_behavior.rb', line 58
def submit_name
if session[:scripts]
return "Save"
elsif params[:new_asset]
return "Continue"
else
return "Save and Continue"
end
end
|
#user_key ⇒ Object
TODO this method is also in Hydra::Controller – DRY it out
69
70
71
|
# File 'app/helpers/hydra/hydra_helper_behavior.rb', line 69
def user_key
current_user.user_key
end
|