-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2338 from alphagov/425-metadata-tab-edit-page
425 metadata tab edit page
- Loading branch information
Showing
10 changed files
with
205 additions
and
35 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
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,57 @@ | ||
<%= render "govuk_publishing_components/components/heading", { | ||
text: "Metadata", | ||
heading_level: 2, | ||
margin_bottom: 5, | ||
} %> | ||
|
||
<% if Edition::PUBLISHING_API_DRAFT_STATES.include? publication.state %> | ||
<%= form_for(@artefact, :html => { :class => "artefact", :id => "edit_artefact" }) do |f| %> | ||
<%= f.hidden_field :id, value: @artefact.id %> | ||
|
||
<%= render "govuk_publishing_components/components/input", { | ||
label: { | ||
text: "Slug", | ||
}, | ||
hint: "If you change the slug of a published page, the old slug will automatically redirect to the new one.", | ||
name: "artefact[slug]", | ||
value: publication.slug, | ||
heading_level: 3, | ||
heading_size: "m", | ||
} %> | ||
|
||
<%= render "govuk_publishing_components/components/radio", { | ||
heading: "Language", | ||
name: "artefact[language]", | ||
heading_level: 3, | ||
heading_size: "m", | ||
inline: true, | ||
items: [ | ||
{ | ||
value: "en", | ||
text: "English", | ||
checked: publication.artefact.language == "en" ? true : false, | ||
}, | ||
{ | ||
value: "cy", | ||
text: "Welsh", | ||
checked: publication.artefact.language == "cy" ? true : false, | ||
}, | ||
], | ||
} %> | ||
<%= render "govuk_publishing_components/components/button", { | ||
text: "Update", | ||
} %> | ||
<% end %> | ||
<% else %> | ||
<% @artefact.attributes.slice("slug", "language").each do |key, value| %> | ||
<%= render "govuk_publishing_components/components/heading", { | ||
text: key.humanize, | ||
heading_level: 3, | ||
font_size: "m", | ||
margin_bottom: 3, | ||
} %> | ||
<p class="govuk-body"> | ||
<%= key.eql?("slug") ? value : locale_to_language(value) %> | ||
</p> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h3>Work in progress</h3> |
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