Skip to content

Commit

Permalink
Merge pull request #481 from pgiraud/issue193InstructionsTab
Browse files Browse the repository at this point in the history
Issue193 instructions tab
  • Loading branch information
Pierre GIRAUD committed Dec 8, 2014
2 parents 0813352 + aa63f78 commit 8509c25
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 26 deletions.
2 changes: 1 addition & 1 deletion osmtm/static/css/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ h1 {
text-decoration: line-through;
}

#instructions {
#instructions, #description {
.icon-question-sign {
.opacity(50);
}
Expand Down
1 change: 1 addition & 0 deletions osmtm/static/js/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ osmtm.project = (function() {
loadEmptyTask();

$('#start').on('click', function() {$('#contribute_tab').tab('show');});
$('.instructions.btn').on('click', function() {$('#instructions_tab').tab('show');});
$('a[data-toggle="tab"]').on('shown.bs.tab', onTabShow);

// actions button handlers
Expand Down
31 changes: 31 additions & 0 deletions osmtm/templates/project.description.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<%
import bleach
import markdown
%>
% if project.status in [project.status_draft, project.status_archived] :
<p class="alert alert-warning text-muted">
<span class="glyphicon glyphicon-warning-sign"></span>
% if project.status == project.status_draft:
${_('This project is not published yet.')}
% if user and (user.is_project_manager or user.is_admin):
<a href="${request.route_url('project_publish', project=project.id)}" class="pull-right">
<span class="glyphicon glyphicon-share-alt"></span> ${_('Publish')}
</a>
% endif
% elif project.status == project.status_archived:
${_('This project was archived.')}
% endif
</p>
% endif
% if project.private:
<p class="text-muted">
<span class="glyphicon glyphicon-lock"></span>
${_('Access to this project is limited')}
</p>
% endif
<p>${bleach.clean(markdown.markdown(project.description), strip=True) |n}</p>
<p class="text-center">
<a class="btn btn-success btn-lg instructions">
<span class="glyphicon glyphicon-share-alt"></span>&nbsp;
${_('Instructions')}</a>
</p>
23 changes: 0 additions & 23 deletions osmtm/templates/project.instructions.mako
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,6 @@
import bleach
import markdown
%>
% if project.status in [project.status_draft, project.status_archived] :
<p class="alert alert-warning text-muted">
<span class="glyphicon glyphicon-warning-sign"></span>
% if project.status == project.status_draft:
${_('This project is not published yet.')}
% if user and (user.is_project_manager or user.is_admin):
<a href="${request.route_url('project_publish', project=project.id)}" class="pull-right">
<span class="glyphicon glyphicon-share-alt"></span> ${_('Publish')}
</a>
% endif
% elif project.status == project.status_archived:
${_('This project was archived.')}
% endif
</p>
% endif
% if project.private:
<p class="text-muted">
<span class="glyphicon glyphicon-lock"></span>
${_('Access to this project is limited')}
</p>
% endif
<p>${bleach.clean(markdown.markdown(project.description), strip=True) |n}</p>
<hr />
<dl>
% if project.entities_to_map:
<dt>
Expand Down
8 changes: 6 additions & 2 deletions osmtm/templates/project.mako
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ else:
<div class="row">
<div class="col-md-12">
<ul class="nav nav-pills">
<li class="active"><a id="instructions_tab" href="#instructions" data-toggle="tab">${_('Instructions')}</a></li>
<li class="active"><a id="description_tab" href="#description" data-toggle="tab">${_('Description')}</a></li>
<li><a id="instructions_tab" href="#instructions" data-toggle="tab">${_('Instructions')}</a></li>
<li><a id="contribute_tab" href="#contribute" data-toggle="tab">${_('Contribute')}</a>
<li><a href="#activity" data-toggle="tab">${_('Activity')}</a></li>
<li><a id="stats_tab" href="#stats" data-toggle="tab">${_('Stats')}</a>
Expand All @@ -70,7 +71,10 @@ else:
<div id="activity" class="row-fluid tab-pane">
<%include file="task.history.mako" args="section='project'"/>
</div>
<div id="instructions" class="tab-pane active">
<div id="description" class="tab-pane active">
<%include file="project.description.mako" />
</div>
<div id="instructions" class="tab-pane">
<%include file="project.instructions.mako" />
</div>
<div id="contribute" class="tab-pane">
Expand Down

0 comments on commit 8509c25

Please sign in to comment.