Skip to content

Commit

Permalink
story author tag #24
Browse files Browse the repository at this point in the history
  • Loading branch information
mondoboia committed Jul 28, 2022
1 parent 37bff42 commit a054ad0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
11 changes: 6 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ def datastory(section_name, datastory_name):
data_methods.create_html(r, datastory_name, section_name)

# commit json and html to repo
github_sync.push('static/temp/config_'+section_name+'.json', branch='main', gituser='melodyeditor',
email='[email protected]', bearer_token=conf.melody_token, action='')
github_sync.push('static/temp/'+datastory_name+'_'+section_name+'.html', branch='main', gituser='melodyeditor',
email='[email protected]', bearer_token=conf.melody_token, action='')
github_sync.push('static/temp/config_'+section_name+'.json', 'main', 'melodyeditor',
'[email protected]', conf.melody_token, '@'+session['name'])
github_sync.push('static/temp/'+datastory_name+'_'+section_name+'.html', 'main', 'melodyeditor',
'[email protected]', conf.melody_token, '@'+session['name'])

# remove both files
os.remove('static/temp/config_'+section_name+'.json')
Expand Down Expand Up @@ -195,7 +195,8 @@ def setup():
config_data['template_mode'] = template_mode
config_data['title'] = datastory_title
config_data['color_code'] = color_code
config_data['name'] = session['name'] + '_' + str(ts)
config_data['user_name'] = session['name']
config_data['id'] = str(ts)

clean_title = datastory_title.lower().replace(" ", "_")
# add to config file
Expand Down
2 changes: 1 addition & 1 deletion github_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def push(local_file_path, branch='main', gituser=None, email=None, bearer_token=
message = "updated file "+absolute_file_path+" "+action
except:
update = False
message = "created file "+absolute_file_path
message = "created file "+absolute_file_path+" "+action

# Both create/update file replace the file with the local one
with open(local_file_path) as f:
Expand Down
3 changes: 1 addition & 2 deletions templates/datastory_statistics.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ <h4>About</h4>
{% endif %}
<!-- modify button -->
{% if session['user_type'] != 'polifonia' %}
{% set name = (datastory_data.name).split('_') %}
<a class="col-4 modifystoryicon"
href="{{ url_for('modify_datastory', section_name=name[1], datastory_name=datastory_data.title|replace(' ', '_')|lower ) }}"><img
href="{{ url_for('modify_datastory', section_name=datastory_data.id, datastory_name=datastory_data.title|replace(' ', '_')|lower ) }}"><img
src="{{ url_for('static', filename='img/edit.png') }}" alt=""></a>
{% endif %}
</section>
Expand Down

0 comments on commit a054ad0

Please sign in to comment.