Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
0d9f9ed0
Commit
0d9f9ed0
authored
Oct 23, 2014
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEATURE] Adding a button (with confirmation) to delete project.
parent
ae6d3056
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
7 deletions
+106
-7
urls.py
gargantext_web/urls.py
+3
-3
views.py
gargantext_web/views.py
+3
-0
menu.html
templates/menu.html
+2
-0
projects.html
templates/projects.html
+2
-1
test_parser_ngramextractor.ipynb
test_parser_ngramextractor.ipynb
+96
-3
No files found.
gargantext_web/urls.py
View file @
0d9f9ed0
...
...
@@ -3,22 +3,22 @@ from django.conf.urls import patterns, include, url
from
django.contrib
import
admin
from
gargantext_web.views
import
home
,
projects
,
project
,
corpus
from
gargantext_web.views
import
add_corpus
,
add_project
from
gargantext_web.views
import
add_corpus
,
add_project
,
delete_project
admin
.
autodiscover
()
urlpatterns
=
patterns
(
''
,
# Examples:
# url(r'^$', 'gargantext_web.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url
(
r'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r'^login/'
,
include
(
admin
.
site
.
urls
)),
url
(
r'^grappelli/'
,
include
(
'grappelli.urls'
)),
# grappelli URLS
url
(
r'^grappelli/'
,
include
(
'grappelli.urls'
)),
url
(
r'^$'
,
home
),
url
(
r'^projects/$'
,
projects
),
url
(
r'^projects/add/$'
,
add_project
),
url
(
r'^project/(\d+)/delete/$'
,
delete_project
),
url
(
r'^project/(\d+)/$'
,
project
),
url
(
r'^project/(\d+)/add/$'
,
add_corpus
),
...
...
gargantext_web/views.py
View file @
0d9f9ed0
...
...
@@ -301,5 +301,8 @@ def add_project(request):
return
render
(
request
,
'add_project.html'
,
{
'form'
:
form
})
def
delete_project
(
request
,
node_id
):
Node
.
objects
.
filter
(
id
=
node_id
)
.
all
()
.
delete
()
return
HttpResponseRedirect
(
'/projects/'
)
templates/menu.html
View file @
0d9f9ed0
...
...
@@ -75,6 +75,8 @@ $(function() {
</script>
<script
src=
"{% static "
js
/
bootstrap
.
min
.
js
"
%}"
></script>
<script>
$
(
function
()
{
$
(
"[data-toggle='popover']"
).
popover
({
html
:
true
});});
</script>
</body>
</html>
templates/projects.html
View file @
0d9f9ed0
...
...
@@ -24,7 +24,6 @@
{% csrf_token %}
{{ form.non_field_errors }}
{{ form.as_p}}
<input
type=
"submit"
value=
"Add project"
/>
</form>
</div>
...
...
@@ -40,6 +39,8 @@
<!--<div class="col-md-offset-7 col-md-4 content" style="background-color:grey">!-->
<div
class=
"col-md-3 content"
>
<h3><a
href=
"/project/{{ project.id }}"
>
{{ project.name }}
</a></h3>
<button
type=
"button"
class=
"btn btn-xs btn-default"
data-container=
"body"
data-toggle=
"popover"
data-placement=
"bottom"
data-content=
'<a href="/project/{{ project.id }}/delete">Yes, I am sure!</a>'
>
Delete
</button>
<h4>
{{ project.subtitle }}
<h4>
<h5>
Completed:
</h5>
<div
class=
"chart"
barColor=
"#fffff"
data-percent=
"75"
>
75%
</div>
...
...
test_parser_ngramextractor.ipynb
View file @
0d9f9ed0
{
"metadata": {
"name": "",
"signature": "sha256:
df3d60ee3db86cfa96ad9f0cfbd6b55c075a84ca08e52b566913b10ba2bcf0b3
"
"signature": "sha256:
195a9cc559b057dabbc3bdae9e34d6694fc3e0d4788ecfd055da1444d1875d5a
"
},
"nbformat": 3,
"nbformat_minor": 0,
...
...
@@ -513,10 +513,103 @@
{
"cell_type": "code",
"collapsed": false,
"input": [],
"input": [
"destruction = Node.objects.filter(id=1038).all()"
],
"language": "python",
"metadata": {},
"outputs": []
"outputs": [],
"prompt_number": 20
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"destruction.delete()"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 21
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"destruction"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 22,
"text": [
"[]"
]
}
],
"prompt_number": 22
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"destruction.children.all().delete()\n",
"destruction.delete"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 14,
"text": [
"<bound method Node.delete of <Node: Encore un >>"
]
}
],
"prompt_number": 14
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"help(destruction.delete)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Help on method delete in module cte_tree.models:\n",
"\n",
"delete(method=None, position=None, save=True) method of node.models.Node instance\n",
" Prepares the tree for deletion according to the deletion semantics\n",
" specified for the :class:`CTENode` Model, and then delegates to the\n",
" :class:`CTENode` superclass ``delete`` method.\n",
" \n",
" Default deletion `method` and `position` callable can be overridden\n",
" by being supplied as arguments to this method.\n",
" \n",
" :param method: optionally a particular deletion method, overriding\n",
" the default method specified for this model.\n",
" \n",
" :param position: optional callable to invoke prior to each move\n",
" operation, should the delete method require any moves.\n",
" \n",
" :param save: optional flag indicating whether this model's\n",
" :meth:`save` method should be invoked after each move operation,\n",
" should the delete method require any moves.\n",
"\n"
]
}
],
"prompt_number": 15
}
],
"metadata": {}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment