-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add state transition widget to show pages.
- Loading branch information
1 parent
bad484c
commit 7dd2b63
Showing
12 changed files
with
205 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
margin-left: 0; | ||
} | ||
} | ||
.form-group .radio input.radio_buttons { | ||
margin-left: 0; | ||
} |
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,6 @@ | ||
# frozen_string_literal: true | ||
class WorkflowNoteChangeSet < Valkyrie::ChangeSet | ||
validates :author, :note, presence: true | ||
property :note, multiple: false, required: false | ||
property :author, multiple: false | ||
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
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,10 @@ | ||
# frozen_string_literal: true | ||
class WorkflowNoteDecorator < Valkyrie::ResourceDecorator | ||
def note | ||
super.first | ||
end | ||
|
||
def author | ||
super.first | ||
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
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,6 @@ | ||
# frozen_string_literal: true | ||
class WorkflowNote < Valhalla::Resource | ||
attribute :id, Valkyrie::Types::ID.optional | ||
attribute :author | ||
attribute :note | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<% if can?(:edit, resource) && @change_set.respond_to?(:workflow_class) %> | ||
<div id="workflow_controls"class="panel panel-default workflow-affix"> | ||
<div class="panel-heading"> | ||
<h2 class="panel-title">Review and Approval</h2> | ||
</div> | ||
<div id="workflow_controls_collapse" class="row panel-body"> | ||
<%= simple_form_for @change_set do |f| %> | ||
<div class="col-sm-6 workflow-actions"> | ||
<h3>Actions</h3> | ||
|
||
<%= f.input :state, as: :radio_buttons, | ||
collection: ControlledVocabulary.for(:"state_#{f.object.workflow_class.to_s.underscore}").all(f.object), | ||
required: f.object.required?(:state), | ||
label_method: :label, | ||
value_method: :value, | ||
label: false %> | ||
</div> | ||
<div class="col-sm-6 workflow-comments"> | ||
<%= f.simple_fields_for :new_workflow_note do |note| %> | ||
<%= note.input :note, as: :text, required: note.object.required?(:note), label: "Review comment" %> | ||
<%= note.input :author, as: :hidden, input_html: { value: current_user.uid }, required: note.object.required?(:author) %> | ||
<% end %> | ||
|
||
<input class="btn btn-primary" type="submit" value="Submit"> | ||
|
||
<h4>Previous Comments</h4> | ||
<dl> | ||
<% @change_set.workflow_note.map(&:decorate).each do |comment| %> | ||
<dt><%= comment.author %></dt> | ||
<dd><%= comment.note %></dd> | ||
<% end %> | ||
</dl> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
<% 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
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