forked from discourse/discourse
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
231 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
app/controllers/administration/annotator_store/collections_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require "administrate/field/belongs_to" | ||
|
||
module Administrate | ||
class MergeTagField < Administrate::Field::BelongsTo | ||
|
||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
app/views/administration/annotator_store/annotations/index.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<%# | ||
# Index | ||
This view is the template for the index page. | ||
It is responsible for rendering the search bar, header and pagination. | ||
It renders the `_table` partial to display details about the resources. | ||
## Local variables: | ||
- `page`: | ||
An instance of [Administrate::Page::Collection][1]. | ||
Contains helper methods to help display a table, | ||
and knows which attributes should be displayed in the resource's table. | ||
- `resources`: | ||
An instance of `ActiveRecord::Relation` containing the resources | ||
that match the user's search criteria. | ||
By default, these resources are passed to the table partial to be displayed. | ||
- `search_term`: | ||
A string containing the term the user has searched for, if any. | ||
- `show_search_bar`: | ||
A boolean that determines if the search bar should be shown. | ||
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection | ||
%> | ||
<% content_for(:title) do %> | ||
Annotations | ||
<% if params[:code_id].present? %> | ||
> <%= AnnotatorStore::Tag.find_by(id: params[:code_id]).name %> | ||
<% end %> | ||
<% end %> | ||
|
||
|
||
<header class="main-content__header" role="banner"> | ||
<h1 class="main-content__page-title" id="page-title"> | ||
<%= content_for(:title) %> | ||
</h1> | ||
|
||
<% if show_search_bar %> | ||
<%= render( | ||
'search', | ||
search_term: search_term, | ||
resource_name: 'Annotations' | ||
) %> | ||
<% end %> | ||
</header> | ||
|
||
<section class="main-content__body main-content__body--flush"> | ||
<% if params[:search].present? %> | ||
<%= render("collection", collection_presenter: page, resources: resources, table_title: "page-title") %> | ||
<% else %> | ||
<style type="text/css"> | ||
.filter-nav { | ||
margin: 0 0 20px 40px; | ||
} | ||
|
||
.filter-nav a { | ||
margin-right: 10px; | ||
font-size: 80%; | ||
} | ||
|
||
.filter-nav a.active { | ||
color: #333; | ||
text-decoration: none; | ||
} | ||
</style> | ||
|
||
<div class="filter-nav"> | ||
<%= link_to 'Any Creator', params.except(:page).deep_merge(creator_id: nil), class: (params[:creator_id].present? ? '' : 'active') %> | ||
<% User.where(id: AnnotatorStore::Annotation.select(:creator_id).uniq.pluck(:creator_id)).order(:name).each do |model| %> | ||
<%= link_to "by #{model.username}", params.except(:page).deep_merge(creator_id: model.id), class: (params[:creator_id] == model.id.to_s ? 'active' : '') %> | ||
<% end %> | ||
</div> | ||
|
||
<%= render("collection", collection_presenter: page, resources: resources, table_title: "page-title") %> | ||
<% end %> | ||
<%= paginate resources %> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.