aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/oauth2/create-resource.html
blob: 28a93ef494037f8ff473978dbfd45e39dab92f63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{% extends "index_page.html" %}
{%from "oauth2/profile_nav.html" import profile_nav%}

{%block title%}Create Resource{%endblock%}
{%block css%}
<link rel="stylesheet" type="text/css" href="/static/new/css/mytooltip.css" />
{%endblock%}

{%block content%}
<div class="container" style="min-width: 1250px;">
  {{profile_nav("resources", user_privileges)}}

  {{flash_me()}}

  <div class="container-fluid">
    <div class="row">
      {%if resource_category_error%}
      <p>
	<span class="glyphicon glyphicon-exclamation-sign text-danger"></span>
	&nbsp;
	<span class="text-danger">{{resource_category_error.error}}</span>:
	{{resource_category_error.error_message}}
      </p>
      {%else%}
      <form method="POST"
	    action="{{url_for('oauth2.resource.create_resource')}}">

	<fieldset>
	  <legend>Resource Category</legend>
	  <div class="form-group">
	    {%for category in resource_categories%}
	    <div class="radio mytooltip">
	      <label for="rdo:resource_category:{{category.resource_category_id}}"
		     class="form-label"
		     style="text-transform: capitalize;">
		<input type="radio" name="resource_category" required="required"
		       id="rdo:resource_category:{{category.resource_category_id}}"
		       value="{{category.resource_category_id}}"
		       {%if resource_category is defined%}
		       {%if category.resource_category_id == resource_category%}
		       checked="checked"
		       {%endif%}
		       {%endif%} />
		{{category.resource_category_key}}
	      </label>
	      <span class="mytooltiptext">
		{{category.resource_category_description}}
	      </span>
	    </div>
	    {%endfor%}
	  </div>
	</fieldset>

	<fieldset>
	  <legend>Basic Resource Information</legend>
	  <div class="form-group mytooltip">
	    <label for="resource_name" class="form-label">Name</label>
	    <input type="text" name="resource_name" class="form-control"
		   {%if resource_name is defined and resource_name is not none%}
		   value="{{resource_name}}"
		   {%endif%}
		   required="required" />
	    <span class="mytooltiptext">
	      The resource name, e.g. the experiment name.
	    </span>
	  </div>
	</fieldset>

	<fieldset>
	  <legend>Access Control</legend>
	  <div class="form-group mytooltip">
	    <label for="chk-public">Publicly Viewable?</label>
	    <input type="checkbox" name="public" id="chk-public"
		   checked="checked" />
	    <span class="mytooltiptext">
	      Select whether data in this resource will be publicly viewable.
	    </span>
	  </div>
	</fieldset>

	<input class="btn btn-primary" type="submit" value="Create" />

      </form>
      {%endif%}
    </div>
  </div>

</div>
{%endblock%}