Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar_network_webui/templates/dialog_project.html
blob: ecd1ead67f85145f55106e16a376eca45e568ea6 (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
{% extends "base.html" %}
{% block view %}
<div class="resource-form">
    <div id="resource-form-title">
    {%- if mode=='new' -%}
    <span id="dialog-title">{{_('Creating new project')}}</span>
    {%- elif mode=='edit' -%}
    <span id="dialog-title">{{_('Editing project')}}</span>
    {%- endif -%}
    <div class="window-buttons">
        <img id="cancel-button" class="button window-button" src="/static/icons/dialog-cancel.png" />
        <img id="accept-button" class="button window-button" src="/static/icons/dialog-ok.png" />
    </div>
    </div>
    {%- if mode=='new' -%}
    <form id="resource-form1" method="POST" action="/submit_context">
    {%- elif mode=='edit' -%}
    <form id="resource-form1" method="POST" action="/update_context">
    {%- endif -%}
        <div class="resource-form-field">
            <span id="title_label">{{_('Title')}}</span><br/>
            <input onkeypress="return event.keyCode != 13;" name="title" id="title" class="resource-input" type="text" value="{{title|special_str or ''}}"/>
            {%- if mode=='edit' -%}
            <input id="href" name="href" type="hidden" value="/{{resource_type}}/{{resource}}" />
            <input id="edit_guid" name="edit_guid" type="hidden" value="{{context|special_str or ''}}" />
            {%- endif -%}
        </div>
        <div class="resource-form-field" id="summary_section">
            <span id="summary_label">{{_('Summary')}}</span><br/>
            <input onkeypress="return event.keyCode != 13;" id="summary" name="summary" class="resource-input" type="text" value="{{summary|special_str or ''}}"/>
        </div>
        <div class="resource-form-field" >
            <span id="details_label">{{_('Details')}}</span><br/>
            <textarea id="edit-content" name="content" class="resource-inputarea" >{{content|special_str or ''}}</textarea>
        </div>
    </form>
    <div class="resource-form-field warning" id="warning" style="display: none">
        {{_('Must fill all fields.')}}
    </div>
    <div class="resource-form-field license-notice">
        <img class="license-big" src="/static/images/{{_('cc-by-sa-full.png')}}" />
        {{_('<b>Creative Commons Attribution Share-Alike License</b>')}}
        {{_('Please note that all contributions to Sugar Labs are considered to be released under the Attribution 3.0 Unported. If you do not want your writing to be edited and redistributed at will, then do not submit it here.') }}
        <br />
        {{_('You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.')}}
    </div>

</div>
<script type="text/javascript">
    $(function() {
       $("#query").attr('disabled', true);
       $("#cancel-button").click( function() {
            //history.back();
            location='{{returnto|special_str or session['returnto']}}';
            });
        // Mini Validation
       $('#accept-button').click( function () {
            if ( $('#title').val() == '' ||
                 $('#summary').val() == '' ||
                 $('#edit-content').val() == '')
                {
                     $('#warning').show();
            }
            else
            {
            $("#resource-form1").submit();
            }
        })
        });
</script>
{% endblock view %}