Skip to content

Commit

Permalink
updated dataset creation user interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedsalem401 committed Apr 16, 2024
1 parent 8906ee9 commit 94c252f
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 64 deletions.
62 changes: 58 additions & 4 deletions ckanext/datasetapproval/assets/css/approval.css
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
line-height: 24px;
letter-spacing: 0em;
text-align: left;
font-family: Calibri;
font-family: Calibri , sans-serif;
font-size: 16px;
font-weight: 400;
line-height: 24px;
Expand All @@ -290,20 +290,34 @@
display: block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
margin-bottom: 24px;
cursor: pointer;
font-size: 18px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width: 548px;
box-sizing: content-box;
}

.form-label {
font-weight: 400;
font-size: 20px;
line-height: 24px;
font-family: Calibri , sans-serif;
}

.form-group input[type="text"] {
border-radius: 3px;
height: 37px;
}

.checkbox label input {
position: absolute;
opacity: 0;
cursor: pointer;
font-family: Calibri;
font-family: Calibri , sans-serif;
font-size: 12px;
font-weight: 100;
line-height: 20px;
Expand All @@ -328,7 +342,7 @@

.resource-form-buttons {
/* there are four buttons in the resource form */
/* the first button should be aligned left and other buttons should be aligned rigght*/
/* the first button should be aligned left and other buttons should be aligned right*/

display: flex;
justify-content: space-between;
Expand All @@ -349,4 +363,44 @@
flex-direction: row;
justify-content: right;
margin-top: 20px;
}

.btn{
display: inline-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 6px 16px;
height: 32px;
border-radius: 5px;
font-family: Calibri , sans-serif;
font-style: normal;
font-weight: 700;
font-size: 16px;
margin-left: 17px;
gap: 2px;
}

.btn-primary{
background: #006D84;
}

.btn-default{
background: #FFFFFF;
border: 2px solid #006D84;
color: #006D84;
}

.btn-default:hover, .btn-default:focus{
border-color: #006D84;
background-color: #FAFAFA;
color: #006D84;
}

.no-nav .col-md-9{
width: 100%;
}

.row{
background-color: transparent;
}
122 changes: 62 additions & 60 deletions ckanext/datasetapproval/templates/package/snippets/review_request.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,74 +7,76 @@
{% block secondary %}{% block secondary_content %}{% endblock %}{% endblock %}

{% block primary %}
<div class="col-md-9">
<div class="col-md-9">
<div class="module module-content">
{% block stages %}
{{ h.snippet('package/snippets/stages.html', stages=['complete', 'complete', 'complete', 'active'], pkg_name=pkg_name, dataset_type=dataset_type) }}
{% endblock %}
</div>

<div class="package-create">
{% block primary_content_inner %}
<form method="POST" action="/submit_review">
{% block approval %}
{% block approval_heading %}
<h3>{{ _('Request review') }}</h3>
{% endblock %}
{% block approval_description %}
<p>{{ _('This is a preview of your dataset. You can either go back to step 2 and edit the dataset before sending to review, or send directly to review and ask for publication. <a href="/">How does the review process work?</a>
') }}</p>
{% endblock %}
{% endblock %}
<div class="form-actions" style="float:left">
<button class="btn btn-default" name="save" value="go-resource" type="submit"">{{ _('Previous: Upload data') }}</button>
<button class="btn btn-primary" name="save" value="go-metadata" type="submit">{{_('Send to review')}}</button>
<input type="hidden" name="dataset_name" value="{{ pkg.name }}">
</div>
</form>

<div class="package-create col-md-9">
{% block primary_content_inner %}
<form method="POST" action="/submit_review">
{% block approval %}
{% block approval_heading %}
<h3>{{ _('Request review') }}</h3>
{% endblock %}
{% block approval_description %}
<p>{{ _('This is a preview of your dataset. You can either go back to step 2 and edit the dataset before sending to review, or send directly to review and ask for publication. <a href="/">How does the review process work?</a>
') }}</p>
{% endblock %}
{% endblock %}

<div class="form-actions" style="float:left">
<button class="btn btn-default" name="save" value="go-resource" type="submit"">{{ _('Previous: Upload data') }}</button>
<button class="btn btn-primary" name="save" value="go-metadata" type="submit">{{_('Send to review')}}</button>
<input type="hidden" name="dataset_name" value="{{ pkg.name }}">
</div>
</form>

{% block package_description %}
<h1 style="clear: both;">
{% block page_heading %}
{{ h.dataset_display_name(pkg) }}
{% if pkg.state.startswith('draft') %}
[{{ _('Draft') }}]
{% endif %}
{% if pkg.state == 'deleted' %}
[{{ _('Deleted') }}]
{% endif %}
{% block package_description %}
<h1>
{% block page_heading %}
{{ h.dataset_display_name(pkg) }}
{% if pkg.state.startswith('draft') %}
[{{ _('Draft') }}]
{% endif %}
{% if pkg.state == 'deleted' %}
[{{ _('Deleted') }}]
{% endif %}
{% endblock %}
</h1>
{% block package_notes %}
{% if pkg.notes %}
<div class="notes embedded-content">
{{ h.render_markdown(h.get_translated(pkg, 'notes')) }}
</div>
{% endif %}
{% endblock %}
{# FIXME why is this here? seems wrong #}
<span class="insert-comment-thread"></span>
{% endblock %}
</h1>
{% block package_notes %}
{% if pkg.notes %}
<div class="notes embedded-content">
{{ h.render_markdown(h.get_translated(pkg, 'notes')) }}
</div>
{% endif %}
{% endblock %}
{# FIXME why is this here? seems wrong #}
<span class="insert-comment-thread"></span>
{% endblock %}

{% block package_resources %}
{% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %}
{% endblock %}

{% block package_tags %}
{% snippet "package/snippets/tags.html", tags=pkg.tags %}
{% endblock %}
{% block package_resources %}
{% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %}
{% endblock %}

{% block package_additional_info %}
{% snippet "package/snippets/additional_info.html", pkg_dict=pkg %}
{% endblock %}
{% block package_tags %}
{% snippet "package/snippets/tags.html", tags=pkg.tags %}
{% endblock %}

<form method="POST" action="/submit_review">
<div class="form-actions" style="float:left">
<button class="btn btn-default" name="save" value="go-resource" type="submit"">{{ _('Previous: Upload data') }}</button>
<button class="btn btn-primary" name="save" value="go-metadata" type="submit">{{_('Send to review')}}</button>
<input type="hidden" name="dataset_name" value="{{ pkg.name }}">
</div>
</form>
{% block package_additional_info %}
{% snippet "package/snippets/additional_info.html", pkg_dict=pkg %}
{% endblock %}
</div>

<form method="POST" action="/submit_review">
<div>
<button type="button" class="btn btn-default" onclick="window.history.back();">{{ _('Previous: Upload data') }}</button>
<button class="btn btn-primary" name="save" value="go-metadata" type="submit">{% block save_button_text %}{{_('Send to review')}}{% endblock %}</button>
<input type="hidden" name="dataset_name" value="{{ pkg.name }}">
</div>
</form>
{% endblock %}
</div>
</div>
</div>
{% endblock %}

0 comments on commit 94c252f

Please sign in to comment.