Merge pull request #6630 from davipatury/newscaster-ui

Newscaster Nano-UI-ification
This commit is contained in:
Crazy Lemon
2017-03-03 21:20:53 -08:00
committed by GitHub
2 changed files with 621 additions and 508 deletions
File diff suppressed because it is too large Load Diff
+301
View File
@@ -0,0 +1,301 @@
<!--
Title: Newscaster
Used In File(s): /code/game/machinery/newscaster.dm
-->
<!--
#define NEWSCASTER_MAIN 0
#define NEWSCASTER_FC_LIST 1
#define NEWSCASTER_CREATE_FC 2
#define NEWSCASTER_CREATE_FM 3
#define NEWSCASTER_PRINT 4
#define NEWSCASTER_VIEW_FC 5
#define NEWSCASTER_NT_CENSOR 6
#define NEWSCASTER_D_NOTICE 7
#define NEWSCASTER_CENSOR_FC 8
#define NEWSCASTER_D_NOTICE_FC 9
#define NEWSCASTER_W_ISSUE_H 10
#define NEWSCASTER_W_ISSUE 11
-->
<h3>Welcome to Newscasting Unit #{{:data.unit_no}}.</h3>
<font size=1>Interface & News networks Operational.<br>
Property of Nanotrasen</font><br>
<hr>
{{if data.temp}}
<div class='line'>{{:data.temp}}</div>
<div class='line'>{{:helper.link('Return', 'arrow-left', {'setScreen' : data.temp_back_screen})}}</div>
{{else}}
{{if data.screen == 0}} <!-- NEWSCASTER_MAIN -->
<div class='item'>
{{if data.wanted_issue}}
<div class='line'>{{:helper.link('Read Wanted issue', 'exclamation-triangle', {'view_wanted' : 1})}}</div>
{{/if}}
<div class='line'>{{:helper.link('Create feed channel', 'plus', {'create_channel' : 1})}}</div>
<div class='line'>{{:helper.link('View feed channels', 'arrow-right', {'view' : 1})}}</div>
<div class='line'>{{:helper.link('Submit new feed story', 'share', {'create_feed_story' : 1})}}</div>
<div class='line'>{{:helper.link('Print newspaper', 'print', {'menu_paper' : 1})}}</div>
<div class='line'>{{:helper.link(data.silence ? 'Unsilence unit' : 'Silence unit', data.silence ? 'volume-up' : 'volume-off', {'silence_unit' : 1})}}</div>
<div class='line'>{{:helper.link('Re-scan user', 'refresh', {'refresh' : 1})}}</div>
{{if data.securityCaster}}
<div class='line'><b>Feed Security functions:</b></div>
<div class='line'>{{:helper.link(data.wanted_issue ? 'Manage wanted issue' : 'Publish wanted issue', data.wanted_issue ? 'pencil' : 'share', {'menu_wanted' : 1})}}</div>
<div class='line'>{{:helper.link('Censor feed stories', 'ban', {'menu_censor_story' : 1})}}</div>
<div class='line'>{{:helper.link('Mark feed channel with Nanotrasen D-Notice', 'thumb-tack', {'menu_censor_channel' : 1})}}</div>
<div class='line'>The newscaster recognises you as: <span class='good'>{{:data.scanned_user}}</span></div>
{{/if}}
</div>
{{else data.screen == 1}} <!-- NEWSCASTER_FC_LIST -->
<h4>Station Feed Channels</h4>
<div class='item'>
{{for data.channels}}
<div class='line'>
{{if value.admin}}
{{:helper.link('<b>' + value.name + '</b>', 'arrow-right', {'show_channel' : value.ref})}}
{{else}}
{{:helper.link(value.name, 'arrow-right', {'show_channel' : value.ref}, null, value.censored ? 'link linkDanger' : null)}}
{{/if}}
</div>
{{empty}}
<i class='average'>No active channels found...</i>
{{/for}}
</div>
<hr>
<div class='item'>
<div class='line'>{{:helper.link('Refresh', 'refresh', {'refresh' : 1})}}</div>
<div class='line'>{{:helper.link('Back', 'arrow-left', {'setScreen' : 0})}}</div>
</div>
{{else data.screen == 2}} <!-- NEWSCASTER_CREATE_FC -->
<h4>Creating new feed channel...</h4>
<div class='item'>
<div class='itemLabel'>Channel name:</div>
<div class='itemContent'>
<a style='float: left; padding-right: 6px;'>{{:data.channel_name}}</a>
{{:helper.link('Edit', 'pencil', {'set_channel_name' : 1})}}
</div>
</div>
<div class='item'>
<div class='itemLabel'>Channel author:</div>
<div class='itemContent good'>{{:data.scanned_user}}</div>
</div>
<div class='item'>
<div class='itemLabel'>Accept public feeds:</div>
<div class='itemContent'>{{:helper.link(data.c_locked ? 'NO' : 'YES', data.c_locked ? 'times' : 'check', {'set_channel_lock' : 1})}}</div>
</div>
<div class='item'>
{{:helper.link('Submit', 'share', {'submit_new_channel' : 1})}}
{{:helper.link('Cancel', 'arrow-left', {'setScreen' : 0})}}
</div>
{{else data.screen == 3}} <!-- NEWSCASTER_CREATE_FM -->
<b>Creating new feed message...</b>
<div class='item'>
<div class='itemLabel'>Receiving channel:</div>
<div class='itemContent'>
<a style='float: left; padding-right: 6px;'>{{:data.channel_name}}</a>
{{:helper.link('Edit', 'pencil', {'set_channel_receiving' : 1})}}
</div>
</div>
<div class='item'>
<div class='itemLabel'>Message body:</div>
<div class='itemContent'>
<a style='float: left; padding-right: 6px;'>{{:data.msg}}</a>
{{:helper.link('Edit', 'pencil', {'set_new_message' : 1})}}
</div>
</div>
<div class='item'>
<div class='itemLabel'>Attached photo:</div>
<div class='itemContent'>{{:helper.link(data.photo ? 'Dettach photo' : 'Attach photo', data.photo ? 'times' : 'paperclip', {'set_attachment' : 1})}}</div>
</div>
<div class='item'>
{{:helper.link('Submit', 'share', {'submit_new_message' : 1})}}
{{:helper.link('Cancel', 'arrow-left', {'setScreen' : 0})}}
</div>
{{else data.screen == 4}} <!-- NEWSCASTER_PRINT -->
Network currently serves a total of {{:data.total_num}} feed channels, {{:data.active_num}} of which are active, and a total of {{:data.message_num}} feed stories.
<div class='item'>
<div class='itemLabel'>Liquid paper remaining:</div>
<div class='itemContent'>{{:data.paper_remaining}} cm<sup>3</sup></div>
</div>
<div class='item'>
{{:helper.link('Print paper', 'print', {'print_paper' : 0})}}
{{:helper.link('Cancel', 'arrow-left', {'setScreen' : 0})}}
</div>
{{else data.screen == 5}} <!-- NEWSCASTER_VIEW_FC -->
<b>{{:data.channel_name}}</b> <i><font size=1>[created by: <span class='good'>{{:data.author}}</span>]</font></i><br>
<i><font size=1>Feed view count: {{:data.total_view_count}}</font></i><br>
{{if data.censored}}
<div class='statusDisplay'>
<b class='bad'>ATTENTION: </b>This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.<BR>
No further feed story additions are allowed while the D-Notice is in effect.
</div>
{{else}}
{{for data.messages}}
<div class='statusDisplay'>
- {{:value.body}}<br>
{{if value.img}}
<img src='data:image/png;base64,{{:value.img}}' width=180><br>
{{/if}}
<i><font size=1>[{{:value.message_type}} by <span class='good'>{{:value.author}}</span>]</font></i><br>
<i><font size=1>Message view count: {{:value.view_count}}</font></i>
</div>
{{empty}}
<i>No feed messages found in channel...</i>
{{/for}}
{{/if}}
<hr>
<div class='item'>
<div class='line'>{{:helper.link('Refresh', 'refresh', {'refresh' : 0})}}</div>
<div class='line'>{{:helper.link('Back', 'arrow-left', {'setScreen' : 1})}}</div>
</div>
{{else data.screen == 6}} <!-- NEWSCASTER_NT_CENSOR -->
<B>Nanotrasen Feed Censorship Tool</B><BR>
<i><font size=1>NOTE: Due to the nature of news Feeds, total deletion of a Feed Story is not possible.
Keep in mind that users attempting to view a censored feed will instead see the <b class='bad'>[REDACTED]</b> tag above it.</font></i>
<hr>
Select feed channel to get stories from:
<div class='item'>
{{for data.channels}}
<div class='line'>
{{if value.admin}}
{{:helper.link('<b>' + value.name + '</b>', 'arrow-right', {'pick_censor_channel' : value.ref})}}
{{else}}
{{:helper.link(value.name, 'arrow-right', {'pick_censor_channel' : value.ref}, null, value.censored ? 'link linkDanger' : null)}}
{{/if}}
</div>
{{empty}}
<i>No feed channels found active...</i>
{{/for}}
</div>
<div class='item'>
<div class='line'>{{:helper.link('Back', 'arrow-left', {'setScreen' : 0})}}</div>
</div>
{{else data.screen == 7}} <!-- NEWSCASTER_D_NOTICE -->
<B>Nanotrasen D-Notice Handler</B><BR>
<i><font size=1>A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the station<>s morale, integrity or disciplinary behaviour.
A D-Notice will render a channel unable to be updated by anyone, without deleting any feedstories it might contain at the time.
You can lift a D-Notice if you have the required access at any time.</font></i>
<hr>
<div class='item'>
{{for data.channels}}
<div class='line'>
{{if value.admin}}
{{:helper.link('<b>' + value.name + '</b>', 'arrow-right', {'pick_d_notice' : value.ref})}}
{{else}}
{{:helper.link(value.name, 'arrow-right', {'pick_d_notice' : value.ref}, null, value.censored ? 'link linkDanger' : null)}}
{{/if}}
</div>
{{empty}}
<i>No feed channels found active...</i>
{{/for}}
</div>
<hr>
<div class='item'>
<div class='line'>{{:helper.link('Back', 'arrow-left', {'setScreen' : 0})}}</div>
</div>
{{else data.screen == 8}} <!-- NEWSCASTER_CENSOR_FC -->
<b>{{:data.channel_name}}</b> <i><font size=1>[created by: <span class='good'>{{:data.author}}</span>]</font></i><br>
<i>{{:helper.link(data.author_redacted ? 'Undo author censorship' : 'Censor channel author', null, {'censor_channel_author' : data.ref})}}</i><br><hr>
{{for data.messages}}
<div class='statusDisplay'>
- {{:value.body}}<br>
{{if value.img}}
<img src='{{:value.img}}' width=180><br>
{{/if}}
<i><font size=1>[{{:value.message_type}} by <span class='good'>{{:value.author}}</span>]</font></i><br>
<i>
{{:helper.link(value.body_redacted ? 'Undo story censorship' : 'Censor story', null, {'censor_channel_story_body' : value.ref})}}
{{:helper.link(value.author_redacted ? 'Undo author censorship' : 'Censor message author', null, {'censor_channel_story_author' : value.ref})}}
</i>
</div>
{{empty}}
<i>No feed messages found in channel...</i>
{{/for}}
<hr>
<div class='item'>
<div class='line'>{{:helper.link('Back', 'arrow-left', {'setScreen' : 6})}}</div>
</div>
{{else data.screen == 9}} <!-- NEWSCASTER_D_NOTICE_FC -->
<b>{{:data.channel_name}}</b> <i><font size=1>[created by: <span class='good'>{{:data.author}}</span>]</font></i><br>
<i>Channel messages listed below. If you deem them dangerous to the station, you can <div style='clear: both;'>{{:helper.link('Bestow a D-Notice upon the channel', null, {'toggle_d_notice' : data.ref})}}</div></i><br><hr>
{{if data.censored}}
<div class='statusDisplay'>
<b class='bad'>ATTENTION: </b>This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.
No further feed story additions are allowed while the D-Notice is in effect.
</div>
{{else}}
{{for data.messages}}
<div class='statusDisplay'>
- {{:value.body}}<br>
{{if value.img}}
<img src='{{:value.img}}' width=180><br>
{{/if}}
<i><font size=1>[{{:value.message_type}} by <span class='good'>{{:value.author}}</span>]</font></i>
</div>
{{empty}}
<i>No feed messages found in channel...</i>
{{/for}}
{{/if}}
<div class='item'>
<div class='line'>{{:helper.link('Back', 'arrow-left', {'setScreen' : 7})}}</div>
</div>
{{else data.screen == 10}} <!-- NEWSCASTER_W_ISSUE_H -->
<b>Wanted Issue handler:</b><br>
{{if data.wanted_already}}
<i>A wanted issue is already in Feed Circulation. You can edit or cancel it below.</i><br>
{{/if}}
<div class='item'>
<div class='itemLabel'>Criminal name:</div>
<div class='itemContent'>
<a style='float: left; padding-right: 6px;'>{{:data.channel_name}}</a>
{{:helper.link('Edit', 'pencil', {'set_wanted_name' : 1})}}
</div>
</div>
<div class='item'>
<div class='itemLabel'>Description:</div>
<div class='itemContent'>
<a style='float: left; padding-right: 6px;'>{{:data.msg}}</a>
{{:helper.link('Edit', 'pencil', {'set_wanted_desc' : 1})}}
</div>
</div>
<div class='item'>
<div class='itemLabel'>Attached photo:</div>
<div class='itemContent'>{{:helper.link(data.photo ? 'Dettach photo' : 'Attach photo', data.photo ? 'times' : 'paperclip', {'set_attachment' : 1})}}</div>
</div>
<div class='item'>
<div class='itemLabel'>Author:</div>
<div class='itemContent good'>{{:data.wanted_already ? data.author : data.scanned_user}}</div>
</div>
<hr>
<div class='item'>
{{:helper.link(data.wanted_already ? 'Edit issue' : 'Submit', data.wanted_already ? 'pencil' : 'share', {'submit_wanted' : data.end_param})}}
{{if data.wanted_already}}
{{:helper.link('Take down issue', 'times', {'cancel_wanted' : 1})}}
{{/if}}
{{:helper.link('Back', 'arrow-left', {'setScreen' : 0})}}
</div>
{{else data.screen == 11}} <!-- NEWSCASTER_W_ISSUE -->
<center><h3 class='bad'>STATIONWIDE WANTED ISSUE</h3>
<i><font size=1>[Submitted by: <span class='good'>{{:data.author}}</span>]</font></i></center><hr>
<div class='item'>
<div class='itemLabel'>Criminal:</div>
<div class='itemContent'>{{:data.criminal}}</div>
</div>
<div class='item'>
<div class='itemLabel'>Description:</div>
<div class='itemContent'>{{:data.description}}</div>
</div>
<div class='item'>
<div class='itemLabel'>Photo:</div>
<div class='itemContent'>
{{if data.photo}}
<img src='data:image/png;base64,{{:data.photo}}' width=180>
{{else}}
None
{{/if}}
</div>
</div>
<div class='item'>
<div class='line'>{{:helper.link('Back', 'arrow-left', {'setScreen' : 0})}}</div>
</div>
{{/if}}
{{/if}}