Revision 1274:5ea1a213c7a5 plugins/redmine_bibliography/app/controllers
| plugins/redmine_bibliography/app/controllers/publications_controller.rb | ||
|---|---|---|
| 5 | 5 |
unloadable |
| 6 | 6 |
|
| 7 | 7 |
model_object Publication |
| 8 |
before_filter :find_model_object, :except => [:new, :create, :index, :get_bibtex_required_fields, :autocomplete_for_project, :add_author, :sort_author_order, :autocomplete_for_author, :get_user_info ] |
|
| 8 |
# before_filter :find_model_object, :except => [:new, :create, :index, :show_bibtex_fields, :autocomplete_for_project, :add_author, :sort_author_order, :autocomplete_for_author, :get_user_info ] |
|
| 9 |
|
|
| 9 | 10 |
before_filter :find_project_by_project_id, :authorize, :only => [ :edit, :new, :update, :create ] |
| 10 | 11 |
|
| 11 | 12 |
def new |
| ... | ... | |
| 60 | 61 |
end |
| 61 | 62 |
end |
| 62 | 63 |
|
| 63 |
def get_bibtex_required_fields |
|
| 64 |
def show_bibtex_fields |
|
| 65 |
@fields = [] |
|
| 64 | 66 |
|
| 65 | 67 |
unless params[:value].empty? |
| 66 |
fields = BibtexEntryType.fields(params[:value]) |
|
| 68 |
@fields = BibtexEntryType.fields(params[:value])
|
|
| 67 | 69 |
end |
| 68 | 70 |
|
| 69 | 71 |
respond_to do |format| |
| 70 | 72 |
format.js {
|
| 71 |
render(:update) {|page|
|
|
| 72 |
if params[:value].empty? |
|
| 73 |
page << "hideOnLoad();" |
|
| 74 |
else |
|
| 75 |
page << "show_required_bibtex_fields(#{fields.to_json()});"
|
|
| 76 |
end |
|
| 77 |
} |
|
| 73 |
render :show_bibtex_fields |
|
| 78 | 74 |
} |
| 79 |
|
|
| 80 | 75 |
end |
| 81 | 76 |
end |
| 82 | 77 |
|
Also available in: Unified diff